@happyvertical/smrt-affiliates 0.57.8 → 0.57.10

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 CHANGED
@@ -30,7 +30,7 @@ imports `@happyvertical/smrt-sales` directly.
30
30
  - `PayoutStatus` values are a subset of the `CommissionPayoutStatus` union
31
31
  (which adds `'rejected'`; legacy affiliates had no reject) — the shared
32
32
  string values align exactly. `PayoutMethod` values align with the new
33
- `PayoutMethod` union (which adds `'other'`).
33
+ `PayoutMethod` union (which adds `'other'`, `'stripe_connect'`, and `'crypto'`).
34
34
  - `CommissionStatus.INCLUDED` (`'included'`) has **no direct equivalent**;
35
35
  the nearest new state is `'payable'` with `payoutId` set. `PENDING`/`PAID`
36
36
  align.
package/MIGRATION.md CHANGED
@@ -34,7 +34,7 @@ import from `@happyvertical/smrt-sales` directly.
34
34
  | `CommissionType` enum | — (plan component keys) | See the worked `CommissionPlan` below. |
35
35
  | `CommissionStatus` enum | `CommissionStatus` union (`COMMISSION_STATUSES`) | `pending`/`paid` align; `included` has no direct equivalent (see status mapping). |
36
36
  | `PayoutStatus` enum | `CommissionPayoutStatus` union (`COMMISSION_PAYOUT_STATUSES`) | 1:1. |
37
- | `PayoutMethod` enum | `PayoutMethod` union (`PAYOUT_METHODS`) | Legacy values align; the new union adds `'other'`. |
37
+ | `PayoutMethod` enum | `PayoutMethod` union (`PAYOUT_METHODS`) | Legacy values align; the new union adds `'other'`, `'stripe_connect'`, and `'crypto'`. |
38
38
 
39
39
  New concepts with no legacy counterpart (adopt as you migrate):
40
40
  `CommissionPlan(Collection)` (versioned calculation terms),
@@ -66,7 +66,7 @@ helpers (`roundCents`, `centsToAmount`, `amountToCents`,
66
66
  | `parent_commission_share` | plan component rates / `share_fraction` | See the worked plan below. Note the legacy column was declared with an integer default (`= 0`) — audit stored values before converting. |
67
67
  | `display_commission_rate`, `referral_commission_rate`, `sales_commission_rate` | `commission_plans.components` (JSON) | Per-type rates become plan components; see the worked plan below. Legacy values were true 0–1 decimals. |
68
68
  | `payout_threshold` | `earners.payout_threshold_cents` | Same unit (integer cents), explicit `*Cents` name. |
69
- | `payout_method` | `earners.payout_method` | Same string values; the new union adds `'other'`. |
69
+ | `payout_method` | `earners.payout_method` | Same string values; the new union adds `'other'`, `'stripe_connect'`, and `'crypto'`. |
70
70
  | `currency` | `earners.currency` | Copy the explicit value (see currency note below). |
71
71
  | `status` | `earners.status` | Same string values (`pending`/`active`/`suspended`). |
72
72
  | `metadata` (JSON string) | `earners.metadata` | New default is `'{}'` rather than `''`. |
package/dist/index.d.ts CHANGED
@@ -133,9 +133,9 @@ export type PayoutStatus = (typeof PayoutStatus)[keyof typeof PayoutStatus];
133
133
  * Legacy payout method values.
134
134
  *
135
135
  * @deprecated Use the `PayoutMethod` union
136
- * (`'bank_transfer' | 'check' | 'paypal' | 'credit' | 'other'`) from
137
- * `@happyvertical/smrt-sales` — the legacy values align exactly; the new
138
- * union adds `'other'`.
136
+ * (`PAYOUT_METHODS`) from `@happyvertical/smrt-sales` — the legacy values
137
+ * align exactly; the new union adds `'other'`, `'stripe_connect'`, and
138
+ * `'crypto'`.
139
139
  */
140
140
  export declare const PayoutMethod: Readonly<{
141
141
  readonly BANK_TRANSFER: "bank_transfer";
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["/**\n * @happyvertical/smrt-affiliates — DEPRECATED compatibility shim.\n *\n * This package no longer declares any models and owns no persistence. Every\n * export below is a thin alias over the neutral commissions core in\n * `@happyvertical/smrt-sales` (`Earner`, `Commission`, `CommissionPayout`,\n * their collections, and the status vocabularies), kept only so existing\n * imports keep compiling while consumers migrate.\n *\n * Migrate at your own pace:\n *\n * - New code should import from `@happyvertical/smrt-sales` directly\n * (`Earner`, `EarnerCollection`, `Commission`, `CommissionCollection`,\n * `CommissionPayout`, `CommissionPayoutCollection`, plans, earning events,\n * adjustments, services, and money helpers).\n * - The legacy partner ROLES (publisher/salesperson/referrer) are now\n * first-class models: `Referrer` in `@happyvertical/smrt-sales/referrals`\n * and `SalesRepresentative` in `@happyvertical/smrt-sales/crm`, each\n * holding an `earnerId` pointing at the shared financial account.\n * - The data/API migration path (table and column mappings, status mappings,\n * SQL sketches) is documented in this package's `MIGRATION.md`.\n *\n * This shim will be removed in a future major release.\n *\n * @deprecated Use `@happyvertical/smrt-sales` instead. See `MIGRATION.md` in\n * this package for the full data/API migration path.\n * @packageDocumentation\n */\n\nimport type {\n CommissionOptions as SalesCommissionOptions,\n CommissionPayoutOptions as SalesCommissionPayoutOptions,\n EarnerOptions as SalesEarnerOptions,\n} from '@happyvertical/smrt-sales';\n\n// ---------------------------------------------------------------------------\n// Class / collection aliases\n//\n// These are the SAME runtime classes as the `@happyvertical/smrt-sales`\n// exports — `Partner === Earner`, `Payout === CommissionPayout` — re-exported\n// under the legacy names. Data lives in the sales tables (`earners`,\n// `commissions`, `commission_payouts`); the legacy `partners`/`payouts`\n// tables are not read or written by this package. See MIGRATION.md.\n// ---------------------------------------------------------------------------\n\n/**\n * @deprecated Import `Earner` / `EarnerCollection`, `Commission` /\n * `CommissionCollection`, and `CommissionPayout` /\n * `CommissionPayoutCollection` from `@happyvertical/smrt-sales` instead.\n */\nexport {\n Commission,\n CommissionCollection,\n CommissionPayout as Payout,\n CommissionPayoutCollection as PayoutCollection,\n Earner as Partner,\n EarnerCollection as PartnerCollection,\n} from '@happyvertical/smrt-sales';\n\n// ---------------------------------------------------------------------------\n// Option-type aliases\n// ---------------------------------------------------------------------------\n\n/** @deprecated Use `EarnerOptions` from `@happyvertical/smrt-sales`. */\nexport type PartnerOptions = SalesEarnerOptions;\n\n/** @deprecated Use `CommissionOptions` from `@happyvertical/smrt-sales`. */\nexport type CommissionOptions = SalesCommissionOptions;\n\n/** @deprecated Use `CommissionPayoutOptions` from `@happyvertical/smrt-sales`. */\nexport type PayoutOptions = SalesCommissionPayoutOptions;\n\n// ---------------------------------------------------------------------------\n// Legacy enum-compatible const objects\n//\n// The old package exported TS enums; these frozen `as const` objects preserve\n// the exact legacy member names and string values so both value positions\n// (`PartnerStatus.ACTIVE`) and type positions (`status: PartnerStatus`) keep\n// compiling. Where a new equivalent exists, the values align with the\n// `@happyvertical/smrt-sales` string-literal unions.\n// ---------------------------------------------------------------------------\n\n/**\n * Legacy partner status values.\n *\n * @deprecated Use the `EarnerStatus` union\n * (`'pending' | 'active' | 'suspended'`) from `@happyvertical/smrt-sales` —\n * the string values align exactly.\n */\nexport const PartnerStatus = Object.freeze({\n PENDING: 'pending',\n ACTIVE: 'active',\n SUSPENDED: 'suspended',\n} as const);\n/** @deprecated Use `EarnerStatus` from `@happyvertical/smrt-sales`. */\nexport type PartnerStatus = (typeof PartnerStatus)[keyof typeof PartnerStatus];\n\n/**\n * Legacy partner role values.\n *\n * @deprecated Partner roles have NO direct equivalent in\n * `@happyvertical/smrt-sales` — roles are now first-class models instead of a\n * JSON array on the financial account: use `Referrer` from\n * `@happyvertical/smrt-sales/referrals` and `SalesRepresentative` from\n * `@happyvertical/smrt-sales/crm` (each holds an `earnerId`); model\n * publisher-style roles in your application domain. See MIGRATION.md.\n */\nexport const PartnerType = Object.freeze({\n PUBLISHER: 'publisher',\n SALESPERSON: 'salesperson',\n REFERRER: 'referrer',\n} as const);\n/**\n * @deprecated Roles are first-class models in `@happyvertical/smrt-sales`\n * (`Referrer`, `SalesRepresentative`); see MIGRATION.md.\n */\nexport type PartnerType = (typeof PartnerType)[keyof typeof PartnerType];\n\n/**\n * Legacy commission type values.\n *\n * @deprecated Superseded by `CommissionPlan` component keys in\n * `@happyvertical/smrt-sales`: a versioned plan's `components` array replaces\n * the fixed display/referral/sales/parent/overhead taxonomy — each component\n * has its own `key`, `trigger`, `basis`, and `rate`, and every `Commission`\n * records the `componentKey` that produced it. See MIGRATION.md for a worked\n * plan reproducing the legacy waterfall.\n */\nexport const CommissionType = Object.freeze({\n DISPLAY: 'display',\n REFERRAL: 'referral',\n SALES: 'sales',\n PARENT: 'parent',\n OVERHEAD: 'overhead',\n} as const);\n/**\n * @deprecated Superseded by `CommissionPlan` component keys in\n * `@happyvertical/smrt-sales`; see MIGRATION.md.\n */\nexport type CommissionType =\n (typeof CommissionType)[keyof typeof CommissionType];\n\n/**\n * Legacy commission status values.\n *\n * @deprecated Use the `CommissionStatus` union\n * (`'pending' | 'earned' | 'approved' | 'payable' | 'paid'`) from\n * `@happyvertical/smrt-sales`. `PENDING` and `PAID` align; `INCLUDED` has no\n * direct equivalent — the nearest new state is `'payable'` with `payoutId`\n * set (a commission gathered into a payout batch). See MIGRATION.md.\n */\nexport const CommissionStatus = Object.freeze({\n PENDING: 'pending',\n INCLUDED: 'included',\n PAID: 'paid',\n} as const);\n/** @deprecated Use `CommissionStatus` from `@happyvertical/smrt-sales`. */\nexport type CommissionStatus =\n (typeof CommissionStatus)[keyof typeof CommissionStatus];\n\n/**\n * Legacy payout status values.\n *\n * @deprecated Use the `CommissionPayoutStatus` union\n * (`'pending' | 'approved' | 'processing' | 'completed' | 'failed' |\n * 'rejected'`) from `@happyvertical/smrt-sales` — the legacy value set is a\n * subset (legacy affiliates had no reject) and the shared string values\n * align exactly.\n */\nexport const PayoutStatus = Object.freeze({\n PENDING: 'pending',\n APPROVED: 'approved',\n PROCESSING: 'processing',\n COMPLETED: 'completed',\n FAILED: 'failed',\n} as const);\n/** @deprecated Use `CommissionPayoutStatus` from `@happyvertical/smrt-sales`. */\nexport type PayoutStatus = (typeof PayoutStatus)[keyof typeof PayoutStatus];\n\n/**\n * Legacy payout method values.\n *\n * @deprecated Use the `PayoutMethod` union\n * (`'bank_transfer' | 'check' | 'paypal' | 'credit' | 'other'`) from\n * `@happyvertical/smrt-sales` — the legacy values align exactly; the new\n * union adds `'other'`.\n */\nexport const PayoutMethod = Object.freeze({\n BANK_TRANSFER: 'bank_transfer',\n CHECK: 'check',\n PAYPAL: 'paypal',\n CREDIT: 'credit',\n} as const);\n/** @deprecated Use `PayoutMethod` from `@happyvertical/smrt-sales`. */\nexport type PayoutMethod = (typeof PayoutMethod)[keyof typeof PayoutMethod];\n"],"mappings":";;AAyFO,IAAM,gBAAgB,OAAO,OAAO;CACzC,SAAS;CACT,QAAQ;CACR,WAAW;AACb,CAAU;AAcH,IAAM,cAAc,OAAO,OAAO;CACvC,WAAW;CACX,aAAa;CACb,UAAU;AACZ,CAAU;AAiBH,IAAM,iBAAiB,OAAO,OAAO;CAC1C,SAAS;CACT,UAAU;CACV,OAAO;CACP,QAAQ;CACR,UAAU;AACZ,CAAU;AAiBH,IAAM,mBAAmB,OAAO,OAAO;CAC5C,SAAS;CACT,UAAU;CACV,MAAM;AACR,CAAU;AAcH,IAAM,eAAe,OAAO,OAAO;CACxC,SAAS;CACT,UAAU;CACV,YAAY;CACZ,WAAW;CACX,QAAQ;AACV,CAAU;AAYH,IAAM,eAAe,OAAO,OAAO;CACxC,eAAe;CACf,OAAO;CACP,QAAQ;CACR,QAAQ;AACV,CAAU"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["/**\n * @happyvertical/smrt-affiliates — DEPRECATED compatibility shim.\n *\n * This package no longer declares any models and owns no persistence. Every\n * export below is a thin alias over the neutral commissions core in\n * `@happyvertical/smrt-sales` (`Earner`, `Commission`, `CommissionPayout`,\n * their collections, and the status vocabularies), kept only so existing\n * imports keep compiling while consumers migrate.\n *\n * Migrate at your own pace:\n *\n * - New code should import from `@happyvertical/smrt-sales` directly\n * (`Earner`, `EarnerCollection`, `Commission`, `CommissionCollection`,\n * `CommissionPayout`, `CommissionPayoutCollection`, plans, earning events,\n * adjustments, services, and money helpers).\n * - The legacy partner ROLES (publisher/salesperson/referrer) are now\n * first-class models: `Referrer` in `@happyvertical/smrt-sales/referrals`\n * and `SalesRepresentative` in `@happyvertical/smrt-sales/crm`, each\n * holding an `earnerId` pointing at the shared financial account.\n * - The data/API migration path (table and column mappings, status mappings,\n * SQL sketches) is documented in this package's `MIGRATION.md`.\n *\n * This shim will be removed in a future major release.\n *\n * @deprecated Use `@happyvertical/smrt-sales` instead. See `MIGRATION.md` in\n * this package for the full data/API migration path.\n * @packageDocumentation\n */\n\nimport type {\n CommissionOptions as SalesCommissionOptions,\n CommissionPayoutOptions as SalesCommissionPayoutOptions,\n EarnerOptions as SalesEarnerOptions,\n} from '@happyvertical/smrt-sales';\n\n// ---------------------------------------------------------------------------\n// Class / collection aliases\n//\n// These are the SAME runtime classes as the `@happyvertical/smrt-sales`\n// exports — `Partner === Earner`, `Payout === CommissionPayout` — re-exported\n// under the legacy names. Data lives in the sales tables (`earners`,\n// `commissions`, `commission_payouts`); the legacy `partners`/`payouts`\n// tables are not read or written by this package. See MIGRATION.md.\n// ---------------------------------------------------------------------------\n\n/**\n * @deprecated Import `Earner` / `EarnerCollection`, `Commission` /\n * `CommissionCollection`, and `CommissionPayout` /\n * `CommissionPayoutCollection` from `@happyvertical/smrt-sales` instead.\n */\nexport {\n Commission,\n CommissionCollection,\n CommissionPayout as Payout,\n CommissionPayoutCollection as PayoutCollection,\n Earner as Partner,\n EarnerCollection as PartnerCollection,\n} from '@happyvertical/smrt-sales';\n\n// ---------------------------------------------------------------------------\n// Option-type aliases\n// ---------------------------------------------------------------------------\n\n/** @deprecated Use `EarnerOptions` from `@happyvertical/smrt-sales`. */\nexport type PartnerOptions = SalesEarnerOptions;\n\n/** @deprecated Use `CommissionOptions` from `@happyvertical/smrt-sales`. */\nexport type CommissionOptions = SalesCommissionOptions;\n\n/** @deprecated Use `CommissionPayoutOptions` from `@happyvertical/smrt-sales`. */\nexport type PayoutOptions = SalesCommissionPayoutOptions;\n\n// ---------------------------------------------------------------------------\n// Legacy enum-compatible const objects\n//\n// The old package exported TS enums; these frozen `as const` objects preserve\n// the exact legacy member names and string values so both value positions\n// (`PartnerStatus.ACTIVE`) and type positions (`status: PartnerStatus`) keep\n// compiling. Where a new equivalent exists, the values align with the\n// `@happyvertical/smrt-sales` string-literal unions.\n// ---------------------------------------------------------------------------\n\n/**\n * Legacy partner status values.\n *\n * @deprecated Use the `EarnerStatus` union\n * (`'pending' | 'active' | 'suspended'`) from `@happyvertical/smrt-sales` —\n * the string values align exactly.\n */\nexport const PartnerStatus = Object.freeze({\n PENDING: 'pending',\n ACTIVE: 'active',\n SUSPENDED: 'suspended',\n} as const);\n/** @deprecated Use `EarnerStatus` from `@happyvertical/smrt-sales`. */\nexport type PartnerStatus = (typeof PartnerStatus)[keyof typeof PartnerStatus];\n\n/**\n * Legacy partner role values.\n *\n * @deprecated Partner roles have NO direct equivalent in\n * `@happyvertical/smrt-sales` — roles are now first-class models instead of a\n * JSON array on the financial account: use `Referrer` from\n * `@happyvertical/smrt-sales/referrals` and `SalesRepresentative` from\n * `@happyvertical/smrt-sales/crm` (each holds an `earnerId`); model\n * publisher-style roles in your application domain. See MIGRATION.md.\n */\nexport const PartnerType = Object.freeze({\n PUBLISHER: 'publisher',\n SALESPERSON: 'salesperson',\n REFERRER: 'referrer',\n} as const);\n/**\n * @deprecated Roles are first-class models in `@happyvertical/smrt-sales`\n * (`Referrer`, `SalesRepresentative`); see MIGRATION.md.\n */\nexport type PartnerType = (typeof PartnerType)[keyof typeof PartnerType];\n\n/**\n * Legacy commission type values.\n *\n * @deprecated Superseded by `CommissionPlan` component keys in\n * `@happyvertical/smrt-sales`: a versioned plan's `components` array replaces\n * the fixed display/referral/sales/parent/overhead taxonomy — each component\n * has its own `key`, `trigger`, `basis`, and `rate`, and every `Commission`\n * records the `componentKey` that produced it. See MIGRATION.md for a worked\n * plan reproducing the legacy waterfall.\n */\nexport const CommissionType = Object.freeze({\n DISPLAY: 'display',\n REFERRAL: 'referral',\n SALES: 'sales',\n PARENT: 'parent',\n OVERHEAD: 'overhead',\n} as const);\n/**\n * @deprecated Superseded by `CommissionPlan` component keys in\n * `@happyvertical/smrt-sales`; see MIGRATION.md.\n */\nexport type CommissionType =\n (typeof CommissionType)[keyof typeof CommissionType];\n\n/**\n * Legacy commission status values.\n *\n * @deprecated Use the `CommissionStatus` union\n * (`'pending' | 'earned' | 'approved' | 'payable' | 'paid'`) from\n * `@happyvertical/smrt-sales`. `PENDING` and `PAID` align; `INCLUDED` has no\n * direct equivalent — the nearest new state is `'payable'` with `payoutId`\n * set (a commission gathered into a payout batch). See MIGRATION.md.\n */\nexport const CommissionStatus = Object.freeze({\n PENDING: 'pending',\n INCLUDED: 'included',\n PAID: 'paid',\n} as const);\n/** @deprecated Use `CommissionStatus` from `@happyvertical/smrt-sales`. */\nexport type CommissionStatus =\n (typeof CommissionStatus)[keyof typeof CommissionStatus];\n\n/**\n * Legacy payout status values.\n *\n * @deprecated Use the `CommissionPayoutStatus` union\n * (`'pending' | 'approved' | 'processing' | 'completed' | 'failed' |\n * 'rejected'`) from `@happyvertical/smrt-sales` — the legacy value set is a\n * subset (legacy affiliates had no reject) and the shared string values\n * align exactly.\n */\nexport const PayoutStatus = Object.freeze({\n PENDING: 'pending',\n APPROVED: 'approved',\n PROCESSING: 'processing',\n COMPLETED: 'completed',\n FAILED: 'failed',\n} as const);\n/** @deprecated Use `CommissionPayoutStatus` from `@happyvertical/smrt-sales`. */\nexport type PayoutStatus = (typeof PayoutStatus)[keyof typeof PayoutStatus];\n\n/**\n * Legacy payout method values.\n *\n * @deprecated Use the `PayoutMethod` union\n * (`PAYOUT_METHODS`) from `@happyvertical/smrt-sales` — the legacy values\n * align exactly; the new union adds `'other'`, `'stripe_connect'`, and\n * `'crypto'`.\n */\nexport const PayoutMethod = Object.freeze({\n BANK_TRANSFER: 'bank_transfer',\n CHECK: 'check',\n PAYPAL: 'paypal',\n CREDIT: 'credit',\n} as const);\n/** @deprecated Use `PayoutMethod` from `@happyvertical/smrt-sales`. */\nexport type PayoutMethod = (typeof PayoutMethod)[keyof typeof PayoutMethod];\n"],"mappings":";;AAyFO,IAAM,gBAAgB,OAAO,OAAO;CACzC,SAAS;CACT,QAAQ;CACR,WAAW;AACb,CAAU;AAcH,IAAM,cAAc,OAAO,OAAO;CACvC,WAAW;CACX,aAAa;CACb,UAAU;AACZ,CAAU;AAiBH,IAAM,iBAAiB,OAAO,OAAO;CAC1C,SAAS;CACT,UAAU;CACV,OAAO;CACP,QAAQ;CACR,UAAU;AACZ,CAAU;AAiBH,IAAM,mBAAmB,OAAO,OAAO;CAC5C,SAAS;CACT,UAAU;CACV,MAAM;AACR,CAAU;AAcH,IAAM,eAAe,OAAO,OAAO;CACxC,SAAS;CACT,UAAU;CACV,YAAY;CACZ,WAAW;CACX,QAAQ;AACV,CAAU;AAYH,IAAM,eAAe,OAAO,OAAO;CACxC,eAAe;CACf,OAAO;CACP,QAAQ;CACR,QAAQ;AACV,CAAU"}
@@ -2,7 +2,7 @@
2
2
  "version": "1.0.0",
3
3
  "timestamp": 0,
4
4
  "packageName": "@happyvertical/smrt-affiliates",
5
- "packageVersion": "0.57.8",
5
+ "packageVersion": "0.57.10",
6
6
  "objects": {},
7
7
  "moduleType": "smrt",
8
8
  "smrtDependencies": [
@@ -3,13 +3,13 @@
3
3
  "sensitiveFieldsExcluded": true,
4
4
  "generatedAt": "1970-01-01T00:00:00.000Z",
5
5
  "packageName": "@happyvertical/smrt-affiliates",
6
- "packageVersion": "0.57.8",
6
+ "packageVersion": "0.57.10",
7
7
  "sourceManifestPath": "dist/manifest.json",
8
8
  "agentDocPath": "AGENTS.md",
9
9
  "sourceHashes": {
10
- "manifest": "b26495e8052dc35eb1c1d5a66798f56e519e3729f726c306110c736b52c899f2",
11
- "packageJson": "28d3047e75f7f4666e34fce8df2c3902f7bdb653428c11adbe26ab25e565bae2",
12
- "agents": "e88706ca8179c73de1d0cd0b851acac2d2cc1be37cb31c5f9f59529b9de03bf1"
10
+ "manifest": "7c9218d52b8390f08e9cda45cd7bd94b7b08ac3a25126042e20393ffbc738dca",
11
+ "packageJson": "ba22caced2491a5f3f6d780958ba3ecb9eaaf4040e429389a928e091e7414dbe",
12
+ "agents": "b0fe76bd0e1f8a8ab3b7e2294744d4a747207bc24c3d9220a6a71fa3fcd7083c"
13
13
  },
14
14
  "exports": [
15
15
  ".",
@@ -52,5 +52,5 @@
52
52
  "polymorphicAssociations": 0,
53
53
  "uuidColumns": 0
54
54
  },
55
- "agentDoc": "# @happyvertical/smrt-affiliates\n\n**DEPRECATED compatibility shim** over the `@happyvertical/smrt-sales`\ncommissions core. This package declares **no models and owns no persistence**\n— every export is a re-export (or a legacy-shaped alias) of the sales\npackage's neutral commissions module, kept so existing imports compile while\nconsumers migrate. It will be removed in a future major release.\n\n- Migration path (tables, columns, statuses, SQL sketches): `MIGRATION.md`\n in this package.\n- The real API: `packages/sales/AGENTS.md` (`commissions` module).\n\n## What the shim exports\n\n| Shim export | Actual thing |\n|---|---|\n| `Partner` / `PartnerCollection` | `Earner` / `EarnerCollection` from `@happyvertical/smrt-sales` (same class references) |\n| `Commission` / `CommissionCollection` | `Commission` / `CommissionCollection` from `@happyvertical/smrt-sales` (new shape) |\n| `Payout` / `PayoutCollection` | `CommissionPayout` / `CommissionPayoutCollection` from `@happyvertical/smrt-sales` |\n| `PartnerOptions` / `CommissionOptions` / `PayoutOptions` | `EarnerOptions` / `CommissionOptions` / `CommissionPayoutOptions` type aliases |\n| `PartnerStatus`, `PartnerType`, `CommissionType`, `CommissionStatus`, `PayoutStatus`, `PayoutMethod` | frozen `as const` objects preserving the exact legacy enum members/values, each with a matching derived type |\n\nThe shim deliberately does **not** re-export the rest of the new surface\n(no `Earner`-named exports, no plans/events/adjustments/services) — new code\nimports `@happyvertical/smrt-sales` directly.\n\n## Name/value mapping notes\n\n- `PartnerStatus` values align exactly with the `EarnerStatus` union.\n- `PayoutStatus` values are a subset of the `CommissionPayoutStatus` union\n (which adds `'rejected'`; legacy affiliates had no reject) — the shared\n string values align exactly. `PayoutMethod` values align with the new\n `PayoutMethod` union (which adds `'other'`).\n- `CommissionStatus.INCLUDED` (`'included'`) has **no direct equivalent**;\n the nearest new state is `'payable'` with `payoutId` set. `PENDING`/`PAID`\n align.\n- `PartnerType` has no equivalent — roles are first-class models now:\n `Referrer` (`@happyvertical/smrt-sales/referrals`) and\n `SalesRepresentative` (`@happyvertical/smrt-sales/crm`), each holding an\n `earnerId`.\n- `CommissionType` is superseded by `CommissionPlan` component keys.\n\n## Gotchas\n\n- **No manifest, no tables**: the package emits no SMRT objects; there is no\n `./manifest` export anymore. Data lives in the sales tables (`earners`,\n `commissions`, `commission_payouts`).\n- **Tenancy stance changed**: the legacy models were intentionally NOT\n tenant-scoped; the sales models are `@TenantScoped({ mode: 'optional' })`.\n Legacy rows migrate with `tenant_id = NULL` (global) — see `MIGRATION.md`.\n- **Do not add models here**: new commission features belong in\n `packages/sales/src/commissions/`.\n"
55
+ "agentDoc": "# @happyvertical/smrt-affiliates\n\n**DEPRECATED compatibility shim** over the `@happyvertical/smrt-sales`\ncommissions core. This package declares **no models and owns no persistence**\n— every export is a re-export (or a legacy-shaped alias) of the sales\npackage's neutral commissions module, kept so existing imports compile while\nconsumers migrate. It will be removed in a future major release.\n\n- Migration path (tables, columns, statuses, SQL sketches): `MIGRATION.md`\n in this package.\n- The real API: `packages/sales/AGENTS.md` (`commissions` module).\n\n## What the shim exports\n\n| Shim export | Actual thing |\n|---|---|\n| `Partner` / `PartnerCollection` | `Earner` / `EarnerCollection` from `@happyvertical/smrt-sales` (same class references) |\n| `Commission` / `CommissionCollection` | `Commission` / `CommissionCollection` from `@happyvertical/smrt-sales` (new shape) |\n| `Payout` / `PayoutCollection` | `CommissionPayout` / `CommissionPayoutCollection` from `@happyvertical/smrt-sales` |\n| `PartnerOptions` / `CommissionOptions` / `PayoutOptions` | `EarnerOptions` / `CommissionOptions` / `CommissionPayoutOptions` type aliases |\n| `PartnerStatus`, `PartnerType`, `CommissionType`, `CommissionStatus`, `PayoutStatus`, `PayoutMethod` | frozen `as const` objects preserving the exact legacy enum members/values, each with a matching derived type |\n\nThe shim deliberately does **not** re-export the rest of the new surface\n(no `Earner`-named exports, no plans/events/adjustments/services) — new code\nimports `@happyvertical/smrt-sales` directly.\n\n## Name/value mapping notes\n\n- `PartnerStatus` values align exactly with the `EarnerStatus` union.\n- `PayoutStatus` values are a subset of the `CommissionPayoutStatus` union\n (which adds `'rejected'`; legacy affiliates had no reject) — the shared\n string values align exactly. `PayoutMethod` values align with the new\n `PayoutMethod` union (which adds `'other'`, `'stripe_connect'`, and `'crypto'`).\n- `CommissionStatus.INCLUDED` (`'included'`) has **no direct equivalent**;\n the nearest new state is `'payable'` with `payoutId` set. `PENDING`/`PAID`\n align.\n- `PartnerType` has no equivalent — roles are first-class models now:\n `Referrer` (`@happyvertical/smrt-sales/referrals`) and\n `SalesRepresentative` (`@happyvertical/smrt-sales/crm`), each holding an\n `earnerId`.\n- `CommissionType` is superseded by `CommissionPlan` component keys.\n\n## Gotchas\n\n- **No manifest, no tables**: the package emits no SMRT objects; there is no\n `./manifest` export anymore. Data lives in the sales tables (`earners`,\n `commissions`, `commission_payouts`).\n- **Tenancy stance changed**: the legacy models were intentionally NOT\n tenant-scoped; the sales models are `@TenantScoped({ mode: 'optional' })`.\n Legacy rows migrate with `tenant_id = NULL` (global) — see `MIGRATION.md`.\n- **Do not add models here**: new commission features belong in\n `packages/sales/src/commissions/`.\n"
56
56
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@happyvertical/smrt-affiliates",
3
- "version": "0.57.8",
3
+ "version": "0.57.10",
4
4
  "description": "DEPRECATED compatibility shim over @happyvertical/smrt-sales — re-exports the legacy Partner/Commission/Payout names. See MIGRATION.md.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -20,10 +20,10 @@
20
20
  "./manifest.json": "./dist/manifest.json"
21
21
  },
22
22
  "dependencies": {
23
- "@happyvertical/smrt-sales": "0.57.8"
23
+ "@happyvertical/smrt-sales": "0.57.10"
24
24
  },
25
25
  "devDependencies": {
26
- "@happyvertical/smrt-vitest": "0.57.8",
26
+ "@happyvertical/smrt-vitest": "0.57.10",
27
27
  "@types/node": "24.13.6",
28
28
  "typescript": "6.0.3",
29
29
  "vite": "8.1.4",