@happyvertical/smrt-sales 0.57.37 → 0.57.39
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.
- package/dist/agreements/models/Agreement.d.ts +2 -2
- package/dist/agreements/models/Agreement.d.ts.map +1 -1
- package/dist/agreements/models/AgreementExecution.d.ts +2 -2
- package/dist/agreements/models/AgreementExecution.d.ts.map +1 -1
- package/dist/agreements/models/AgreementExecutionEvent.d.ts +2 -2
- package/dist/agreements/models/AgreementExecutionEvent.d.ts.map +1 -1
- package/dist/agreements/models/ExecutedAgreement.d.ts +2 -2
- package/dist/agreements/models/ExecutedAgreement.d.ts.map +1 -1
- package/dist/agreements.js +2 -2
- package/dist/chunks/__smrt-register__-B1Rg_X-v.js +6 -0
- package/dist/chunks/__smrt-register__-B1Rg_X-v.js.map +1 -0
- package/dist/chunks/{agreements-RsyRLeDn.js → agreements-C8rxIVGB.js} +9 -9
- package/dist/chunks/agreements-C8rxIVGB.js.map +1 -0
- package/dist/chunks/{commissions-DSVGf1ZX.js → commissions-B1WnBKsn.js} +15 -15
- package/dist/chunks/commissions-B1WnBKsn.js.map +1 -0
- package/dist/chunks/{crm-BENK-hHd.js → crm-Bzk65hv_.js} +13 -13
- package/dist/chunks/crm-Bzk65hv_.js.map +1 -0
- package/dist/chunks/{referrals-o8qZG5fw.js → referrals-DE0tKm5G.js} +12 -12
- package/dist/chunks/referrals-DE0tKm5G.js.map +1 -0
- package/dist/commissions/models/Commission.d.ts +2 -2
- package/dist/commissions/models/Commission.d.ts.map +1 -1
- package/dist/commissions/models/CommissionAdjustment.d.ts +2 -2
- package/dist/commissions/models/CommissionAdjustment.d.ts.map +1 -1
- package/dist/commissions/models/CommissionPayout.d.ts +2 -2
- package/dist/commissions/models/CommissionPayout.d.ts.map +1 -1
- package/dist/commissions/models/CommissionPlan.d.ts +2 -2
- package/dist/commissions/models/CommissionPlan.d.ts.map +1 -1
- package/dist/commissions/models/Earner.d.ts +2 -2
- package/dist/commissions/models/Earner.d.ts.map +1 -1
- package/dist/commissions/models/EarnerSourceAttribution.d.ts +2 -2
- package/dist/commissions/models/EarnerSourceAttribution.d.ts.map +1 -1
- package/dist/commissions/models/EarningEvent.d.ts +2 -2
- package/dist/commissions/models/EarningEvent.d.ts.map +1 -1
- package/dist/commissions.js +2 -2
- package/dist/crm/models/Lead.d.ts +2 -2
- package/dist/crm/models/Lead.d.ts.map +1 -1
- package/dist/crm/models/Opportunity.d.ts +2 -2
- package/dist/crm/models/Opportunity.d.ts.map +1 -1
- package/dist/crm/models/OpportunityConversion.d.ts +2 -2
- package/dist/crm/models/OpportunityConversion.d.ts.map +1 -1
- package/dist/crm/models/SalesActivity.d.ts +2 -2
- package/dist/crm/models/SalesActivity.d.ts.map +1 -1
- package/dist/crm/models/SalesGovernanceEvent.d.ts +2 -2
- package/dist/crm/models/SalesGovernanceEvent.d.ts.map +1 -1
- package/dist/crm/models/SalesGovernanceState.d.ts +2 -2
- package/dist/crm/models/SalesGovernanceState.d.ts.map +1 -1
- package/dist/crm.js +2 -2
- package/dist/index.js +5 -5
- package/dist/manifest.json +155 -23
- package/dist/referrals/models/AttributionPolicy.d.ts +2 -2
- package/dist/referrals/models/AttributionPolicy.d.ts.map +1 -1
- package/dist/referrals/models/Referral.d.ts +2 -2
- package/dist/referrals/models/Referral.d.ts.map +1 -1
- package/dist/referrals/models/ReferralAgreement.d.ts +2 -2
- package/dist/referrals/models/ReferralAgreement.d.ts.map +1 -1
- package/dist/referrals/models/ReferralLink.d.ts +2 -2
- package/dist/referrals/models/ReferralLink.d.ts.map +1 -1
- package/dist/referrals/models/ReferralTermSnapshot.d.ts +2 -2
- package/dist/referrals/models/ReferralTermSnapshot.d.ts.map +1 -1
- package/dist/referrals.js +2 -2
- package/dist/smrt-knowledge.json +69 -3
- package/package.json +8 -8
- package/dist/chunks/__smrt-register__-o8Dm_Ogl.js +0 -6
- package/dist/chunks/__smrt-register__-o8Dm_Ogl.js.map +0 -1
- package/dist/chunks/agreements-RsyRLeDn.js.map +0 -1
- package/dist/chunks/commissions-DSVGf1ZX.js.map +0 -1
- package/dist/chunks/crm-BENK-hHd.js.map +0 -1
- package/dist/chunks/referrals-o8qZG5fw.js.map +0 -1
|
@@ -83,9 +83,9 @@ var CommissionAdjustment = class extends SmrtObject {
|
|
|
83
83
|
* field except `payoutId` must match the captured snapshot. Corrections
|
|
84
84
|
* to a wrong adjustment are new counter-adjustments, never edits.
|
|
85
85
|
*/
|
|
86
|
-
async save() {
|
|
86
|
+
async save(options) {
|
|
87
87
|
this.assertImmutableOncePersisted();
|
|
88
|
-
const result = await super.save();
|
|
88
|
+
const result = await super.save(options);
|
|
89
89
|
if (!frozenAdjustmentSnapshot.has(this)) frozenAdjustmentSnapshot.set(this, this.serializeFrozenSnapshot());
|
|
90
90
|
return result;
|
|
91
91
|
}
|
|
@@ -508,11 +508,11 @@ var Commission = class extends SmrtObject {
|
|
|
508
508
|
* row. Brand-new rows may start in any status (fixtures/imports); a
|
|
509
509
|
* persisted row may only advance one legal step.
|
|
510
510
|
*/
|
|
511
|
-
async save() {
|
|
511
|
+
async save(options) {
|
|
512
512
|
const prior = await this.resolvePriorStatus();
|
|
513
513
|
this.assertStatusTransition(prior);
|
|
514
514
|
await this.assertDedupeKeyNotTaken();
|
|
515
|
-
const result = await super.save();
|
|
515
|
+
const result = await super.save(options);
|
|
516
516
|
loadedCommissionStatus.set(this, this.status);
|
|
517
517
|
return result;
|
|
518
518
|
}
|
|
@@ -924,9 +924,9 @@ var Earner = class extends SmrtObject {
|
|
|
924
924
|
* a stored destination must be valid and match `payoutMethod`, and an
|
|
925
925
|
* active Stripe Connect / crypto earner must have a destination.
|
|
926
926
|
*/
|
|
927
|
-
async save() {
|
|
927
|
+
async save(options) {
|
|
928
928
|
this.assertPayoutTerms();
|
|
929
|
-
return await super.save();
|
|
929
|
+
return await super.save(options);
|
|
930
930
|
}
|
|
931
931
|
assertPayoutTerms() {
|
|
932
932
|
const label = `Earner ${this.id ?? "<new>"}`;
|
|
@@ -1207,7 +1207,7 @@ ${memo}` : memo;
|
|
|
1207
1207
|
* matching {@link complete}'s invariant, regardless of how the status
|
|
1208
1208
|
* was set.
|
|
1209
1209
|
*/
|
|
1210
|
-
async save() {
|
|
1210
|
+
async save(options) {
|
|
1211
1211
|
this.validateTotals();
|
|
1212
1212
|
await this.assertRoutingUnchanged();
|
|
1213
1213
|
const prior = await this.resolvePriorStatus();
|
|
@@ -1218,7 +1218,7 @@ ${memo}` : memo;
|
|
|
1218
1218
|
].includes(this.status));
|
|
1219
1219
|
this.assertStatusTransition(prior);
|
|
1220
1220
|
if (this.status === "completed" && !this.paymentReference) throw new Error(`CommissionPayout ${this.id ?? "<new>"}: a completed payout requires a paymentReference (use complete()).`);
|
|
1221
|
-
const result = await super.save();
|
|
1221
|
+
const result = await super.save(options);
|
|
1222
1222
|
loadedPayoutStatus.set(this, this.status);
|
|
1223
1223
|
return result;
|
|
1224
1224
|
}
|
|
@@ -2093,7 +2093,7 @@ var CommissionPlan = class extends SmrtObject {
|
|
|
2093
2093
|
* Activating saves also re-validate components, so an `active` row always
|
|
2094
2094
|
* carries well-formed terms regardless of which write path set them.
|
|
2095
2095
|
*/
|
|
2096
|
-
async save() {
|
|
2096
|
+
async save(options) {
|
|
2097
2097
|
const prior = await this.resolvePriorStatus();
|
|
2098
2098
|
this.assertStatusTransition(prior);
|
|
2099
2099
|
this.assertFrozenIdentityUnchanged();
|
|
@@ -2103,7 +2103,7 @@ var CommissionPlan = class extends SmrtObject {
|
|
|
2103
2103
|
this.validateEffectiveWindow();
|
|
2104
2104
|
this.validateWaterfallTerms();
|
|
2105
2105
|
}
|
|
2106
|
-
const result = await super.save();
|
|
2106
|
+
const result = await super.save(options);
|
|
2107
2107
|
loadedPlanStatus.set(this, this.status);
|
|
2108
2108
|
if (this.status !== "draft" && !frozenPlanSnapshot.has(this)) frozenPlanSnapshot.set(this, this.serializeFrozenSnapshot());
|
|
2109
2109
|
return result;
|
|
@@ -2427,10 +2427,10 @@ var EarnerSourceAttribution = class extends SmrtObject {
|
|
|
2427
2427
|
* tenant interception) because the guard must see the earner's true
|
|
2428
2428
|
* tenant even when saving from another tenant's context.
|
|
2429
2429
|
*/
|
|
2430
|
-
async save() {
|
|
2430
|
+
async save(options) {
|
|
2431
2431
|
if (!this.earnerId || !this.sourceKind || !this.sourceId) throw new Error(`EarnerSourceAttribution ${this.id ?? "<new>"}: earnerId, sourceKind, and sourceId are all required.`);
|
|
2432
2432
|
await this.assertEarnerTenantCoherence();
|
|
2433
|
-
return await super.save();
|
|
2433
|
+
return await super.save(options);
|
|
2434
2434
|
}
|
|
2435
2435
|
async assertEarnerTenantCoherence() {
|
|
2436
2436
|
let earnerRow = null;
|
|
@@ -2605,7 +2605,7 @@ var EarningEvent = class extends SmrtObject {
|
|
|
2605
2605
|
* through `EarningEventCollection.getOrCreateByDedupeKey()`, which
|
|
2606
2606
|
* finds first and never upserts.
|
|
2607
2607
|
*/
|
|
2608
|
-
async save() {
|
|
2608
|
+
async save(options) {
|
|
2609
2609
|
const captured = persistedEventState.get(this);
|
|
2610
2610
|
if (captured !== void 0) {
|
|
2611
2611
|
if (captured !== this.serializeState()) throw new Error(`EarningEvent ${this.id ?? "<new>"}: earning events are immutable evidence \u2014 record a correcting event (or a CommissionAdjustment downstream) instead of editing this row.`);
|
|
@@ -2616,7 +2616,7 @@ var EarningEvent = class extends SmrtObject {
|
|
|
2616
2616
|
} catch (error) {
|
|
2617
2617
|
if (error instanceof Error && error.message.includes("immutable evidence")) throw error;
|
|
2618
2618
|
}
|
|
2619
|
-
const result = await super.save();
|
|
2619
|
+
const result = await super.save(options);
|
|
2620
2620
|
persistedEventState.set(this, this.serializeState());
|
|
2621
2621
|
return result;
|
|
2622
2622
|
}
|
|
@@ -4399,4 +4399,4 @@ var EarnerAttributionService = class EarnerAttributionService {
|
|
|
4399
4399
|
//#endregion
|
|
4400
4400
|
export { ADJUSTMENT_SETTLEABLE_COMMISSION_STATUSES as A, PAYOUT_METHODS as B, calculateWaterfallWithPools as C, CommissionPayout as D, CommissionPayoutCollection as E, COMMISSION_STATUSES as F, Commission as G, WATERFALL_POOL_RESIDUAL_RULES as H, EARNER_KINDS as I, CommissionAdjustmentCollection as J, CommissionAdjustmentOperationCollection as K, EARNER_SOURCE_ATTRIBUTION_STATUSES as L, COMMISSION_BASES as M, COMMISSION_PAYOUT_STATUSES as N, Earner as O, COMMISSION_PLAN_STATUSES as P, EARNER_STATUSES as R, calculateWaterfall as S, validateWaterfallPlan as T, WATERFALL_POOL_ZERO_WEIGHT_RULES as U, PAYOUT_METHODS_REQUIRING_DESTINATION as V, CommissionCollection as W, CommissionAdjustment as Y, EarnerCollection as _, CommissionBalanceService as a, validateCommissionPlanComponents as b, CommissionAdjustmentValidationError as c, centsToAmount as d, roundCents as f, EarnerSourceAttribution as g, EarnerSourceAttributionCollection as h, CommissionCalculationService as i, COMMISSION_ADJUSTMENT_KINDS as j, validatePayoutDestination as k, amountToCents as l, EarningEvent as m, CommissionSettlementService as n, CommissionAdjustmentReplayConflictError as o, EarningEventCollection as p, CommissionAdjustmentOperation as q, CommissionPayoutService as r, CommissionAdjustmentService as s, EarnerAttributionService as t, calculateCommissionAmountCents as u, CommissionPlanCollection as v, prepareWaterfallPools as w, WaterfallRecipientResolverRegistry as x, CommissionPlan as y, EARNING_EVENT_KINDS as z };
|
|
4401
4401
|
|
|
4402
|
-
//# sourceMappingURL=commissions-
|
|
4402
|
+
//# sourceMappingURL=commissions-B1WnBKsn.js.map
|