@happyvertical/smrt-sales 0.60.11 → 0.60.13
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/AGENTS.md +1 -0
- package/README.md +10 -0
- package/agents/referrals.md +28 -1
- package/dist/agreements.js +1 -1
- package/dist/chunks/{__smrt-register__-a4KFA58F.js → __smrt-register__-BLLZk-ni.js} +2 -2
- package/dist/chunks/{__smrt-register__-a4KFA58F.js.map → __smrt-register__-BLLZk-ni.js.map} +1 -1
- package/dist/chunks/{referrals-DQaEehr8.js → referrals-STQ8kdIv.js} +674 -174
- package/dist/chunks/referrals-STQ8kdIv.js.map +1 -0
- package/dist/commissions.js +1 -1
- package/dist/crm.js +1 -1
- package/dist/index.js +3 -3
- package/dist/manifest.json +530 -2
- package/dist/referrals/collections/AttributionExceptionCollection.d.ts +1 -1
- package/dist/referrals/collections/AttributionExceptionCollection.d.ts.map +1 -1
- package/dist/referrals/collections/ReferrerIdentifierCollection.d.ts +20 -0
- package/dist/referrals/collections/ReferrerIdentifierCollection.d.ts.map +1 -0
- package/dist/referrals/index.d.ts +3 -0
- package/dist/referrals/index.d.ts.map +1 -1
- package/dist/referrals/models/AttributionException.d.ts +4 -3
- package/dist/referrals/models/AttributionException.d.ts.map +1 -1
- package/dist/referrals/models/ReferralTouch.d.ts +4 -3
- package/dist/referrals/models/ReferralTouch.d.ts.map +1 -1
- package/dist/referrals/models/ReferrerIdentifier.d.ts +24 -0
- package/dist/referrals/models/ReferrerIdentifier.d.ts.map +1 -0
- package/dist/referrals/nomination-identity.d.ts +3 -0
- package/dist/referrals/nomination-identity.d.ts.map +1 -0
- package/dist/referrals/services/AttributionService.d.ts +5 -3
- package/dist/referrals/services/AttributionService.d.ts.map +1 -1
- package/dist/referrals/services/ReferralAgreementExecutionService.d.ts +1 -1
- package/dist/referrals/services/ReferralAgreementExecutionService.d.ts.map +1 -1
- package/dist/referrals/services/ReferralNominationResolver.d.ts +55 -0
- package/dist/referrals/services/ReferralNominationResolver.d.ts.map +1 -0
- package/dist/referrals/types.d.ts +21 -2
- package/dist/referrals/types.d.ts.map +1 -1
- package/dist/referrals.js +3 -3
- package/dist/smrt-knowledge.json +285 -11
- package/dist/smrt-knowledge.okf.md +6 -2
- package/package.json +8 -8
- package/dist/chunks/referrals-DQaEehr8.js.map +0 -1
package/dist/commissions.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "./chunks/__smrt-register__-
|
|
1
|
+
import "./chunks/__smrt-register__-BLLZk-ni.js";
|
|
2
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-DbhfPQbi.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__-
|
|
1
|
+
import "./chunks/__smrt-register__-BLLZk-ni.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-C4iAa-zA.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__-
|
|
1
|
+
import "./chunks/__smrt-register__-BLLZk-ni.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-C8rxIVGB.js";
|
|
3
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-DbhfPQbi.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-C4iAa-zA.js";
|
|
5
|
-
import { A as
|
|
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, AffiliatesReferralsRecipe, 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 };
|
|
5
|
+
import { $ as AttributionExceptionCollection, A as ReferralLink, B as validateAttributionPolicyTerms, C as REFERRAL_CODE_LENGTH, D as generateReferralCode, E as ReferralLinkCollection, F as ReferralClickOperation, G as ATTRIBUTION_RESOLUTION_MODES, H as ATTRIBUTION_CREDIT_MODES, I as ReferralAgreementCollection, J as REFERRAL_LINK_STATUSES, K as REFERRAL_AGREEMENT_APPROVAL_MODES, L as ReferralAgreement, M as ReferralCollection, N as Referral, O as ReferralTouchCollection, P as ReferralClickOperationCollection, Q as REFERRER_STATUSES, R as AttributionPolicyCollection, S as REFERRAL_CODE_ALPHABET, T as ReferralClickValidationError, U as ATTRIBUTION_EXCEPTION_STATUSES, V as ATTRIBUTION_CONFLICT_BEHAVIORS, W as ATTRIBUTION_POLICY_STATUSES, X as REFERRAL_STATUSES, Y as REFERRAL_PROGRAM_STATUSES, Z as REFERRAL_TOUCH_KINDS, _ as ReferralProgramCollection, a as REFERRAL_AGREEMENT_SOURCE_KIND, b as MAX_CODE_GENERATION_ATTEMPTS, c as QualifiedReferralOverrideError, d as ReferrerIdentifierConflictError, et as AttributionException, f as ReferrerIdentifier, g as ReferralTermSnapshot, h as ReferralTermSnapshotCollection, i as ReferralCommissionService, j as assertHttpTargetUrl, k as ReferralTouch, l as AffiliatesReferralsRecipe, m as Referrer, n as ReferralNominationResolver, o as ReferralAgreementExecutionService, p as ReferrerCollection, q as REFERRAL_AGREEMENT_STATUSES, r as REFERRAL_TERMS_SNAPSHOT_KIND, s as AttributionService, t as ReferralQualificationService, u as ReferrerIdentifierCollection, v as ReferralProgram, w as ReferralClickReplayConflictError, x as MAX_REFERRAL_CLICK_IDEMPOTENCY_KEY_BYTES, y as DEFAULT_REFERRAL_CLICK_EVIDENCE_MAX_BYTES, z as AttributionPolicy } from "./chunks/referrals-STQ8kdIv.js";
|
|
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, AffiliatesReferralsRecipe, 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, ReferralNominationResolver, ReferralProgram, ReferralProgramCollection, ReferralQualificationService, ReferralTermSnapshot, ReferralTermSnapshotCollection, ReferralTouch, ReferralTouchCollection, Referrer, ReferrerCollection, ReferrerIdentifier, ReferrerIdentifierCollection, ReferrerIdentifierConflictError, 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 };
|
package/dist/manifest.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"version": "1.0.0",
|
|
3
3
|
"timestamp": 0,
|
|
4
4
|
"packageName": "@happyvertical/smrt-sales",
|
|
5
|
-
"packageVersion": "0.60.
|
|
5
|
+
"packageVersion": "0.60.13",
|
|
6
6
|
"objects": {
|
|
7
7
|
"@happyvertical/smrt-sales:AgreementCollection": {
|
|
8
8
|
"name": "agreementcollection",
|
|
@@ -12881,6 +12881,19 @@
|
|
|
12881
12881
|
"name": "programId",
|
|
12882
12882
|
"type": "string",
|
|
12883
12883
|
"optional": false
|
|
12884
|
+
},
|
|
12885
|
+
{
|
|
12886
|
+
"name": "tenantId",
|
|
12887
|
+
"type": "string | null",
|
|
12888
|
+
"optional": true,
|
|
12889
|
+
"unionBranches": [
|
|
12890
|
+
{
|
|
12891
|
+
"type": "string"
|
|
12892
|
+
},
|
|
12893
|
+
{
|
|
12894
|
+
"type": "null"
|
|
12895
|
+
}
|
|
12896
|
+
]
|
|
12884
12897
|
}
|
|
12885
12898
|
],
|
|
12886
12899
|
"returnType": "Promise<AttributionException | null>",
|
|
@@ -15124,6 +15137,193 @@
|
|
|
15124
15137
|
},
|
|
15125
15138
|
"importPath": "@happyvertical/smrt-sales/referrals"
|
|
15126
15139
|
},
|
|
15140
|
+
"@happyvertical/smrt-sales:ReferrerIdentifierCollection": {
|
|
15141
|
+
"name": "referreridentifiercollection",
|
|
15142
|
+
"className": "ReferrerIdentifierCollection",
|
|
15143
|
+
"qualifiedName": "@happyvertical/smrt-sales:ReferrerIdentifierCollection",
|
|
15144
|
+
"collection": "referreridentifiers",
|
|
15145
|
+
"filePath": "/home/runner/work/smrt/smrt/packages/sales/src/referrals/collections/ReferrerIdentifierCollection.ts",
|
|
15146
|
+
"packageName": "@happyvertical/smrt-sales",
|
|
15147
|
+
"fields": {},
|
|
15148
|
+
"methods": {
|
|
15149
|
+
"register": {
|
|
15150
|
+
"name": "register",
|
|
15151
|
+
"async": true,
|
|
15152
|
+
"parameters": [
|
|
15153
|
+
{
|
|
15154
|
+
"name": "input",
|
|
15155
|
+
"type": "RegisterReferrerIdentifierInput",
|
|
15156
|
+
"optional": false
|
|
15157
|
+
}
|
|
15158
|
+
],
|
|
15159
|
+
"returnType": "Promise<ReferrerIdentifier>",
|
|
15160
|
+
"isStatic": false,
|
|
15161
|
+
"isPublic": true
|
|
15162
|
+
}
|
|
15163
|
+
},
|
|
15164
|
+
"decoratorConfig": {
|
|
15165
|
+
"api": {
|
|
15166
|
+
"include": [
|
|
15167
|
+
"list",
|
|
15168
|
+
"get"
|
|
15169
|
+
]
|
|
15170
|
+
},
|
|
15171
|
+
"mcp": {
|
|
15172
|
+
"include": [
|
|
15173
|
+
"list",
|
|
15174
|
+
"get"
|
|
15175
|
+
]
|
|
15176
|
+
},
|
|
15177
|
+
"cli": false
|
|
15178
|
+
},
|
|
15179
|
+
"extends": "SmrtCollection",
|
|
15180
|
+
"extendsTypeArg": "ReferrerIdentifier",
|
|
15181
|
+
"exportName": "ReferrerIdentifierCollection",
|
|
15182
|
+
"collectionExportName": "ReferrerIdentifierCollectionCollection",
|
|
15183
|
+
"collectionOf": "@happyvertical/smrt-sales:ReferrerIdentifier",
|
|
15184
|
+
"inheritedExposure": [
|
|
15185
|
+
"api",
|
|
15186
|
+
"mcp",
|
|
15187
|
+
"cli"
|
|
15188
|
+
],
|
|
15189
|
+
"schema": {
|
|
15190
|
+
"tableName": "referrer_identifiers",
|
|
15191
|
+
"ddl": "CREATE TABLE IF NOT EXISTS \"referrer_identifiers\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\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 \"referrer_id\" UUID NOT NULL,\n \"program_id\" UUID,\n \"kind\" TEXT NOT NULL DEFAULT '',\n \"value\" TEXT NOT NULL DEFAULT '',\n \"normalized_value\" TEXT NOT NULL DEFAULT '',\n \"status\" TEXT DEFAULT 'active',\n \"metadata\" TEXT DEFAULT '{}'\n);",
|
|
15192
|
+
"columns": {
|
|
15193
|
+
"_sync_origin_device_id": {
|
|
15194
|
+
"type": "TEXT"
|
|
15195
|
+
},
|
|
15196
|
+
"_sync_revision": {
|
|
15197
|
+
"type": "INTEGER"
|
|
15198
|
+
},
|
|
15199
|
+
"id": {
|
|
15200
|
+
"type": "UUID",
|
|
15201
|
+
"primaryKey": true,
|
|
15202
|
+
"referenceKind": "id",
|
|
15203
|
+
"notNull": true
|
|
15204
|
+
},
|
|
15205
|
+
"slug": {
|
|
15206
|
+
"type": "TEXT",
|
|
15207
|
+
"notNull": true
|
|
15208
|
+
},
|
|
15209
|
+
"context": {
|
|
15210
|
+
"type": "TEXT",
|
|
15211
|
+
"notNull": true,
|
|
15212
|
+
"default": ""
|
|
15213
|
+
},
|
|
15214
|
+
"created_at": {
|
|
15215
|
+
"type": "TIMESTAMP",
|
|
15216
|
+
"notNull": true,
|
|
15217
|
+
"default": "current_timestamp"
|
|
15218
|
+
},
|
|
15219
|
+
"updated_at": {
|
|
15220
|
+
"type": "TIMESTAMP",
|
|
15221
|
+
"notNull": true,
|
|
15222
|
+
"default": "current_timestamp"
|
|
15223
|
+
},
|
|
15224
|
+
"tenant_id": {
|
|
15225
|
+
"type": "UUID",
|
|
15226
|
+
"referenceKind": "tenantId",
|
|
15227
|
+
"notNull": false,
|
|
15228
|
+
"unique": false
|
|
15229
|
+
},
|
|
15230
|
+
"referrer_id": {
|
|
15231
|
+
"type": "UUID",
|
|
15232
|
+
"referenceKind": "foreignKey",
|
|
15233
|
+
"notNull": true,
|
|
15234
|
+
"unique": false,
|
|
15235
|
+
"foreignKey": {
|
|
15236
|
+
"table": "referrers",
|
|
15237
|
+
"column": "id",
|
|
15238
|
+
"onDelete": "NO ACTION",
|
|
15239
|
+
"onUpdate": "CASCADE"
|
|
15240
|
+
}
|
|
15241
|
+
},
|
|
15242
|
+
"program_id": {
|
|
15243
|
+
"type": "UUID",
|
|
15244
|
+
"referenceKind": "foreignKey",
|
|
15245
|
+
"notNull": false,
|
|
15246
|
+
"unique": false,
|
|
15247
|
+
"foreignKey": {
|
|
15248
|
+
"table": "referral_programs",
|
|
15249
|
+
"column": "id",
|
|
15250
|
+
"onDelete": "NO ACTION",
|
|
15251
|
+
"onUpdate": "CASCADE"
|
|
15252
|
+
}
|
|
15253
|
+
},
|
|
15254
|
+
"kind": {
|
|
15255
|
+
"type": "TEXT",
|
|
15256
|
+
"notNull": true,
|
|
15257
|
+
"unique": false,
|
|
15258
|
+
"default": ""
|
|
15259
|
+
},
|
|
15260
|
+
"value": {
|
|
15261
|
+
"type": "TEXT",
|
|
15262
|
+
"notNull": true,
|
|
15263
|
+
"unique": false,
|
|
15264
|
+
"default": ""
|
|
15265
|
+
},
|
|
15266
|
+
"normalized_value": {
|
|
15267
|
+
"type": "TEXT",
|
|
15268
|
+
"notNull": true,
|
|
15269
|
+
"unique": false,
|
|
15270
|
+
"default": ""
|
|
15271
|
+
},
|
|
15272
|
+
"status": {
|
|
15273
|
+
"type": "TEXT",
|
|
15274
|
+
"notNull": false,
|
|
15275
|
+
"unique": false,
|
|
15276
|
+
"default": "active"
|
|
15277
|
+
},
|
|
15278
|
+
"metadata": {
|
|
15279
|
+
"type": "TEXT",
|
|
15280
|
+
"notNull": false,
|
|
15281
|
+
"unique": false,
|
|
15282
|
+
"default": "{}"
|
|
15283
|
+
}
|
|
15284
|
+
},
|
|
15285
|
+
"indexes": [
|
|
15286
|
+
{
|
|
15287
|
+
"name": "referrer_identifiers_tenant_id_kind_idx",
|
|
15288
|
+
"columns": [
|
|
15289
|
+
"tenant_id",
|
|
15290
|
+
"kind",
|
|
15291
|
+
"normalized_value"
|
|
15292
|
+
],
|
|
15293
|
+
"unique": true,
|
|
15294
|
+
"nullsNotDistinct": true
|
|
15295
|
+
},
|
|
15296
|
+
{
|
|
15297
|
+
"name": "referrer_identifiers_slug_context_idx",
|
|
15298
|
+
"columns": [
|
|
15299
|
+
"slug",
|
|
15300
|
+
"context"
|
|
15301
|
+
]
|
|
15302
|
+
},
|
|
15303
|
+
{
|
|
15304
|
+
"name": "referrer_identifiers_tenant_id_created_at_idx",
|
|
15305
|
+
"columns": [
|
|
15306
|
+
"tenant_id",
|
|
15307
|
+
"created_at"
|
|
15308
|
+
]
|
|
15309
|
+
},
|
|
15310
|
+
{
|
|
15311
|
+
"name": "referrer_identifiers_referrer_id_idx",
|
|
15312
|
+
"columns": [
|
|
15313
|
+
"referrer_id"
|
|
15314
|
+
]
|
|
15315
|
+
},
|
|
15316
|
+
{
|
|
15317
|
+
"name": "referrer_identifiers_program_id_idx",
|
|
15318
|
+
"columns": [
|
|
15319
|
+
"program_id"
|
|
15320
|
+
]
|
|
15321
|
+
}
|
|
15322
|
+
],
|
|
15323
|
+
"version": "acd06bab"
|
|
15324
|
+
},
|
|
15325
|
+
"importPath": "@happyvertical/smrt-sales/referrals"
|
|
15326
|
+
},
|
|
15127
15327
|
"@happyvertical/smrt-sales:AttributionException": {
|
|
15128
15328
|
"name": "attributionexception",
|
|
15129
15329
|
"className": "AttributionException",
|
|
@@ -18562,6 +18762,334 @@
|
|
|
18562
18762
|
"version": "16a6f845"
|
|
18563
18763
|
},
|
|
18564
18764
|
"importPath": "@happyvertical/smrt-sales/referrals"
|
|
18765
|
+
},
|
|
18766
|
+
"@happyvertical/smrt-sales:ReferrerIdentifier": {
|
|
18767
|
+
"name": "referreridentifier",
|
|
18768
|
+
"className": "ReferrerIdentifier",
|
|
18769
|
+
"qualifiedName": "@happyvertical/smrt-sales:ReferrerIdentifier",
|
|
18770
|
+
"collection": "referreridentifiers",
|
|
18771
|
+
"description": "A tenant's verified spelling, code, address, or other alias for a referrer.",
|
|
18772
|
+
"filePath": "/home/runner/work/smrt/smrt/packages/sales/src/referrals/models/ReferrerIdentifier.ts",
|
|
18773
|
+
"packageName": "@happyvertical/smrt-sales",
|
|
18774
|
+
"fields": {
|
|
18775
|
+
"tenantId": {
|
|
18776
|
+
"type": "text",
|
|
18777
|
+
"required": false,
|
|
18778
|
+
"_meta": {
|
|
18779
|
+
"sqlType": "UUID",
|
|
18780
|
+
"nullable": true,
|
|
18781
|
+
"__tenancy": {
|
|
18782
|
+
"isTenantIdField": true,
|
|
18783
|
+
"autoFilter": true,
|
|
18784
|
+
"required": false,
|
|
18785
|
+
"autoPopulate": true,
|
|
18786
|
+
"nullable": true,
|
|
18787
|
+
"mode": "optional",
|
|
18788
|
+
"field": "tenantId",
|
|
18789
|
+
"allowSuperAdminBypass": false
|
|
18790
|
+
}
|
|
18791
|
+
}
|
|
18792
|
+
},
|
|
18793
|
+
"referrerId": {
|
|
18794
|
+
"type": "foreignKey",
|
|
18795
|
+
"required": true,
|
|
18796
|
+
"related": "Referrer",
|
|
18797
|
+
"_meta": {
|
|
18798
|
+
"required": true
|
|
18799
|
+
}
|
|
18800
|
+
},
|
|
18801
|
+
"programId": {
|
|
18802
|
+
"type": "foreignKey",
|
|
18803
|
+
"required": false,
|
|
18804
|
+
"related": "ReferralProgram"
|
|
18805
|
+
},
|
|
18806
|
+
"kind": {
|
|
18807
|
+
"type": "text",
|
|
18808
|
+
"required": true,
|
|
18809
|
+
"default": "",
|
|
18810
|
+
"_meta": {
|
|
18811
|
+
"required": true
|
|
18812
|
+
}
|
|
18813
|
+
},
|
|
18814
|
+
"value": {
|
|
18815
|
+
"type": "text",
|
|
18816
|
+
"required": true,
|
|
18817
|
+
"default": "",
|
|
18818
|
+
"_meta": {
|
|
18819
|
+
"required": true
|
|
18820
|
+
}
|
|
18821
|
+
},
|
|
18822
|
+
"normalizedValue": {
|
|
18823
|
+
"type": "text",
|
|
18824
|
+
"required": true,
|
|
18825
|
+
"default": "",
|
|
18826
|
+
"_meta": {
|
|
18827
|
+
"required": true
|
|
18828
|
+
}
|
|
18829
|
+
},
|
|
18830
|
+
"status": {
|
|
18831
|
+
"type": "text",
|
|
18832
|
+
"required": false,
|
|
18833
|
+
"default": "active",
|
|
18834
|
+
"enum": [
|
|
18835
|
+
"active",
|
|
18836
|
+
"disabled"
|
|
18837
|
+
]
|
|
18838
|
+
},
|
|
18839
|
+
"metadata": {
|
|
18840
|
+
"type": "text",
|
|
18841
|
+
"required": false,
|
|
18842
|
+
"default": "{}"
|
|
18843
|
+
}
|
|
18844
|
+
},
|
|
18845
|
+
"methods": {
|
|
18846
|
+
"isActive": {
|
|
18847
|
+
"name": "isActive",
|
|
18848
|
+
"async": false,
|
|
18849
|
+
"parameters": [],
|
|
18850
|
+
"returnType": "boolean",
|
|
18851
|
+
"isStatic": false,
|
|
18852
|
+
"isPublic": true
|
|
18853
|
+
},
|
|
18854
|
+
"disable": {
|
|
18855
|
+
"name": "disable",
|
|
18856
|
+
"async": false,
|
|
18857
|
+
"parameters": [],
|
|
18858
|
+
"returnType": "void",
|
|
18859
|
+
"isStatic": false,
|
|
18860
|
+
"isPublic": true
|
|
18861
|
+
},
|
|
18862
|
+
"getMetadata": {
|
|
18863
|
+
"name": "getMetadata",
|
|
18864
|
+
"async": false,
|
|
18865
|
+
"parameters": [],
|
|
18866
|
+
"returnType": "Record<string, unknown>",
|
|
18867
|
+
"isStatic": false,
|
|
18868
|
+
"isPublic": true
|
|
18869
|
+
},
|
|
18870
|
+
"setMetadata": {
|
|
18871
|
+
"name": "setMetadata",
|
|
18872
|
+
"async": false,
|
|
18873
|
+
"parameters": [
|
|
18874
|
+
{
|
|
18875
|
+
"name": "metadata",
|
|
18876
|
+
"type": "Record<string, unknown>",
|
|
18877
|
+
"optional": false
|
|
18878
|
+
}
|
|
18879
|
+
],
|
|
18880
|
+
"returnType": "void",
|
|
18881
|
+
"isStatic": false,
|
|
18882
|
+
"isPublic": true
|
|
18883
|
+
},
|
|
18884
|
+
"save": {
|
|
18885
|
+
"name": "save",
|
|
18886
|
+
"async": true,
|
|
18887
|
+
"parameters": [
|
|
18888
|
+
{
|
|
18889
|
+
"name": "options",
|
|
18890
|
+
"type": "SmrtSaveOptions",
|
|
18891
|
+
"optional": true
|
|
18892
|
+
}
|
|
18893
|
+
],
|
|
18894
|
+
"returnType": "Promise<this>",
|
|
18895
|
+
"isStatic": false,
|
|
18896
|
+
"isPublic": true
|
|
18897
|
+
},
|
|
18898
|
+
"delete": {
|
|
18899
|
+
"name": "delete",
|
|
18900
|
+
"async": true,
|
|
18901
|
+
"parameters": [],
|
|
18902
|
+
"returnType": "Promise<void>",
|
|
18903
|
+
"isStatic": false,
|
|
18904
|
+
"isPublic": true
|
|
18905
|
+
}
|
|
18906
|
+
},
|
|
18907
|
+
"decoratorConfig": {
|
|
18908
|
+
"conflictColumns": [
|
|
18909
|
+
"tenant_id",
|
|
18910
|
+
"kind",
|
|
18911
|
+
"normalized_value"
|
|
18912
|
+
],
|
|
18913
|
+
"sensitive": true,
|
|
18914
|
+
"api": {
|
|
18915
|
+
"include": [
|
|
18916
|
+
"list",
|
|
18917
|
+
"get"
|
|
18918
|
+
]
|
|
18919
|
+
},
|
|
18920
|
+
"mcp": {
|
|
18921
|
+
"include": [
|
|
18922
|
+
"list",
|
|
18923
|
+
"get"
|
|
18924
|
+
]
|
|
18925
|
+
},
|
|
18926
|
+
"cli": false,
|
|
18927
|
+
"tenantScoped": {
|
|
18928
|
+
"mode": "optional"
|
|
18929
|
+
}
|
|
18930
|
+
},
|
|
18931
|
+
"extends": "SmrtObject",
|
|
18932
|
+
"exportName": "ReferrerIdentifier",
|
|
18933
|
+
"collectionExportName": "ReferrerIdentifierCollection",
|
|
18934
|
+
"validationRules": [
|
|
18935
|
+
{
|
|
18936
|
+
"field": "referrerId",
|
|
18937
|
+
"rule": "required",
|
|
18938
|
+
"fieldType": "foreignKey"
|
|
18939
|
+
},
|
|
18940
|
+
{
|
|
18941
|
+
"field": "kind",
|
|
18942
|
+
"rule": "required",
|
|
18943
|
+
"fieldType": "text"
|
|
18944
|
+
},
|
|
18945
|
+
{
|
|
18946
|
+
"field": "value",
|
|
18947
|
+
"rule": "required",
|
|
18948
|
+
"fieldType": "text"
|
|
18949
|
+
},
|
|
18950
|
+
{
|
|
18951
|
+
"field": "normalizedValue",
|
|
18952
|
+
"rule": "required",
|
|
18953
|
+
"fieldType": "text"
|
|
18954
|
+
}
|
|
18955
|
+
],
|
|
18956
|
+
"schema": {
|
|
18957
|
+
"tableName": "referrer_identifiers",
|
|
18958
|
+
"ddl": "CREATE TABLE IF NOT EXISTS \"referrer_identifiers\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\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 \"referrer_id\" UUID NOT NULL,\n \"program_id\" UUID,\n \"kind\" TEXT NOT NULL DEFAULT '',\n \"value\" TEXT NOT NULL DEFAULT '',\n \"normalized_value\" TEXT NOT NULL DEFAULT '',\n \"status\" TEXT DEFAULT 'active',\n \"metadata\" TEXT DEFAULT '{}'\n);",
|
|
18959
|
+
"columns": {
|
|
18960
|
+
"_sync_origin_device_id": {
|
|
18961
|
+
"type": "TEXT"
|
|
18962
|
+
},
|
|
18963
|
+
"_sync_revision": {
|
|
18964
|
+
"type": "INTEGER"
|
|
18965
|
+
},
|
|
18966
|
+
"id": {
|
|
18967
|
+
"type": "UUID",
|
|
18968
|
+
"primaryKey": true,
|
|
18969
|
+
"referenceKind": "id",
|
|
18970
|
+
"notNull": true
|
|
18971
|
+
},
|
|
18972
|
+
"slug": {
|
|
18973
|
+
"type": "TEXT",
|
|
18974
|
+
"notNull": true
|
|
18975
|
+
},
|
|
18976
|
+
"context": {
|
|
18977
|
+
"type": "TEXT",
|
|
18978
|
+
"notNull": true,
|
|
18979
|
+
"default": ""
|
|
18980
|
+
},
|
|
18981
|
+
"created_at": {
|
|
18982
|
+
"type": "TIMESTAMP",
|
|
18983
|
+
"notNull": true,
|
|
18984
|
+
"default": "current_timestamp"
|
|
18985
|
+
},
|
|
18986
|
+
"updated_at": {
|
|
18987
|
+
"type": "TIMESTAMP",
|
|
18988
|
+
"notNull": true,
|
|
18989
|
+
"default": "current_timestamp"
|
|
18990
|
+
},
|
|
18991
|
+
"tenant_id": {
|
|
18992
|
+
"type": "UUID",
|
|
18993
|
+
"referenceKind": "tenantId",
|
|
18994
|
+
"notNull": false,
|
|
18995
|
+
"unique": false
|
|
18996
|
+
},
|
|
18997
|
+
"referrer_id": {
|
|
18998
|
+
"type": "UUID",
|
|
18999
|
+
"referenceKind": "foreignKey",
|
|
19000
|
+
"notNull": true,
|
|
19001
|
+
"unique": false,
|
|
19002
|
+
"foreignKey": {
|
|
19003
|
+
"table": "referrers",
|
|
19004
|
+
"column": "id",
|
|
19005
|
+
"onDelete": "NO ACTION",
|
|
19006
|
+
"onUpdate": "CASCADE"
|
|
19007
|
+
}
|
|
19008
|
+
},
|
|
19009
|
+
"program_id": {
|
|
19010
|
+
"type": "UUID",
|
|
19011
|
+
"referenceKind": "foreignKey",
|
|
19012
|
+
"notNull": false,
|
|
19013
|
+
"unique": false,
|
|
19014
|
+
"foreignKey": {
|
|
19015
|
+
"table": "referral_programs",
|
|
19016
|
+
"column": "id",
|
|
19017
|
+
"onDelete": "NO ACTION",
|
|
19018
|
+
"onUpdate": "CASCADE"
|
|
19019
|
+
}
|
|
19020
|
+
},
|
|
19021
|
+
"kind": {
|
|
19022
|
+
"type": "TEXT",
|
|
19023
|
+
"notNull": true,
|
|
19024
|
+
"unique": false,
|
|
19025
|
+
"default": ""
|
|
19026
|
+
},
|
|
19027
|
+
"value": {
|
|
19028
|
+
"type": "TEXT",
|
|
19029
|
+
"notNull": true,
|
|
19030
|
+
"unique": false,
|
|
19031
|
+
"default": ""
|
|
19032
|
+
},
|
|
19033
|
+
"normalized_value": {
|
|
19034
|
+
"type": "TEXT",
|
|
19035
|
+
"notNull": true,
|
|
19036
|
+
"unique": false,
|
|
19037
|
+
"default": ""
|
|
19038
|
+
},
|
|
19039
|
+
"status": {
|
|
19040
|
+
"type": "TEXT",
|
|
19041
|
+
"notNull": false,
|
|
19042
|
+
"unique": false,
|
|
19043
|
+
"default": "active"
|
|
19044
|
+
},
|
|
19045
|
+
"metadata": {
|
|
19046
|
+
"type": "TEXT",
|
|
19047
|
+
"notNull": false,
|
|
19048
|
+
"unique": false,
|
|
19049
|
+
"default": "{}"
|
|
19050
|
+
}
|
|
19051
|
+
},
|
|
19052
|
+
"indexes": [
|
|
19053
|
+
{
|
|
19054
|
+
"name": "referrer_identifiers_tenant_id_kind_idx",
|
|
19055
|
+
"columns": [
|
|
19056
|
+
"tenant_id",
|
|
19057
|
+
"kind",
|
|
19058
|
+
"normalized_value"
|
|
19059
|
+
],
|
|
19060
|
+
"unique": true,
|
|
19061
|
+
"nullsNotDistinct": true
|
|
19062
|
+
},
|
|
19063
|
+
{
|
|
19064
|
+
"name": "referrer_identifiers_slug_context_idx",
|
|
19065
|
+
"columns": [
|
|
19066
|
+
"slug",
|
|
19067
|
+
"context"
|
|
19068
|
+
]
|
|
19069
|
+
},
|
|
19070
|
+
{
|
|
19071
|
+
"name": "referrer_identifiers_tenant_id_created_at_idx",
|
|
19072
|
+
"columns": [
|
|
19073
|
+
"tenant_id",
|
|
19074
|
+
"created_at"
|
|
19075
|
+
]
|
|
19076
|
+
},
|
|
19077
|
+
{
|
|
19078
|
+
"name": "referrer_identifiers_referrer_id_idx",
|
|
19079
|
+
"columns": [
|
|
19080
|
+
"referrer_id"
|
|
19081
|
+
]
|
|
19082
|
+
},
|
|
19083
|
+
{
|
|
19084
|
+
"name": "referrer_identifiers_program_id_idx",
|
|
19085
|
+
"columns": [
|
|
19086
|
+
"program_id"
|
|
19087
|
+
]
|
|
19088
|
+
}
|
|
19089
|
+
],
|
|
19090
|
+
"version": "acd06bab"
|
|
19091
|
+
},
|
|
19092
|
+
"importPath": "@happyvertical/smrt-sales/referrals"
|
|
18565
19093
|
}
|
|
18566
19094
|
},
|
|
18567
19095
|
"moduleType": "smrt",
|
|
@@ -18927,7 +19455,7 @@
|
|
|
18927
19455
|
}
|
|
18928
19456
|
},
|
|
18929
19457
|
"help": {
|
|
18930
|
-
"markdown": "## Overview\n\nAffiliates lets partners and customers send people your way and earn a reward\nwhen it leads to a sale. You set up a program that says what a referral earns,\nsign up the people who will refer, record each person they send, and see what\neach affiliate has earned and what has been paid out.\n\n## Tasks\n\n### Sign up an affiliate\n\n1. Open the list of affiliates and choose **New**.\n2. Type their **{field:Referrer.displayName}**.\n3. Save. They stay pending until you approve them by setting the **{field:Referrer.status}**.\n\n### Set up a program\n\n1. Open the programs and choose **New**.\n2. Give the program a **{field:ReferralProgram.name}** your affiliates will understand.\n3. Set the **{field:ReferralProgram.status}** to active when you are ready to start.\n4. Save.\n\n### Record a referral\n\n1. Open the referrals and choose **New**.\n2. Pick the **{field:Referral.referrerId}** who sent the person and the **{field:Referral.programId}** it belongs to.\n3. Save. The referral stays pending until it leads to a sale.\n\n### Check what an affiliate has earned\n\n1. Open the commissions and find the affiliate.\n2. Read the **{field:Commission.amountCents}** and the **{field:Commission.status}** of each one.\n3. A commission moves from pending to approved,
|
|
19458
|
+
"markdown": "## Overview\n\nAffiliates lets partners and customers send people your way and earn a reward\nwhen it leads to a sale. You set up a program that says what a referral earns,\nsign up the people who will refer, record each person they send, and see what\neach affiliate has earned and what has been paid out.\n\n## Tasks\n\n### Sign up an affiliate\n\n1. Open the list of affiliates and choose **New**.\n2. Type their **{field:Referrer.displayName}**.\n3. Save. They stay pending until you approve them by setting the **{field:Referrer.status}**.\n\n### Set up a program\n\n1. Open the programs and choose **New**.\n2. Give the program a **{field:ReferralProgram.name}** your affiliates will understand.\n3. Set the **{field:ReferralProgram.status}** to active when you are ready to start.\n4. Save.\n\n### Record a referral\n\n1. Open the referrals and choose **New**.\n2. Pick the **{field:Referral.referrerId}** who sent the person and the **{field:Referral.programId}** it belongs to.\n3. Save. The referral stays pending until it leads to a sale.\n\n### Check what an affiliate has earned\n\n1. Open the commissions and find the affiliate.\n2. Read the **{field:Commission.amountCents}** and the **{field:Commission.status}** of each one.\n3. A commission moves from pending to earned, approved, payable, and paid as it is worked through.\n\n### Check a payout\n\nPayouts are made by the commission payout service, not by hand in the app. You\ncan see what has been paid.\n\n1. Open the payouts.\n2. Read the **{field:CommissionPayout.earnerId}**, the **{field:CommissionPayout.totalAmountCents}** and the **{field:CommissionPayout.status}**.\n3. A payout is waiting, approved, being sent, then completed. It shows failed or rejected if the money did not go out.\n",
|
|
18931
19459
|
"fieldRefs": [
|
|
18932
19460
|
"Commission.amountCents",
|
|
18933
19461
|
"Commission.status",
|
|
@@ -14,7 +14,7 @@ export declare class AttributionExceptionCollection extends SmrtCollection<Attri
|
|
|
14
14
|
* `AttributionService.resolve()` returns this instead of minting a
|
|
15
15
|
* duplicate when a conflict is already parked for review.
|
|
16
16
|
*/
|
|
17
|
-
findOpenByTarget(targetKind: string, targetId: string, programId: string): Promise<AttributionException | null>;
|
|
17
|
+
findOpenByTarget(targetKind: string, targetId: string, programId: string, tenantId?: string | null): Promise<AttributionException | null>;
|
|
18
18
|
/** Every exception (open and resolved) for one target, newest first. */
|
|
19
19
|
findByTarget(targetKind: string, targetId: string): Promise<AttributionException[]>;
|
|
20
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AttributionExceptionCollection.d.ts","sourceRoot":"","sources":["../../../src/referrals/collections/AttributionExceptionCollection.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAEzE,qBAAa,8BAA+B,SAAQ,cAAc,CAAC,oBAAoB,CAAC;IACtF,MAAM,CAAC,QAAQ,CAAC,UAAU,8BAAwB;IAElD,6DAA6D;IACvD,QAAQ,IAAI,OAAO,CAAC,oBAAoB,EAAE,CAAC;IAOjD;;;;OAIG;IACG,gBAAgB,CACpB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"AttributionExceptionCollection.d.ts","sourceRoot":"","sources":["../../../src/referrals/collections/AttributionExceptionCollection.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAEzE,qBAAa,8BAA+B,SAAQ,cAAc,CAAC,oBAAoB,CAAC;IACtF,MAAM,CAAC,QAAQ,CAAC,UAAU,8BAAwB;IAElD,6DAA6D;IACvD,QAAQ,IAAI,OAAO,CAAC,oBAAoB,EAAE,CAAC;IAOjD;;;;OAIG;IACG,gBAAgB,CACpB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,GACvB,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IAevC,wEAAwE;IAClE,YAAY,CAChB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,oBAAoB,EAAE,CAAC;CAMnC;AAED,eAAe,8BAA8B,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SmrtCollection } from '@happyvertical/smrt-core';
|
|
2
|
+
import { ReferrerIdentifier } from '../models/ReferrerIdentifier.js';
|
|
3
|
+
export interface RegisterReferrerIdentifierInput {
|
|
4
|
+
tenantId: string | null;
|
|
5
|
+
referrerId: string;
|
|
6
|
+
programId?: string | null;
|
|
7
|
+
kind: string;
|
|
8
|
+
value: string;
|
|
9
|
+
metadata?: Record<string, unknown>;
|
|
10
|
+
}
|
|
11
|
+
/** An alias stays reserved to its original owner after it is disabled. */
|
|
12
|
+
export declare class ReferrerIdentifierConflictError extends Error {
|
|
13
|
+
constructor(cause?: unknown);
|
|
14
|
+
}
|
|
15
|
+
export declare class ReferrerIdentifierCollection extends SmrtCollection<ReferrerIdentifier> {
|
|
16
|
+
static readonly _itemClass: typeof ReferrerIdentifier;
|
|
17
|
+
/** Register an alias in the caller's executor and tenant lane. */
|
|
18
|
+
register(input: RegisterReferrerIdentifierInput): Promise<ReferrerIdentifier>;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=ReferrerIdentifierCollection.d.ts.map
|