business-as-code
Version:
Primitives for expressing business logic and processes as code
44 lines • 2.18 kB
TypeScript
/**
* RefundContract — typed refund machinery. The 7-pattern catalog (per startup-builder
* SERVICES.md) defines the contractual templates a Service can bind to.
*
* Stripe's Smart Disputes are consumer-chargeback-shaped; this is B2B SLA-shape.
*/
export type RefundContractRef = 'no-charge-if-not-qualified' | 'quality-floor-fail' | 'sla-credit-on-late-delivery' | 'sla-credit-on-late-close' | 'partial-credit-on-partial-delivery' | 'time-bounded-money-back' | 'escalate-to-dispute' | (string & {
__brand?: 'RefundContractRef';
});
/**
* Catalog of canonical refund contracts. Consumers reference by id; substrate
* resolves the contract semantics at settlement time.
*/
export declare const RefundContracts: {
readonly 'no-charge-if-not-qualified': {
readonly description: "No charge unless EvaluatorPass + downstream verification confirms work delivered.";
readonly triggersAt: "pre-charge";
};
readonly 'quality-floor-fail': {
readonly description: "Full refund when EvaluatorPanel rejects below quality floor.";
readonly triggersAt: "post-quality-review";
};
readonly 'sla-credit-on-late-delivery': {
readonly description: "Credit equal to N% of invoice when delivery exceeds OutcomeContract.expiresAt.";
readonly triggersAt: "on-timeout";
};
readonly 'sla-credit-on-late-close': {
readonly description: "Credit on monthly subscription when SLA target (e.g. close-by-day-5) breached.";
readonly triggersAt: "sla-breach";
};
readonly 'partial-credit-on-partial-delivery': {
readonly description: "Pro-rata credit when fraction of work-units delivered (e.g. tickets resolved).";
readonly triggersAt: "post-delivery";
};
readonly 'time-bounded-money-back': {
readonly description: "Full refund within N days of acceptance, no questions asked.";
readonly triggersAt: "on-customer-request";
};
readonly 'escalate-to-dispute': {
readonly description: "Route to ESCALATED_TO_HUMAN_REVIEW state; manual resolution.";
readonly triggersAt: "on-customer-dispute";
};
};
//# sourceMappingURL=refund.d.ts.map