@happyvertical/smrt-sales 0.57.23 → 0.57.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,11 +3,13 @@
3
3
  * {@link CommissionPayout}.
4
4
  * @packageDocumentation
5
5
  */
6
- import { SmrtCollection } from '@happyvertical/smrt-core';
6
+ import { type AuditContext, SmrtCollection, type SmrtCreateInput } from '@happyvertical/smrt-core';
7
7
  import { CommissionPayout } from '../models/CommissionPayout.js';
8
8
  import type { CommissionPayoutStatus } from '../types.js';
9
9
  export declare class CommissionPayoutCollection extends SmrtCollection<CommissionPayout> {
10
10
  static readonly _itemClass: typeof CommissionPayout;
11
+ /** Persist the first routing snapshot atomically; a duplicate key must not upsert it. */
12
+ create(options: SmrtCreateInput<CommissionPayout>, context?: Partial<AuditContext>): Promise<CommissionPayout>;
11
13
  /** All payout batches for an earner, newest first. */
12
14
  findByEarner(earnerId: string): Promise<CommissionPayout[]>;
13
15
  /** Payout batches by status, newest first. */
@@ -1 +1 @@
1
- {"version":3,"file":"CommissionPayoutCollection.d.ts","sourceRoot":"","sources":["../../../src/commissions/collections/CommissionPayoutCollection.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAE1D,qBAAa,0BAA2B,SAAQ,cAAc,CAAC,gBAAgB,CAAC;IAC9E,MAAM,CAAC,QAAQ,CAAC,UAAU,0BAAoB;IAE9C,sDAAsD;IAChD,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAOjE,8CAA8C;IACxC,YAAY,CAChB,MAAM,EAAE,sBAAsB,GAC7B,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAO9B,uDAAuD;IACjD,oBAAoB,CACxB,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAMnC;;;;;;;;OAQG;IACG,YAAY,CAChB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GACtC,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAU9B;;;OAGG;IACG,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAM3E;AAED,eAAe,0BAA0B,CAAC"}
1
+ {"version":3,"file":"CommissionPayoutCollection.d.ts","sourceRoot":"","sources":["../../../src/commissions/collections/CommissionPayoutCollection.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,KAAK,YAAY,EACjB,cAAc,EACd,KAAK,eAAe,EACrB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAE1D,qBAAa,0BAA2B,SAAQ,cAAc,CAAC,gBAAgB,CAAC;IAC9E,MAAM,CAAC,QAAQ,CAAC,UAAU,0BAAoB;IAE9C,yFAAyF;IAC1E,MAAM,CACnB,OAAO,EAAE,eAAe,CAAC,gBAAgB,CAAC,EAC1C,OAAO,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,GAC9B,OAAO,CAAC,gBAAgB,CAAC;IAI5B,sDAAsD;IAChD,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAOjE,8CAA8C;IACxC,YAAY,CAChB,MAAM,EAAE,sBAAsB,GAC7B,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAO9B,uDAAuD;IACjD,oBAAoB,CACxB,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAMnC;;;;;;;;OAQG;IACG,YAAY,CAChB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GACtC,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAU9B;;;OAGG;IACG,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAM3E;AAED,eAAe,0BAA0B,CAAC"}
@@ -33,7 +33,7 @@
33
33
  * @packageDocumentation
34
34
  */
35
35
  import { SmrtObject } from '@happyvertical/smrt-core';
36
- import type { CommissionPayoutOptions, CommissionPayoutStatus, PayoutMethod } from '../types.js';
36
+ import { type CommissionPayoutOptions, type CommissionPayoutStatus, type PayoutDestination, type PayoutMethod } from '../types.js';
37
37
  export declare class CommissionPayout extends SmrtObject {
38
38
  /** Tenant ID for multi-tenant isolation (nullable → global payouts). */
39
39
  tenantId: string | null;
@@ -59,6 +59,13 @@ export declare class CommissionPayout extends SmrtObject {
59
59
  currency: string;
60
60
  /** Delivery method for this batch (defaulted from the Earner). */
61
61
  payoutMethod: PayoutMethod;
62
+ /**
63
+ * Routing descriptor captured at batch creation, never the live Earner's
64
+ * preference. Routing is immutable after the first save, including pending
65
+ * and failed/reset batches; reject and create a new batch to change it.
66
+ * Legacy/manual methods have no typed descriptor (`{}`).
67
+ */
68
+ payoutDestination: string;
62
69
  /**
63
70
  * Lifecycle status — see the class doc. Mutate via {@link approve} /
64
71
  * {@link markProcessing} / {@link complete} / {@link fail} /
@@ -152,6 +159,10 @@ export declare class CommissionPayout extends SmrtObject {
152
159
  * audit. The only path out of `failed`. Does NOT save — the caller saves.
153
160
  */
154
161
  resetFromFailed(): void;
162
+ /** Read the batch's validated routing snapshot, never a live Earner. */
163
+ getPayoutDestination(): PayoutDestination | null;
164
+ /** Set a descriptor before first persistence; save enforces routing freeze. */
165
+ setPayoutDestination(destination: PayoutDestination | null): void;
155
166
  /** Parse {@link metadata}; returns `{}` on empty/invalid JSON. */
156
167
  getMetadata(): Record<string, unknown>;
157
168
  /** Serialize and store {@link metadata}. */
@@ -170,6 +181,9 @@ export declare class CommissionPayout extends SmrtObject {
170
181
  * was set.
171
182
  */
172
183
  save(): Promise<this>;
184
+ private validateRouting;
185
+ /** Authoritative read also closes blind-id and natural-key upsert doors. */
186
+ private assertRoutingUnchanged;
173
187
  /** Throws when the totals invariant doesn't hold. */
174
188
  validateTotals(): void;
175
189
  private resolvePriorStatus;
@@ -1 +1 @@
1
- {"version":3,"file":"CommissionPayout.d.ts","sourceRoot":"","sources":["../../../src/commissions/models/CommissionPayout.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,EAIL,UAAU,EAEX,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,EACV,uBAAuB,EACvB,sBAAsB,EACtB,YAAY,EACb,MAAM,aAAa,CAAC;AAgCrB,qBAYa,gBAAiB,SAAQ,UAAU;IAC9C,wEAAwE;IAExE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAQ;IAE/B,+CAA+C;IAE/C,QAAQ,EAAE,MAAM,CAAM;IAEtB,wEAAwE;IACxE,WAAW,EAAE,IAAI,GAAG,IAAI,CAAQ;IAEhC,sEAAsE;IACtE,SAAS,EAAE,IAAI,GAAG,IAAI,CAAQ;IAE9B,2EAA2E;IAC3E,oBAAoB,EAAE,MAAM,CAAK;IAEjC;;;OAGG;IACH,oBAAoB,EAAE,MAAM,CAAK;IAEjC;;;OAGG;IACH,gBAAgB,EAAE,MAAM,CAAK;IAE7B,sCAAsC;IACtC,QAAQ,EAAE,MAAM,CAAS;IAEzB,kEAAkE;IAClE,YAAY,EAAE,YAAY,CAAmB;IAE7C;;;;OAIG;IACH,MAAM,EAAE,sBAAsB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OAAO,CAAC,IAAI,CAAC;IAqBpC,OAAO,CAAC,eAAe;IAuCvB,4EAA4E;YAC9D,sBAAsB;IAgCpC,qDAAqD;IACrD,cAAc,IAAI,IAAI;YAsBR,kBAAkB;IAgBhC,OAAO,CAAC,sBAAsB;IAe9B,OAAO,CAAC,MAAM,CAAC,UAAU;CAS1B;AAED,eAAe,gBAAgB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"CommissionPayoutService.d.ts","sourceRoot":"","sources":["../../../src/commissions/services/CommissionPayoutService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAEjE,OAAO,EAAE,8BAA8B,EAAE,MAAM,kDAAkD,CAAC;AAClG,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAC9E,OAAO,EAAE,0BAA0B,EAAE,MAAM,8CAA8C,CAAC;AAC1F,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAGtE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAEL,KAAK,sBAAsB,EAG3B,KAAK,YAAY,EAClB,MAAM,aAAa,CAAC;AAkCrB,yDAAyD;AACzD,MAAM,WAAW,2BAA2B;IAC1C,OAAO,EAAE,gBAAgB,CAAC;IAC1B,WAAW,EAAE,oBAAoB,CAAC;IAClC,WAAW,EAAE,8BAA8B,CAAC;IAC5C,OAAO,EAAE,0BAA0B,CAAC;CACrC;AAED,mEAAmE;AACnE,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,0DAA0D;IAC1D,WAAW,CAAC,EAAE,IAAI,CAAC;IACnB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB;;;;;;;;OAQG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB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,CAAC,iBAAiB,CASvC;IAEF,4EAA4E;IAC5E,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,eAAe,CASrC;IAEF,OAAO,CAAC,MAAM,CAAC,SAAS;IAWxB,OAAO,CAAC,MAAM,CAAC,SAAS;IAYxB;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,sBAAsB;IAerC;;;;;;;;;;OAUG;mBACkB,gBAAgB;IAwBrC;;;OAGG;YACW,qBAAqB;IAyBnC;;;;;OAKG;IACH,OAAO,CAAC,MAAM,CAAC,sBAAsB;IA8BrC;;;;;OAKG;IACH,OAAO,CAAC,MAAM,CAAC,sBAAsB;IA0HrC,6DAA6D;IAC7D,OAAO,CAAC,eAAe;IAUvB;;;;;;;;;OASG;YACW,wBAAwB;IA2BtC;;;;;;;;OAQG;YACW,gCAAgC;IA8B9C;;;;;OAKG;YACW,sBAAsB;IAqCpC;;;;;;OAMG;IACH,OAAO,CAAC,MAAM,CAAC,yBAAyB;IAiBxC;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,WAAW;YA8BZ,aAAa;IAU3B;;;;;;;;;OASG;IACH,OAAO,CAAC,MAAM,CAAC,qBAAqB;CAarC;AAED,eAAe,uBAAuB,CAAC"}
1
+ {"version":3,"file":"CommissionPayoutService.d.ts","sourceRoot":"","sources":["../../../src/commissions/services/CommissionPayoutService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAEjE,OAAO,EAAE,8BAA8B,EAAE,MAAM,kDAAkD,CAAC;AAClG,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAC9E,OAAO,EAAE,0BAA0B,EAAE,MAAM,8CAA8C,CAAC;AAC1F,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAGtE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAA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C,qBAAqB;CAarC;AAED,eAAe,uBAAuB,CAAC"}
@@ -534,6 +534,8 @@ export interface CommissionPayoutOptions extends SmrtObjectOptions {
534
534
  totalAmountCents?: number;
535
535
  currency?: string;
536
536
  payoutMethod?: PayoutMethod;
537
+ /** JSON routing snapshot captured at batch creation. */
538
+ payoutDestination?: string;
537
539
  status?: CommissionPayoutStatus;
538
540
  paymentReference?: string;
539
541
  providerRef?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/commissions/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAMlE,qDAAqD;AACrD,eAAO,MAAM,eAAe,6CAA8C,CAAC;AAC3E,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5D;;;;GAIG;AACH,eAAO,MAAM,kCAAkC,iCAGrC,CAAC;AACX,MAAM,MAAM,6BAA6B,GACvC,CAAC,OAAO,kCAAkC,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,YAAY,iDAAkD,CAAC;AAC5E,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAEvD;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,8FAQjB,CAAC;AACX,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAE3D;;;GAGG;AACH,eAAO,MAAM,oCAAoC,uCAGL,CAAC;AAE7C;;;GAGG;AACH,MAAM,WAAW,8BAA8B;IAC7C,MAAM,EAAE,gBAAgB,CAAC;IACzB,uCAAuC;IACvC,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAED;;;;GAIG;AACH,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,QAAQ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,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
@@ -1,3 +1,3 @@
1
- import "./chunks/__smrt-register__-BRrJGGpG.js";
2
- import { A as COMMISSION_BASES, B as WATERFALL_POOL_RESIDUAL_RULES, C as WaterfallRecipientResolverRegistry, D as validateWaterfallPlan, E as prepareWaterfallPools, F as EARNER_SOURCE_ATTRIBUTION_STATUSES, G as Commission, H as CommissionPayoutCollection, I as EARNER_STATUSES, J as CommissionAdjustmentCollection, K as CommissionAdjustmentOperationCollection, L as EARNING_EVENT_KINDS, M as COMMISSION_PLAN_STATUSES, N as COMMISSION_STATUSES, O as ADJUSTMENT_SETTLEABLE_COMMISSION_STATUSES, P as EARNER_KINDS, R as PAYOUT_METHODS, S as validateCommissionPlanComponents, T as calculateWaterfallWithPools, U as CommissionPayout, V as WATERFALL_POOL_ZERO_WEIGHT_RULES, W as CommissionCollection, Y as CommissionAdjustment, _ as EarnerCollection, a as CommissionBalanceService, b as CommissionPlanCollection, c as CommissionAdjustmentValidationError, d as centsToAmount, f as roundCents, g as EarnerSourceAttribution, h as EarnerSourceAttributionCollection, i as CommissionCalculationService, j as COMMISSION_PAYOUT_STATUSES, k as COMMISSION_ADJUSTMENT_KINDS, l as amountToCents, m as EarningEvent, n as CommissionSettlementService, o as CommissionAdjustmentReplayConflictError, p as EarningEventCollection, q as CommissionAdjustmentOperation, r as CommissionPayoutService, s as CommissionAdjustmentService, t as EarnerAttributionService, u as calculateCommissionAmountCents, v as Earner, w as calculateWaterfall, x as CommissionPlan, y as validatePayoutDestination, z as PAYOUT_METHODS_REQUIRING_DESTINATION } from "./chunks/commissions-D5x24d4o.js";
1
+ import "./chunks/__smrt-register__-Yzz7_2xD.js";
2
+ import { A as ADJUSTMENT_SETTLEABLE_COMMISSION_STATUSES, B as PAYOUT_METHODS, C as calculateWaterfallWithPools, D as CommissionPayout, E as CommissionPayoutCollection, F as COMMISSION_STATUSES, G as Commission, H as WATERFALL_POOL_RESIDUAL_RULES, I as EARNER_KINDS, J as CommissionAdjustmentCollection, K as CommissionAdjustmentOperationCollection, L as EARNER_SOURCE_ATTRIBUTION_STATUSES, M as COMMISSION_BASES, N as COMMISSION_PAYOUT_STATUSES, O as Earner, P as COMMISSION_PLAN_STATUSES, R as EARNER_STATUSES, S as calculateWaterfall, T as validateWaterfallPlan, U as WATERFALL_POOL_ZERO_WEIGHT_RULES, V as PAYOUT_METHODS_REQUIRING_DESTINATION, W as CommissionCollection, Y as CommissionAdjustment, _ as EarnerCollection, a as CommissionBalanceService, b as validateCommissionPlanComponents, c as CommissionAdjustmentValidationError, d as centsToAmount, f as roundCents, g as EarnerSourceAttribution, h as EarnerSourceAttributionCollection, i as CommissionCalculationService, j as COMMISSION_ADJUSTMENT_KINDS, k as validatePayoutDestination, l as amountToCents, m as EarningEvent, n as CommissionSettlementService, o as CommissionAdjustmentReplayConflictError, p as EarningEventCollection, q as CommissionAdjustmentOperation, r as CommissionPayoutService, s as CommissionAdjustmentService, t as EarnerAttributionService, u as calculateCommissionAmountCents, v as CommissionPlanCollection, w as prepareWaterfallPools, x as WaterfallRecipientResolverRegistry, y as CommissionPlan, z as EARNING_EVENT_KINDS } from "./chunks/commissions-nMBMa0DT.js";
3
3
  export { ADJUSTMENT_SETTLEABLE_COMMISSION_STATUSES, COMMISSION_ADJUSTMENT_KINDS, COMMISSION_BASES, COMMISSION_PAYOUT_STATUSES, COMMISSION_PLAN_STATUSES, COMMISSION_STATUSES, Commission, CommissionAdjustment, CommissionAdjustmentCollection, CommissionAdjustmentOperation, CommissionAdjustmentOperationCollection, CommissionAdjustmentReplayConflictError, CommissionAdjustmentService, CommissionAdjustmentValidationError, CommissionBalanceService, CommissionCalculationService, CommissionCollection, CommissionPayout, CommissionPayoutCollection, CommissionPayoutService, CommissionPlan, CommissionPlanCollection, CommissionSettlementService, EARNER_KINDS, EARNER_SOURCE_ATTRIBUTION_STATUSES, EARNER_STATUSES, EARNING_EVENT_KINDS, Earner, EarnerAttributionService, EarnerCollection, EarnerSourceAttribution, EarnerSourceAttributionCollection, EarningEvent, EarningEventCollection, PAYOUT_METHODS, PAYOUT_METHODS_REQUIRING_DESTINATION, WATERFALL_POOL_RESIDUAL_RULES, WATERFALL_POOL_ZERO_WEIGHT_RULES, WaterfallRecipientResolverRegistry, amountToCents, calculateCommissionAmountCents, calculateWaterfall, calculateWaterfallWithPools, centsToAmount, prepareWaterfallPools, roundCents, validateCommissionPlanComponents, validatePayoutDestination, validateWaterfallPlan };
package/dist/crm.js CHANGED
@@ -1,3 +1,3 @@
1
- import "./chunks/__smrt-register__-BRrJGGpG.js";
1
+ import "./chunks/__smrt-register__-Yzz7_2xD.js";
2
2
  import { A as OPPORTUNITY_STATUSES, C as SalesActivity, D as DEFAULT_PIPELINE_KEY, E as Opportunity, F as Lead, M as SALES_ACTIVITY_KINDS, N as SALES_ACTIVITY_SUBJECT_KINDS, O as DEFAULT_PIPELINE_STAGES, P as SALES_REPRESENTATIVE_STATUSES, S as SalesActivityCollection, T as PipelineStage, _ as SalesRepresentativeCollection, a as LeadWorkflowValidationError, b as PipelineDefinition, c as LeadConversionService, d as SalesGovernanceState, f as SalesGovernanceEventCollection, g as LeadCollection, h as OpportunityConversion, i as LeadWorkflowService, j as PIPELINE_STATUSES, k as LEAD_STATUSES, l as SalesPipelineRecipe, m as OpportunityConversionCollection, n as SalesGovernanceService, o as MAX_LEAD_WORKFLOW_TEXT_LENGTH, p as SalesGovernanceEvent, r as LEAD_HUMAN_ACTIVITY_KINDS, s as projectLeadWorkQueue, t as SalesGovernanceError, u as SalesGovernanceStateCollection, v as SalesRepresentative, w as PipelineStageCollection, x as OpportunityCollection, y as PipelineDefinitionCollection } from "./chunks/crm-BENK-hHd.js";
3
3
  export { DEFAULT_PIPELINE_KEY, DEFAULT_PIPELINE_STAGES, LEAD_HUMAN_ACTIVITY_KINDS, LEAD_STATUSES, Lead, LeadCollection, LeadConversionService, LeadWorkflowService, LeadWorkflowValidationError, MAX_LEAD_WORKFLOW_TEXT_LENGTH, OPPORTUNITY_STATUSES, Opportunity, OpportunityCollection, OpportunityConversion, OpportunityConversionCollection, PIPELINE_STATUSES, PipelineDefinition, PipelineDefinitionCollection, PipelineStage, PipelineStageCollection, SALES_ACTIVITY_KINDS, SALES_ACTIVITY_SUBJECT_KINDS, SALES_REPRESENTATIVE_STATUSES, SalesActivity, SalesActivityCollection, SalesGovernanceError, SalesGovernanceEvent, SalesGovernanceEventCollection, SalesGovernanceService, SalesGovernanceState, SalesGovernanceStateCollection, SalesPipelineRecipe, SalesRepresentative, SalesRepresentativeCollection, projectLeadWorkQueue };
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import "./chunks/__smrt-register__-BRrJGGpG.js";
1
+ import "./chunks/__smrt-register__-Yzz7_2xD.js";
2
2
  import { a as AgreementExecutionEvent, c as AgreementCollection, d as serializeAgreementParty, f as AGREEMENT_EXECUTION_STATUSES, g as sanitizeSignerIntent, h as sanitizeSignerEvidence, i as AgreementExecutionEventCollection, l as Agreement, m as coerceAgreementDate, n as ExecutedAgreementCollection, o as AgreementExecutionCollection, p as AGREEMENT_STATUSES, r as ExecutedAgreement, s as AgreementExecution, t as AgreementExecutionService, u as parseAgreementParty } from "./chunks/agreements-RsyRLeDn.js";
3
- import { A as COMMISSION_BASES, B as WATERFALL_POOL_RESIDUAL_RULES, C as WaterfallRecipientResolverRegistry, D as validateWaterfallPlan, E as prepareWaterfallPools, F as EARNER_SOURCE_ATTRIBUTION_STATUSES, G as Commission, H as CommissionPayoutCollection, I as EARNER_STATUSES, J as CommissionAdjustmentCollection, K as CommissionAdjustmentOperationCollection, L as EARNING_EVENT_KINDS, M as COMMISSION_PLAN_STATUSES, N as COMMISSION_STATUSES, O as ADJUSTMENT_SETTLEABLE_COMMISSION_STATUSES, P as EARNER_KINDS, R as PAYOUT_METHODS, S as validateCommissionPlanComponents, T as calculateWaterfallWithPools, U as CommissionPayout, V as WATERFALL_POOL_ZERO_WEIGHT_RULES, W as CommissionCollection, Y as CommissionAdjustment, _ as EarnerCollection, a as CommissionBalanceService, b as CommissionPlanCollection, c as CommissionAdjustmentValidationError, d as centsToAmount, f as roundCents, g as EarnerSourceAttribution, h as EarnerSourceAttributionCollection, i as CommissionCalculationService, j as COMMISSION_PAYOUT_STATUSES, k as COMMISSION_ADJUSTMENT_KINDS, l as amountToCents, m as EarningEvent, n as CommissionSettlementService, o as CommissionAdjustmentReplayConflictError, p as EarningEventCollection, q as CommissionAdjustmentOperation, r as CommissionPayoutService, s as CommissionAdjustmentService, t as EarnerAttributionService, u as calculateCommissionAmountCents, v as Earner, w as calculateWaterfall, x as CommissionPlan, y as validatePayoutDestination, z as PAYOUT_METHODS_REQUIRING_DESTINATION } from "./chunks/commissions-D5x24d4o.js";
3
+ import { A as ADJUSTMENT_SETTLEABLE_COMMISSION_STATUSES, B as PAYOUT_METHODS, C as calculateWaterfallWithPools, D as CommissionPayout, E as CommissionPayoutCollection, F as COMMISSION_STATUSES, G as Commission, H as WATERFALL_POOL_RESIDUAL_RULES, I as EARNER_KINDS, J as CommissionAdjustmentCollection, K as CommissionAdjustmentOperationCollection, L as EARNER_SOURCE_ATTRIBUTION_STATUSES, M as COMMISSION_BASES, N as COMMISSION_PAYOUT_STATUSES, O as Earner, P as COMMISSION_PLAN_STATUSES, R as EARNER_STATUSES, S as calculateWaterfall, T as validateWaterfallPlan, U as WATERFALL_POOL_ZERO_WEIGHT_RULES, V as PAYOUT_METHODS_REQUIRING_DESTINATION, W as CommissionCollection, Y as CommissionAdjustment, _ as EarnerCollection, a as CommissionBalanceService, b as validateCommissionPlanComponents, c as CommissionAdjustmentValidationError, d as centsToAmount, f as roundCents, g as EarnerSourceAttribution, h as EarnerSourceAttributionCollection, i as CommissionCalculationService, j as COMMISSION_ADJUSTMENT_KINDS, k as validatePayoutDestination, l as amountToCents, m as EarningEvent, n as CommissionSettlementService, o as CommissionAdjustmentReplayConflictError, p as EarningEventCollection, q as CommissionAdjustmentOperation, r as CommissionPayoutService, s as CommissionAdjustmentService, t as EarnerAttributionService, u as calculateCommissionAmountCents, v as CommissionPlanCollection, w as prepareWaterfallPools, x as WaterfallRecipientResolverRegistry, y as CommissionPlan, z as EARNING_EVENT_KINDS } from "./chunks/commissions-nMBMa0DT.js";
4
4
  import { A as OPPORTUNITY_STATUSES, C as SalesActivity, D as DEFAULT_PIPELINE_KEY, E as Opportunity, F as Lead, M as SALES_ACTIVITY_KINDS, N as SALES_ACTIVITY_SUBJECT_KINDS, O as DEFAULT_PIPELINE_STAGES, P as SALES_REPRESENTATIVE_STATUSES, S as SalesActivityCollection, T as PipelineStage, _ as SalesRepresentativeCollection, a as LeadWorkflowValidationError, b as PipelineDefinition, c as LeadConversionService, d as SalesGovernanceState, f as SalesGovernanceEventCollection, g as LeadCollection, h as OpportunityConversion, i as LeadWorkflowService, j as PIPELINE_STATUSES, k as LEAD_STATUSES, l as SalesPipelineRecipe, m as OpportunityConversionCollection, n as SalesGovernanceService, o as MAX_LEAD_WORKFLOW_TEXT_LENGTH, p as SalesGovernanceEvent, r as LEAD_HUMAN_ACTIVITY_KINDS, s as projectLeadWorkQueue, t as SalesGovernanceError, u as SalesGovernanceStateCollection, v as SalesRepresentative, w as PipelineStageCollection, x as OpportunityCollection, y as PipelineDefinitionCollection } from "./chunks/crm-BENK-hHd.js";
5
- import { A as ReferralClickOperation, B as ATTRIBUTION_RESOLUTION_MODES, C as ReferralTouchCollection, D as ReferralCollection, E as assertHttpTargetUrl, F as validateAttributionPolicyTerms, G as REFERRAL_STATUSES, H as REFERRAL_AGREEMENT_STATUSES, I as ATTRIBUTION_CONFLICT_BEHAVIORS, J as AttributionExceptionCollection, K as REFERRAL_TOUCH_KINDS, L as ATTRIBUTION_CREDIT_MODES, M as ReferralAgreement, N as AttributionPolicyCollection, O as Referral, P as AttributionPolicy, R as ATTRIBUTION_EXCEPTION_STATUSES, S as generateReferralCode, T as ReferralLink, U as REFERRAL_LINK_STATUSES, V as REFERRAL_AGREEMENT_APPROVAL_MODES, W as REFERRAL_PROGRAM_STATUSES, Y as AttributionException, _ as REFERRAL_CODE_ALPHABET, a as ReferralAgreementExecutionService, b as ReferralClickValidationError, c as ReferrerCollection, d as ReferralTermSnapshot, f as ReferralProgramCollection, g as MAX_REFERRAL_CLICK_IDEMPOTENCY_KEY_BYTES, h as MAX_CODE_GENERATION_ATTEMPTS, i as REFERRAL_AGREEMENT_SOURCE_KIND, j as ReferralAgreementCollection, k as ReferralClickOperationCollection, l as Referrer, m as DEFAULT_REFERRAL_CLICK_EVIDENCE_MAX_BYTES, n as REFERRAL_TERMS_SNAPSHOT_KIND, o as AttributionService, p as ReferralProgram, q as REFERRER_STATUSES, r as ReferralCommissionService, s as QualifiedReferralOverrideError, t as ReferralQualificationService, u as ReferralTermSnapshotCollection, v as REFERRAL_CODE_LENGTH, w as ReferralTouch, x as ReferralLinkCollection, y as ReferralClickReplayConflictError, z as ATTRIBUTION_POLICY_STATUSES } from "./chunks/referrals-BRdTkEFt.js";
5
+ import { A as ReferralClickOperation, B as ATTRIBUTION_RESOLUTION_MODES, C as ReferralTouchCollection, D as ReferralCollection, E as assertHttpTargetUrl, F as validateAttributionPolicyTerms, G as REFERRAL_STATUSES, H as REFERRAL_AGREEMENT_STATUSES, I as ATTRIBUTION_CONFLICT_BEHAVIORS, J as AttributionExceptionCollection, K as REFERRAL_TOUCH_KINDS, L as ATTRIBUTION_CREDIT_MODES, M as ReferralAgreement, N as AttributionPolicyCollection, O as Referral, P as AttributionPolicy, R as ATTRIBUTION_EXCEPTION_STATUSES, S as generateReferralCode, T as ReferralLink, U as REFERRAL_LINK_STATUSES, V as REFERRAL_AGREEMENT_APPROVAL_MODES, W as REFERRAL_PROGRAM_STATUSES, Y as AttributionException, _ as REFERRAL_CODE_ALPHABET, a as ReferralAgreementExecutionService, b as ReferralClickValidationError, c as ReferrerCollection, d as ReferralTermSnapshot, f as ReferralProgramCollection, g as MAX_REFERRAL_CLICK_IDEMPOTENCY_KEY_BYTES, h as MAX_CODE_GENERATION_ATTEMPTS, i as REFERRAL_AGREEMENT_SOURCE_KIND, j as ReferralAgreementCollection, k as ReferralClickOperationCollection, l as Referrer, m as DEFAULT_REFERRAL_CLICK_EVIDENCE_MAX_BYTES, n as REFERRAL_TERMS_SNAPSHOT_KIND, o as AttributionService, p as ReferralProgram, q as REFERRER_STATUSES, r as ReferralCommissionService, s as QualifiedReferralOverrideError, t as ReferralQualificationService, u as ReferralTermSnapshotCollection, v as REFERRAL_CODE_LENGTH, w as ReferralTouch, x as ReferralLinkCollection, y as ReferralClickReplayConflictError, z as ATTRIBUTION_POLICY_STATUSES } from "./chunks/referrals-BPEaXqCz.js";
6
6
  export { ADJUSTMENT_SETTLEABLE_COMMISSION_STATUSES, AGREEMENT_EXECUTION_STATUSES, AGREEMENT_STATUSES, ATTRIBUTION_CONFLICT_BEHAVIORS, ATTRIBUTION_CREDIT_MODES, ATTRIBUTION_EXCEPTION_STATUSES, ATTRIBUTION_POLICY_STATUSES, ATTRIBUTION_RESOLUTION_MODES, Agreement, AgreementCollection, AgreementExecution, AgreementExecutionCollection, AgreementExecutionEvent, AgreementExecutionEventCollection, AgreementExecutionService, AttributionException, AttributionExceptionCollection, AttributionPolicy, AttributionPolicyCollection, AttributionService, COMMISSION_ADJUSTMENT_KINDS, COMMISSION_BASES, COMMISSION_PAYOUT_STATUSES, COMMISSION_PLAN_STATUSES, COMMISSION_STATUSES, Commission, CommissionAdjustment, CommissionAdjustmentCollection, CommissionAdjustmentOperation, CommissionAdjustmentOperationCollection, CommissionAdjustmentReplayConflictError, CommissionAdjustmentService, CommissionAdjustmentValidationError, CommissionBalanceService, CommissionCalculationService, CommissionCollection, CommissionPayout, CommissionPayoutCollection, CommissionPayoutService, CommissionPlan, CommissionPlanCollection, CommissionSettlementService, DEFAULT_PIPELINE_KEY, DEFAULT_PIPELINE_STAGES, DEFAULT_REFERRAL_CLICK_EVIDENCE_MAX_BYTES, EARNER_KINDS, EARNER_SOURCE_ATTRIBUTION_STATUSES, EARNER_STATUSES, EARNING_EVENT_KINDS, Earner, EarnerAttributionService, EarnerCollection, EarnerSourceAttribution, EarnerSourceAttributionCollection, EarningEvent, EarningEventCollection, ExecutedAgreement, ExecutedAgreementCollection, LEAD_HUMAN_ACTIVITY_KINDS, LEAD_STATUSES, Lead, LeadCollection, LeadConversionService, LeadWorkflowService, LeadWorkflowValidationError, MAX_CODE_GENERATION_ATTEMPTS, MAX_LEAD_WORKFLOW_TEXT_LENGTH, MAX_REFERRAL_CLICK_IDEMPOTENCY_KEY_BYTES, OPPORTUNITY_STATUSES, Opportunity, OpportunityCollection, OpportunityConversion, OpportunityConversionCollection, PAYOUT_METHODS, PAYOUT_METHODS_REQUIRING_DESTINATION, PIPELINE_STATUSES, PipelineDefinition, PipelineDefinitionCollection, PipelineStage, PipelineStageCollection, QualifiedReferralOverrideError, REFERRAL_AGREEMENT_APPROVAL_MODES, REFERRAL_AGREEMENT_SOURCE_KIND, REFERRAL_AGREEMENT_STATUSES, REFERRAL_CODE_ALPHABET, REFERRAL_CODE_LENGTH, REFERRAL_LINK_STATUSES, REFERRAL_PROGRAM_STATUSES, REFERRAL_STATUSES, REFERRAL_TERMS_SNAPSHOT_KIND, REFERRAL_TOUCH_KINDS, REFERRER_STATUSES, Referral, ReferralAgreement, ReferralAgreementCollection, ReferralAgreementExecutionService, ReferralClickOperation, ReferralClickOperationCollection, ReferralClickReplayConflictError, ReferralClickValidationError, ReferralCollection, ReferralCommissionService, ReferralLink, ReferralLinkCollection, ReferralProgram, ReferralProgramCollection, ReferralQualificationService, ReferralTermSnapshot, ReferralTermSnapshotCollection, ReferralTouch, ReferralTouchCollection, Referrer, ReferrerCollection, SALES_ACTIVITY_KINDS, SALES_ACTIVITY_SUBJECT_KINDS, SALES_REPRESENTATIVE_STATUSES, SalesActivity, SalesActivityCollection, SalesGovernanceError, SalesGovernanceEvent, SalesGovernanceEventCollection, SalesGovernanceService, SalesGovernanceState, SalesGovernanceStateCollection, SalesPipelineRecipe, SalesRepresentative, SalesRepresentativeCollection, WATERFALL_POOL_RESIDUAL_RULES, WATERFALL_POOL_ZERO_WEIGHT_RULES, WaterfallRecipientResolverRegistry, amountToCents, assertHttpTargetUrl, calculateCommissionAmountCents, calculateWaterfall, calculateWaterfallWithPools, centsToAmount, coerceAgreementDate, generateReferralCode, parseAgreementParty, prepareWaterfallPools, projectLeadWorkQueue, roundCents, sanitizeSignerEvidence, sanitizeSignerIntent, serializeAgreementParty, validateAttributionPolicyTerms, validateCommissionPlanComponents, validatePayoutDestination, validateWaterfallPlan };
@@ -2,7 +2,7 @@
2
2
  "version": "1.0.0",
3
3
  "timestamp": 0,
4
4
  "packageName": "@happyvertical/smrt-sales",
5
- "packageVersion": "0.57.23",
5
+ "packageVersion": "0.57.24",
6
6
  "objects": {
7
7
  "@happyvertical/smrt-sales:AgreementCollection": {
8
8
  "name": "agreementcollection",
@@ -4046,6 +4046,25 @@
4046
4046
  "packageName": "@happyvertical/smrt-sales",
4047
4047
  "fields": {},
4048
4048
  "methods": {
4049
+ "create": {
4050
+ "name": "create",
4051
+ "async": true,
4052
+ "parameters": [
4053
+ {
4054
+ "name": "options",
4055
+ "type": "SmrtCreateInput<CommissionPayout>",
4056
+ "optional": false
4057
+ },
4058
+ {
4059
+ "name": "context",
4060
+ "type": "Partial<AuditContext>",
4061
+ "optional": true
4062
+ }
4063
+ ],
4064
+ "returnType": "Promise<CommissionPayout>",
4065
+ "isStatic": false,
4066
+ "isPublic": true
4067
+ },
4049
4068
  "findByEarner": {
4050
4069
  "name": "findByEarner",
4051
4070
  "async": true,
@@ -4161,7 +4180,7 @@
4161
4180
  "collectionExportName": "CommissionPayoutCollectionCollection",
4162
4181
  "schema": {
4163
4182
  "tableName": "commission_payouts",
4164
- "ddl": "CREATE TABLE IF NOT EXISTS \"commission_payouts\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"earner_id\" UUID NOT NULL,\n \"period_start\" TIMESTAMP,\n \"period_end\" TIMESTAMP,\n \"commission_total_cents\" INTEGER DEFAULT 0,\n \"adjustment_total_cents\" INTEGER DEFAULT 0,\n \"total_amount_cents\" INTEGER DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\n \"payout_method\" TEXT DEFAULT 'bank_transfer',\n \"status\" TEXT DEFAULT 'pending',\n \"payment_reference\" TEXT DEFAULT '',\n \"provider_ref\" TEXT DEFAULT '',\n \"paid_at\" TIMESTAMP,\n \"invoice_id\" UUID,\n \"notes\" TEXT DEFAULT '',\n \"idempotency_key\" TEXT NOT NULL DEFAULT '',\n \"source_kind\" TEXT DEFAULT '',\n \"source_id\" TEXT DEFAULT '',\n \"metadata\" TEXT DEFAULT '{}'\n);",
4183
+ "ddl": "CREATE TABLE IF NOT EXISTS \"commission_payouts\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"earner_id\" UUID NOT NULL,\n \"period_start\" TIMESTAMP,\n \"period_end\" TIMESTAMP,\n \"commission_total_cents\" INTEGER DEFAULT 0,\n \"adjustment_total_cents\" INTEGER DEFAULT 0,\n \"total_amount_cents\" INTEGER DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\n \"payout_method\" TEXT DEFAULT 'bank_transfer',\n \"payout_destination\" TEXT DEFAULT '{}',\n \"status\" TEXT DEFAULT 'pending',\n \"payment_reference\" TEXT DEFAULT '',\n \"provider_ref\" TEXT DEFAULT '',\n \"paid_at\" TIMESTAMP,\n \"invoice_id\" UUID,\n \"notes\" TEXT DEFAULT '',\n \"idempotency_key\" TEXT NOT NULL DEFAULT '',\n \"source_kind\" TEXT DEFAULT '',\n \"source_id\" TEXT DEFAULT '',\n \"metadata\" TEXT DEFAULT '{}'\n);",
4165
4184
  "columns": {
4166
4185
  "id": {
4167
4186
  "type": "UUID",
@@ -4246,6 +4265,12 @@
4246
4265
  "unique": false,
4247
4266
  "default": "bank_transfer"
4248
4267
  },
4268
+ "payout_destination": {
4269
+ "type": "TEXT",
4270
+ "notNull": false,
4271
+ "unique": false,
4272
+ "default": "{}"
4273
+ },
4249
4274
  "status": {
4250
4275
  "type": "TEXT",
4251
4276
  "notNull": false,
@@ -4347,7 +4372,7 @@
4347
4372
  ]
4348
4373
  }
4349
4374
  ],
4350
- "version": "d4997e44"
4375
+ "version": "242b9cec"
4351
4376
  },
4352
4377
  "importPath": "@happyvertical/smrt-sales/commissions"
4353
4378
  },
@@ -6352,6 +6377,11 @@
6352
6377
  "required": false,
6353
6378
  "default": "bank_transfer"
6354
6379
  },
6380
+ "payoutDestination": {
6381
+ "type": "text",
6382
+ "required": false,
6383
+ "default": "{}"
6384
+ },
6355
6385
  "status": {
6356
6386
  "type": "text",
6357
6387
  "required": false,
@@ -6536,6 +6566,36 @@
6536
6566
  "isStatic": false,
6537
6567
  "isPublic": true
6538
6568
  },
6569
+ "getPayoutDestination": {
6570
+ "name": "getPayoutDestination",
6571
+ "async": false,
6572
+ "parameters": [],
6573
+ "returnType": "PayoutDestination | null",
6574
+ "isStatic": false,
6575
+ "isPublic": true
6576
+ },
6577
+ "setPayoutDestination": {
6578
+ "name": "setPayoutDestination",
6579
+ "async": false,
6580
+ "parameters": [
6581
+ {
6582
+ "name": "destination",
6583
+ "type": "PayoutDestination | null",
6584
+ "optional": false,
6585
+ "unionBranches": [
6586
+ {
6587
+ "type": "PayoutDestination"
6588
+ },
6589
+ {
6590
+ "type": "null"
6591
+ }
6592
+ ]
6593
+ }
6594
+ ],
6595
+ "returnType": "void",
6596
+ "isStatic": false,
6597
+ "isPublic": true
6598
+ },
6539
6599
  "getMetadata": {
6540
6600
  "name": "getMetadata",
6541
6601
  "async": false,
@@ -6618,7 +6678,7 @@
6618
6678
  ],
6619
6679
  "schema": {
6620
6680
  "tableName": "commission_payouts",
6621
- "ddl": "CREATE TABLE IF NOT EXISTS \"commission_payouts\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"earner_id\" UUID NOT NULL,\n \"period_start\" TIMESTAMP,\n \"period_end\" TIMESTAMP,\n \"commission_total_cents\" INTEGER DEFAULT 0,\n \"adjustment_total_cents\" INTEGER DEFAULT 0,\n \"total_amount_cents\" INTEGER DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\n \"payout_method\" TEXT DEFAULT 'bank_transfer',\n \"status\" TEXT DEFAULT 'pending',\n \"payment_reference\" TEXT DEFAULT '',\n \"provider_ref\" TEXT DEFAULT '',\n \"paid_at\" TIMESTAMP,\n \"invoice_id\" UUID,\n \"notes\" TEXT DEFAULT '',\n \"idempotency_key\" TEXT NOT NULL DEFAULT '',\n \"source_kind\" TEXT DEFAULT '',\n \"source_id\" TEXT DEFAULT '',\n \"metadata\" TEXT DEFAULT '{}'\n);",
6681
+ "ddl": "CREATE TABLE IF NOT EXISTS \"commission_payouts\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"earner_id\" UUID NOT NULL,\n \"period_start\" TIMESTAMP,\n \"period_end\" TIMESTAMP,\n \"commission_total_cents\" INTEGER DEFAULT 0,\n \"adjustment_total_cents\" INTEGER DEFAULT 0,\n \"total_amount_cents\" INTEGER DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\n \"payout_method\" TEXT DEFAULT 'bank_transfer',\n \"payout_destination\" TEXT DEFAULT '{}',\n \"status\" TEXT DEFAULT 'pending',\n \"payment_reference\" TEXT DEFAULT '',\n \"provider_ref\" TEXT DEFAULT '',\n \"paid_at\" TIMESTAMP,\n \"invoice_id\" UUID,\n \"notes\" TEXT DEFAULT '',\n \"idempotency_key\" TEXT NOT NULL DEFAULT '',\n \"source_kind\" TEXT DEFAULT '',\n \"source_id\" TEXT DEFAULT '',\n \"metadata\" TEXT DEFAULT '{}'\n);",
6622
6682
  "columns": {
6623
6683
  "id": {
6624
6684
  "type": "UUID",
@@ -6703,6 +6763,12 @@
6703
6763
  "unique": false,
6704
6764
  "default": "bank_transfer"
6705
6765
  },
6766
+ "payout_destination": {
6767
+ "type": "TEXT",
6768
+ "notNull": false,
6769
+ "unique": false,
6770
+ "default": "{}"
6771
+ },
6706
6772
  "status": {
6707
6773
  "type": "TEXT",
6708
6774
  "notNull": false,
@@ -6804,7 +6870,7 @@
6804
6870
  ]
6805
6871
  }
6806
6872
  ],
6807
- "version": "d4997e44"
6873
+ "version": "242b9cec"
6808
6874
  },
6809
6875
  "importPath": "@happyvertical/smrt-sales/commissions"
6810
6876
  },
package/dist/referrals.js CHANGED
@@ -1,3 +1,3 @@
1
- import "./chunks/__smrt-register__-BRrJGGpG.js";
2
- import { A as ReferralClickOperation, B as ATTRIBUTION_RESOLUTION_MODES, C as ReferralTouchCollection, D as ReferralCollection, E as assertHttpTargetUrl, F as validateAttributionPolicyTerms, G as REFERRAL_STATUSES, H as REFERRAL_AGREEMENT_STATUSES, I as ATTRIBUTION_CONFLICT_BEHAVIORS, J as AttributionExceptionCollection, K as REFERRAL_TOUCH_KINDS, L as ATTRIBUTION_CREDIT_MODES, M as ReferralAgreement, N as AttributionPolicyCollection, O as Referral, P as AttributionPolicy, R as ATTRIBUTION_EXCEPTION_STATUSES, S as generateReferralCode, T as ReferralLink, U as REFERRAL_LINK_STATUSES, V as REFERRAL_AGREEMENT_APPROVAL_MODES, W as REFERRAL_PROGRAM_STATUSES, Y as AttributionException, _ as REFERRAL_CODE_ALPHABET, a as ReferralAgreementExecutionService, b as ReferralClickValidationError, c as ReferrerCollection, d as ReferralTermSnapshot, f as ReferralProgramCollection, g as MAX_REFERRAL_CLICK_IDEMPOTENCY_KEY_BYTES, h as MAX_CODE_GENERATION_ATTEMPTS, i as REFERRAL_AGREEMENT_SOURCE_KIND, j as ReferralAgreementCollection, k as ReferralClickOperationCollection, l as Referrer, m as DEFAULT_REFERRAL_CLICK_EVIDENCE_MAX_BYTES, n as REFERRAL_TERMS_SNAPSHOT_KIND, o as AttributionService, p as ReferralProgram, q as REFERRER_STATUSES, r as ReferralCommissionService, s as QualifiedReferralOverrideError, t as ReferralQualificationService, u as ReferralTermSnapshotCollection, v as REFERRAL_CODE_LENGTH, w as ReferralTouch, x as ReferralLinkCollection, y as ReferralClickReplayConflictError, z as ATTRIBUTION_POLICY_STATUSES } from "./chunks/referrals-BRdTkEFt.js";
1
+ import "./chunks/__smrt-register__-Yzz7_2xD.js";
2
+ import { A as ReferralClickOperation, B as ATTRIBUTION_RESOLUTION_MODES, C as ReferralTouchCollection, D as ReferralCollection, E as assertHttpTargetUrl, F as validateAttributionPolicyTerms, G as REFERRAL_STATUSES, H as REFERRAL_AGREEMENT_STATUSES, I as ATTRIBUTION_CONFLICT_BEHAVIORS, J as AttributionExceptionCollection, K as REFERRAL_TOUCH_KINDS, L as ATTRIBUTION_CREDIT_MODES, M as ReferralAgreement, N as AttributionPolicyCollection, O as Referral, P as AttributionPolicy, R as ATTRIBUTION_EXCEPTION_STATUSES, S as generateReferralCode, T as ReferralLink, U as REFERRAL_LINK_STATUSES, V as REFERRAL_AGREEMENT_APPROVAL_MODES, W as REFERRAL_PROGRAM_STATUSES, Y as AttributionException, _ as REFERRAL_CODE_ALPHABET, a as ReferralAgreementExecutionService, b as ReferralClickValidationError, c as ReferrerCollection, d as ReferralTermSnapshot, f as ReferralProgramCollection, g as MAX_REFERRAL_CLICK_IDEMPOTENCY_KEY_BYTES, h as MAX_CODE_GENERATION_ATTEMPTS, i as REFERRAL_AGREEMENT_SOURCE_KIND, j as ReferralAgreementCollection, k as ReferralClickOperationCollection, l as Referrer, m as DEFAULT_REFERRAL_CLICK_EVIDENCE_MAX_BYTES, n as REFERRAL_TERMS_SNAPSHOT_KIND, o as AttributionService, p as ReferralProgram, q as REFERRER_STATUSES, r as ReferralCommissionService, s as QualifiedReferralOverrideError, t as ReferralQualificationService, u as ReferralTermSnapshotCollection, v as REFERRAL_CODE_LENGTH, w as ReferralTouch, x as ReferralLinkCollection, y as ReferralClickReplayConflictError, z as ATTRIBUTION_POLICY_STATUSES } from "./chunks/referrals-BPEaXqCz.js";
3
3
  export { ATTRIBUTION_CONFLICT_BEHAVIORS, ATTRIBUTION_CREDIT_MODES, ATTRIBUTION_EXCEPTION_STATUSES, ATTRIBUTION_POLICY_STATUSES, ATTRIBUTION_RESOLUTION_MODES, AttributionException, AttributionExceptionCollection, AttributionPolicy, AttributionPolicyCollection, AttributionService, DEFAULT_REFERRAL_CLICK_EVIDENCE_MAX_BYTES, MAX_CODE_GENERATION_ATTEMPTS, MAX_REFERRAL_CLICK_IDEMPOTENCY_KEY_BYTES, QualifiedReferralOverrideError, REFERRAL_AGREEMENT_APPROVAL_MODES, REFERRAL_AGREEMENT_SOURCE_KIND, REFERRAL_AGREEMENT_STATUSES, REFERRAL_CODE_ALPHABET, REFERRAL_CODE_LENGTH, REFERRAL_LINK_STATUSES, REFERRAL_PROGRAM_STATUSES, REFERRAL_STATUSES, REFERRAL_TERMS_SNAPSHOT_KIND, REFERRAL_TOUCH_KINDS, REFERRER_STATUSES, Referral, ReferralAgreement, ReferralAgreementCollection, ReferralAgreementExecutionService, ReferralClickOperation, ReferralClickOperationCollection, ReferralClickReplayConflictError, ReferralClickValidationError, ReferralCollection, ReferralCommissionService, ReferralLink, ReferralLinkCollection, ReferralProgram, ReferralProgramCollection, ReferralQualificationService, ReferralTermSnapshot, ReferralTermSnapshotCollection, ReferralTouch, ReferralTouchCollection, Referrer, ReferrerCollection, assertHttpTargetUrl, generateReferralCode, validateAttributionPolicyTerms };
@@ -3,15 +3,15 @@
3
3
  "sensitiveFieldsExcluded": true,
4
4
  "generatedAt": "1970-01-01T00:00:00.000Z",
5
5
  "packageName": "@happyvertical/smrt-sales",
6
- "packageVersion": "0.57.23",
6
+ "packageVersion": "0.57.24",
7
7
  "sourceManifestPath": "dist/manifest.json",
8
8
  "agentDocPath": "AGENTS.md",
9
9
  "sourceHashes": {
10
- "manifest": "6ac9aa2863dc68114f69f3eb515501eccd996b7bedaa7c2651b0420023fb838e",
11
- "packageJson": "d3fa1404c45031983aea881dd9b0953f7ef8335d9701519f9c64c7bdaa932ce4",
10
+ "manifest": "98b45d286c2724a164ec8b304d42c4038736e9c707e232af434e3bcc59fd76cd",
11
+ "packageJson": "4e7d54d3d9dace9383ba2a7e9794b07d8d3d42f3edabc2fd57ca8fcf2be9a0bf",
12
12
  "agents": "561dfe5741f74b8f105617a907b5a17446d4546f6fdef7eb754956bfd09aedd9",
13
13
  "moduleDoc:agents/agreements.md": "86609271b56633c1b6a3d9b1905a200cad1cb15de54adb8ca9f1200f6af8b9ce",
14
- "moduleDoc:agents/commissions.md": "ba06d133f2cbee14ea9a5f18b632f155e3484c4cd721ed5ac993436397198cf8",
14
+ "moduleDoc:agents/commissions.md": "2f41ada34b583f037d9337f9ba3f4c93fd64d1cfcd0830cb7e1c260a6b339374",
15
15
  "moduleDoc:agents/crm.md": "074eff9e3ca7ae6d86e65a1d29ac7b9b555b719b3801918678b15df7538f99e0",
16
16
  "moduleDoc:agents/referrals.md": "ef48c88e63155e3d08b9003f4643bc66ebb1942f1fb713252dc042ddcaad38e5",
17
17
  "moduleDoc:agents/svelte.md": "75e26f56185b5c2ce3895d9969522405131efcee4af4f5aaa66232a26fb27c8b"
@@ -2261,6 +2261,7 @@
2261
2261
  "fields": [],
2262
2262
  "relationships": [],
2263
2263
  "methods": [
2264
+ "create",
2264
2265
  "findByEarner",
2265
2266
  "findByIdempotencyKey",
2266
2267
  "findBySource",
@@ -2268,6 +2269,15 @@
2268
2269
  "sumPaidByEarner"
2269
2270
  ],
2270
2271
  "methodSignatures": [
2272
+ {
2273
+ "name": "create",
2274
+ "async": true,
2275
+ "params": [
2276
+ "options: SmrtCreateInput<CommissionPayout>",
2277
+ "context?: Partial<AuditContext>"
2278
+ ],
2279
+ "returns": "Promise<CommissionPayout>"
2280
+ },
2271
2281
  {
2272
2282
  "name": "findByEarner",
2273
2283
  "async": true,
@@ -3546,6 +3556,13 @@
3546
3556
  "columnType": "TEXT",
3547
3557
  "default": "bank_transfer"
3548
3558
  },
3559
+ {
3560
+ "name": "payoutDestination",
3561
+ "type": "text",
3562
+ "required": false,
3563
+ "columnType": "TEXT",
3564
+ "default": "{}"
3565
+ },
3549
3566
  {
3550
3567
  "name": "status",
3551
3568
  "type": "text",
@@ -3637,6 +3654,7 @@
3637
3654
  "complete",
3638
3655
  "fail",
3639
3656
  "getMetadata",
3657
+ "getPayoutDestination",
3640
3658
  "initialize",
3641
3659
  "isApproved",
3642
3660
  "isCompleted",
@@ -3649,6 +3667,7 @@
3649
3667
  "resetFromFailed",
3650
3668
  "save",
3651
3669
  "setMetadata",
3670
+ "setPayoutDestination",
3652
3671
  "validateTotals"
3653
3672
  ],
3654
3673
  "methodSignatures": [
@@ -3675,6 +3694,10 @@
3675
3694
  "name": "getMetadata",
3676
3695
  "returns": "Record<string, unknown>"
3677
3696
  },
3697
+ {
3698
+ "name": "getPayoutDestination",
3699
+ "returns": "PayoutDestination | null"
3700
+ },
3678
3701
  {
3679
3702
  "name": "initialize",
3680
3703
  "async": true,
@@ -3731,6 +3754,13 @@
3731
3754
  ],
3732
3755
  "returns": "void"
3733
3756
  },
3757
+ {
3758
+ "name": "setPayoutDestination",
3759
+ "params": [
3760
+ "destination: PayoutDestination | null"
3761
+ ],
3762
+ "returns": "void"
3763
+ },
3734
3764
  {
3735
3765
  "name": "validateTotals",
3736
3766
  "returns": "void"
@@ -3815,6 +3845,13 @@
3815
3845
  "reason": "not listed in api.include",
3816
3846
  "objectName": "@happyvertical/smrt-sales:CommissionPayout"
3817
3847
  },
3848
+ {
3849
+ "kind": "api",
3850
+ "operation": "getPayoutDestination",
3851
+ "code": "not-included",
3852
+ "reason": "not listed in api.include",
3853
+ "objectName": "@happyvertical/smrt-sales:CommissionPayout"
3854
+ },
3818
3855
  {
3819
3856
  "kind": "api",
3820
3857
  "operation": "initialize",
@@ -3899,6 +3936,13 @@
3899
3936
  "reason": "not listed in api.include",
3900
3937
  "objectName": "@happyvertical/smrt-sales:CommissionPayout"
3901
3938
  },
3939
+ {
3940
+ "kind": "api",
3941
+ "operation": "setPayoutDestination",
3942
+ "code": "not-included",
3943
+ "reason": "not listed in api.include",
3944
+ "objectName": "@happyvertical/smrt-sales:CommissionPayout"
3945
+ },
3902
3946
  {
3903
3947
  "kind": "api",
3904
3948
  "operation": "validateTotals",
@@ -13874,7 +13918,7 @@
13874
13918
  {
13875
13919
  "path": "agents/commissions.md",
13876
13920
  "module": "commissions",
13877
- "content": "# smrt-sales/commissions — neutral financial core\n\nPer-module semantics for `@happyvertical/smrt-sales/commissions`. Package orientation, the\ncross-module invariants (currency, tenancy, cross-package refs, roles vs.\nmoney), and the Gotchas that apply before editing anything live in\n[../AGENTS.md](../AGENTS.md) — read that first.\n\n- **Earner**: `kind` (`person|organisation|treasury`, default `person`; organisation and treasury earners need no person Profile, so `profileId` stays empty unless the host links an organisation Profile), `profileId`, `status` (`pending|active|suspended`), `payoutMethod` (`bank_transfer|check|paypal|credit|other|stripe_connect|crypto`), `payoutDestination` (typed JSON descriptor via `getPayoutDestination()`/`setPayoutDestination()`: Stripe Connect `connectedAccountId` (`acct_…`) or crypto `network`/`asset`/`address`/`memo?`; unknown fields are refused so secrets cannot ride along; its `method` must equal `payoutMethod`, and an `active` Stripe Connect/crypto earner must have one — enforced at save; `createPayoutBatch` refuses to create a NEW Stripe Connect/crypto batch, including a `payoutMethod` override, unless the earner's destination has that method; an existing idempotency key still replays/repairs its batch after the preference changes), `payoutThresholdCents`, `payoutScheduleKey` (open string: `manual`, `monthly`, …), `currency`, `metadata`. Descriptors only: nothing in this package calls a payment provider. Map an organisation earner to the host's own organisation id through `EarnerSourceAttribution`.\n- **EarnerSourceAttribution** (#1986): indexed external attribution mapping `(sourceKind, sourceId) → earnerId` with `status` (`active|inactive`) — the queryable replacement for stashing associations in `Earner.metadata`. Natural key `(tenant_id, source_kind, source_id)` (one mapping per key per tenant; a re-`create` upserts/re-points; the adapters' null-aware upsert dedups NULL-tenant keys too, but duplicate global rows minted outside the model layer remain representable). The attribution kind space is consumer-defined and need not match earning-event source kinds. `EarnerAttributionService` is the public API: `registerAttribution` (idempotent; reports `created`/`previousEarnerId`; also the documented metadata-migration backfill primitive — loop earners, register each association, verify, drop the metadata key) and `resolveActiveEarnerBySource`/`resolveActiveEarnersBySources` (single/batched; 2 queries bounded by the REQUESTED ids, never a scan of active earners; fail-closed typed reasons `no_mapping|mapping_inactive|ambiguous_mapping|earner_not_found|earner_not_active` — more than one ACTIVE row for a key refuses rather than guessing). In tenant context mappings resolve within that tenant only; without context, lookups span all rows and cross-tenant duplicates surface as `ambiguous_mapping`.\n- **CommissionPlan**: versioned calculation terms. Natural key `(tenant_id, plan_key, version)` (per-tenant keys; the adapters' null-aware upsert dedups NULL-tenant keys through the model layer, though duplicate global rows minted via raw SQL remain representable); `status` (`draft|active|superseded|retired`); `effectiveFrom`. Components are a JSON-string array (`getComponents()`): each component has `key`, `trigger` (earning-event kind or `*`), `basis` (`fixed|gross|net|margin|custom`), `rate` or `fixedAmountCents`, `recurrence` (`one_time` or `recurring` with optional `maxOccurrences`/`windowMonths`). **Immutable once active** — amendments create a new row with `version + 1`; prior versions are never rewritten. `latestActiveByKey(key, at?)` resolves the highest active version **already in effect at `at`** — a future-dated amendment can be activated ahead of time without governing earlier qualifications (same rule on `AttributionPolicyCollection`).\n- **Waterfall pool steps** (#3834): a v2 step with `pool: { metric?, residual?, zeroWeight? }` splits its amount across the members of the pool its `recipient` descriptor resolves to (through the normal recipient registry). Membership comes from an injected `WaterfallPoolMembershipResolver`, weights from an injected `MetricProvider` (omitted `metric` ⇒ equal weights, no provider call). `calculateWaterfall` stays synchronous and never calls providers: `prepareWaterfallPools()` (async) resolves pools at the authoritative event and the result is passed as `pools`; `calculateWaterfallWithPools()` does both. Weights must be non-negative safe integers (hosts scale fractional metrics); members are canonicalized to `(kind, id)` order and duplicates, non-member metric rows, and repeated rows are refused; members the provider omits weigh zero. Allocation is exact BigInt `floor(amount × weight ÷ total)`; the residual goes to the remainder sink (default) or, with `residual: 'largest_remainder'`, one unit at a time by largest fractional remainder, then larger weight, then `kind`, then `id` (UTF-16 code-unit order). An empty pool, or an all-zero pool under the default `zeroWeight: 'remainder_sink'`, sends the whole step to the sink; `zeroWeight: 'equal'` splits equally instead. The trace freezes `frozenInputs.poolsByStep` (pool identity, metric, ISO period, members, weights) so replay never re-reads metrics; frozen and prepared snapshots must match their frozen recipient and the step's declared `metric` (`null` for equal weights), and a prepared snapshot (or `null` unresolved marker) must equal what the step's descriptor resolves to at calculation, so pools prepared for another plan are refused. Replay trusts the evidence it is given — like frozen `recipientByStep`, an internally consistent edit to stored evidence is undetectable without keyed integrity, so hosts store it immutably. Pool-free plans emit no `poolsByStep` key or step `pool` field, so their traces are unchanged. A pool step cannot be the application-fee offset recipient. Each member trace carries `shareFraction` for hosts that persist member allocations as Commissions under one `splitGroupId` (for example `${earningEventId}:${stepKey}`).\n- **EarningEvent**: immutable commercial-event evidence (`conversion`, `agreement_execution`, `invoice_payment`, `collected_revenue`, `recognized_margin`, or any extensible kind). Carries `sourceKind`/`sourceId` (generic earning source), `grossAmountCents`/`netAmountCents`/`marginCents`, `currency`, `occurredAt`, and a `dedupeKey` natural key for idempotent ingestion. No update/delete surface, plus a save-time immutability guard: hydrated edits, blind id overwrites, and fresh creates onto an existing dedupe key all throw (the upsert would rotate the row id and orphan referencing Commissions) — idempotent ingestion goes through `getOrCreateByDedupeKey()`.\n- **Commission**: one earning record per earner per plan component per event occurrence. Integer-cents amounts (`baseAmountCents`, `amountCents`), decimal `rate`, `basis`, snapshot references (`planKey`/`planVersion`, generic `termsSnapshotKind`/`termsSnapshotId`), a JSON `calculationTrace` sufficient to reproduce the amount, split support (`splitGroupId`, `shareFraction`), and a `dedupeKey` for idempotent creation. Lifecycle `pending → earned → approved → payable → paid`, enforced by a save-time transition guard with an authoritative prior-status re-read (commerce pattern).\n- **CommissionAdjustment**: append-only corrections (`refund|credit|chargeback|dispute|correction`), signed `amountCents`, required `reason`, immutable once created. `CommissionAdjustmentService.createAdjustment()` is the tenant-required idempotent creation door: callers provide a stable operation UUID; the database creates exactly one row, exact retries return it, and changed tenant/commission/earner/kind/cents/currency/reason/operator/metadata fail with a typed replay conflict. Parent Commission plus denormalized tenant/Earner/currency and operator UUID are validated before insert. The financial row deliberately exposes no operation field. A private, required-tenant `CommissionAdjustmentOperation` table uses the globally unique operation UUID as its primary id, maps it to the adjustment UUID, and is inserted in the same transaction as the adjustment. Claims tolerate either primary-key or tenant/slug/context uniqueness arbitration without aborting the transaction; only the tenant-scoped operation UUID lookup and immutable intent comparison authorize a replay. Existing adjustment schemas and legacy direct creates remain unchanged. Earned/paid Commissions are never rewritten — adjustments append to them.\n- **Payable balance**: computed, not stored — `CommissionBalanceService` sums payable Commissions plus unsettled Adjustments per Earner/currency.\n- **CommissionPayout**: settlement batch per Earner. `pending → approved → processing → completed | failed` (`resetFromFailed()` is the only exit from failed), plus the terminal operator decline `rejected` reachable from pending/approved (#1987 — reject through `transitionPayoutForSource`, which also RELEASES the batch's membership so the rows settle through a future batch; `reject()` on the model mutates status only). Settles rows via the collections' **conditional `claimForPayout`** (model-layer get/save/re-read — tenancy- and dialect-safe; a row owned by another batch is never re-claimed) and stores totals recomputed from the VERIFIED claimed membership; idempotent via `idempotencyKey` natural key (default `${earnerId}:${currency}:${YYYY-MM-DD}`) — a clean replay touches nothing, while a pending payout whose totals disagree with its stamped rows (interrupted claim pass) is repaired on replay (the claim pass re-checks the payout is still pending first). Each batch/repair pass also derives the payout's **single-source stamp** (`sourceKind`/`sourceId`, indexed): set when every claimed commission — and every claimed adjustment through its parent commission — shares exactly one non-empty source; empty for mixed/unknown/empty membership. `completePayout` flips member commissions to `paid` BEFORE the terminal transition, so a mid-loop failure stays retryable. Enforces `totalAmountCents = commissionTotalCents + adjustmentTotalCents` at save; retains `paymentReference`/`providerRef`; optional `invoiceId` cross-package string ref to a commerce Invoice. Generated surface is read-only on ALL doors (api/mcp/cli `list`/`get`) — writes go through `CommissionPayoutService`. `createPayoutBatch` settles the whole earner+currency by default, or a **scoped** subset: pass `sourceKind`+`sourceId` to settle just one earning source (e.g. one ad network), or `commissionIds` for an explicit set (each validated payable+unsettled+earner+currency; requires its own `idempotencyKey`) — adjustments are narrowed to the same scope, and the default idempotency key folds the source in. Scoping is how concurrent per-source batches settle safely: batches scoped to different sources (or disjoint `commissionIds`) gather **disjoint** row sets and never contend. The collection layer has no cross-row transaction, so OVERLAPPING concurrent scopes (a source batch + the earner-wide batch, intersecting id sets, or a batch replay racing a lifecycle transition of the same payout) must be serialized by the caller — `claimForPayout` still won't double-own a row, but a shared commission and its adjustment could split across the two batches.\n- **Source-scoped payout history** (#1985): `CommissionPayoutService.getSourcePayoutHistory({ sourceKind, sourceId, limit?, offset? })` — one page of the payouts belonging to ONE earning source, newest first (`created_at DESC, id DESC`), offset contract (`nextOffset` advances by the scanned count; `null` when exhausted). Candidates come from the indexed stamp, so work is bounded by page size (a sparse source never scans the global history); each page is re-verified against actual membership in three batched queries (no per-payout N+1) — every member commission and every adjustment's parent must carry exactly the requested source and agree on earner/currency/tenant; unprovable rows (mixed-source, missing parents, memberless artifacts, released/rejected batches) are excluded fail-closed and reported in `excluded` with reasons. Adjustment-only payouts prove ownership through parent commissions and list normally. Payouts minted before the stamp existed are invisible until backfilled with `restampPayoutSource(payoutId)` (idempotent, any status).\n- **Source-authorized lifecycle transitions** (#1987): `CommissionPayoutService.transitionPayoutForSource({ payoutId, sourceKind, sourceId, action, expectedStatus?, paymentReference?, reason? })` — atomic alternative to load-verify-transition. Actions `approve | mark_processing | complete | fail | reject`. Everything runs on one transaction database: the payout row is locked (PostgreSQL `SELECT … FOR UPDATE`, replica-safe; single-connection engines serialize transitions per database in-process), membership is re-verified under the lock (every commission and every adjustment through its parent must carry exactly the requested source and matching earner/currency/tenant — else typed fail-closed refusals with no payout/member data), and only authorized calls receive status-derived `already_applied` or `status_conflict` outcomes. Totals are then recomputed under the lock (drift refuses the money-forward actions with `totals_drift`; repair = `createPayoutBatch` replay while pending; `fail`/`reject` proceed despite drift — reject IS the remedy), and the transition plus member writes commit or roll back together (`complete` flips members to paid in the same transaction; `reject` releases membership then declines). Outcomes: `transitioned`, `already_applied` (idempotent echo — terminal completion NEVER rewrites `paymentReference`/`providerRef`/`paidAt`), or `refused` with `{ reason, detail }`. Concurrent duplicate calls for actions that retain membership resolve as one `transitioned` + `already_applied` echoes; `reject` releases its membership evidence, so serialized replays fail `membership_empty` rather than expose rejected state. `expectedStatus` adds optimistic-concurrency strictness after authorization. Memberless batch artifacts cannot pass the source-authorized door (`membership_empty`) — they stay operator-level.\n"
13921
+ "content": "# smrt-sales/commissions — neutral financial core\n\nPer-module semantics for `@happyvertical/smrt-sales/commissions`. Package orientation, the\ncross-module invariants (currency, tenancy, cross-package refs, roles vs.\nmoney), and the Gotchas that apply before editing anything live in\n[../AGENTS.md](../AGENTS.md) — read that first.\n\n- **Earner**: `kind` (`person|organisation|treasury`, default `person`; organisation and treasury earners need no person Profile, so `profileId` stays empty unless the host links an organisation Profile), `profileId`, `status` (`pending|active|suspended`), `payoutMethod` (`bank_transfer|check|paypal|credit|other|stripe_connect|crypto`), `payoutDestination` (typed JSON descriptor via `getPayoutDestination()`/`setPayoutDestination()`: Stripe Connect `connectedAccountId` (`acct_…`) or crypto `network`/`asset`/`address`/`memo?`; unknown fields are refused so secrets cannot ride along; its `method` must equal `payoutMethod`, and an `active` Stripe Connect/crypto earner must have one — enforced at save; `createPayoutBatch` refuses to create a NEW Stripe Connect/crypto batch, including a `payoutMethod` override, unless the earner's destination has that method; an existing idempotency key still replays/repairs its batch after the preference changes), `payoutThresholdCents`, `payoutScheduleKey` (open string: `manual`, `monthly`, …), `currency`, `metadata`. Descriptors only: nothing in this package calls a payment provider. Map an organisation earner to the host's own organisation id through `EarnerSourceAttribution`.\n- **EarnerSourceAttribution** (#1986): indexed external attribution mapping `(sourceKind, sourceId) → earnerId` with `status` (`active|inactive`) — the queryable replacement for stashing associations in `Earner.metadata`. Natural key `(tenant_id, source_kind, source_id)` (one mapping per key per tenant; a re-`create` upserts/re-points; the adapters' null-aware upsert dedups NULL-tenant keys too, but duplicate global rows minted outside the model layer remain representable). The attribution kind space is consumer-defined and need not match earning-event source kinds. `EarnerAttributionService` is the public API: `registerAttribution` (idempotent; reports `created`/`previousEarnerId`; also the documented metadata-migration backfill primitive — loop earners, register each association, verify, drop the metadata key) and `resolveActiveEarnerBySource`/`resolveActiveEarnersBySources` (single/batched; 2 queries bounded by the REQUESTED ids, never a scan of active earners; fail-closed typed reasons `no_mapping|mapping_inactive|ambiguous_mapping|earner_not_found|earner_not_active` — more than one ACTIVE row for a key refuses rather than guessing). In tenant context mappings resolve within that tenant only; without context, lookups span all rows and cross-tenant duplicates surface as `ambiguous_mapping`.\n- **CommissionPlan**: versioned calculation terms. Natural key `(tenant_id, plan_key, version)` (per-tenant keys; the adapters' null-aware upsert dedups NULL-tenant keys through the model layer, though duplicate global rows minted via raw SQL remain representable); `status` (`draft|active|superseded|retired`); `effectiveFrom`. Components are a JSON-string array (`getComponents()`): each component has `key`, `trigger` (earning-event kind or `*`), `basis` (`fixed|gross|net|margin|custom`), `rate` or `fixedAmountCents`, `recurrence` (`one_time` or `recurring` with optional `maxOccurrences`/`windowMonths`). **Immutable once active** — amendments create a new row with `version + 1`; prior versions are never rewritten. `latestActiveByKey(key, at?)` resolves the highest active version **already in effect at `at`** — a future-dated amendment can be activated ahead of time without governing earlier qualifications (same rule on `AttributionPolicyCollection`).\n- **Waterfall pool steps** (#3834): a v2 step with `pool: { metric?, residual?, zeroWeight? }` splits its amount across the members of the pool its `recipient` descriptor resolves to (through the normal recipient registry). Membership comes from an injected `WaterfallPoolMembershipResolver`, weights from an injected `MetricProvider` (omitted `metric` ⇒ equal weights, no provider call). `calculateWaterfall` stays synchronous and never calls providers: `prepareWaterfallPools()` (async) resolves pools at the authoritative event and the result is passed as `pools`; `calculateWaterfallWithPools()` does both. Weights must be non-negative safe integers (hosts scale fractional metrics); members are canonicalized to `(kind, id)` order and duplicates, non-member metric rows, and repeated rows are refused; members the provider omits weigh zero. Allocation is exact BigInt `floor(amount × weight ÷ total)`; the residual goes to the remainder sink (default) or, with `residual: 'largest_remainder'`, one unit at a time by largest fractional remainder, then larger weight, then `kind`, then `id` (UTF-16 code-unit order). An empty pool, or an all-zero pool under the default `zeroWeight: 'remainder_sink'`, sends the whole step to the sink; `zeroWeight: 'equal'` splits equally instead. The trace freezes `frozenInputs.poolsByStep` (pool identity, metric, ISO period, members, weights) so replay never re-reads metrics; frozen and prepared snapshots must match their frozen recipient and the step's declared `metric` (`null` for equal weights), and a prepared snapshot (or `null` unresolved marker) must equal what the step's descriptor resolves to at calculation, so pools prepared for another plan are refused. Replay trusts the evidence it is given — like frozen `recipientByStep`, an internally consistent edit to stored evidence is undetectable without keyed integrity, so hosts store it immutably. Pool-free plans emit no `poolsByStep` key or step `pool` field, so their traces are unchanged. A pool step cannot be the application-fee offset recipient. Each member trace carries `shareFraction` for hosts that persist member allocations as Commissions under one `splitGroupId` (for example `${earningEventId}:${stepKey}`).\n- **EarningEvent**: immutable commercial-event evidence (`conversion`, `agreement_execution`, `invoice_payment`, `collected_revenue`, `recognized_margin`, or any extensible kind). Carries `sourceKind`/`sourceId` (generic earning source), `grossAmountCents`/`netAmountCents`/`marginCents`, `currency`, `occurredAt`, and a `dedupeKey` natural key for idempotent ingestion. No update/delete surface, plus a save-time immutability guard: hydrated edits, blind id overwrites, and fresh creates onto an existing dedupe key all throw (the upsert would rotate the row id and orphan referencing Commissions) — idempotent ingestion goes through `getOrCreateByDedupeKey()`.\n- **Commission**: one earning record per earner per plan component per event occurrence. Integer-cents amounts (`baseAmountCents`, `amountCents`), decimal `rate`, `basis`, snapshot references (`planKey`/`planVersion`, generic `termsSnapshotKind`/`termsSnapshotId`), a JSON `calculationTrace` sufficient to reproduce the amount, split support (`splitGroupId`, `shareFraction`), and a `dedupeKey` for idempotent creation. Lifecycle `pending → earned → approved → payable → paid`, enforced by a save-time transition guard with an authoritative prior-status re-read (commerce pattern).\n- **CommissionAdjustment**: append-only corrections (`refund|credit|chargeback|dispute|correction`), signed `amountCents`, required `reason`, immutable once created. `CommissionAdjustmentService.createAdjustment()` is the tenant-required idempotent creation door: callers provide a stable operation UUID; the database creates exactly one row, exact retries return it, and changed tenant/commission/earner/kind/cents/currency/reason/operator/metadata fail with a typed replay conflict. Parent Commission plus denormalized tenant/Earner/currency and operator UUID are validated before insert. The financial row deliberately exposes no operation field. A private, required-tenant `CommissionAdjustmentOperation` table uses the globally unique operation UUID as its primary id, maps it to the adjustment UUID, and is inserted in the same transaction as the adjustment. Claims tolerate either primary-key or tenant/slug/context uniqueness arbitration without aborting the transaction; only the tenant-scoped operation UUID lookup and immutable intent comparison authorize a replay. Existing adjustment schemas and legacy direct creates remain unchanged. Earned/paid Commissions are never rewritten — adjustments append to them.\n- **Payable balance**: computed, not stored — `CommissionBalanceService` sums payable Commissions plus unsettled Adjustments per Earner/currency.\n- **CommissionPayout**: settlement batch per Earner. `pending → approved → processing → completed | failed` (`resetFromFailed()` is the only exit from failed), plus the terminal operator decline `rejected` reachable from pending/approved (#1987 — reject through `transitionPayoutForSource`, which also RELEASES the batch's membership so the rows settle through a future batch; `reject()` on the model mutates status only). Settles rows via the collections' **conditional `claimForPayout`** (model-layer get/save/re-read — tenancy- and dialect-safe; a row owned by another batch is never re-claimed) and stores totals recomputed from the VERIFIED claimed membership; idempotent via `idempotencyKey` natural key (default `${earnerId}:${currency}:${YYYY-MM-DD}`) — initial creation uses a strict insert so concurrent same-key creators cannot overwrite the first routing snapshot; the loser receives a unique-constraint error and can retry the same key. A clean replay touches nothing, while a pending payout whose totals disagree with its stamped rows (interrupted claim pass) is repaired on replay (the claim pass re-checks the payout is still pending first). Each batch/repair pass also derives the payout's **single-source stamp** (`sourceKind`/`sourceId`, indexed): set when every claimed commission — and every claimed adjustment through its parent commission — shares exactly one non-empty source; empty for mixed/unknown/empty membership. `completePayout` flips member commissions to `paid` BEFORE the terminal transition, so a mid-loop failure stays retryable. Enforces `totalAmountCents = commissionTotalCents + adjustmentTotalCents` at save; retains `paymentReference`/`providerRef`; optional `invoiceId` cross-package string ref to a commerce Invoice. Generated surface is read-only on ALL doors (api/mcp/cli `list`/`get`) — writes go through `CommissionPayoutService`. `createPayoutBatch` settles the whole earner+currency by default, or a **scoped** subset: pass `sourceKind`+`sourceId` to settle just one earning source (e.g. one ad network), or `commissionIds` for an explicit set (each validated payable+unsettled+earner+currency; requires its own `idempotencyKey`) — adjustments are narrowed to the same scope, and the default idempotency key folds the source in. Scoping is how concurrent per-source batches settle safely: batches scoped to different sources (or disjoint `commissionIds`) gather **disjoint** row sets and never contend. The collection layer has no cross-row transaction, so OVERLAPPING concurrent scopes (a source batch + the earner-wide batch, intersecting id sets, or a batch replay racing a lifecycle transition of the same payout) must be serialized by the caller — `claimForPayout` still won't double-own a row, but a shared commission and its adjustment could split across the two batches.\n- **Payout destination snapshot** (#4148): `CommissionPayout.payoutDestination` stores the typed Earner descriptor captured at batch creation. Use `getPayoutDestination()` on the batch for execution/review, never live Earner routing. Method and destination are immutable from first persistence (pending included); idempotency replay/repair and failed-reset preserve them. Reject through the source transition service and create a new key to change routing. Existing Connect/crypto batches with an empty migrated snapshot cannot approve/process/complete; reject/recreate rather than infer historical routing. Manual methods retain `{}`. Generated list/get surfaces expose the snapshot; no provider transfer is implemented.\n- **Source-scoped payout history** (#1985): `CommissionPayoutService.getSourcePayoutHistory({ sourceKind, sourceId, limit?, offset? })` — one page of the payouts belonging to ONE earning source, newest first (`created_at DESC, id DESC`), offset contract (`nextOffset` advances by the scanned count; `null` when exhausted). Candidates come from the indexed stamp, so work is bounded by page size (a sparse source never scans the global history); each page is re-verified against actual membership in three batched queries (no per-payout N+1) — every member commission and every adjustment's parent must carry exactly the requested source and agree on earner/currency/tenant; unprovable rows (mixed-source, missing parents, memberless artifacts, released/rejected batches) are excluded fail-closed and reported in `excluded` with reasons. Adjustment-only payouts prove ownership through parent commissions and list normally. Payouts minted before the stamp existed are invisible until backfilled with `restampPayoutSource(payoutId)` (idempotent, any status).\n- **Source-authorized lifecycle transitions** (#1987): `CommissionPayoutService.transitionPayoutForSource({ payoutId, sourceKind, sourceId, action, expectedStatus?, paymentReference?, reason? })` — atomic alternative to load-verify-transition. Actions `approve | mark_processing | complete | fail | reject`. Everything runs on one transaction database: the payout row is locked (PostgreSQL `SELECT … FOR UPDATE`, replica-safe; single-connection engines serialize transitions per database in-process), membership is re-verified under the lock (every commission and every adjustment through its parent must carry exactly the requested source and matching earner/currency/tenant — else typed fail-closed refusals with no payout/member data), and only authorized calls receive status-derived `already_applied` or `status_conflict` outcomes. Totals are then recomputed under the lock (drift refuses the money-forward actions with `totals_drift`; repair = `createPayoutBatch` replay while pending; `fail`/`reject` proceed despite drift — reject IS the remedy), and the transition plus member writes commit or roll back together (`complete` flips members to paid in the same transaction; `reject` releases membership then declines). Outcomes: `transitioned`, `already_applied` (idempotent echo — terminal completion NEVER rewrites `paymentReference`/`providerRef`/`paidAt`), or `refused` with `{ reason, detail }`. Concurrent duplicate calls for actions that retain membership resolve as one `transitioned` + `already_applied` echoes; `reject` releases its membership evidence, so serialized replays fail `membership_empty` rather than expose rejected state. `expectedStatus` adds optimistic-concurrency strictness after authorization. Memberless batch artifacts cannot pass the source-authorized door (`membership_empty`) — they stay operator-level.\n"
13878
13922
  },
13879
13923
  {
13880
13924
  "path": "agents/crm.md",
@@ -14,7 +14,7 @@
14
14
  *
15
15
  * @module
16
16
  */
17
- import type { CommissionAdjustmentKind, CommissionBasis, CommissionPayoutStatus, CommissionStatus, EarnerBalance, PayoutMethod } from '../commissions/index.js';
17
+ import type { CommissionAdjustmentKind, CommissionBasis, CommissionPayoutStatus, CommissionStatus, EarnerBalance, PayoutDestination, PayoutMethod } from '../commissions/index.js';
18
18
  import type { LeadHumanActivityKind, LeadStatus, OpportunityStatus } from '../crm/index.js';
19
19
  import type { AttributionAward, AttributionExceptionStatus, ReferralAgreementApprovalMode, ReferralAgreementStatus, ReferralLinkStatus, ReferralStatus, ReferralTouchKind } from '../referrals/index.js';
20
20
  export type { AttributionAward, EarnerBalance };
@@ -301,6 +301,8 @@ export interface PayoutView {
301
301
  totalAmountCents: number;
302
302
  currency: string;
303
303
  payoutMethod: PayoutMethod;
304
+ /** Batch-owned descriptor; hosts must never substitute the live Earner's routing. */
305
+ payoutDestination?: PayoutDestination | null;
304
306
  status: CommissionPayoutStatus;
305
307
  paymentReference?: string;
306
308
  providerRef?: string;