Skip to content

Offer

Public offer definition and immutable accepted-terms boundary; not wired into checkout yet.

const Offer: Schema.brand<Schema.Struct<{
key: Schema.brand<Schema.String, "OfferKey">;
revision: Schema.brand<Schema.Int, "DefinitionRevision">;
purchase: Schema.Struct<{
key: Schema.brand<Schema.String, "PurchaseKey">;
revision: Schema.brand<Schema.Int, "DefinitionRevision">;
provides: Schema.$Array<Schema.toTaggedUnion<"type", readonly [Schema.Struct<...>, Schema.Struct<...>, Schema.Struct<...>, Schema.Struct<...>, Schema.Struct<...>, Schema.Struct<...>, Schema.Struct<...>, Schema.Struct<...>]>>;
}>;
billing: Schema.Union<readonly [Schema.Struct<{
family: Schema.brand<..., ...>;
interval: Schema.Literals<...>;
meter: Schema.Struct<...>;
rate: Schema.Struct<...>;
collection: Schema.Literal<...>;
roundingScope: Schema.Literal<...>;
lateUsage: Schema.Literal<...>;
accessPolicy: Schema.Struct<...>;
type: Schema.tag<...>;
}>, Schema.Struct<{
price: Schema.Struct<...>;
minimumQuantity: Schema.brand<..., ...>;
maximumQuantity: Schema.brand<..., ...>;
type: Schema.tag<...>;
}>, Schema.Struct<{
family: Schema.brand<..., ...>;
price: Schema.Struct<...>;
minimumQuantity: Schema.brand<..., ...>;
maximumQuantity: Schema.brand<..., ...>;
interval: Schema.Literals<...>;
renewal: Schema.Literal<...>;
type: Schema.tag<...>;
}>, Schema.Struct<{
price: Schema.Struct<...>;
type: Schema.tag<...>;
}>, Schema.Struct<{
family: Schema.brand<..., ...>;
price: Schema.Struct<...>;
interval: Schema.Literals<...>;
renewal: Schema.Literal<...>;
type: Schema.tag<...>;
}>]> & {
discriminants: readonly ["metered_subscription", "per_seat_one_time", "per_seat_subscription", "one_time", "subscription"];
cases: {
metered_subscription: Schema.Struct<{
family: Schema.brand<Schema.String, "SubscriptionFamilyKey">;
interval: Schema.Literals<readonly ...>;
meter: Schema.Struct<{
key: ...;
revision: ...;
}>;
rate: Schema.Struct<{
currency: ...;
amount: ...;
perUnits: ...;
rounding: ...;
}>;
collection: Schema.Literal<"invoice">;
roundingScope: Schema.Literal<"meter_invoice_period">;
lateUsage: Schema.Literal<"next_invoice_original_rate">;
accessPolicy: Schema.Struct<{
key: ...;
revision: ...;
}>;
type: Schema.tag<"metered_subscription">;
}>;
one_time: Schema.Struct<{
price: Schema.Struct<{
currency: ...;
amount: ...;
}>;
type: Schema.tag<"one_time">;
}>;
per_seat_one_time: Schema.Struct<{
price: Schema.Struct<{
currency: ...;
amount: ...;
}>;
minimumQuantity: Schema.brand<Schema.Int, "SeatCapacityQuantity">;
maximumQuantity: Schema.brand<Schema.Int, "SeatCapacityQuantity">;
type: Schema.tag<"per_seat_one_time">;
}>;
per_seat_subscription: Schema.Struct<{
family: Schema.brand<Schema.String, "SubscriptionFamilyKey">;
price: Schema.Struct<{
currency: ...;
amount: ...;
}>;
minimumQuantity: Schema.brand<Schema.Int, "SeatCapacityQuantity">;
maximumQuantity: Schema.brand<Schema.Int, "SeatCapacityQuantity">;
interval: Schema.Literals<readonly ...>;
renewal: Schema.Literal<"manual">;
type: Schema.tag<"per_seat_subscription">;
}>;
subscription: Schema.Struct<{
family: Schema.brand<Schema.String, "SubscriptionFamilyKey">;
price: Schema.Struct<{
currency: ...;
amount: ...;
}>;
interval: Schema.Literals<readonly ...>;
renewal: Schema.Literal<"manual">;
type: Schema.tag<"subscription">;
}>;
};
isAnyOf: <Keys>(keys) => (value) => value is Extract<(...), (...)> | Extract<(...), (...)> | Extract<(...), (...)> | Extract<(...), (...)> | Extract<(...), (...)>;
guards: {
metered_subscription: (u) => u is { family: (...) & (...); interval: (...) | (...); meter: { key: ...; revision: ... }; rate: { currency: ...; amount: ...; perUnits: ...; rounding: ... }; collection: "invoice"; roundingScope: "meter_invoice_period"; lateUsage: "next_invoice_original_rate"; accessPolicy: { key: ...; revision: ... }; type: "metered_subscription" };
one_time: (u) => u is { price: { currency: ...; amount: ... }; type: "one_time" };
per_seat_one_time: (u) => u is { price: { currency: ...; amount: ... }; minimumQuantity: (...) & (...); maximumQuantity: (...) & (...); type: "per_seat_one_time" };
per_seat_subscription: (u) => u is { family: (...) & (...); price: { currency: ...; amount: ... }; minimumQuantity: (...) & (...); maximumQuantity: (...) & (...); interval: (...) | (...); renewal: "manual"; type: "per_seat_subscription" };
subscription: (u) => u is { family: (...) & (...); price: { currency: ...; amount: ... }; interval: (...) | (...); renewal: "manual"; type: "subscription" };
};
match: {
<Cases> (value, cases): Cases[keyof Cases] extends (value) => R ? any : never;
<Cases> (cases): (value) => Cases[keyof ...] extends (value) => R ? any : never;
};
} & {
oneTime: (input) => Effect.Effect<typeof BillingSchema.cases.one_time.Type, Schema.SchemaError>;
subscription: (input) => Effect.Effect<typeof BillingSchema.cases.subscription.Type, Schema.SchemaError>;
perSeatOneTime: (input) => Effect.Effect<typeof BillingSchema.cases.per_seat_one_time.Type, Schema.SchemaError>;
perSeatSubscription: (input) => Effect.Effect<typeof BillingSchema.cases.per_seat_subscription.Type, Schema.SchemaError>;
meteredSubscription: (input) => Effect.Effect<typeof BillingSchema.cases.metered_subscription.Type, Schema.SchemaError>;
};
}>, "OfferTerms"> & {
register: (definitions) => Effect.Effect<RegisteredOffers, OfferRegistrationError>;
checkCompatibility: (terms, support) => Effect.Effect<void,
| OfferDefinitionError
| OfferCompatibilityError>;
parse: (input) => Effect.Effect<OfferTerms, OfferDefinitionError>;
parseSnapshot: (input) => Effect.Effect<OfferTerms, OfferDefinitionError>;
snapshot: (terms) => Effect.Effect<string, OfferDefinitionError>;
};
register: (definitions) => Effect.Effect<RegisteredOffers, OfferRegistrationError>;

Registers a complete set of parsed definitions; extend explicitly with […previous, …incoming]. No persistence is performed.

ReadonlyArray<OfferTerms>

Effect.Effect<RegisteredOffers, OfferRegistrationError>

checkCompatibility: (terms, support) => Effect.Effect<void,
| OfferDefinitionError
| OfferCompatibilityError>;

Compares valid terms with trusted composition facts; success is not executable capability proof.

OfferTerms

typeof OfferCapabilities.Encoded

Effect.Effect<void, | OfferDefinitionError | OfferCompatibilityError>

parse: (input) => Effect.Effect<OfferTerms, OfferDefinitionError>;

Parses a native bigint declaration and checks all cross-benefit rules, without I/O.

typeof OfferDeclaration.Encoded

Effect.Effect<OfferTerms, OfferDefinitionError>

parseSnapshot: (input) => Effect.Effect<OfferTerms, OfferDefinitionError>;

Reads version-one immutable JSON terms; rejects extra fields and unknown versions explicitly.

string

Effect.Effect<OfferTerms, OfferDefinitionError>

snapshot: (terms) => Effect.Effect<string, OfferDefinitionError>;

Encodes proposed accepted terms deterministically; does not persist acceptance or certify installation support.

OfferTerms

Effect.Effect<string, OfferDefinitionError>