@happyvertical/smrt-sales 0.57.46 → 0.57.48
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 -1
- package/agents/commissions.md +3 -3
- package/dist/agreements.js +1 -1
- package/dist/chunks/__smrt-register__-BX852n_Z.js +6 -0
- package/dist/chunks/__smrt-register__-BX852n_Z.js.map +1 -0
- package/dist/chunks/{commissions-B1WnBKsn.js → commissions-DbhfPQbi.js} +78 -36
- package/dist/chunks/commissions-DbhfPQbi.js.map +1 -0
- package/dist/chunks/{referrals-DE0tKm5G.js → referrals-DQaEehr8.js} +2 -2
- package/dist/chunks/{referrals-DE0tKm5G.js.map → referrals-DQaEehr8.js.map} +1 -1
- package/dist/commissions/collections/CommissionCollection.d.ts +8 -2
- package/dist/commissions/collections/CommissionCollection.d.ts.map +1 -1
- package/dist/commissions/collections/CommissionPayoutCollection.d.ts +8 -2
- package/dist/commissions/collections/CommissionPayoutCollection.d.ts.map +1 -1
- package/dist/commissions/collections/EarningEventCollection.d.ts +12 -5
- package/dist/commissions/collections/EarningEventCollection.d.ts.map +1 -1
- package/dist/commissions/models/Commission.d.ts.map +1 -1
- package/dist/commissions/models/CommissionPayout.d.ts.map +1 -1
- package/dist/commissions/models/EarningEvent.d.ts +5 -5
- package/dist/commissions/models/EarningEvent.d.ts.map +1 -1
- package/dist/commissions/replay-owner.d.ts +35 -0
- package/dist/commissions/replay-owner.d.ts.map +1 -0
- package/dist/commissions/services/CommissionCalculationService.d.ts.map +1 -1
- package/dist/commissions/services/CommissionPayoutService.d.ts.map +1 -1
- package/dist/commissions.js +2 -2
- package/dist/crm.js +1 -1
- package/dist/index.js +3 -3
- package/dist/manifest.json +225 -13
- package/dist/referrals.js +2 -2
- package/dist/smrt-knowledge.json +16 -10
- package/package.json +8 -8
- package/dist/chunks/__smrt-register__-DpLLYukX.js +0 -6
- package/dist/chunks/__smrt-register__-DpLLYukX.js.map +0 -1
- package/dist/chunks/commissions-B1WnBKsn.js.map +0 -1
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.57.
|
|
5
|
+
"packageVersion": "0.57.48",
|
|
6
6
|
"objects": {
|
|
7
7
|
"@happyvertical/smrt-sales:AgreementCollection": {
|
|
8
8
|
"name": "agreementcollection",
|
|
@@ -157,6 +157,11 @@
|
|
|
157
157
|
"extendsTypeArg": "Agreement",
|
|
158
158
|
"exportName": "AgreementCollection",
|
|
159
159
|
"collectionExportName": "AgreementCollectionCollection",
|
|
160
|
+
"collectionOf": "@happyvertical/smrt-sales:Agreement",
|
|
161
|
+
"inheritedExposure": [
|
|
162
|
+
"api",
|
|
163
|
+
"mcp"
|
|
164
|
+
],
|
|
160
165
|
"schema": {
|
|
161
166
|
"tableName": "agreements",
|
|
162
167
|
"ddl": "CREATE TABLE IF NOT EXISTS \"agreements\" (\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 \"kind\" TEXT NOT NULL DEFAULT '',\n \"party_a\" TEXT NOT NULL DEFAULT '',\n \"party_b\" TEXT NOT NULL DEFAULT '',\n \"version\" INTEGER DEFAULT 1,\n \"status\" TEXT DEFAULT 'draft',\n \"terms\" TEXT DEFAULT '{}',\n \"effective_from\" TIMESTAMP,\n \"effective_to\" TIMESTAMP,\n \"executed_agreement_id\" UUID,\n \"amendment_predecessor_id\" UUID,\n \"amendment_predecessor_end\" TIMESTAMP,\n \"metadata\" TEXT DEFAULT '{}'\n);",
|
|
@@ -506,6 +511,12 @@
|
|
|
506
511
|
"extendsTypeArg": "AgreementExecution",
|
|
507
512
|
"exportName": "AgreementExecutionCollection",
|
|
508
513
|
"collectionExportName": "AgreementExecutionCollectionCollection",
|
|
514
|
+
"collectionOf": "@happyvertical/smrt-sales:AgreementExecution",
|
|
515
|
+
"inheritedExposure": [
|
|
516
|
+
"api",
|
|
517
|
+
"mcp",
|
|
518
|
+
"cli"
|
|
519
|
+
],
|
|
509
520
|
"schema": {
|
|
510
521
|
"tableName": "agreement_executions",
|
|
511
522
|
"ddl": "CREATE TABLE IF NOT EXISTS \"agreement_executions\" (\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 NOT NULL,\n \"provider\" TEXT NOT NULL DEFAULT '',\n \"provider_account_ref\" TEXT DEFAULT '',\n \"credential_ref\" TEXT DEFAULT '',\n \"idempotency_key\" TEXT NOT NULL DEFAULT '',\n \"source_kind\" TEXT NOT NULL DEFAULT '',\n \"source_id\" TEXT NOT NULL DEFAULT '',\n \"source_version\" INTEGER DEFAULT 1,\n \"source_asset_id\" UUID,\n \"source_sha256\" TEXT DEFAULT '',\n \"source_size_bytes\" INTEGER DEFAULT 0,\n \"request_intent_sha256\" TEXT DEFAULT '',\n \"title\" TEXT DEFAULT '',\n \"signer_intent\" TEXT DEFAULT '[]',\n \"provider_request_id\" TEXT DEFAULT '',\n \"provider_request_key\" TEXT UNIQUE,\n \"status\" TEXT DEFAULT 'prepared',\n \"expires_at\" TIMESTAMP,\n \"cancellation_reason\" TEXT DEFAULT '',\n \"last_provider_event_at\" TIMESTAMP,\n \"last_reconciled_at\" TIMESTAMP,\n \"completed_at\" TIMESTAMP,\n \"effective_from\" TIMESTAMP,\n \"effective_to\" TIMESTAMP,\n \"supersedes_executed_agreement_id\" TEXT DEFAULT '',\n \"signed_document_asset_id\" UUID,\n \"signed_document_sha256\" TEXT DEFAULT '',\n \"signed_document_size_bytes\" INTEGER DEFAULT 0,\n \"signed_document_media_type\" TEXT DEFAULT '',\n \"signed_document_filename\" TEXT DEFAULT '',\n \"audit_trail_asset_id\" UUID,\n \"audit_trail_sha256\" TEXT DEFAULT '',\n \"audit_trail_size_bytes\" INTEGER DEFAULT 0,\n \"audit_trail_media_type\" TEXT DEFAULT '',\n \"audit_trail_filename\" TEXT DEFAULT '',\n \"attempt_count\" INTEGER DEFAULT 0,\n \"create_lease_id\" TEXT DEFAULT '',\n \"create_lease_expires_at\" TIMESTAMP,\n \"last_error\" TEXT DEFAULT '',\n \"metadata\" TEXT DEFAULT '{}'\n);",
|
|
@@ -889,6 +900,12 @@
|
|
|
889
900
|
"extendsTypeArg": "AgreementExecutionEvent",
|
|
890
901
|
"exportName": "AgreementExecutionEventCollection",
|
|
891
902
|
"collectionExportName": "AgreementExecutionEventCollectionCollection",
|
|
903
|
+
"collectionOf": "@happyvertical/smrt-sales:AgreementExecutionEvent",
|
|
904
|
+
"inheritedExposure": [
|
|
905
|
+
"api",
|
|
906
|
+
"mcp",
|
|
907
|
+
"cli"
|
|
908
|
+
],
|
|
892
909
|
"schema": {
|
|
893
910
|
"tableName": "agreement_execution_events",
|
|
894
911
|
"ddl": "CREATE TABLE IF NOT EXISTS \"agreement_execution_events\" (\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 NOT NULL,\n \"execution_id\" UUID NOT NULL,\n \"provider\" TEXT DEFAULT '',\n \"provider_event_id\" TEXT DEFAULT '',\n \"event_origin\" TEXT DEFAULT 'provider_webhook',\n \"operation_id\" TEXT DEFAULT '',\n \"dedupe_key\" TEXT NOT NULL DEFAULT '',\n \"ordering_key\" TEXT DEFAULT '',\n \"event_type\" TEXT DEFAULT '',\n \"status\" TEXT DEFAULT 'prepared',\n \"occurred_at\" TIMESTAMP,\n \"received_at\" TIMESTAMP,\n \"payload_sha256\" TEXT DEFAULT '',\n \"signer_evidence\" TEXT DEFAULT '[]',\n \"payload\" TEXT DEFAULT '{}'\n);",
|
|
@@ -1147,6 +1164,12 @@
|
|
|
1147
1164
|
"extendsTypeArg": "ExecutedAgreement",
|
|
1148
1165
|
"exportName": "ExecutedAgreementCollection",
|
|
1149
1166
|
"collectionExportName": "ExecutedAgreementCollectionCollection",
|
|
1167
|
+
"collectionOf": "@happyvertical/smrt-sales:ExecutedAgreement",
|
|
1168
|
+
"inheritedExposure": [
|
|
1169
|
+
"api",
|
|
1170
|
+
"mcp",
|
|
1171
|
+
"cli"
|
|
1172
|
+
],
|
|
1150
1173
|
"schema": {
|
|
1151
1174
|
"tableName": "executed_agreements",
|
|
1152
1175
|
"ddl": "CREATE TABLE IF NOT EXISTS \"executed_agreements\" (\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 NOT NULL,\n \"execution_id\" UUID NOT NULL,\n \"source_kind\" TEXT NOT NULL DEFAULT '',\n \"source_id\" TEXT NOT NULL DEFAULT '',\n \"source_version\" INTEGER DEFAULT 1,\n \"source_asset_id\" UUID,\n \"source_sha256\" TEXT DEFAULT '',\n \"source_size_bytes\" INTEGER DEFAULT 0,\n \"signed_document_asset_id\" UUID,\n \"signed_document_sha256\" TEXT DEFAULT '',\n \"signed_document_size_bytes\" INTEGER DEFAULT 0,\n \"signed_document_media_type\" TEXT DEFAULT '',\n \"signed_document_filename\" TEXT DEFAULT '',\n \"audit_trail_asset_id\" UUID,\n \"audit_trail_sha256\" TEXT DEFAULT '',\n \"audit_trail_size_bytes\" INTEGER DEFAULT 0,\n \"audit_trail_media_type\" TEXT DEFAULT '',\n \"audit_trail_filename\" TEXT DEFAULT '',\n \"signer_evidence\" TEXT DEFAULT '[]',\n \"accepted_at\" TIMESTAMP,\n \"effective_from\" TIMESTAMP,\n \"effective_to\" TIMESTAMP,\n \"supersedes_executed_agreement_id\" UUID,\n \"metadata\" TEXT DEFAULT '{}'\n);",
|
|
@@ -3361,6 +3384,12 @@
|
|
|
3361
3384
|
"extendsTypeArg": "CommissionAdjustment",
|
|
3362
3385
|
"exportName": "CommissionAdjustmentCollection",
|
|
3363
3386
|
"collectionExportName": "CommissionAdjustmentCollectionCollection",
|
|
3387
|
+
"collectionOf": "@happyvertical/smrt-sales:CommissionAdjustment",
|
|
3388
|
+
"inheritedExposure": [
|
|
3389
|
+
"api",
|
|
3390
|
+
"mcp",
|
|
3391
|
+
"cli"
|
|
3392
|
+
],
|
|
3364
3393
|
"schema": {
|
|
3365
3394
|
"tableName": "commission_adjustments",
|
|
3366
3395
|
"ddl": "CREATE TABLE IF NOT EXISTS \"commission_adjustments\" (\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 \"commission_id\" UUID NOT NULL,\n \"earner_id\" UUID NOT NULL,\n \"adjustment_kind\" TEXT DEFAULT 'correction',\n \"amount_cents\" INTEGER DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\n \"reason\" TEXT NOT NULL DEFAULT '',\n \"created_by_profile_id\" UUID,\n \"payout_id\" UUID,\n \"metadata\" TEXT DEFAULT '{}'\n);",
|
|
@@ -3563,6 +3592,12 @@
|
|
|
3563
3592
|
"extendsTypeArg": "CommissionAdjustmentOperation",
|
|
3564
3593
|
"exportName": "CommissionAdjustmentOperationCollection",
|
|
3565
3594
|
"collectionExportName": "CommissionAdjustmentOperationCollectionCollection",
|
|
3595
|
+
"collectionOf": "@happyvertical/smrt-sales:CommissionAdjustmentOperation",
|
|
3596
|
+
"inheritedExposure": [
|
|
3597
|
+
"api",
|
|
3598
|
+
"mcp",
|
|
3599
|
+
"cli"
|
|
3600
|
+
],
|
|
3566
3601
|
"schema": {
|
|
3567
3602
|
"tableName": "commission_adjustment_operations",
|
|
3568
3603
|
"ddl": "CREATE TABLE IF NOT EXISTS \"commission_adjustment_operations\" (\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 NOT NULL,\n \"adjustment_id\" UUID NOT NULL\n);",
|
|
@@ -3691,6 +3726,14 @@
|
|
|
3691
3726
|
"name": "dedupeKey",
|
|
3692
3727
|
"type": "string",
|
|
3693
3728
|
"optional": false
|
|
3729
|
+
},
|
|
3730
|
+
{
|
|
3731
|
+
"name": "options",
|
|
3732
|
+
"type": "object",
|
|
3733
|
+
"optional": true,
|
|
3734
|
+
"memberTypes": [
|
|
3735
|
+
"string | null"
|
|
3736
|
+
]
|
|
3694
3737
|
}
|
|
3695
3738
|
],
|
|
3696
3739
|
"returnType": "Promise<Commission | null>",
|
|
@@ -3811,6 +3854,12 @@
|
|
|
3811
3854
|
"extendsTypeArg": "Commission",
|
|
3812
3855
|
"exportName": "CommissionCollection",
|
|
3813
3856
|
"collectionExportName": "CommissionCollectionCollection",
|
|
3857
|
+
"collectionOf": "@happyvertical/smrt-sales:Commission",
|
|
3858
|
+
"inheritedExposure": [
|
|
3859
|
+
"api",
|
|
3860
|
+
"mcp",
|
|
3861
|
+
"cli"
|
|
3862
|
+
],
|
|
3814
3863
|
"schema": {
|
|
3815
3864
|
"tableName": "commissions",
|
|
3816
3865
|
"ddl": "CREATE TABLE IF NOT EXISTS \"commissions\" (\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 \"earning_event_id\" UUID,\n \"plan_key\" TEXT DEFAULT '',\n \"plan_version\" INTEGER DEFAULT 0,\n \"component_key\" TEXT DEFAULT '',\n \"terms_snapshot_kind\" TEXT DEFAULT '',\n \"terms_snapshot_id\" TEXT DEFAULT '',\n \"basis\" TEXT DEFAULT 'gross',\n \"base_amount_cents\" INTEGER DEFAULT 0,\n \"rate\" REAL DEFAULT 0,\n \"share_fraction\" REAL DEFAULT 1,\n \"split_group_id\" TEXT DEFAULT '',\n \"amount_cents\" INTEGER DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\n \"status\" TEXT DEFAULT 'pending',\n \"clearing_ends_at\" TIMESTAMP,\n \"earned_at\" TIMESTAMP,\n \"approved_at\" TIMESTAMP,\n \"payable_at\" TIMESTAMP,\n \"paid_at\" TIMESTAMP,\n \"payout_id\" UUID,\n \"source_kind\" TEXT DEFAULT '',\n \"source_id\" TEXT DEFAULT '',\n \"calculation_trace\" TEXT DEFAULT '{}',\n \"dedupe_key\" TEXT NOT NULL DEFAULT '',\n \"metadata\" TEXT DEFAULT '{}'\n);",
|
|
@@ -4018,11 +4067,13 @@
|
|
|
4018
4067
|
},
|
|
4019
4068
|
"indexes": [
|
|
4020
4069
|
{
|
|
4021
|
-
"name": "
|
|
4070
|
+
"name": "commissions_tenant_id_dedupe_key_idx",
|
|
4022
4071
|
"columns": [
|
|
4072
|
+
"tenant_id",
|
|
4023
4073
|
"dedupe_key"
|
|
4024
4074
|
],
|
|
4025
|
-
"unique": true
|
|
4075
|
+
"unique": true,
|
|
4076
|
+
"nullsNotDistinct": true
|
|
4026
4077
|
},
|
|
4027
4078
|
{
|
|
4028
4079
|
"name": "commissions_slug_context_idx",
|
|
@@ -4125,6 +4176,14 @@
|
|
|
4125
4176
|
"name": "idempotencyKey",
|
|
4126
4177
|
"type": "string",
|
|
4127
4178
|
"optional": false
|
|
4179
|
+
},
|
|
4180
|
+
{
|
|
4181
|
+
"name": "options",
|
|
4182
|
+
"type": "object",
|
|
4183
|
+
"optional": true,
|
|
4184
|
+
"memberTypes": [
|
|
4185
|
+
"string | null"
|
|
4186
|
+
]
|
|
4128
4187
|
}
|
|
4129
4188
|
],
|
|
4130
4189
|
"returnType": "Promise<CommissionPayout | null>",
|
|
@@ -4202,6 +4261,12 @@
|
|
|
4202
4261
|
"extendsTypeArg": "CommissionPayout",
|
|
4203
4262
|
"exportName": "CommissionPayoutCollection",
|
|
4204
4263
|
"collectionExportName": "CommissionPayoutCollectionCollection",
|
|
4264
|
+
"collectionOf": "@happyvertical/smrt-sales:CommissionPayout",
|
|
4265
|
+
"inheritedExposure": [
|
|
4266
|
+
"api",
|
|
4267
|
+
"mcp",
|
|
4268
|
+
"cli"
|
|
4269
|
+
],
|
|
4205
4270
|
"schema": {
|
|
4206
4271
|
"tableName": "commission_payouts",
|
|
4207
4272
|
"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);",
|
|
@@ -4357,11 +4422,13 @@
|
|
|
4357
4422
|
},
|
|
4358
4423
|
"indexes": [
|
|
4359
4424
|
{
|
|
4360
|
-
"name": "
|
|
4425
|
+
"name": "commission_payouts_tenant_id_idempotency_key_idx",
|
|
4361
4426
|
"columns": [
|
|
4427
|
+
"tenant_id",
|
|
4362
4428
|
"idempotency_key"
|
|
4363
4429
|
],
|
|
4364
|
-
"unique": true
|
|
4430
|
+
"unique": true,
|
|
4431
|
+
"nullsNotDistinct": true
|
|
4365
4432
|
},
|
|
4366
4433
|
{
|
|
4367
4434
|
"name": "commission_payouts_slug_context_idx",
|
|
@@ -4508,6 +4575,11 @@
|
|
|
4508
4575
|
"extendsTypeArg": "CommissionPlan",
|
|
4509
4576
|
"exportName": "CommissionPlanCollection",
|
|
4510
4577
|
"collectionExportName": "CommissionPlanCollectionCollection",
|
|
4578
|
+
"collectionOf": "@happyvertical/smrt-sales:CommissionPlan",
|
|
4579
|
+
"inheritedExposure": [
|
|
4580
|
+
"api",
|
|
4581
|
+
"mcp"
|
|
4582
|
+
],
|
|
4511
4583
|
"schema": {
|
|
4512
4584
|
"tableName": "commission_plans",
|
|
4513
4585
|
"ddl": "CREATE TABLE IF NOT EXISTS \"commission_plans\" (\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 \"plan_key\" TEXT NOT NULL DEFAULT '',\n \"version\" INTEGER DEFAULT 1,\n \"name\" TEXT DEFAULT '',\n \"description\" TEXT DEFAULT '',\n \"status\" TEXT DEFAULT 'draft',\n \"effective_from\" TIMESTAMP,\n \"effective_to\" TIMESTAMP,\n \"currency\" TEXT DEFAULT 'USD',\n \"components\" TEXT DEFAULT '[]',\n \"steps\" TEXT DEFAULT '[]',\n \"remainder_sink\" TEXT DEFAULT '{}',\n \"application_fee_offset_recipient\" TEXT DEFAULT '{}',\n \"metadata\" TEXT DEFAULT '{}'\n);",
|
|
@@ -4717,6 +4789,11 @@
|
|
|
4717
4789
|
"extendsTypeArg": "Earner",
|
|
4718
4790
|
"exportName": "EarnerCollection",
|
|
4719
4791
|
"collectionExportName": "EarnerCollectionCollection",
|
|
4792
|
+
"collectionOf": "@happyvertical/smrt-sales:Earner",
|
|
4793
|
+
"inheritedExposure": [
|
|
4794
|
+
"api",
|
|
4795
|
+
"mcp"
|
|
4796
|
+
],
|
|
4720
4797
|
"schema": {
|
|
4721
4798
|
"tableName": "earners",
|
|
4722
4799
|
"ddl": "CREATE TABLE IF NOT EXISTS \"earners\" (\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 \"kind\" TEXT DEFAULT 'person',\n \"profile_id\" UUID,\n \"display_name\" TEXT DEFAULT '',\n \"status\" TEXT DEFAULT 'pending',\n \"payout_method\" TEXT DEFAULT 'bank_transfer',\n \"payout_destination\" TEXT DEFAULT '{}',\n \"payout_threshold_cents\" INTEGER DEFAULT 5000,\n \"payout_schedule_key\" TEXT DEFAULT 'manual',\n \"currency\" TEXT DEFAULT 'USD',\n \"metadata\" TEXT DEFAULT '{}'\n);",
|
|
@@ -4933,6 +5010,12 @@
|
|
|
4933
5010
|
"extendsTypeArg": "EarnerSourceAttribution",
|
|
4934
5011
|
"exportName": "EarnerSourceAttributionCollection",
|
|
4935
5012
|
"collectionExportName": "EarnerSourceAttributionCollectionCollection",
|
|
5013
|
+
"collectionOf": "@happyvertical/smrt-sales:EarnerSourceAttribution",
|
|
5014
|
+
"inheritedExposure": [
|
|
5015
|
+
"api",
|
|
5016
|
+
"mcp",
|
|
5017
|
+
"cli"
|
|
5018
|
+
],
|
|
4936
5019
|
"schema": {
|
|
4937
5020
|
"tableName": "earner_source_attributions",
|
|
4938
5021
|
"ddl": "CREATE TABLE IF NOT EXISTS \"earner_source_attributions\" (\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 \"source_kind\" TEXT NOT NULL DEFAULT '',\n \"source_id\" TEXT NOT NULL DEFAULT '',\n \"status\" TEXT DEFAULT 'active',\n \"metadata\" TEXT DEFAULT '{}'\n);",
|
|
@@ -5064,6 +5147,14 @@
|
|
|
5064
5147
|
"name": "dedupeKey",
|
|
5065
5148
|
"type": "string",
|
|
5066
5149
|
"optional": false
|
|
5150
|
+
},
|
|
5151
|
+
{
|
|
5152
|
+
"name": "options",
|
|
5153
|
+
"type": "object",
|
|
5154
|
+
"optional": true,
|
|
5155
|
+
"memberTypes": [
|
|
5156
|
+
"string | null"
|
|
5157
|
+
]
|
|
5067
5158
|
}
|
|
5068
5159
|
],
|
|
5069
5160
|
"returnType": "Promise<EarningEvent | null>",
|
|
@@ -5138,6 +5229,12 @@
|
|
|
5138
5229
|
"extendsTypeArg": "EarningEvent",
|
|
5139
5230
|
"exportName": "EarningEventCollection",
|
|
5140
5231
|
"collectionExportName": "EarningEventCollectionCollection",
|
|
5232
|
+
"collectionOf": "@happyvertical/smrt-sales:EarningEvent",
|
|
5233
|
+
"inheritedExposure": [
|
|
5234
|
+
"api",
|
|
5235
|
+
"mcp",
|
|
5236
|
+
"cli"
|
|
5237
|
+
],
|
|
5141
5238
|
"schema": {
|
|
5142
5239
|
"tableName": "earning_events",
|
|
5143
5240
|
"ddl": "CREATE TABLE IF NOT EXISTS \"earning_events\" (\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 \"event_kind\" TEXT NOT NULL DEFAULT '',\n \"occurred_at\" TIMESTAMP,\n \"source_kind\" TEXT DEFAULT '',\n \"source_id\" TEXT DEFAULT '',\n \"gross_amount_cents\" INTEGER DEFAULT 0,\n \"net_amount_cents\" INTEGER,\n \"margin_cents\" INTEGER,\n \"currency\" TEXT DEFAULT 'USD',\n \"custom_bases\" TEXT DEFAULT '{}',\n \"dedupe_key\" TEXT NOT NULL DEFAULT '',\n \"metadata\" TEXT DEFAULT '{}'\n);",
|
|
@@ -5239,11 +5336,13 @@
|
|
|
5239
5336
|
},
|
|
5240
5337
|
"indexes": [
|
|
5241
5338
|
{
|
|
5242
|
-
"name": "
|
|
5339
|
+
"name": "earning_events_tenant_id_dedupe_key_idx",
|
|
5243
5340
|
"columns": [
|
|
5341
|
+
"tenant_id",
|
|
5244
5342
|
"dedupe_key"
|
|
5245
5343
|
],
|
|
5246
|
-
"unique": true
|
|
5344
|
+
"unique": true,
|
|
5345
|
+
"nullsNotDistinct": true
|
|
5247
5346
|
},
|
|
5248
5347
|
{
|
|
5249
5348
|
"name": "earning_events_slug_context_idx",
|
|
@@ -5612,6 +5711,7 @@
|
|
|
5612
5711
|
},
|
|
5613
5712
|
"decoratorConfig": {
|
|
5614
5713
|
"conflictColumns": [
|
|
5714
|
+
"tenant_id",
|
|
5615
5715
|
"dedupe_key"
|
|
5616
5716
|
],
|
|
5617
5717
|
"api": {
|
|
@@ -5854,11 +5954,13 @@
|
|
|
5854
5954
|
},
|
|
5855
5955
|
"indexes": [
|
|
5856
5956
|
{
|
|
5857
|
-
"name": "
|
|
5957
|
+
"name": "commissions_tenant_id_dedupe_key_idx",
|
|
5858
5958
|
"columns": [
|
|
5959
|
+
"tenant_id",
|
|
5859
5960
|
"dedupe_key"
|
|
5860
5961
|
],
|
|
5861
|
-
"unique": true
|
|
5962
|
+
"unique": true,
|
|
5963
|
+
"nullsNotDistinct": true
|
|
5862
5964
|
},
|
|
5863
5965
|
{
|
|
5864
5966
|
"name": "commissions_slug_context_idx",
|
|
@@ -6715,6 +6817,7 @@
|
|
|
6715
6817
|
},
|
|
6716
6818
|
"decoratorConfig": {
|
|
6717
6819
|
"conflictColumns": [
|
|
6820
|
+
"tenant_id",
|
|
6718
6821
|
"idempotency_key"
|
|
6719
6822
|
],
|
|
6720
6823
|
"api": {
|
|
@@ -6909,11 +7012,13 @@
|
|
|
6909
7012
|
},
|
|
6910
7013
|
"indexes": [
|
|
6911
7014
|
{
|
|
6912
|
-
"name": "
|
|
7015
|
+
"name": "commission_payouts_tenant_id_idempotency_key_idx",
|
|
6913
7016
|
"columns": [
|
|
7017
|
+
"tenant_id",
|
|
6914
7018
|
"idempotency_key"
|
|
6915
7019
|
],
|
|
6916
|
-
"unique": true
|
|
7020
|
+
"unique": true,
|
|
7021
|
+
"nullsNotDistinct": true
|
|
6917
7022
|
},
|
|
6918
7023
|
{
|
|
6919
7024
|
"name": "commission_payouts_slug_context_idx",
|
|
@@ -8169,6 +8274,7 @@
|
|
|
8169
8274
|
},
|
|
8170
8275
|
"decoratorConfig": {
|
|
8171
8276
|
"conflictColumns": [
|
|
8277
|
+
"tenant_id",
|
|
8172
8278
|
"dedupe_key"
|
|
8173
8279
|
],
|
|
8174
8280
|
"api": {
|
|
@@ -8305,11 +8411,13 @@
|
|
|
8305
8411
|
},
|
|
8306
8412
|
"indexes": [
|
|
8307
8413
|
{
|
|
8308
|
-
"name": "
|
|
8414
|
+
"name": "earning_events_tenant_id_dedupe_key_idx",
|
|
8309
8415
|
"columns": [
|
|
8416
|
+
"tenant_id",
|
|
8310
8417
|
"dedupe_key"
|
|
8311
8418
|
],
|
|
8312
|
-
"unique": true
|
|
8419
|
+
"unique": true,
|
|
8420
|
+
"nullsNotDistinct": true
|
|
8313
8421
|
},
|
|
8314
8422
|
{
|
|
8315
8423
|
"name": "earning_events_slug_context_idx",
|
|
@@ -8445,6 +8553,11 @@
|
|
|
8445
8553
|
"extendsTypeArg": "Lead",
|
|
8446
8554
|
"exportName": "LeadCollection",
|
|
8447
8555
|
"collectionExportName": "LeadCollectionCollection",
|
|
8556
|
+
"collectionOf": "@happyvertical/smrt-sales:Lead",
|
|
8557
|
+
"inheritedExposure": [
|
|
8558
|
+
"api",
|
|
8559
|
+
"mcp"
|
|
8560
|
+
],
|
|
8448
8561
|
"schema": {
|
|
8449
8562
|
"tableName": "leads",
|
|
8450
8563
|
"ddl": "CREATE TABLE IF NOT EXISTS \"leads\" (\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 \"name\" TEXT NOT NULL DEFAULT '',\n \"contact_name\" TEXT DEFAULT '',\n \"email\" TEXT DEFAULT '',\n \"phone\" TEXT DEFAULT '',\n \"organization_name\" TEXT DEFAULT '',\n \"profile_id\" UUID,\n \"owner_rep_id\" UUID,\n \"status\" TEXT DEFAULT 'new',\n \"source_kind\" TEXT DEFAULT '',\n \"source_id\" TEXT DEFAULT '',\n \"acquisition_context\" TEXT DEFAULT '{}',\n \"intake_ref\" TEXT DEFAULT '',\n \"merged_into_id\" UUID,\n \"qualified_at\" TIMESTAMP,\n \"metadata\" TEXT DEFAULT '{}'\n);",
|
|
@@ -8695,6 +8808,11 @@
|
|
|
8695
8808
|
"extendsTypeArg": "Opportunity",
|
|
8696
8809
|
"exportName": "OpportunityCollection",
|
|
8697
8810
|
"collectionExportName": "OpportunityCollectionCollection",
|
|
8811
|
+
"collectionOf": "@happyvertical/smrt-sales:Opportunity",
|
|
8812
|
+
"inheritedExposure": [
|
|
8813
|
+
"api",
|
|
8814
|
+
"mcp"
|
|
8815
|
+
],
|
|
8698
8816
|
"schema": {
|
|
8699
8817
|
"tableName": "opportunities",
|
|
8700
8818
|
"ddl": "CREATE TABLE IF NOT EXISTS \"opportunities\" (\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 \"name\" TEXT NOT NULL DEFAULT '',\n \"lead_id\" UUID,\n \"owner_rep_id\" UUID,\n \"pipeline_id\" UUID,\n \"stage_id\" UUID,\n \"expected_value_cents\" INTEGER DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\n \"probability\" REAL DEFAULT 0,\n \"expected_close_at\" TIMESTAMP,\n \"status\" TEXT DEFAULT 'open',\n \"outcome_reason\" TEXT DEFAULT '',\n \"won_at\" TIMESTAMP,\n \"lost_at\" TIMESTAMP,\n \"source_kind\" TEXT DEFAULT '',\n \"source_id\" TEXT DEFAULT '',\n \"metadata\" TEXT DEFAULT '{}'\n);",
|
|
@@ -8953,6 +9071,12 @@
|
|
|
8953
9071
|
"extendsTypeArg": "OpportunityConversion",
|
|
8954
9072
|
"exportName": "OpportunityConversionCollection",
|
|
8955
9073
|
"collectionExportName": "OpportunityConversionCollectionCollection",
|
|
9074
|
+
"collectionOf": "@happyvertical/smrt-sales:OpportunityConversion",
|
|
9075
|
+
"inheritedExposure": [
|
|
9076
|
+
"api",
|
|
9077
|
+
"mcp",
|
|
9078
|
+
"cli"
|
|
9079
|
+
],
|
|
8956
9080
|
"schema": {
|
|
8957
9081
|
"tableName": "opportunity_conversions",
|
|
8958
9082
|
"ddl": "CREATE TABLE IF NOT EXISTS \"opportunity_conversions\" (\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 \"opportunity_id\" UUID NOT NULL,\n \"target_kind\" TEXT NOT NULL DEFAULT '',\n \"target_id\" TEXT NOT NULL DEFAULT '',\n \"note\" TEXT DEFAULT '',\n \"metadata\" TEXT DEFAULT '{}'\n);",
|
|
@@ -9134,6 +9258,11 @@
|
|
|
9134
9258
|
"extendsTypeArg": "PipelineDefinition",
|
|
9135
9259
|
"exportName": "PipelineDefinitionCollection",
|
|
9136
9260
|
"collectionExportName": "PipelineDefinitionCollectionCollection",
|
|
9261
|
+
"collectionOf": "@happyvertical/smrt-sales:PipelineDefinition",
|
|
9262
|
+
"inheritedExposure": [
|
|
9263
|
+
"api",
|
|
9264
|
+
"mcp"
|
|
9265
|
+
],
|
|
9137
9266
|
"schema": {
|
|
9138
9267
|
"tableName": "pipeline_definitions",
|
|
9139
9268
|
"ddl": "CREATE TABLE IF NOT EXISTS \"pipeline_definitions\" (\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 \"key\" TEXT NOT NULL DEFAULT '',\n \"name\" TEXT DEFAULT '',\n \"is_default\" BOOLEAN DEFAULT FALSE,\n \"status\" TEXT DEFAULT 'active',\n \"metadata\" TEXT DEFAULT '{}'\n);",
|
|
@@ -9293,6 +9422,12 @@
|
|
|
9293
9422
|
"extendsTypeArg": "PipelineStage",
|
|
9294
9423
|
"exportName": "PipelineStageCollection",
|
|
9295
9424
|
"collectionExportName": "PipelineStageCollectionCollection",
|
|
9425
|
+
"collectionOf": "@happyvertical/smrt-sales:PipelineStage",
|
|
9426
|
+
"inheritedExposure": [
|
|
9427
|
+
"api",
|
|
9428
|
+
"mcp",
|
|
9429
|
+
"cli"
|
|
9430
|
+
],
|
|
9296
9431
|
"schema": {
|
|
9297
9432
|
"tableName": "pipeline_stages",
|
|
9298
9433
|
"ddl": "CREATE TABLE IF NOT EXISTS \"pipeline_stages\" (\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 \"pipeline_id\" UUID NOT NULL,\n \"key\" TEXT NOT NULL DEFAULT '',\n \"name\" TEXT DEFAULT '',\n \"sort_order\" INTEGER DEFAULT 0,\n \"probability\" REAL DEFAULT 0,\n \"is_won\" BOOLEAN DEFAULT FALSE,\n \"is_lost\" BOOLEAN DEFAULT FALSE,\n \"metadata\" TEXT DEFAULT '{}'\n);",
|
|
@@ -9479,6 +9614,12 @@
|
|
|
9479
9614
|
"extendsTypeArg": "SalesActivity",
|
|
9480
9615
|
"exportName": "SalesActivityCollection",
|
|
9481
9616
|
"collectionExportName": "SalesActivityCollectionCollection",
|
|
9617
|
+
"collectionOf": "@happyvertical/smrt-sales:SalesActivity",
|
|
9618
|
+
"inheritedExposure": [
|
|
9619
|
+
"api",
|
|
9620
|
+
"mcp",
|
|
9621
|
+
"cli"
|
|
9622
|
+
],
|
|
9482
9623
|
"schema": {
|
|
9483
9624
|
"tableName": "sales_activities",
|
|
9484
9625
|
"ddl": "CREATE TABLE IF NOT EXISTS \"sales_activities\" (\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 \"subject_kind\" TEXT DEFAULT 'lead',\n \"subject_id\" TEXT NOT NULL DEFAULT '',\n \"activity_kind\" TEXT DEFAULT 'note',\n \"summary\" TEXT DEFAULT '',\n \"due_at\" TIMESTAMP,\n \"completed_at\" TIMESTAMP,\n \"actor_profile_id\" UUID,\n \"metadata\" TEXT DEFAULT '{}'\n);",
|
|
@@ -9608,6 +9749,12 @@
|
|
|
9608
9749
|
"extendsTypeArg": "SalesGovernanceEvent",
|
|
9609
9750
|
"exportName": "SalesGovernanceEventCollection",
|
|
9610
9751
|
"collectionExportName": "SalesGovernanceEventCollectionCollection",
|
|
9752
|
+
"collectionOf": "@happyvertical/smrt-sales:SalesGovernanceEvent",
|
|
9753
|
+
"inheritedExposure": [
|
|
9754
|
+
"api",
|
|
9755
|
+
"mcp",
|
|
9756
|
+
"cli"
|
|
9757
|
+
],
|
|
9611
9758
|
"schema": {
|
|
9612
9759
|
"tableName": "sales_governance_events",
|
|
9613
9760
|
"ddl": "CREATE TABLE IF NOT EXISTS \"sales_governance_events\" (\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 NOT NULL,\n \"intent\" TEXT DEFAULT '',\n \"result\" TEXT DEFAULT ''\n);",
|
|
@@ -9749,6 +9896,12 @@
|
|
|
9749
9896
|
"extendsTypeArg": "SalesGovernanceState",
|
|
9750
9897
|
"exportName": "SalesGovernanceStateCollection",
|
|
9751
9898
|
"collectionExportName": "SalesGovernanceStateCollectionCollection",
|
|
9899
|
+
"collectionOf": "@happyvertical/smrt-sales:SalesGovernanceState",
|
|
9900
|
+
"inheritedExposure": [
|
|
9901
|
+
"api",
|
|
9902
|
+
"mcp",
|
|
9903
|
+
"cli"
|
|
9904
|
+
],
|
|
9752
9905
|
"schema": {
|
|
9753
9906
|
"tableName": "sales_governance_states",
|
|
9754
9907
|
"ddl": "CREATE TABLE IF NOT EXISTS \"sales_governance_states\" (\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 NOT NULL,\n \"revision\" INTEGER DEFAULT 0,\n \"payload\" TEXT DEFAULT '{}'\n);",
|
|
@@ -9871,6 +10024,11 @@
|
|
|
9871
10024
|
"extendsTypeArg": "SalesRepresentative",
|
|
9872
10025
|
"exportName": "SalesRepresentativeCollection",
|
|
9873
10026
|
"collectionExportName": "SalesRepresentativeCollectionCollection",
|
|
10027
|
+
"collectionOf": "@happyvertical/smrt-sales:SalesRepresentative",
|
|
10028
|
+
"inheritedExposure": [
|
|
10029
|
+
"api",
|
|
10030
|
+
"mcp"
|
|
10031
|
+
],
|
|
9874
10032
|
"schema": {
|
|
9875
10033
|
"tableName": "sales_representatives",
|
|
9876
10034
|
"ddl": "CREATE TABLE IF NOT EXISTS \"sales_representatives\" (\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 \"profile_id\" UUID,\n \"earner_id\" UUID,\n \"status\" TEXT DEFAULT 'active',\n \"title\" TEXT DEFAULT '',\n \"metadata\" TEXT DEFAULT '{}'\n);",
|
|
@@ -12516,6 +12674,12 @@
|
|
|
12516
12674
|
"extendsTypeArg": "AttributionException",
|
|
12517
12675
|
"exportName": "AttributionExceptionCollection",
|
|
12518
12676
|
"collectionExportName": "AttributionExceptionCollectionCollection",
|
|
12677
|
+
"collectionOf": "@happyvertical/smrt-sales:AttributionException",
|
|
12678
|
+
"inheritedExposure": [
|
|
12679
|
+
"api",
|
|
12680
|
+
"mcp",
|
|
12681
|
+
"cli"
|
|
12682
|
+
],
|
|
12519
12683
|
"schema": {
|
|
12520
12684
|
"tableName": "attribution_exceptions",
|
|
12521
12685
|
"ddl": "CREATE TABLE IF NOT EXISTS \"attribution_exceptions\" (\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 \"target_kind\" TEXT NOT NULL DEFAULT '',\n \"target_id\" TEXT NOT NULL DEFAULT '',\n \"program_id\" UUID,\n \"status\" TEXT DEFAULT 'open',\n \"conflict_reason\" TEXT DEFAULT '',\n \"candidates\" TEXT DEFAULT '[]',\n \"resolution_mode\" TEXT DEFAULT '',\n \"resolution_reason\" TEXT DEFAULT '',\n \"resolved_by_profile_id\" UUID,\n \"resolved_referral_ids\" TEXT DEFAULT '[]',\n \"resolved_at\" TIMESTAMP,\n \"metadata\" TEXT DEFAULT '{}'\n);",
|
|
@@ -12772,6 +12936,11 @@
|
|
|
12772
12936
|
"extendsTypeArg": "AttributionPolicy",
|
|
12773
12937
|
"exportName": "AttributionPolicyCollection",
|
|
12774
12938
|
"collectionExportName": "AttributionPolicyCollectionCollection",
|
|
12939
|
+
"collectionOf": "@happyvertical/smrt-sales:AttributionPolicy",
|
|
12940
|
+
"inheritedExposure": [
|
|
12941
|
+
"api",
|
|
12942
|
+
"mcp"
|
|
12943
|
+
],
|
|
12775
12944
|
"schema": {
|
|
12776
12945
|
"tableName": "attribution_policies",
|
|
12777
12946
|
"ddl": "CREATE TABLE IF NOT EXISTS \"attribution_policies\" (\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 \"policy_key\" TEXT NOT NULL DEFAULT '',\n \"version\" INTEGER DEFAULT 1,\n \"status\" TEXT DEFAULT 'draft',\n \"effective_from\" TIMESTAMP,\n \"window_days\" INTEGER DEFAULT 30,\n \"credit_mode\" TEXT DEFAULT 'first_touch',\n \"conflict_behavior\" TEXT DEFAULT 'auto',\n \"allow_self_referral\" BOOLEAN DEFAULT FALSE,\n \"allow_existing_clients\" BOOLEAN DEFAULT FALSE,\n \"eligible_services\" TEXT DEFAULT '[]',\n \"eligible_campaigns\" TEXT DEFAULT '[]',\n \"eligible_regions\" TEXT DEFAULT '[]',\n \"metadata\" TEXT DEFAULT '{}'\n);",
|
|
@@ -13011,6 +13180,11 @@
|
|
|
13011
13180
|
"extendsTypeArg": "ReferralAgreement",
|
|
13012
13181
|
"exportName": "ReferralAgreementCollection",
|
|
13013
13182
|
"collectionExportName": "ReferralAgreementCollectionCollection",
|
|
13183
|
+
"collectionOf": "@happyvertical/smrt-sales:ReferralAgreement",
|
|
13184
|
+
"inheritedExposure": [
|
|
13185
|
+
"api",
|
|
13186
|
+
"mcp"
|
|
13187
|
+
],
|
|
13014
13188
|
"schema": {
|
|
13015
13189
|
"tableName": "referral_agreements",
|
|
13016
13190
|
"ddl": "CREATE TABLE IF NOT EXISTS \"referral_agreements\" (\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 NOT NULL,\n \"version\" INTEGER DEFAULT 1,\n \"status\" TEXT DEFAULT 'draft',\n \"effective_from\" TIMESTAMP,\n \"effective_to\" TIMESTAMP,\n \"commission_plan_key\" TEXT DEFAULT '',\n \"commission_plan_version\" INTEGER DEFAULT 0,\n \"clearing_days\" INTEGER DEFAULT 0,\n \"approval_mode\" TEXT DEFAULT 'manual',\n \"execution_id\" UUID,\n \"executed_agreement_id\" UUID,\n \"metadata\" TEXT DEFAULT '{}'\n);",
|
|
@@ -13242,6 +13416,12 @@
|
|
|
13242
13416
|
"extendsTypeArg": "ReferralClickOperation",
|
|
13243
13417
|
"exportName": "ReferralClickOperationCollection",
|
|
13244
13418
|
"collectionExportName": "ReferralClickOperationCollectionCollection",
|
|
13419
|
+
"collectionOf": "@happyvertical/smrt-sales:ReferralClickOperation",
|
|
13420
|
+
"inheritedExposure": [
|
|
13421
|
+
"api",
|
|
13422
|
+
"mcp",
|
|
13423
|
+
"cli"
|
|
13424
|
+
],
|
|
13245
13425
|
"schema": {
|
|
13246
13426
|
"tableName": "referral_click_operations",
|
|
13247
13427
|
"ddl": "CREATE TABLE IF NOT EXISTS \"referral_click_operations\" (\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 \"key_hash\" TEXT NOT NULL,\n \"link_id\" UUID NOT NULL,\n \"touch_id\" UUID NOT NULL,\n \"intent_hash\" TEXT NOT NULL,\n \"caller_evidence_hash\" TEXT NOT NULL,\n \"requested_occurred_at\" TEXT NOT NULL\n);",
|
|
@@ -13438,6 +13618,11 @@
|
|
|
13438
13618
|
"extendsTypeArg": "Referral",
|
|
13439
13619
|
"exportName": "ReferralCollection",
|
|
13440
13620
|
"collectionExportName": "ReferralCollectionCollection",
|
|
13621
|
+
"collectionOf": "@happyvertical/smrt-sales:Referral",
|
|
13622
|
+
"inheritedExposure": [
|
|
13623
|
+
"api",
|
|
13624
|
+
"mcp"
|
|
13625
|
+
],
|
|
13441
13626
|
"schema": {
|
|
13442
13627
|
"tableName": "referrals",
|
|
13443
13628
|
"ddl": "CREATE TABLE IF NOT EXISTS \"referrals\" (\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 NOT NULL,\n \"policy_key\" TEXT DEFAULT '',\n \"policy_version\" INTEGER DEFAULT 0,\n \"status\" TEXT DEFAULT 'pending',\n \"target_kind\" TEXT DEFAULT '',\n \"target_id\" TEXT DEFAULT '',\n \"credit_fraction\" REAL DEFAULT 1,\n \"split_group_id\" TEXT DEFAULT '',\n \"primary_touch_id\" UUID,\n \"attributed_at\" TIMESTAMP,\n \"qualified_at\" TIMESTAMP,\n \"expires_at\" TIMESTAMP,\n \"snapshot_id\" TEXT DEFAULT '',\n \"metadata\" TEXT DEFAULT '{}'\n);",
|
|
@@ -13707,6 +13892,11 @@
|
|
|
13707
13892
|
"extendsTypeArg": "ReferralLink",
|
|
13708
13893
|
"exportName": "ReferralLinkCollection",
|
|
13709
13894
|
"collectionExportName": "ReferralLinkCollectionCollection",
|
|
13895
|
+
"collectionOf": "@happyvertical/smrt-sales:ReferralLink",
|
|
13896
|
+
"inheritedExposure": [
|
|
13897
|
+
"api",
|
|
13898
|
+
"mcp"
|
|
13899
|
+
],
|
|
13710
13900
|
"schema": {
|
|
13711
13901
|
"tableName": "referral_links",
|
|
13712
13902
|
"ddl": "CREATE TABLE IF NOT EXISTS \"referral_links\" (\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 NOT NULL,\n \"code\" TEXT NOT NULL DEFAULT '',\n \"target_url\" TEXT DEFAULT '',\n \"label\" TEXT DEFAULT '',\n \"status\" TEXT DEFAULT 'active',\n \"click_count\" INTEGER DEFAULT 0,\n \"metadata\" TEXT DEFAULT '{}'\n);",
|
|
@@ -13908,6 +14098,11 @@
|
|
|
13908
14098
|
"extendsTypeArg": "ReferralProgram",
|
|
13909
14099
|
"exportName": "ReferralProgramCollection",
|
|
13910
14100
|
"collectionExportName": "ReferralProgramCollectionCollection",
|
|
14101
|
+
"collectionOf": "@happyvertical/smrt-sales:ReferralProgram",
|
|
14102
|
+
"inheritedExposure": [
|
|
14103
|
+
"api",
|
|
14104
|
+
"mcp"
|
|
14105
|
+
],
|
|
13911
14106
|
"schema": {
|
|
13912
14107
|
"tableName": "referral_programs",
|
|
13913
14108
|
"ddl": "CREATE TABLE IF NOT EXISTS \"referral_programs\" (\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 \"key\" TEXT NOT NULL DEFAULT '',\n \"name\" TEXT DEFAULT '',\n \"status\" TEXT DEFAULT 'draft',\n \"default_commission_plan_key\" TEXT DEFAULT '',\n \"default_attribution_policy_key\" TEXT DEFAULT '',\n \"metadata\" TEXT DEFAULT '{}'\n);",
|
|
@@ -14052,6 +14247,12 @@
|
|
|
14052
14247
|
"extendsTypeArg": "ReferralTermSnapshot",
|
|
14053
14248
|
"exportName": "ReferralTermSnapshotCollection",
|
|
14054
14249
|
"collectionExportName": "ReferralTermSnapshotCollectionCollection",
|
|
14250
|
+
"collectionOf": "@happyvertical/smrt-sales:ReferralTermSnapshot",
|
|
14251
|
+
"inheritedExposure": [
|
|
14252
|
+
"api",
|
|
14253
|
+
"mcp",
|
|
14254
|
+
"cli"
|
|
14255
|
+
],
|
|
14055
14256
|
"schema": {
|
|
14056
14257
|
"tableName": "referral_term_snapshots",
|
|
14057
14258
|
"ddl": "CREATE TABLE IF NOT EXISTS \"referral_term_snapshots\" (\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 \"referral_id\" UUID NOT NULL,\n \"agreement_id\" TEXT DEFAULT '',\n \"agreement_version\" INTEGER DEFAULT 0,\n \"plan_key\" TEXT DEFAULT '',\n \"plan_version\" INTEGER DEFAULT 0,\n \"policy_key\" TEXT DEFAULT '',\n \"policy_version\" INTEGER DEFAULT 0,\n \"components\" TEXT DEFAULT '[]',\n \"currency\" TEXT DEFAULT 'USD',\n \"clearing_days\" INTEGER DEFAULT 0,\n \"approval_mode\" TEXT DEFAULT 'manual',\n \"metadata\" TEXT DEFAULT '{}'\n);",
|
|
@@ -14272,6 +14473,12 @@
|
|
|
14272
14473
|
"extendsTypeArg": "ReferralTouch",
|
|
14273
14474
|
"exportName": "ReferralTouchCollection",
|
|
14274
14475
|
"collectionExportName": "ReferralTouchCollectionCollection",
|
|
14476
|
+
"collectionOf": "@happyvertical/smrt-sales:ReferralTouch",
|
|
14477
|
+
"inheritedExposure": [
|
|
14478
|
+
"api",
|
|
14479
|
+
"mcp",
|
|
14480
|
+
"cli"
|
|
14481
|
+
],
|
|
14275
14482
|
"schema": {
|
|
14276
14483
|
"tableName": "referral_touches",
|
|
14277
14484
|
"ddl": "CREATE TABLE IF NOT EXISTS \"referral_touches\" (\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 \"link_id\" UUID,\n \"code\" TEXT DEFAULT '',\n \"referrer_id\" UUID NOT NULL,\n \"program_id\" UUID,\n \"kind\" TEXT DEFAULT 'click',\n \"subject_kind\" TEXT DEFAULT '',\n \"subject_id\" TEXT DEFAULT '',\n \"occurred_at\" TIMESTAMP,\n \"evidence\" TEXT DEFAULT '{}',\n \"metadata\" TEXT DEFAULT '{}'\n);",
|
|
@@ -14493,6 +14700,11 @@
|
|
|
14493
14700
|
"extendsTypeArg": "Referrer",
|
|
14494
14701
|
"exportName": "ReferrerCollection",
|
|
14495
14702
|
"collectionExportName": "ReferrerCollectionCollection",
|
|
14703
|
+
"collectionOf": "@happyvertical/smrt-sales:Referrer",
|
|
14704
|
+
"inheritedExposure": [
|
|
14705
|
+
"api",
|
|
14706
|
+
"mcp"
|
|
14707
|
+
],
|
|
14496
14708
|
"schema": {
|
|
14497
14709
|
"tableName": "referrers",
|
|
14498
14710
|
"ddl": "CREATE TABLE IF NOT EXISTS \"referrers\" (\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 \"profile_id\" UUID,\n \"earner_id\" UUID,\n \"display_name\" TEXT DEFAULT '',\n \"status\" TEXT DEFAULT 'pending',\n \"metadata\" TEXT DEFAULT '{}'\n);",
|
package/dist/referrals.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "./chunks/__smrt-register__-
|
|
2
|
-
import { A as ReferralClickOperationCollection, B as ATTRIBUTION_POLICY_STATUSES, C as generateReferralCode, D as assertHttpTargetUrl, E as ReferralLink, F as AttributionPolicy, G as REFERRAL_PROGRAM_STATUSES, H as REFERRAL_AGREEMENT_APPROVAL_MODES, I as validateAttributionPolicyTerms, J as REFERRER_STATUSES, K as REFERRAL_STATUSES, L as ATTRIBUTION_CONFLICT_BEHAVIORS, M as ReferralAgreementCollection, N as ReferralAgreement, O as ReferralCollection, P as AttributionPolicyCollection, R as ATTRIBUTION_CREDIT_MODES, S as ReferralLinkCollection, T as ReferralTouch, U as REFERRAL_AGREEMENT_STATUSES, V as ATTRIBUTION_RESOLUTION_MODES, W as REFERRAL_LINK_STATUSES, X as AttributionException, Y as AttributionExceptionCollection, _ as MAX_REFERRAL_CLICK_IDEMPOTENCY_KEY_BYTES, a as ReferralAgreementExecutionService, b as ReferralClickReplayConflictError, c as AffiliatesReferralsRecipe, d as ReferralTermSnapshotCollection, f as ReferralTermSnapshot, g as MAX_CODE_GENERATION_ATTEMPTS, h as DEFAULT_REFERRAL_CLICK_EVIDENCE_MAX_BYTES, i as REFERRAL_AGREEMENT_SOURCE_KIND, j as ReferralClickOperation, k as Referral, l as ReferrerCollection, m as ReferralProgram, n as REFERRAL_TERMS_SNAPSHOT_KIND, o as AttributionService, p as ReferralProgramCollection, q as REFERRAL_TOUCH_KINDS, r as ReferralCommissionService, s as QualifiedReferralOverrideError, t as ReferralQualificationService, u as Referrer, v as REFERRAL_CODE_ALPHABET, w as ReferralTouchCollection, x as ReferralClickValidationError, y as REFERRAL_CODE_LENGTH, z as ATTRIBUTION_EXCEPTION_STATUSES } from "./chunks/referrals-
|
|
1
|
+
import "./chunks/__smrt-register__-BX852n_Z.js";
|
|
2
|
+
import { A as ReferralClickOperationCollection, B as ATTRIBUTION_POLICY_STATUSES, C as generateReferralCode, D as assertHttpTargetUrl, E as ReferralLink, F as AttributionPolicy, G as REFERRAL_PROGRAM_STATUSES, H as REFERRAL_AGREEMENT_APPROVAL_MODES, I as validateAttributionPolicyTerms, J as REFERRER_STATUSES, K as REFERRAL_STATUSES, L as ATTRIBUTION_CONFLICT_BEHAVIORS, M as ReferralAgreementCollection, N as ReferralAgreement, O as ReferralCollection, P as AttributionPolicyCollection, R as ATTRIBUTION_CREDIT_MODES, S as ReferralLinkCollection, T as ReferralTouch, U as REFERRAL_AGREEMENT_STATUSES, V as ATTRIBUTION_RESOLUTION_MODES, W as REFERRAL_LINK_STATUSES, X as AttributionException, Y as AttributionExceptionCollection, _ as MAX_REFERRAL_CLICK_IDEMPOTENCY_KEY_BYTES, a as ReferralAgreementExecutionService, b as ReferralClickReplayConflictError, c as AffiliatesReferralsRecipe, d as ReferralTermSnapshotCollection, f as ReferralTermSnapshot, g as MAX_CODE_GENERATION_ATTEMPTS, h as DEFAULT_REFERRAL_CLICK_EVIDENCE_MAX_BYTES, i as REFERRAL_AGREEMENT_SOURCE_KIND, j as ReferralClickOperation, k as Referral, l as ReferrerCollection, m as ReferralProgram, n as REFERRAL_TERMS_SNAPSHOT_KIND, o as AttributionService, p as ReferralProgramCollection, q as REFERRAL_TOUCH_KINDS, r as ReferralCommissionService, s as QualifiedReferralOverrideError, t as ReferralQualificationService, u as Referrer, v as REFERRAL_CODE_ALPHABET, w as ReferralTouchCollection, x as ReferralClickValidationError, y as REFERRAL_CODE_LENGTH, z as ATTRIBUTION_EXCEPTION_STATUSES } from "./chunks/referrals-DQaEehr8.js";
|
|
3
3
|
export { ATTRIBUTION_CONFLICT_BEHAVIORS, ATTRIBUTION_CREDIT_MODES, ATTRIBUTION_EXCEPTION_STATUSES, ATTRIBUTION_POLICY_STATUSES, ATTRIBUTION_RESOLUTION_MODES, AffiliatesReferralsRecipe, 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 };
|