@managesome/eposmatic-toolkit 0.2.540 → 0.2.542

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.
@@ -13,7 +13,7 @@ export declare function convertMilliToTime(milliseconds: number): {
13
13
  minutes: number;
14
14
  hours: number;
15
15
  };
16
- export declare function getHMS(milliseconds: number): string;
16
+ export declare function getHMS(milliseconds: number, showSeconds?: boolean): string;
17
17
  export declare function fakeDelay(delay?: number): Promise<void>;
18
18
  export declare const isValidNumber: RegExp;
19
19
  export declare function pxToRem(value: number): string;
@@ -110,17 +110,20 @@ function convertMilliToTime(milliseconds) {
110
110
  };
111
111
  }
112
112
  // ==============================>><<==============================
113
- function getHMS(milliseconds) {
113
+ function getHMS(milliseconds, showSeconds) {
114
114
  const date = new Date(milliseconds);
115
115
  let hours = date.getUTCHours();
116
116
  let minutes = date.getUTCMinutes();
117
- const seconds = '00';
117
+ let seconds = showSeconds ? date.getUTCSeconds() : 0;
118
118
  if (hours < 10) {
119
119
  hours = '0' + hours;
120
120
  }
121
121
  if (minutes < 10) {
122
122
  minutes = '0' + minutes;
123
123
  }
124
+ if (seconds < 10) {
125
+ seconds = '0' + seconds;
126
+ }
124
127
  return hours + ':' + minutes + ':' + seconds;
125
128
  }
126
129
  // ==============================>><<==============================
@@ -47,7 +47,7 @@ export * from './tenant_cash_drawer_sessions';
47
47
  export * from './tenant_cash_drawers';
48
48
  export * from './tenant_cash_in_hand_transactions';
49
49
  export * from './tenant_cash_in_out';
50
- export * from './tenant_days';
50
+ export * from './tenant_day_sessions';
51
51
  export * from './tenant_instore_shift_sessions';
52
52
  export * from './tenant_instore_shifts';
53
53
  export * from './tenant_inventory_department_transactions';
@@ -63,7 +63,7 @@ __exportStar(require("./tenant_cash_drawer_sessions"), exports);
63
63
  __exportStar(require("./tenant_cash_drawers"), exports);
64
64
  __exportStar(require("./tenant_cash_in_hand_transactions"), exports);
65
65
  __exportStar(require("./tenant_cash_in_out"), exports);
66
- __exportStar(require("./tenant_days"), exports);
66
+ __exportStar(require("./tenant_day_sessions"), exports);
67
67
  __exportStar(require("./tenant_instore_shift_sessions"), exports);
68
68
  __exportStar(require("./tenant_instore_shifts"), exports);
69
69
  __exportStar(require("./tenant_inventory_department_transactions"), exports);
@@ -1,5 +1,5 @@
1
1
  import { Schema } from 'mongoose';
2
- export declare const TenantDaySchema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
2
+ export declare const TenantDaySessionSchema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
3
3
  timestamps: true;
4
4
  versionKey: false;
5
5
  minimize: false;
@@ -131,4 +131,4 @@ export declare const TenantDaySchema: Schema<any, import("mongoose").Model<any,
131
131
  }> & {
132
132
  __v: number;
133
133
  }>;
134
- export declare const TENANT_DAYS_COLLECTION_NAME = "tenant_days";
134
+ export declare const TENANT_DAY_SESSIONS_COLLECTION_NAME = "tenant_day_sessions";
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TENANT_DAYS_COLLECTION_NAME = exports.TenantDaySchema = void 0;
3
+ exports.TENANT_DAY_SESSIONS_COLLECTION_NAME = exports.TenantDaySessionSchema = void 0;
4
4
  const mongoose_1 = require("mongoose");
5
5
  const constants_1 = require("../../constants");
6
6
  const common_models_1 = require("./common-models");
7
- const TenantDayOpeningSchema = new mongoose_1.Schema({
7
+ const TenantDaySessionOpeningSchema = new mongoose_1.Schema({
8
8
  staff_id: {
9
9
  type: String,
10
10
  required: true,
@@ -26,7 +26,7 @@ const TenantDayOpeningSchema = new mongoose_1.Schema({
26
26
  required: true,
27
27
  },
28
28
  }, { _id: false, minimize: false });
29
- const TenantDayClosingSchema = new mongoose_1.Schema({
29
+ const TenantDaySessionClosingSchema = new mongoose_1.Schema({
30
30
  staff_id: {
31
31
  type: String,
32
32
  required: true,
@@ -60,7 +60,7 @@ const TenantDayClosingSchema = new mongoose_1.Schema({
60
60
  default: null,
61
61
  },
62
62
  }, { _id: false, minimize: false });
63
- exports.TenantDaySchema = new mongoose_1.Schema({
63
+ exports.TenantDaySessionSchema = new mongoose_1.Schema({
64
64
  _id: {
65
65
  type: mongoose_1.Schema.Types.ObjectId,
66
66
  required: true,
@@ -78,11 +78,11 @@ exports.TenantDaySchema = new mongoose_1.Schema({
78
78
  required: true,
79
79
  },
80
80
  opening: {
81
- type: TenantDayOpeningSchema,
81
+ type: TenantDaySessionOpeningSchema,
82
82
  default: null,
83
83
  },
84
84
  closing: {
85
- type: TenantDayClosingSchema,
85
+ type: TenantDaySessionClosingSchema,
86
86
  default: null,
87
87
  },
88
88
  total_shifts: {
@@ -107,4 +107,4 @@ exports.TenantDaySchema = new mongoose_1.Schema({
107
107
  versionKey: false,
108
108
  minimize: false,
109
109
  });
110
- exports.TENANT_DAYS_COLLECTION_NAME = 'tenant_days';
110
+ exports.TENANT_DAY_SESSIONS_COLLECTION_NAME = 'tenant_day_sessions';
@@ -53,7 +53,7 @@ export * from './tenant_cash_drawer_sessions';
53
53
  export * from './tenant_cash_drawers';
54
54
  export * from './tenant_cash_in_hand_transactions';
55
55
  export * from './tenant_cash_in_out';
56
- export * from './tenant_days';
56
+ export * from './tenant_day_sessions';
57
57
  export * from './tenant_instore_shift_sessions';
58
58
  export * from './tenant_instore_shifts';
59
59
  export * from './tenant_metadata';
@@ -69,7 +69,7 @@ __exportStar(require("./tenant_cash_drawer_sessions"), exports);
69
69
  __exportStar(require("./tenant_cash_drawers"), exports);
70
70
  __exportStar(require("./tenant_cash_in_hand_transactions"), exports);
71
71
  __exportStar(require("./tenant_cash_in_out"), exports);
72
- __exportStar(require("./tenant_days"), exports);
72
+ __exportStar(require("./tenant_day_sessions"), exports);
73
73
  __exportStar(require("./tenant_instore_shift_sessions"), exports);
74
74
  __exportStar(require("./tenant_instore_shifts"), exports);
75
75
  __exportStar(require("./tenant_metadata"), exports);
@@ -1,13 +1,13 @@
1
1
  import { POS_DAY_STATUS_ENUM } from '../../constants';
2
2
  import { ILocalTimeFields } from '../../helpers';
3
- export interface ITenantDayOpening {
3
+ export interface ITenantDaySessionOpening {
4
4
  staff_id: string;
5
5
  staff_name: string;
6
6
  note: string;
7
7
  opened_at: Date;
8
8
  cash_amount: number;
9
9
  }
10
- export interface ITenantDayClosing {
10
+ export interface ITenantDaySessionClosing {
11
11
  staff_id: string;
12
12
  staff_name: string;
13
13
  note: string;
@@ -17,12 +17,12 @@ export interface ITenantDayClosing {
17
17
  difference: number;
18
18
  cash_in_out_id: string | null;
19
19
  }
20
- export interface ITenantDay extends ILocalTimeFields {
20
+ export interface ITenantDaySession extends ILocalTimeFields {
21
21
  _id: string;
22
22
  tenant_id: string;
23
23
  status: POS_DAY_STATUS_ENUM;
24
- opening: ITenantDayOpening | null;
25
- closing: ITenantDayClosing | null;
24
+ opening: ITenantDaySessionOpening | null;
25
+ closing: ITenantDaySessionClosing | null;
26
26
  total_shifts: number;
27
27
  createdAt: Date;
28
28
  updatedAt: Date;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@managesome/eposmatic-toolkit",
3
- "version": "0.2.540",
3
+ "version": "0.2.542",
4
4
  "description": "A Toolkit Library for Eposmatic",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",