@managesome/eposmatic-toolkit 0.4.95 → 0.4.97

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.
@@ -28,6 +28,14 @@ export interface IWorker_UpdateCustomerInfoOnSettleOrder {
28
28
  customerUid?: string;
29
29
  brand_id: string;
30
30
  phoneNumber: string;
31
+ /**
32
+ * The order state before this update. The producer supplies it only when
33
+ * this same update changed `redeemed_offers`/`wallet_redemptions` and the
34
+ * order settles. With `isNewOrder === false`, the worker applies the
35
+ * out-of-wallet delta from this snapshot; the full settlement rewards are
36
+ * already applied from `order`.
37
+ */
38
+ previousOrder?: IOrder;
31
39
  }
32
40
  export interface IWorker_UpdateCustomerInfoOnCancelOrder {
33
41
  order: IOrder;
@@ -41,8 +49,9 @@ export interface IWorker_UpdateCustomerInfoOnCancelOrder {
41
49
  * must move the out-of-wallet delta (points, voucher pathway, cashback,
42
50
  * gift cards) and update the redemption counters.
43
51
  *
44
- * The worker is idempotent per `(order._id, updateVersion)` and never rejects
45
- * the order update.
52
+ * The worker follows the same at-least-once semantics as the other customer
53
+ * sync workers: it does not dedupe a retried/duplicate Cloud Task. It never
54
+ * rejects the order update, and it no-ops for an already-settled order.
46
55
  */
47
56
  export interface IWorker_SyncCustomerWalletOnOrderUpdate {
48
57
  order: IOrder;
@@ -50,13 +59,13 @@ export interface IWorker_SyncCustomerWalletOnOrderUpdate {
50
59
  brand_id: string;
51
60
  phoneNumber: string;
52
61
  previousPhoneNumber: string;
53
- /** `updatedOrder.updatedAt` ISO string — the idempotency version. */
62
+ /** `updatedOrder.updatedAt` ISO string — used for observability/logging. */
54
63
  updateVersion: string;
55
64
  /**
56
65
  * True when the order was ALREADY fully paid BEFORE this update. The
57
- * settlement worker only grants into-wallet rewards for an order that was
58
- * not settled yet; an already-settled order edited afterwards has no settle
59
- * run, so this worker must apply the added into-wallet delta itself.
66
+ * producer does not dispatch this worker for such an update, and the worker
67
+ * no-ops if it receives one: post-settlement reward/offer/wallet changes are
68
+ * not entertained.
60
69
  */
61
70
  wasOrderAlreadySettled: boolean;
62
71
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@managesome/eposmatic-toolkit",
3
- "version": "0.4.95",
3
+ "version": "0.4.97",
4
4
  "description": "A Toolkit Library for Eposmatic",
5
5
  "main": "lib/index.js",
6
6
  "module": "esm/index.js",