@managesome/eposmatic-toolkit 0.4.94 → 0.4.95

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.
@@ -4,6 +4,7 @@ export const WORKER_ENDPOINTS = {
4
4
  UPDATE_CUSTOMER_INFO_ON_CREATE_ORDER: '/update-customer-info-on-create-order',
5
5
  UPDATE_CUSTOMER_INFO_ON_CANCEL_ORDER: '/update-customer-info-on-cancel-order',
6
6
  UPDATE_CUSTOMER_INFO_ON_SETTLE_ORDER: '/update-customer-info-on-settle-order',
7
+ SYNC_CUSTOMER_WALLET_ON_ORDER_UPDATE: '/sync-customer-wallet-on-order-update',
7
8
  CLEANUP_REWARDS_AND_ASSETS_ON_SETTLE_ORDER: '/cleanup-rewards-and-assets-on-settle-order',
8
9
  ADD_OFFER_FINGERPRINTS_ON_SETTLE_ORDER: '/add-offer-fingerprints-on-settle-order',
9
10
  RESERVE_CUSTOMER_REDEMPTIONS_FOR_ORDER: '/reserve-customer-redemptions-for-order',
@@ -3,6 +3,7 @@ export declare const WORKER_ENDPOINTS: {
3
3
  readonly UPDATE_CUSTOMER_INFO_ON_CREATE_ORDER: "/update-customer-info-on-create-order";
4
4
  readonly UPDATE_CUSTOMER_INFO_ON_CANCEL_ORDER: "/update-customer-info-on-cancel-order";
5
5
  readonly UPDATE_CUSTOMER_INFO_ON_SETTLE_ORDER: "/update-customer-info-on-settle-order";
6
+ readonly SYNC_CUSTOMER_WALLET_ON_ORDER_UPDATE: "/sync-customer-wallet-on-order-update";
6
7
  readonly CLEANUP_REWARDS_AND_ASSETS_ON_SETTLE_ORDER: "/cleanup-rewards-and-assets-on-settle-order";
7
8
  readonly ADD_OFFER_FINGERPRINTS_ON_SETTLE_ORDER: "/add-offer-fingerprints-on-settle-order";
8
9
  readonly RESERVE_CUSTOMER_REDEMPTIONS_FOR_ORDER: "/reserve-customer-redemptions-for-order";
@@ -7,6 +7,7 @@ exports.WORKER_ENDPOINTS = {
7
7
  UPDATE_CUSTOMER_INFO_ON_CREATE_ORDER: '/update-customer-info-on-create-order',
8
8
  UPDATE_CUSTOMER_INFO_ON_CANCEL_ORDER: '/update-customer-info-on-cancel-order',
9
9
  UPDATE_CUSTOMER_INFO_ON_SETTLE_ORDER: '/update-customer-info-on-settle-order',
10
+ SYNC_CUSTOMER_WALLET_ON_ORDER_UPDATE: '/sync-customer-wallet-on-order-update',
10
11
  CLEANUP_REWARDS_AND_ASSETS_ON_SETTLE_ORDER: '/cleanup-rewards-and-assets-on-settle-order',
11
12
  ADD_OFFER_FINGERPRINTS_ON_SETTLE_ORDER: '/add-offer-fingerprints-on-settle-order',
12
13
  RESERVE_CUSTOMER_REDEMPTIONS_FOR_ORDER: '/reserve-customer-redemptions-for-order',
@@ -34,6 +34,32 @@ export interface IWorker_UpdateCustomerInfoOnCancelOrder {
34
34
  brand_id: string;
35
35
  phoneNumber?: string;
36
36
  }
37
+ /**
38
+ * Order-update wallet sync. Fills the gap between the create-time
39
+ * out-of-wallet consumption and the settlement-time into-wallet grant: a
40
+ * `redeemed_offers` / `wallet_redemptions` change made through an order update
41
+ * must move the out-of-wallet delta (points, voucher pathway, cashback,
42
+ * gift cards) and update the redemption counters.
43
+ *
44
+ * The worker is idempotent per `(order._id, updateVersion)` and never rejects
45
+ * the order update.
46
+ */
47
+ export interface IWorker_SyncCustomerWalletOnOrderUpdate {
48
+ order: IOrder;
49
+ previousOrder: IOrder;
50
+ brand_id: string;
51
+ phoneNumber: string;
52
+ previousPhoneNumber: string;
53
+ /** `updatedOrder.updatedAt` ISO string — the idempotency version. */
54
+ updateVersion: string;
55
+ /**
56
+ * 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.
60
+ */
61
+ wasOrderAlreadySettled: boolean;
62
+ }
37
63
  export interface IWorker_AddOfferFingerprintsOnSettleOrder {
38
64
  order: IOrder;
39
65
  brand_id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@managesome/eposmatic-toolkit",
3
- "version": "0.4.94",
3
+ "version": "0.4.95",
4
4
  "description": "A Toolkit Library for Eposmatic",
5
5
  "main": "lib/index.js",
6
6
  "module": "esm/index.js",