NewCouponInput
input type
Create-input for a Coupon. The tenant (org group) is derived SERVER-SIDE from the principal — NEVER supplied here; the RAW code is normalized (trim+UPPERCASE) + grammar-gated server-side; flavor⟺payload coherence is the boundary refine (trigger ⟺ promotionId, discount ⟺ effect); a trigger promotion must be same-tenant + ACTIVE + couponGated.
Fields
| Field | Type | Required | Notes |
|---|---|---|---|
caption | String | no | Optional: when omitted the per-type default applies — the NORMALIZED code (self-documenting — the code IS the identity); when supplied it must be non-blank. |
code | String String! | yes | The RAW code (1..64 pre-normalization) — normalized + grammar-gated server-side; the org-group ACTIVE-code UNIQ marker mints IN the create transaction (a LIVE holder refuses CONFLICT/COUPON_CODE_TAKEN naming it; a DOOMED holder is taken over). |
flavor | CouponFlavor CouponFlavor! | yes | No further notes. |
promotionId | ID | no | REQUIRED iff trigger: the unlocked Promotion (tenant-scoped + ACTIVE + couponGated — REF_STATE / VALIDATION/INVALID otherwise). |
effect | CouponEffectInput | no | REQUIRED iff discount: the carried effect. |
startAt | String | no | The window start — omitted ⇒ stamped NOW. |
endAt | String | no | The window end (half-open) — omitted ⇒ evergreen. |
totalUsesCap | Int | no | No further notes. |