@happyvertical/smrt-sales 0.57.22 → 0.57.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/AGENTS.md +8 -0
  2. package/README.md +34 -0
  3. package/agents/agreements.md +32 -0
  4. package/agents/commissions.md +2 -1
  5. package/agents/crm.md +150 -0
  6. package/agents/svelte.md +7 -0
  7. package/dist/agreements/collections/AgreementCollection.d.ts +3 -2
  8. package/dist/agreements/collections/AgreementCollection.d.ts.map +1 -1
  9. package/dist/agreements/models/Agreement.d.ts.map +1 -1
  10. package/dist/agreements/services/AgreementExecutionService.d.ts +9 -0
  11. package/dist/agreements/services/AgreementExecutionService.d.ts.map +1 -1
  12. package/dist/agreements/types.d.ts +2 -0
  13. package/dist/agreements/types.d.ts.map +1 -1
  14. package/dist/agreements.js +2 -2
  15. package/dist/chunks/__smrt-register__-Yzz7_2xD.js +6 -0
  16. package/dist/chunks/__smrt-register__-Yzz7_2xD.js.map +1 -0
  17. package/dist/chunks/{agreements-jBiVmttD.js → agreements-RsyRLeDn.js} +35 -16
  18. package/dist/chunks/agreements-RsyRLeDn.js.map +1 -0
  19. package/dist/chunks/{commissions-D5x24d4o.js → commissions-nMBMa0DT.js} +410 -344
  20. package/dist/chunks/commissions-nMBMa0DT.js.map +1 -0
  21. package/dist/chunks/{crm-BRICSwf2.js → crm-BENK-hHd.js} +793 -123
  22. package/dist/chunks/crm-BENK-hHd.js.map +1 -0
  23. package/dist/chunks/{referrals-BRdTkEFt.js → referrals-BPEaXqCz.js} +2 -2
  24. package/dist/chunks/{referrals-BRdTkEFt.js.map → referrals-BPEaXqCz.js.map} +1 -1
  25. package/dist/commissions/collections/CommissionPayoutCollection.d.ts +3 -1
  26. package/dist/commissions/collections/CommissionPayoutCollection.d.ts.map +1 -1
  27. package/dist/commissions/models/CommissionPayout.d.ts +15 -1
  28. package/dist/commissions/models/CommissionPayout.d.ts.map +1 -1
  29. package/dist/commissions/services/CommissionPayoutService.d.ts.map +1 -1
  30. package/dist/commissions/types.d.ts +2 -0
  31. package/dist/commissions/types.d.ts.map +1 -1
  32. package/dist/commissions.js +2 -2
  33. package/dist/crm/collections/SalesGovernanceEventCollection.d.ts +7 -0
  34. package/dist/crm/collections/SalesGovernanceEventCollection.d.ts.map +1 -0
  35. package/dist/crm/collections/SalesGovernanceStateCollection.d.ts +13 -0
  36. package/dist/crm/collections/SalesGovernanceStateCollection.d.ts.map +1 -0
  37. package/dist/crm/index.d.ts +6 -0
  38. package/dist/crm/index.d.ts.map +1 -1
  39. package/dist/crm/models/SalesGovernanceEvent.d.ts +19 -0
  40. package/dist/crm/models/SalesGovernanceEvent.d.ts.map +1 -0
  41. package/dist/crm/models/SalesGovernanceState.d.ts +17 -0
  42. package/dist/crm/models/SalesGovernanceState.d.ts.map +1 -0
  43. package/dist/crm/services/SalesGovernanceService.d.ts +68 -0
  44. package/dist/crm/services/SalesGovernanceService.d.ts.map +1 -0
  45. package/dist/crm/services/governance-write.d.ts +4 -0
  46. package/dist/crm/services/governance-write.d.ts.map +1 -0
  47. package/dist/crm/services/sales-governance-types.d.ts +108 -0
  48. package/dist/crm/services/sales-governance-types.d.ts.map +1 -0
  49. package/dist/crm.js +3 -3
  50. package/dist/index.js +6 -6
  51. package/dist/manifest.json +592 -5
  52. package/dist/referrals.js +2 -2
  53. package/dist/smrt-knowledge.json +320 -14
  54. package/dist/svelte/components/SellerGovernancePanel.svelte +65 -0
  55. package/dist/svelte/components/SellerGovernancePanel.svelte.d.ts +13 -0
  56. package/dist/svelte/components/SellerGovernancePanel.svelte.d.ts.map +1 -0
  57. package/dist/svelte/index.d.ts +2 -1
  58. package/dist/svelte/index.d.ts.map +1 -1
  59. package/dist/svelte/index.js +1 -0
  60. package/dist/svelte/types.d.ts +22 -1
  61. package/dist/svelte/types.d.ts.map +1 -1
  62. package/package.json +6 -6
  63. package/dist/chunks/__smrt-register__-bn1C2AUF.js +0 -6
  64. package/dist/chunks/__smrt-register__-bn1C2AUF.js.map +0 -1
  65. package/dist/chunks/agreements-jBiVmttD.js.map +0 -1
  66. package/dist/chunks/commissions-D5x24d4o.js.map +0 -1
  67. package/dist/chunks/crm-BRICSwf2.js.map +0 -1
@@ -2,7 +2,7 @@
2
2
  "version": "1.0.0",
3
3
  "timestamp": 0,
4
4
  "packageName": "@happyvertical/smrt-sales",
5
- "packageVersion": "0.57.22",
5
+ "packageVersion": "0.57.24",
6
6
  "objects": {
7
7
  "@happyvertical/smrt-sales:AgreementCollection": {
8
8
  "name": "agreementcollection",
@@ -4046,6 +4046,25 @@
4046
4046
  "packageName": "@happyvertical/smrt-sales",
4047
4047
  "fields": {},
4048
4048
  "methods": {
4049
+ "create": {
4050
+ "name": "create",
4051
+ "async": true,
4052
+ "parameters": [
4053
+ {
4054
+ "name": "options",
4055
+ "type": "SmrtCreateInput<CommissionPayout>",
4056
+ "optional": false
4057
+ },
4058
+ {
4059
+ "name": "context",
4060
+ "type": "Partial<AuditContext>",
4061
+ "optional": true
4062
+ }
4063
+ ],
4064
+ "returnType": "Promise<CommissionPayout>",
4065
+ "isStatic": false,
4066
+ "isPublic": true
4067
+ },
4049
4068
  "findByEarner": {
4050
4069
  "name": "findByEarner",
4051
4070
  "async": true,
@@ -4161,7 +4180,7 @@
4161
4180
  "collectionExportName": "CommissionPayoutCollectionCollection",
4162
4181
  "schema": {
4163
4182
  "tableName": "commission_payouts",
4164
- "ddl": "CREATE TABLE IF NOT EXISTS \"commission_payouts\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"earner_id\" UUID NOT NULL,\n \"period_start\" TIMESTAMP,\n \"period_end\" TIMESTAMP,\n \"commission_total_cents\" INTEGER DEFAULT 0,\n \"adjustment_total_cents\" INTEGER DEFAULT 0,\n \"total_amount_cents\" INTEGER DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\n \"payout_method\" TEXT DEFAULT 'bank_transfer',\n \"status\" TEXT DEFAULT 'pending',\n \"payment_reference\" TEXT DEFAULT '',\n \"provider_ref\" TEXT DEFAULT '',\n \"paid_at\" TIMESTAMP,\n \"invoice_id\" UUID,\n \"notes\" TEXT DEFAULT '',\n \"idempotency_key\" TEXT NOT NULL DEFAULT '',\n \"source_kind\" TEXT DEFAULT '',\n \"source_id\" TEXT DEFAULT '',\n \"metadata\" TEXT DEFAULT '{}'\n);",
4183
+ "ddl": "CREATE TABLE IF NOT EXISTS \"commission_payouts\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"earner_id\" UUID NOT NULL,\n \"period_start\" TIMESTAMP,\n \"period_end\" TIMESTAMP,\n \"commission_total_cents\" INTEGER DEFAULT 0,\n \"adjustment_total_cents\" INTEGER DEFAULT 0,\n \"total_amount_cents\" INTEGER DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\n \"payout_method\" TEXT DEFAULT 'bank_transfer',\n \"payout_destination\" TEXT DEFAULT '{}',\n \"status\" TEXT DEFAULT 'pending',\n \"payment_reference\" TEXT DEFAULT '',\n \"provider_ref\" TEXT DEFAULT '',\n \"paid_at\" TIMESTAMP,\n \"invoice_id\" UUID,\n \"notes\" TEXT DEFAULT '',\n \"idempotency_key\" TEXT NOT NULL DEFAULT '',\n \"source_kind\" TEXT DEFAULT '',\n \"source_id\" TEXT DEFAULT '',\n \"metadata\" TEXT DEFAULT '{}'\n);",
4165
4184
  "columns": {
4166
4185
  "id": {
4167
4186
  "type": "UUID",
@@ -4246,6 +4265,12 @@
4246
4265
  "unique": false,
4247
4266
  "default": "bank_transfer"
4248
4267
  },
4268
+ "payout_destination": {
4269
+ "type": "TEXT",
4270
+ "notNull": false,
4271
+ "unique": false,
4272
+ "default": "{}"
4273
+ },
4249
4274
  "status": {
4250
4275
  "type": "TEXT",
4251
4276
  "notNull": false,
@@ -4347,7 +4372,7 @@
4347
4372
  ]
4348
4373
  }
4349
4374
  ],
4350
- "version": "d4997e44"
4375
+ "version": "242b9cec"
4351
4376
  },
4352
4377
  "importPath": "@happyvertical/smrt-sales/commissions"
4353
4378
  },
@@ -6352,6 +6377,11 @@
6352
6377
  "required": false,
6353
6378
  "default": "bank_transfer"
6354
6379
  },
6380
+ "payoutDestination": {
6381
+ "type": "text",
6382
+ "required": false,
6383
+ "default": "{}"
6384
+ },
6355
6385
  "status": {
6356
6386
  "type": "text",
6357
6387
  "required": false,
@@ -6536,6 +6566,36 @@
6536
6566
  "isStatic": false,
6537
6567
  "isPublic": true
6538
6568
  },
6569
+ "getPayoutDestination": {
6570
+ "name": "getPayoutDestination",
6571
+ "async": false,
6572
+ "parameters": [],
6573
+ "returnType": "PayoutDestination | null",
6574
+ "isStatic": false,
6575
+ "isPublic": true
6576
+ },
6577
+ "setPayoutDestination": {
6578
+ "name": "setPayoutDestination",
6579
+ "async": false,
6580
+ "parameters": [
6581
+ {
6582
+ "name": "destination",
6583
+ "type": "PayoutDestination | null",
6584
+ "optional": false,
6585
+ "unionBranches": [
6586
+ {
6587
+ "type": "PayoutDestination"
6588
+ },
6589
+ {
6590
+ "type": "null"
6591
+ }
6592
+ ]
6593
+ }
6594
+ ],
6595
+ "returnType": "void",
6596
+ "isStatic": false,
6597
+ "isPublic": true
6598
+ },
6539
6599
  "getMetadata": {
6540
6600
  "name": "getMetadata",
6541
6601
  "async": false,
@@ -6618,7 +6678,7 @@
6618
6678
  ],
6619
6679
  "schema": {
6620
6680
  "tableName": "commission_payouts",
6621
- "ddl": "CREATE TABLE IF NOT EXISTS \"commission_payouts\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"earner_id\" UUID NOT NULL,\n \"period_start\" TIMESTAMP,\n \"period_end\" TIMESTAMP,\n \"commission_total_cents\" INTEGER DEFAULT 0,\n \"adjustment_total_cents\" INTEGER DEFAULT 0,\n \"total_amount_cents\" INTEGER DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\n \"payout_method\" TEXT DEFAULT 'bank_transfer',\n \"status\" TEXT DEFAULT 'pending',\n \"payment_reference\" TEXT DEFAULT '',\n \"provider_ref\" TEXT DEFAULT '',\n \"paid_at\" TIMESTAMP,\n \"invoice_id\" UUID,\n \"notes\" TEXT DEFAULT '',\n \"idempotency_key\" TEXT NOT NULL DEFAULT '',\n \"source_kind\" TEXT DEFAULT '',\n \"source_id\" TEXT DEFAULT '',\n \"metadata\" TEXT DEFAULT '{}'\n);",
6681
+ "ddl": "CREATE TABLE IF NOT EXISTS \"commission_payouts\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"earner_id\" UUID NOT NULL,\n \"period_start\" TIMESTAMP,\n \"period_end\" TIMESTAMP,\n \"commission_total_cents\" INTEGER DEFAULT 0,\n \"adjustment_total_cents\" INTEGER DEFAULT 0,\n \"total_amount_cents\" INTEGER DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\n \"payout_method\" TEXT DEFAULT 'bank_transfer',\n \"payout_destination\" TEXT DEFAULT '{}',\n \"status\" TEXT DEFAULT 'pending',\n \"payment_reference\" TEXT DEFAULT '',\n \"provider_ref\" TEXT DEFAULT '',\n \"paid_at\" TIMESTAMP,\n \"invoice_id\" UUID,\n \"notes\" TEXT DEFAULT '',\n \"idempotency_key\" TEXT NOT NULL DEFAULT '',\n \"source_kind\" TEXT DEFAULT '',\n \"source_id\" TEXT DEFAULT '',\n \"metadata\" TEXT DEFAULT '{}'\n);",
6622
6682
  "columns": {
6623
6683
  "id": {
6624
6684
  "type": "UUID",
@@ -6703,6 +6763,12 @@
6703
6763
  "unique": false,
6704
6764
  "default": "bank_transfer"
6705
6765
  },
6766
+ "payout_destination": {
6767
+ "type": "TEXT",
6768
+ "notNull": false,
6769
+ "unique": false,
6770
+ "default": "{}"
6771
+ },
6706
6772
  "status": {
6707
6773
  "type": "TEXT",
6708
6774
  "notNull": false,
@@ -6804,7 +6870,7 @@
6804
6870
  ]
6805
6871
  }
6806
6872
  ],
6807
- "version": "d4997e44"
6873
+ "version": "242b9cec"
6808
6874
  },
6809
6875
  "importPath": "@happyvertical/smrt-sales/commissions"
6810
6876
  },
@@ -9414,6 +9480,235 @@
9414
9480
  },
9415
9481
  "importPath": "@happyvertical/smrt-sales/crm"
9416
9482
  },
9483
+ "@happyvertical/smrt-sales:SalesGovernanceEventCollection": {
9484
+ "name": "salesgovernanceeventcollection",
9485
+ "className": "SalesGovernanceEventCollection",
9486
+ "qualifiedName": "@happyvertical/smrt-sales:SalesGovernanceEventCollection",
9487
+ "collection": "salesgovernanceevents",
9488
+ "filePath": "/home/runner/work/smrt/smrt/packages/sales/src/crm/collections/SalesGovernanceEventCollection.ts",
9489
+ "packageName": "@happyvertical/smrt-sales",
9490
+ "fields": {},
9491
+ "methods": {},
9492
+ "decoratorConfig": {
9493
+ "api": false,
9494
+ "mcp": false,
9495
+ "cli": false
9496
+ },
9497
+ "extends": "SmrtCollection",
9498
+ "extendsTypeArg": "SalesGovernanceEvent",
9499
+ "exportName": "SalesGovernanceEventCollection",
9500
+ "collectionExportName": "SalesGovernanceEventCollectionCollection",
9501
+ "schema": {
9502
+ "tableName": "sales_governance_events",
9503
+ "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);",
9504
+ "columns": {
9505
+ "id": {
9506
+ "type": "UUID",
9507
+ "primaryKey": true,
9508
+ "referenceKind": "id",
9509
+ "notNull": true
9510
+ },
9511
+ "slug": {
9512
+ "type": "TEXT",
9513
+ "notNull": true
9514
+ },
9515
+ "context": {
9516
+ "type": "TEXT",
9517
+ "notNull": true,
9518
+ "default": ""
9519
+ },
9520
+ "created_at": {
9521
+ "type": "TIMESTAMP",
9522
+ "notNull": true,
9523
+ "default": "current_timestamp"
9524
+ },
9525
+ "updated_at": {
9526
+ "type": "TIMESTAMP",
9527
+ "notNull": true,
9528
+ "default": "current_timestamp"
9529
+ },
9530
+ "tenant_id": {
9531
+ "type": "UUID",
9532
+ "referenceKind": "tenantId",
9533
+ "notNull": true,
9534
+ "unique": false
9535
+ },
9536
+ "intent": {
9537
+ "type": "TEXT",
9538
+ "notNull": false,
9539
+ "unique": false,
9540
+ "default": ""
9541
+ },
9542
+ "result": {
9543
+ "type": "TEXT",
9544
+ "notNull": false,
9545
+ "unique": false,
9546
+ "default": ""
9547
+ }
9548
+ },
9549
+ "indexes": [
9550
+ {
9551
+ "name": "sales_governance_events_slug_context_idx",
9552
+ "columns": [
9553
+ "tenant_id",
9554
+ "slug",
9555
+ "context"
9556
+ ],
9557
+ "unique": true
9558
+ },
9559
+ {
9560
+ "name": "sales_governance_events_tenant_id_created_at_idx",
9561
+ "columns": [
9562
+ "tenant_id",
9563
+ "created_at"
9564
+ ]
9565
+ }
9566
+ ],
9567
+ "version": "361ab8b5"
9568
+ },
9569
+ "importPath": "@happyvertical/smrt-sales/crm"
9570
+ },
9571
+ "@happyvertical/smrt-sales:SalesGovernanceStateCollection": {
9572
+ "name": "salesgovernancestatecollection",
9573
+ "className": "SalesGovernanceStateCollection",
9574
+ "qualifiedName": "@happyvertical/smrt-sales:SalesGovernanceStateCollection",
9575
+ "collection": "salesgovernancestates",
9576
+ "filePath": "/home/runner/work/smrt/smrt/packages/sales/src/crm/collections/SalesGovernanceStateCollection.ts",
9577
+ "packageName": "@happyvertical/smrt-sales",
9578
+ "fields": {},
9579
+ "methods": {
9580
+ "ensure": {
9581
+ "name": "ensure",
9582
+ "async": true,
9583
+ "parameters": [
9584
+ {
9585
+ "name": "id",
9586
+ "type": "string",
9587
+ "optional": false
9588
+ }
9589
+ ],
9590
+ "returnType": "Promise<void>",
9591
+ "isStatic": false,
9592
+ "isPublic": true
9593
+ },
9594
+ "lock": {
9595
+ "name": "lock",
9596
+ "async": true,
9597
+ "parameters": [
9598
+ {
9599
+ "name": "id",
9600
+ "type": "string",
9601
+ "optional": false
9602
+ }
9603
+ ],
9604
+ "returnType": "Promise<SalesGovernanceState>",
9605
+ "isStatic": false,
9606
+ "isPublic": true
9607
+ },
9608
+ "compareAndSwap": {
9609
+ "name": "compareAndSwap",
9610
+ "async": true,
9611
+ "parameters": [
9612
+ {
9613
+ "name": "id",
9614
+ "type": "string",
9615
+ "optional": false
9616
+ },
9617
+ {
9618
+ "name": "revision",
9619
+ "type": "number",
9620
+ "optional": false
9621
+ },
9622
+ {
9623
+ "name": "payload",
9624
+ "type": "string",
9625
+ "optional": false
9626
+ }
9627
+ ],
9628
+ "returnType": "Promise<boolean>",
9629
+ "isStatic": false,
9630
+ "isPublic": true
9631
+ }
9632
+ },
9633
+ "decoratorConfig": {
9634
+ "api": false,
9635
+ "mcp": false,
9636
+ "cli": false
9637
+ },
9638
+ "extends": "SmrtCollection",
9639
+ "extendsTypeArg": "SalesGovernanceState",
9640
+ "exportName": "SalesGovernanceStateCollection",
9641
+ "collectionExportName": "SalesGovernanceStateCollectionCollection",
9642
+ "schema": {
9643
+ "tableName": "sales_governance_states",
9644
+ "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);",
9645
+ "columns": {
9646
+ "id": {
9647
+ "type": "UUID",
9648
+ "primaryKey": true,
9649
+ "referenceKind": "id",
9650
+ "notNull": true
9651
+ },
9652
+ "slug": {
9653
+ "type": "TEXT",
9654
+ "notNull": true
9655
+ },
9656
+ "context": {
9657
+ "type": "TEXT",
9658
+ "notNull": true,
9659
+ "default": ""
9660
+ },
9661
+ "created_at": {
9662
+ "type": "TIMESTAMP",
9663
+ "notNull": true,
9664
+ "default": "current_timestamp"
9665
+ },
9666
+ "updated_at": {
9667
+ "type": "TIMESTAMP",
9668
+ "notNull": true,
9669
+ "default": "current_timestamp"
9670
+ },
9671
+ "tenant_id": {
9672
+ "type": "UUID",
9673
+ "referenceKind": "tenantId",
9674
+ "notNull": true,
9675
+ "unique": false
9676
+ },
9677
+ "revision": {
9678
+ "type": "INTEGER",
9679
+ "notNull": false,
9680
+ "unique": false,
9681
+ "default": 0
9682
+ },
9683
+ "payload": {
9684
+ "type": "TEXT",
9685
+ "notNull": false,
9686
+ "unique": false,
9687
+ "default": "{}"
9688
+ }
9689
+ },
9690
+ "indexes": [
9691
+ {
9692
+ "name": "sales_governance_states_slug_context_idx",
9693
+ "columns": [
9694
+ "tenant_id",
9695
+ "slug",
9696
+ "context"
9697
+ ],
9698
+ "unique": true
9699
+ },
9700
+ {
9701
+ "name": "sales_governance_states_tenant_id_created_at_idx",
9702
+ "columns": [
9703
+ "tenant_id",
9704
+ "created_at"
9705
+ ]
9706
+ }
9707
+ ],
9708
+ "version": "bfdce7d0"
9709
+ },
9710
+ "importPath": "@happyvertical/smrt-sales/crm"
9711
+ },
9417
9712
  "@happyvertical/smrt-sales:SalesRepresentativeCollection": {
9418
9713
  "name": "salesrepresentativecollection",
9419
9714
  "className": "SalesRepresentativeCollection",
@@ -11480,6 +11775,298 @@
11480
11775
  },
11481
11776
  "importPath": "@happyvertical/smrt-sales/crm"
11482
11777
  },
11778
+ "@happyvertical/smrt-sales:SalesGovernanceEvent": {
11779
+ "name": "salesgovernanceevent",
11780
+ "className": "SalesGovernanceEvent",
11781
+ "qualifiedName": "@happyvertical/smrt-sales:SalesGovernanceEvent",
11782
+ "collection": "salesgovernanceevents",
11783
+ "description": "UUID replay fence and immutable audit; no generated mutation surface.",
11784
+ "filePath": "/home/runner/work/smrt/smrt/packages/sales/src/crm/models/SalesGovernanceEvent.ts",
11785
+ "packageName": "@happyvertical/smrt-sales",
11786
+ "fields": {
11787
+ "tenantId": {
11788
+ "type": "text",
11789
+ "required": true,
11790
+ "_meta": {
11791
+ "sqlType": "UUID",
11792
+ "__tenancy": {
11793
+ "isTenantIdField": true,
11794
+ "autoFilter": true,
11795
+ "required": true,
11796
+ "autoPopulate": true,
11797
+ "nullable": false,
11798
+ "mode": "required",
11799
+ "field": "tenantId",
11800
+ "allowSuperAdminBypass": false
11801
+ }
11802
+ }
11803
+ },
11804
+ "intent": {
11805
+ "type": "text",
11806
+ "required": false,
11807
+ "default": ""
11808
+ },
11809
+ "result": {
11810
+ "type": "text",
11811
+ "required": false,
11812
+ "default": ""
11813
+ }
11814
+ },
11815
+ "methods": {
11816
+ "initialize": {
11817
+ "name": "initialize",
11818
+ "async": true,
11819
+ "parameters": [],
11820
+ "returnType": "Promise<this>",
11821
+ "isStatic": false,
11822
+ "isPublic": true
11823
+ },
11824
+ "save": {
11825
+ "name": "save",
11826
+ "async": true,
11827
+ "parameters": [],
11828
+ "returnType": "Promise<this>",
11829
+ "isStatic": false,
11830
+ "isPublic": true
11831
+ },
11832
+ "delete": {
11833
+ "name": "delete",
11834
+ "async": true,
11835
+ "parameters": [],
11836
+ "returnType": "Promise<void>",
11837
+ "isStatic": false,
11838
+ "isPublic": true
11839
+ }
11840
+ },
11841
+ "decoratorConfig": {
11842
+ "api": false,
11843
+ "mcp": false,
11844
+ "cli": false,
11845
+ "tenantScoped": {
11846
+ "mode": "required"
11847
+ },
11848
+ "conflictColumns": [
11849
+ "tenant_id",
11850
+ "slug",
11851
+ "context"
11852
+ ]
11853
+ },
11854
+ "extends": "SmrtObject",
11855
+ "exportName": "SalesGovernanceEvent",
11856
+ "collectionExportName": "SalesGovernanceEventCollection",
11857
+ "validationRules": [],
11858
+ "schema": {
11859
+ "tableName": "sales_governance_events",
11860
+ "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);",
11861
+ "columns": {
11862
+ "id": {
11863
+ "type": "UUID",
11864
+ "primaryKey": true,
11865
+ "referenceKind": "id",
11866
+ "notNull": true
11867
+ },
11868
+ "slug": {
11869
+ "type": "TEXT",
11870
+ "notNull": true
11871
+ },
11872
+ "context": {
11873
+ "type": "TEXT",
11874
+ "notNull": true,
11875
+ "default": ""
11876
+ },
11877
+ "created_at": {
11878
+ "type": "TIMESTAMP",
11879
+ "notNull": true,
11880
+ "default": "current_timestamp"
11881
+ },
11882
+ "updated_at": {
11883
+ "type": "TIMESTAMP",
11884
+ "notNull": true,
11885
+ "default": "current_timestamp"
11886
+ },
11887
+ "tenant_id": {
11888
+ "type": "UUID",
11889
+ "referenceKind": "tenantId",
11890
+ "notNull": true,
11891
+ "unique": false
11892
+ },
11893
+ "intent": {
11894
+ "type": "TEXT",
11895
+ "notNull": false,
11896
+ "unique": false,
11897
+ "default": ""
11898
+ },
11899
+ "result": {
11900
+ "type": "TEXT",
11901
+ "notNull": false,
11902
+ "unique": false,
11903
+ "default": ""
11904
+ }
11905
+ },
11906
+ "indexes": [
11907
+ {
11908
+ "name": "sales_governance_events_slug_context_idx",
11909
+ "columns": [
11910
+ "tenant_id",
11911
+ "slug",
11912
+ "context"
11913
+ ],
11914
+ "unique": true
11915
+ },
11916
+ {
11917
+ "name": "sales_governance_events_tenant_id_created_at_idx",
11918
+ "columns": [
11919
+ "tenant_id",
11920
+ "created_at"
11921
+ ]
11922
+ }
11923
+ ],
11924
+ "version": "361ab8b5"
11925
+ },
11926
+ "importPath": "@happyvertical/smrt-sales/crm"
11927
+ },
11928
+ "@happyvertical/smrt-sales:SalesGovernanceState": {
11929
+ "name": "salesgovernancestate",
11930
+ "className": "SalesGovernanceState",
11931
+ "qualifiedName": "@happyvertical/smrt-sales:SalesGovernanceState",
11932
+ "collection": "salesgovernancestates",
11933
+ "description": "Service-owned compare-and-swap fence. Migrate through the SMRT manifest.",
11934
+ "filePath": "/home/runner/work/smrt/smrt/packages/sales/src/crm/models/SalesGovernanceState.ts",
11935
+ "packageName": "@happyvertical/smrt-sales",
11936
+ "fields": {
11937
+ "tenantId": {
11938
+ "type": "text",
11939
+ "required": true,
11940
+ "_meta": {
11941
+ "sqlType": "UUID",
11942
+ "__tenancy": {
11943
+ "isTenantIdField": true,
11944
+ "autoFilter": true,
11945
+ "required": true,
11946
+ "autoPopulate": true,
11947
+ "nullable": false,
11948
+ "mode": "required",
11949
+ "field": "tenantId",
11950
+ "allowSuperAdminBypass": false
11951
+ }
11952
+ }
11953
+ },
11954
+ "revision": {
11955
+ "type": "integer",
11956
+ "required": false,
11957
+ "default": 0
11958
+ },
11959
+ "payload": {
11960
+ "type": "text",
11961
+ "required": false,
11962
+ "default": "{}"
11963
+ }
11964
+ },
11965
+ "methods": {
11966
+ "save": {
11967
+ "name": "save",
11968
+ "async": true,
11969
+ "parameters": [],
11970
+ "returnType": "Promise<this>",
11971
+ "isStatic": false,
11972
+ "isPublic": true
11973
+ },
11974
+ "delete": {
11975
+ "name": "delete",
11976
+ "async": true,
11977
+ "parameters": [],
11978
+ "returnType": "Promise<void>",
11979
+ "isStatic": false,
11980
+ "isPublic": true
11981
+ }
11982
+ },
11983
+ "decoratorConfig": {
11984
+ "api": false,
11985
+ "mcp": false,
11986
+ "cli": false,
11987
+ "tenantScoped": {
11988
+ "mode": "required"
11989
+ },
11990
+ "conflictColumns": [
11991
+ "tenant_id",
11992
+ "slug",
11993
+ "context"
11994
+ ]
11995
+ },
11996
+ "extends": "SmrtObject",
11997
+ "exportName": "SalesGovernanceState",
11998
+ "collectionExportName": "SalesGovernanceStateCollection",
11999
+ "validationRules": [],
12000
+ "schema": {
12001
+ "tableName": "sales_governance_states",
12002
+ "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);",
12003
+ "columns": {
12004
+ "id": {
12005
+ "type": "UUID",
12006
+ "primaryKey": true,
12007
+ "referenceKind": "id",
12008
+ "notNull": true
12009
+ },
12010
+ "slug": {
12011
+ "type": "TEXT",
12012
+ "notNull": true
12013
+ },
12014
+ "context": {
12015
+ "type": "TEXT",
12016
+ "notNull": true,
12017
+ "default": ""
12018
+ },
12019
+ "created_at": {
12020
+ "type": "TIMESTAMP",
12021
+ "notNull": true,
12022
+ "default": "current_timestamp"
12023
+ },
12024
+ "updated_at": {
12025
+ "type": "TIMESTAMP",
12026
+ "notNull": true,
12027
+ "default": "current_timestamp"
12028
+ },
12029
+ "tenant_id": {
12030
+ "type": "UUID",
12031
+ "referenceKind": "tenantId",
12032
+ "notNull": true,
12033
+ "unique": false
12034
+ },
12035
+ "revision": {
12036
+ "type": "INTEGER",
12037
+ "notNull": false,
12038
+ "unique": false,
12039
+ "default": 0
12040
+ },
12041
+ "payload": {
12042
+ "type": "TEXT",
12043
+ "notNull": false,
12044
+ "unique": false,
12045
+ "default": "{}"
12046
+ }
12047
+ },
12048
+ "indexes": [
12049
+ {
12050
+ "name": "sales_governance_states_slug_context_idx",
12051
+ "columns": [
12052
+ "tenant_id",
12053
+ "slug",
12054
+ "context"
12055
+ ],
12056
+ "unique": true
12057
+ },
12058
+ {
12059
+ "name": "sales_governance_states_tenant_id_created_at_idx",
12060
+ "columns": [
12061
+ "tenant_id",
12062
+ "created_at"
12063
+ ]
12064
+ }
12065
+ ],
12066
+ "version": "bfdce7d0"
12067
+ },
12068
+ "importPath": "@happyvertical/smrt-sales/crm"
12069
+ },
11483
12070
  "@happyvertical/smrt-sales:SalesRepresentative": {
11484
12071
  "name": "salesrepresentative",
11485
12072
  "className": "SalesRepresentative",