@managesome/eposmatic-toolkit 0.2.625 → 0.2.627

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.
@@ -154,6 +154,12 @@ function generateOrderOnCreate(order, withIterations) {
154
154
  if (!newOrder.is_reopened) {
155
155
  delete newOrder.is_reopened;
156
156
  }
157
+ if (!newOrder.synced_offline) {
158
+ delete newOrder.synced_offline;
159
+ }
160
+ if (!newOrder.is_unpaid) {
161
+ delete newOrder.is_unpaid;
162
+ }
157
163
  if (!newOrder.delivery_details) {
158
164
  delete newOrder.delivery_details;
159
165
  }
@@ -334,6 +340,14 @@ function generateOrderOnUpdate(partialUpdatedOrder) {
334
340
  delete set.is_reopened;
335
341
  unset['is_reopened'] = '';
336
342
  }
343
+ if (set.synced_offline === false) {
344
+ delete set.synced_offline;
345
+ unset['synced_offline'] = '';
346
+ }
347
+ if (set.is_unpaid === false) {
348
+ delete set.is_unpaid;
349
+ unset['is_unpaid'] = '';
350
+ }
337
351
  if (set.delivery_details === null) {
338
352
  delete set.delivery_details;
339
353
  unset['delivery_details'] = '';
@@ -138,6 +138,7 @@ export declare function getChangeCourseStatusData(data: Partial<IOrder>, course_
138
138
  synced_offline?: boolean | undefined;
139
139
  is_reopened?: boolean | undefined;
140
140
  deferred_settlement?: boolean | undefined;
141
+ is_unpaid?: boolean | undefined;
141
142
  payment_method_expected?: import("../../constants").PAYMENT_METHOD_EXPECTED_ENUM | undefined;
142
143
  order_taker_details?: (import("../../schemas").IStaffDetails | null) | undefined;
143
144
  redeemed_offers?: (Record<string, number> | null) | undefined;
@@ -360,6 +360,7 @@ function getOrderWithAllFields(order, skipItemMetadata) {
360
360
  review: order['review'] ?? null,
361
361
  is_reopened: order['is_reopened'] ?? false,
362
362
  synced_offline: order['synced_offline'] ?? false,
363
+ is_unpaid: order['is_unpaid'] ?? false,
363
364
  deferred_settlement: order['deferred_settlement'] ?? false,
364
365
  split_parent_id: order['split_parent_id'] ?? null,
365
366
  split_child_ids: order['split_child_ids'] ?? null,
@@ -69,6 +69,7 @@ offers: IOffer[]): {
69
69
  synced_offline?: boolean | undefined;
70
70
  is_reopened?: boolean | undefined;
71
71
  deferred_settlement?: boolean | undefined;
72
+ is_unpaid?: boolean | undefined;
72
73
  payment_method_expected?: import("../../constants").PAYMENT_METHOD_EXPECTED_ENUM | undefined;
73
74
  order_taker_details?: (import("../../schemas").IStaffDetails | null) | undefined;
74
75
  order_settled_at?: Date | undefined;
@@ -48,4 +48,4 @@ export declare function getLocalDocumentFields(gmtOffset: number, date: Date): {
48
48
  * from the actual `order_settled_at` timestamp expressed in the tenant's time
49
49
  * zone (`operational_time_zone_offset_gmt`).
50
50
  */
51
- export declare function getLocalFieldsFromLocalDate(localDate: string, operational_time_zone_offset_gmt: number, order_settled_at: Date): ILocalTimeFields;
51
+ export declare function getLocalFieldsFromLocalDate(localDate: string, operational_time_zone_offset_gmt: number, createdAt: Date): ILocalTimeFields;
@@ -114,7 +114,7 @@ function getLocalDocumentFields(gmtOffset, date) {
114
114
  * from the actual `order_settled_at` timestamp expressed in the tenant's time
115
115
  * zone (`operational_time_zone_offset_gmt`).
116
116
  */
117
- function getLocalFieldsFromLocalDate(localDate, operational_time_zone_offset_gmt, order_settled_at) {
117
+ function getLocalFieldsFromLocalDate(localDate, operational_time_zone_offset_gmt, createdAt) {
118
118
  const [localYear, localMonth, localDay] = localDate.split('-').map(Number);
119
119
  // localDate is already the tenant's local calendar date, so every date
120
120
  // component is derived directly from the string using pure calendar math
@@ -130,7 +130,7 @@ function getLocalFieldsFromLocalDate(localDate, operational_time_zone_offset_gmt
130
130
  // Time components come from the actual settle timestamp in the tenant's
131
131
  // timezone. The timestamp is normalized with new Date() since callers pass
132
132
  // the field straight from the order (which may be a Date or an ISO string).
133
- const timeFields = getLocalDocumentFields(operational_time_zone_offset_gmt, new Date(order_settled_at));
133
+ const timeFields = getLocalDocumentFields(operational_time_zone_offset_gmt, new Date(createdAt));
134
134
  return {
135
135
  day_index: constants_1.ALL_DAY_INDEX[weekday],
136
136
  localDate,
@@ -5085,6 +5085,7 @@ export declare const OrderSchema: Schema<any, import("mongoose").Model<any, any,
5085
5085
  rating?: number | null | undefined;
5086
5086
  review?: string | null | undefined;
5087
5087
  synced_offline?: boolean | null | undefined;
5088
+ is_unpaid?: boolean | null | undefined;
5088
5089
  payment_method_expected?: import("../../constants").PAYMENT_METHOD_EXPECTED_ENUM | null | undefined;
5089
5090
  order_taker_details?: {
5090
5091
  staff_id: string;
@@ -10191,6 +10192,7 @@ export declare const OrderSchema: Schema<any, import("mongoose").Model<any, any,
10191
10192
  rating?: number | null | undefined;
10192
10193
  review?: string | null | undefined;
10193
10194
  synced_offline?: boolean | null | undefined;
10195
+ is_unpaid?: boolean | null | undefined;
10194
10196
  payment_method_expected?: import("../../constants").PAYMENT_METHOD_EXPECTED_ENUM | null | undefined;
10195
10197
  order_taker_details?: {
10196
10198
  staff_id: string;
@@ -15297,6 +15299,7 @@ export declare const OrderSchema: Schema<any, import("mongoose").Model<any, any,
15297
15299
  rating?: number | null | undefined;
15298
15300
  review?: string | null | undefined;
15299
15301
  synced_offline?: boolean | null | undefined;
15302
+ is_unpaid?: boolean | null | undefined;
15300
15303
  payment_method_expected?: import("../../constants").PAYMENT_METHOD_EXPECTED_ENUM | null | undefined;
15301
15304
  order_taker_details?: {
15302
15305
  staff_id: string;
@@ -825,6 +825,10 @@ exports.OrderSchema = new mongoose_1.Schema({
825
825
  type: Boolean,
826
826
  required: false,
827
827
  },
828
+ is_unpaid: {
829
+ type: Boolean,
830
+ required: false,
831
+ },
828
832
  deferred_settlement: {
829
833
  type: Boolean,
830
834
  required: false,
@@ -230,6 +230,7 @@ export interface IOrder extends CommonOptionalFields, Partial<ILocalTimeFields>
230
230
  synced_offline?: boolean;
231
231
  is_reopened?: boolean;
232
232
  deferred_settlement?: boolean;
233
+ is_unpaid?: boolean;
233
234
  payment_method_expected?: PAYMENT_METHOD_EXPECTED_ENUM;
234
235
  order_taker_details?: IStaffDetails | null;
235
236
  redeemed_offers?: Record<string, number> | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@managesome/eposmatic-toolkit",
3
- "version": "0.2.625",
3
+ "version": "0.2.627",
4
4
  "description": "A Toolkit Library for Eposmatic",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",