@managesome/eposmatic-toolkit 0.2.483 → 0.2.485

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.
@@ -178,7 +178,7 @@ function generateOrderOnCreate(order, withIterations) {
178
178
  if (!newOrder.order_taker_details) {
179
179
  delete newOrder.order_taker_details;
180
180
  }
181
- if (!newOrder.source_tenant_id) {
181
+ if (!newOrder.source_tenant_id || (newOrder.tenant_id != null && newOrder.source_tenant_id === newOrder.tenant_id)) {
182
182
  delete newOrder.source_tenant_id;
183
183
  }
184
184
  if (!newOrder.redeemed_offers || Object.keys(newOrder.redeemed_offers).length === 0) {
@@ -363,7 +363,7 @@ function generateOrderOnUpdate(partialUpdatedOrder) {
363
363
  delete set.order_taker_details;
364
364
  unset['order_taker_details'] = '';
365
365
  }
366
- if (set.source_tenant_id === null) {
366
+ if (set.source_tenant_id === null || (set.tenant_id != null && set.source_tenant_id === set.tenant_id)) {
367
367
  delete set.source_tenant_id;
368
368
  unset['source_tenant_id'] = '';
369
369
  }
@@ -210,6 +210,12 @@ function getOrderWithPrice(order, toCents) {
210
210
  : {}),
211
211
  };
212
212
  if (toCents) {
213
+ if (payload.source_tenant_id != null) {
214
+ payload.source_tenant_id =
215
+ payload.tenant_id != null && payload.tenant_id === payload.source_tenant_id
216
+ ? null
217
+ : payload.source_tenant_id;
218
+ }
213
219
  const orderType = order.platform != null ? order.platform.split('_')[1] : null;
214
220
  if (orderType != null) {
215
221
  if (orderType === constants_1.ORDER_TYPE_ENUM.DINE_IN) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@managesome/eposmatic-toolkit",
3
- "version": "0.2.483",
3
+ "version": "0.2.485",
4
4
  "description": "A Toolkit Library for Eposmatic",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",