@happyvertical/smrt-sales 0.57.34 → 0.57.36

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.
@@ -337,15 +337,8 @@ var Commission = class extends SmrtObject {
337
337
  * event/component carries the same `splitGroupId`. Empty for unsplit rows.
338
338
  */
339
339
  splitGroupId = "";
340
- /** The earned amount in integer cents. */
341
340
  amountCents = 0;
342
- /** ISO 4217 currency (copied from the earning event). */
343
341
  currency = "USD";
344
- /**
345
- * Lifecycle status — strict chain `pending → earned → approved → payable
346
- * → paid`. Mutate via the transition methods; the save-time guard rejects
347
- * illegal edges.
348
- */
349
342
  status = "pending";
350
343
  /**
351
344
  * End of the clearing window (refund/chargeback holdback). `null` means
@@ -564,10 +557,16 @@ var Commission = class extends SmrtObject {
564
557
  };
565
558
  __publicField$5(Commission, "__smrtPackage__", "@happyvertical/smrt-sales");
566
559
  __decorateClass$5([tenantId({ nullable: true })], Commission.prototype, "tenantId", 2);
567
- __decorateClass$5([foreignKey("Earner", { required: true })], Commission.prototype, "earnerId", 2);
560
+ __decorateClass$5([field({ description: "The affiliate who earned this commission." }), foreignKey("Earner", { required: true })], Commission.prototype, "earnerId", 2);
568
561
  __decorateClass$5([foreignKey("EarningEvent")], Commission.prototype, "earningEventId", 2);
562
+ __decorateClass$5([field({ description: "How much was earned, in the smallest unit of the currency." })], Commission.prototype, "amountCents", 2);
563
+ __decorateClass$5([field({ description: "The currency the commission is paid in." })], Commission.prototype, "currency", 2);
564
+ __decorateClass$5([field({ description: "Where the commission stands, from pending to paid." })], Commission.prototype, "status", 2);
569
565
  __decorateClass$5([foreignKey("CommissionPayout")], Commission.prototype, "payoutId", 2);
570
- __decorateClass$5([field({ required: true })], Commission.prototype, "dedupeKey", 2);
566
+ __decorateClass$5([field({
567
+ required: true,
568
+ description: "A reference that stops the same commission being recorded twice."
569
+ })], Commission.prototype, "dedupeKey", 2);
571
570
  Commission = __decorateClass$5([TenantScoped({ mode: "optional" }), smrt({
572
571
  conflictColumns: ["dedupe_key"],
573
572
  api: { include: [
@@ -826,9 +825,7 @@ var Earner = class extends SmrtObject {
826
825
  */
827
826
  kind = "person";
828
827
  profileId = "";
829
- /** Human-readable display name for portals and operator views. */
830
828
  displayName = "";
831
- /** Account lifecycle: `pending` (default) → `active` / `suspended`. */
832
829
  status = "pending";
833
830
  /** Preferred payout delivery method. */
834
831
  payoutMethod = "bank_transfer";
@@ -952,6 +949,8 @@ var Earner = class extends SmrtObject {
952
949
  __publicField$4(Earner, "__smrtPackage__", "@happyvertical/smrt-sales");
953
950
  __decorateClass$4([tenantId({ nullable: true })], Earner.prototype, "tenantId", 2);
954
951
  __decorateClass$4([crossPackageRef("@happyvertical/smrt-profiles:Profile")], Earner.prototype, "profileId", 2);
952
+ __decorateClass$4([field({ description: "The name this payee is paid under." })], Earner.prototype, "displayName", 2);
953
+ __decorateClass$4([field({ description: "Whether this payee can be paid." })], Earner.prototype, "status", 2);
955
954
  Earner = __decorateClass$4([TenantScoped({ mode: "optional" }), smrt({
956
955
  api: { include: [
957
956
  "list",
@@ -1010,12 +1009,7 @@ var CommissionPayout = class extends SmrtObject {
1010
1009
  * cents; clawbacks make it negative).
1011
1010
  */
1012
1011
  adjustmentTotalCents = 0;
1013
- /**
1014
- * Net amount remitted — must equal
1015
- * `commissionTotalCents + adjustmentTotalCents` (enforced on save).
1016
- */
1017
1012
  totalAmountCents = 0;
1018
- /** ISO 4217 currency of the batch. */
1019
1013
  currency = "USD";
1020
1014
  /** Delivery method for this batch (defaulted from the Earner). */
1021
1015
  payoutMethod = "bank_transfer";
@@ -1026,11 +1020,6 @@ var CommissionPayout = class extends SmrtObject {
1026
1020
  * Legacy/manual methods have no typed descriptor (`{}`).
1027
1021
  */
1028
1022
  payoutDestination = "{}";
1029
- /**
1030
- * Lifecycle status — see the class doc. Mutate via {@link approve} /
1031
- * {@link markProcessing} / {@link complete} / {@link fail} /
1032
- * {@link resetFromFailed}.
1033
- */
1034
1023
  status = "pending";
1035
1024
  /**
1036
1025
  * Payment reference recorded at completion (check number, transfer id,
@@ -1042,7 +1031,6 @@ var CommissionPayout = class extends SmrtObject {
1042
1031
  * id, …). Retained across failure/reset for audit.
1043
1032
  */
1044
1033
  providerRef = "";
1045
- /** When the payout completed. */
1046
1034
  paidAt = null;
1047
1035
  invoiceId = "";
1048
1036
  /** Operator notes — approval memos, failure reasons (append-only). */
@@ -1300,9 +1288,16 @@ ${memo}` : memo;
1300
1288
  };
1301
1289
  __publicField$3(CommissionPayout, "__smrtPackage__", "@happyvertical/smrt-sales");
1302
1290
  __decorateClass$3([tenantId({ nullable: true })], CommissionPayout.prototype, "tenantId", 2);
1303
- __decorateClass$3([foreignKey("Earner", { required: true })], CommissionPayout.prototype, "earnerId", 2);
1291
+ __decorateClass$3([field({ description: "The affiliate being paid." }), foreignKey("Earner", { required: true })], CommissionPayout.prototype, "earnerId", 2);
1292
+ __decorateClass$3([field({ description: "The total being paid, in the smallest unit of the currency." })], CommissionPayout.prototype, "totalAmountCents", 2);
1293
+ __decorateClass$3([field({ description: "The currency of the payment." })], CommissionPayout.prototype, "currency", 2);
1294
+ __decorateClass$3([field({ description: "Whether the payment is waiting, being sent, completed or failed." })], CommissionPayout.prototype, "status", 2);
1295
+ __decorateClass$3([field({ description: "When the payment went out." })], CommissionPayout.prototype, "paidAt", 2);
1304
1296
  __decorateClass$3([crossPackageRef("@happyvertical/smrt-commerce:Invoice")], CommissionPayout.prototype, "invoiceId", 2);
1305
- __decorateClass$3([field({ required: true })], CommissionPayout.prototype, "idempotencyKey", 2);
1297
+ __decorateClass$3([field({
1298
+ required: true,
1299
+ description: "A reference that stops the same payout being made twice."
1300
+ })], CommissionPayout.prototype, "idempotencyKey", 2);
1306
1301
  __decorateClass$3([field({ indexed: true })], CommissionPayout.prototype, "sourceId", 2);
1307
1302
  CommissionPayout = __decorateClass$3([TenantScoped({ mode: "optional" }), smrt({
1308
1303
  conflictColumns: ["idempotency_key"],
@@ -4404,4 +4399,4 @@ var EarnerAttributionService = class EarnerAttributionService {
4404
4399
  //#endregion
4405
4400
  export { ADJUSTMENT_SETTLEABLE_COMMISSION_STATUSES as A, PAYOUT_METHODS as B, calculateWaterfallWithPools as C, CommissionPayout as D, CommissionPayoutCollection as E, COMMISSION_STATUSES as F, Commission as G, WATERFALL_POOL_RESIDUAL_RULES as H, EARNER_KINDS as I, CommissionAdjustmentCollection as J, CommissionAdjustmentOperationCollection as K, EARNER_SOURCE_ATTRIBUTION_STATUSES as L, COMMISSION_BASES as M, COMMISSION_PAYOUT_STATUSES as N, Earner as O, COMMISSION_PLAN_STATUSES as P, EARNER_STATUSES as R, calculateWaterfall as S, validateWaterfallPlan as T, WATERFALL_POOL_ZERO_WEIGHT_RULES as U, PAYOUT_METHODS_REQUIRING_DESTINATION as V, CommissionCollection as W, CommissionAdjustment as Y, EarnerCollection as _, CommissionBalanceService as a, validateCommissionPlanComponents as b, CommissionAdjustmentValidationError as c, centsToAmount as d, roundCents as f, EarnerSourceAttribution as g, EarnerSourceAttributionCollection as h, CommissionCalculationService as i, COMMISSION_ADJUSTMENT_KINDS as j, validatePayoutDestination as k, amountToCents as l, EarningEvent as m, CommissionSettlementService as n, CommissionAdjustmentReplayConflictError as o, EarningEventCollection as p, CommissionAdjustmentOperation as q, CommissionPayoutService as r, CommissionAdjustmentService as s, EarnerAttributionService as t, calculateCommissionAmountCents as u, CommissionPlanCollection as v, prepareWaterfallPools as w, WaterfallRecipientResolverRegistry as x, CommissionPlan as y, EARNING_EVENT_KINDS as z };
4406
4401
 
4407
- //# sourceMappingURL=commissions-nMBMa0DT.js.map
4402
+ //# sourceMappingURL=commissions-DSVGf1ZX.js.map