@cfxlabsinc/b2b-services
    Preparing search index...

    One authoring domain object for a stored (template_key, status_variant) row (docs/proposals/EMAIL_TEMPLATES.md §4.5), derived from the drizzle Select types so this package's signatures share the DB's field types instead of re-declaring them (service-pattern rule). All fields are strings/numbers/null so the L2 JSON round-trip needs no rehydration.

    subject / body / status are the fields an editor writes — the working copy (the current draft, falling back to the live copy) and the derived lifecycle. The full live-vs-draft content pair is exposed separately by EmailTemplateAdminService.versions.

    type EmailTemplate = {
        body: SelectEmailTemplateVersion["body"];
        draftVersion: SelectEmailTemplateVersion["version"] | null;
        id: SelectEmailTemplate["externalId"];
        invalidReason: string | null;
        liveVersion: SelectEmailTemplateVersion["version"] | null;
        status: "ACTIVE" | "DISABLED";
        statusVariant: SelectEmailTemplate["statusVariant"];
        subject: SelectEmailTemplateVersion["subject"];
        templateKey: SelectEmailTemplate["templateKey"];
    }
    Index
    body: SelectEmailTemplateVersion["body"]
    draftVersion: SelectEmailTemplateVersion["version"] | null

    The version being authored; null when there is no draft.

    id: SelectEmailTemplate["externalId"]

    External id (emt_…).

    invalidReason: string | null

    Projected by the validator; null when the working copy is valid.

    liveVersion: SelectEmailTemplateVersion["version"] | null

    The version currently sending; null when the variant is switched off.

    status: "ACTIVE" | "DISABLED"

    Derived lifecycle: ACTIVE when a live version is set (the variant is sending), DISABLED when switched off.

    statusVariant: SelectEmailTemplate["statusVariant"]
    subject: SelectEmailTemplateVersion["subject"]

    The copy being authored — the current draft, falling back to the live copy. Editing operates on this working copy.

    templateKey: SelectEmailTemplate["templateKey"]