@feedmepos/mf-hrm-portal 2.3.2-dev.9 → 2.3.2

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.
Files changed (114) hide show
  1. package/dist/{ApprovalCodeList-gb0bre9J.js → ApprovalCodeList-C9r8CGNH.js} +15 -14
  2. package/dist/{AuditLogList-9cwS6bL7.js → AuditLogList-Cu-KcQKa.js} +152 -147
  3. package/dist/ConditionBuilderForm.vue_vue_type_script_setup_true_lang-BQ-uIsTN.js +438 -0
  4. package/dist/EmployeeList-BaFqZnFM.js +776 -0
  5. package/dist/FormItem.vue_vue_type_script_setup_true_lang-Be1OU1_r.js +45 -0
  6. package/dist/FormSection.vue_vue_type_script_setup_true_lang-DknXTYiK.js +49 -0
  7. package/dist/{GrantUserList-yU2NqFVO.js → GrantUserList-Bjhx60M7.js} +16 -15
  8. package/dist/Main-CJQpjOgY.js +96 -0
  9. package/dist/{Main-4KwMqF3h.js → Main-DHiTgiDR.js} +5 -5
  10. package/dist/{Main-BS_Lk_eB.js → Main-LpfQqR_u.js} +999 -1005
  11. package/dist/PasscodePinField.vue_vue_type_script_setup_true_lang-CqG0v0Sz.js +243 -0
  12. package/dist/{PermissionSetList-D7SS1iAr.js → PermissionSetList-C0OZ_dvE.js} +80 -80
  13. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-T7dkd5Uv.js +4167 -0
  14. package/dist/PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-EwU7gHP7.js +35 -0
  15. package/dist/RoleList-DpyW5XLs.js +740 -0
  16. package/dist/{ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang--dsZOhnv.js → ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-CqP-Dn1X.js} +1 -1
  17. package/dist/{ScheduleGeneralPage-Pq6ufiDu.js → ScheduleGeneralPage-BNHi5jGf.js} +2 -2
  18. package/dist/{ScheduleModal.vue_vue_type_script_setup_true_lang-DKFJLsTW.js → ScheduleModal.vue_vue_type_script_setup_true_lang-B609MZoP.js} +186 -187
  19. package/dist/{SchedulePage-8EAOfiJx.js → SchedulePage-CrP5_m3p.js} +13 -13
  20. package/dist/{SchedulePositionPage-CGXeUnju.js → SchedulePositionPage-ei_NKAUw.js} +3 -3
  21. package/dist/{SelectFilter-C-UEVLla.js → SelectFilter-CEYQ-ViE.js} +1 -1
  22. package/dist/TeamMemberList-rPiKKu2b.js +1154 -0
  23. package/dist/TimesheetList-B1L4WkNh.js +402 -0
  24. package/dist/TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-By6YR-k2.js +58 -0
  25. package/dist/{app-BohKQtlz.js → app-BzlH-2cN.js} +4015 -7796
  26. package/dist/app.js +3 -3
  27. package/dist/{approval-code-Bfvxsg8h.js → approval-code-CWq2ce3u.js} +1 -1
  28. package/dist/{dayjs.min-C0MqTPg1.js → dayjs.min-D6T4JzVv.js} +21 -21
  29. package/dist/employee-Bw7kRokg.js +209 -0
  30. package/dist/{grant-user-LZ3b6siI.js → grant-user-q_mkj3Vh.js} +1 -1
  31. package/dist/{index-DDDG-LHm.js → iteration-Dz0e08VH.js} +726 -698
  32. package/dist/{lodash-BRqMda7F.js → lodash-DGG_-VgI.js} +1 -1
  33. package/dist/restaurant-DJBQY9N5.js +2688 -0
  34. package/dist/role-CiRbkZSm.js +92 -0
  35. package/dist/rule-DMgkHpva.js +783 -0
  36. package/dist/src/api/employee/index.d.ts +2 -1
  37. package/dist/src/api/timesheet/index.d.ts +1 -1
  38. package/dist/src/components/CollapsibleWrapper.vue.d.ts +3 -11
  39. package/dist/src/helpers/permission-set.d.ts +102 -1
  40. package/dist/src/helpers/rule.d.ts +2 -2
  41. package/dist/src/helpers/string.d.ts +1 -10
  42. package/dist/src/router/shared.d.ts +1 -3
  43. package/dist/src/stores/employee.d.ts +7 -1
  44. package/dist/src/stores/restaurant.d.ts +8 -68
  45. package/dist/src/stores/team.d.ts +0 -30
  46. package/dist/src/stores/timesheet.d.ts +51 -66
  47. package/dist/src/types/team.d.ts +1 -17
  48. package/dist/src/types/timesheet.d.ts +0 -3
  49. package/dist/src/views/audit-log/constants.d.ts +1 -1
  50. package/dist/src/views/audit-log/locales/index.d.ts +16 -12
  51. package/dist/src/views/hr/locales/index.d.ts +0 -20
  52. package/dist/src/views/hr/role/RoleForm.vue.d.ts +2 -29
  53. package/dist/src/views/scheduling/composables/useScheduleOnboardingAvailability.d.ts +1 -1
  54. package/dist/src/views/scheduling/composables/useScheduleOnboardingWizard.d.ts +1 -1
  55. package/dist/src/views/scheduling/composables/useScheduleShiftDraft.d.ts +1 -1
  56. package/dist/src/views/scheduling/composables/useScheduleShiftPopover.d.ts +1 -1
  57. package/dist/src/views/team/components/BasePermission.vue.d.ts +0 -11
  58. package/dist/src/views/team/components/ConditionPermission.vue.d.ts +0 -11
  59. package/dist/src/views/team/components/PortalPermissionEditor.vue.d.ts +0 -21
  60. package/dist/src/views/team/components/PosRolePermission.vue.d.ts +0 -11
  61. package/dist/src/views/team/locales/index.d.ts +0 -716
  62. package/dist/src/views/team/member/AddMemberForm.vue.d.ts +3 -48
  63. package/dist/src/views/team/{components/MemberStatusBadge.vue.d.ts → member/MemberInfo.vue.d.ts} +2 -2
  64. package/dist/src/views/team/member/TeamMemberList.vue.d.ts +0 -1
  65. package/dist/string-VNuQNweN.js +15 -0
  66. package/dist/style.css +1 -1
  67. package/dist/tsconfig.app.tsbuildinfo +1 -1
  68. package/dist/{useAppStore-DV13z6oc.js → useAppStore-TRX-PQD4.js} +1 -1
  69. package/dist/{useLoading-Fcnnfywt.js → useLoading-W3YSF8OB.js} +1 -1
  70. package/dist/{useReportPermissions-BcyVoKVq.js → useReportPermissions-CCkCAaGO.js} +13 -13
  71. package/package.json +3 -3
  72. package/dist/ConditionBuilderForm.vue_vue_type_script_setup_true_lang-DR-c15gr.js +0 -459
  73. package/dist/EmployeeList-DjyoW1we.js +0 -896
  74. package/dist/FormSection.vue_vue_type_script_setup_true_lang-BBWlADve.js +0 -90
  75. package/dist/Main-BuG7SPnC.js +0 -101
  76. package/dist/MyPosProfile-CuDzRaRS.js +0 -360
  77. package/dist/PasscodePinField.vue_vue_type_script_setup_true_lang-TXPEqa46.js +0 -126
  78. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-u1UlV2Aw.js +0 -4208
  79. package/dist/PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-CYkv2x_y.js +0 -1831
  80. package/dist/RoleForm.vue_vue_type_script_setup_true_lang-hiMgwiya.js +0 -547
  81. package/dist/RoleList-B3P-LQYV.js +0 -265
  82. package/dist/TeamMemberList-Bd1O44Ur.js +0 -2087
  83. package/dist/TimesheetList-CSCmigCM.js +0 -437
  84. package/dist/employee-DWxT78W2.js +0 -172
  85. package/dist/iteration-CcXrOMQe.js +0 -30
  86. package/dist/member-grant-a3AGCWfT.js +0 -54
  87. package/dist/restaurant-pL7vHt-H.js +0 -52
  88. package/dist/role--EKCVqho.js +0 -98
  89. package/dist/rule-Db3gFVHx.js +0 -843
  90. package/dist/src/api/my-pos-profile/index.d.ts +0 -3
  91. package/dist/src/api/sso-provider/index.d.ts +0 -5
  92. package/dist/src/api/staff-invite/index.d.ts +0 -16
  93. package/dist/src/components/form/SegmentedTabs.vue.d.ts +0 -23
  94. package/dist/src/composables/useMenuAccess.d.ts +0 -56
  95. package/dist/src/composables/useSsoProviders.d.ts +0 -19
  96. package/dist/src/composables/useStaffInviteProviders.d.ts +0 -8
  97. package/dist/src/helpers/member-grant.d.ts +0 -36
  98. package/dist/src/helpers/my-pos-profile.d.ts +0 -37
  99. package/dist/src/helpers/pos-assignment-rows.d.ts +0 -28
  100. package/dist/src/helpers/staff-invite.d.ts +0 -54
  101. package/dist/src/router/menu-access-guard.d.ts +0 -17
  102. package/dist/src/types/my-pos-profile.d.ts +0 -24
  103. package/dist/src/types/sso-provider.d.ts +0 -10
  104. package/dist/src/types/staff-invite.d.ts +0 -100
  105. package/dist/src/views/my-pos-profile/MyPosProfile.vue.d.ts +0 -2
  106. package/dist/src/views/my-pos-profile/components/PasscodeChangedDialog.vue.d.ts +0 -4
  107. package/dist/src/views/my-pos-profile/locales/index.d.ts +0 -236
  108. package/dist/src/views/team/components/MemberGrantFields.vue.d.ts +0 -51
  109. package/dist/src/views/team/components/PosAssignmentRows.vue.d.ts +0 -44
  110. package/dist/src/views/team/member/ExistingMemberNotice.vue.d.ts +0 -11
  111. package/dist/src/views/team/member/MemberDetailsCard.vue.d.ts +0 -35
  112. package/dist/src/views/team/member/MemberHeaderCard.vue.d.ts +0 -19
  113. package/dist/string-DZQ1uNjn.js +0 -22
  114. package/dist/timesheet-NYW1P4rf.js +0 -76
@@ -1,236 +0,0 @@
1
- import * as enUS from './en-US.json';
2
- export type AppMessagesSchema = typeof enUS;
3
- export declare const i18nMessages: {
4
- 'en-US': {
5
- myPosProfile: {
6
- title: string;
7
- subtitle: string;
8
- table: {
9
- columns: {
10
- name: string;
11
- contact: string;
12
- restaurant: string;
13
- role: string;
14
- };
15
- };
16
- passcode: {
17
- title: string;
18
- updated: string;
19
- updatedJustNow: string;
20
- show: string;
21
- hide: string;
22
- change: string;
23
- empty: string;
24
- emptyHint: string;
25
- generate: string;
26
- };
27
- change: {
28
- title: string;
29
- message: string;
30
- failed: string;
31
- exhausted: string;
32
- inProgress: string;
33
- incomplete: string;
34
- };
35
- generate: {
36
- failed: string;
37
- };
38
- changed: {
39
- title: string;
40
- message: string;
41
- done: string;
42
- };
43
- generated: {
44
- title: string;
45
- message: string;
46
- };
47
- manageAccount: {
48
- message: string;
49
- link: string;
50
- failed: string;
51
- };
52
- noPosUser: {
53
- title: string;
54
- description: string;
55
- };
56
- loadFailed: string;
57
- shared: {
58
- message: string;
59
- };
60
- };
61
- };
62
- 'zh-CN': {
63
- myPosProfile: {
64
- title: string;
65
- subtitle: string;
66
- table: {
67
- columns: {
68
- name: string;
69
- contact: string;
70
- restaurant: string;
71
- role: string;
72
- };
73
- };
74
- passcode: {
75
- title: string;
76
- updated: string;
77
- updatedJustNow: string;
78
- show: string;
79
- hide: string;
80
- change: string;
81
- empty: string;
82
- emptyHint: string;
83
- generate: string;
84
- };
85
- change: {
86
- title: string;
87
- message: string;
88
- failed: string;
89
- exhausted: string;
90
- inProgress: string;
91
- incomplete: string;
92
- };
93
- generate: {
94
- failed: string;
95
- };
96
- changed: {
97
- title: string;
98
- message: string;
99
- done: string;
100
- };
101
- generated: {
102
- title: string;
103
- message: string;
104
- };
105
- manageAccount: {
106
- message: string;
107
- link: string;
108
- failed: string;
109
- };
110
- noPosUser: {
111
- title: string;
112
- description: string;
113
- };
114
- loadFailed: string;
115
- shared: {
116
- message: string;
117
- };
118
- };
119
- };
120
- 'th-TH': {
121
- myPosProfile: {
122
- title: string;
123
- subtitle: string;
124
- table: {
125
- columns: {
126
- name: string;
127
- contact: string;
128
- restaurant: string;
129
- role: string;
130
- };
131
- };
132
- passcode: {
133
- title: string;
134
- updated: string;
135
- updatedJustNow: string;
136
- show: string;
137
- hide: string;
138
- change: string;
139
- empty: string;
140
- emptyHint: string;
141
- generate: string;
142
- };
143
- change: {
144
- title: string;
145
- message: string;
146
- failed: string;
147
- exhausted: string;
148
- inProgress: string;
149
- incomplete: string;
150
- };
151
- generate: {
152
- failed: string;
153
- };
154
- changed: {
155
- title: string;
156
- message: string;
157
- done: string;
158
- };
159
- generated: {
160
- title: string;
161
- message: string;
162
- };
163
- manageAccount: {
164
- message: string;
165
- link: string;
166
- failed: string;
167
- };
168
- noPosUser: {
169
- title: string;
170
- description: string;
171
- };
172
- loadFailed: string;
173
- shared: {
174
- message: string;
175
- };
176
- };
177
- };
178
- 'zh-Hant': {
179
- myPosProfile: {
180
- title: string;
181
- subtitle: string;
182
- table: {
183
- columns: {
184
- name: string;
185
- contact: string;
186
- restaurant: string;
187
- role: string;
188
- };
189
- };
190
- passcode: {
191
- title: string;
192
- updated: string;
193
- updatedJustNow: string;
194
- show: string;
195
- hide: string;
196
- change: string;
197
- empty: string;
198
- emptyHint: string;
199
- generate: string;
200
- };
201
- change: {
202
- title: string;
203
- message: string;
204
- failed: string;
205
- exhausted: string;
206
- inProgress: string;
207
- incomplete: string;
208
- };
209
- generate: {
210
- failed: string;
211
- };
212
- changed: {
213
- title: string;
214
- message: string;
215
- done: string;
216
- };
217
- generated: {
218
- title: string;
219
- message: string;
220
- };
221
- manageAccount: {
222
- message: string;
223
- link: string;
224
- failed: string;
225
- };
226
- noPosUser: {
227
- title: string;
228
- description: string;
229
- };
230
- loadFailed: string;
231
- shared: {
232
- message: string;
233
- };
234
- };
235
- };
236
- };
@@ -1,51 +0,0 @@
1
- import type { RawRule } from '@casl/ability';
2
- import { type PropType } from 'vue';
3
- import { FdoPermissionRule } from '@feedmepos/core/entity';
4
- import { type MemberGrantPayload } from '@/helpers/member-grant';
5
- import { type IFdtoPermissionPosUser } from '@/types/team';
6
- /** The saved grant being edited. A new `id` resets the form. */
7
- export interface MemberGrantInitialValue {
8
- id: string;
9
- isOwner?: boolean;
10
- name: string;
11
- permissions: RawRule[] | FdoPermissionRule[];
12
- permissionSetIds: string[];
13
- posUser?: IFdtoPermissionPosUser;
14
- posUserId?: string;
15
- }
16
- declare function isModified(): boolean;
17
- declare function readGrantData(): MemberGrantPayload;
18
- declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
19
- initialValue: {
20
- type: PropType<MemberGrantInitialValue | null>;
21
- };
22
- /** Name to fall back on when neither the saved grant nor the POS user has one. */
23
- fallbackName: {
24
- type: StringConstructor;
25
- default: string;
26
- };
27
- loading: {
28
- type: BooleanConstructor;
29
- default: boolean;
30
- };
31
- }>, {
32
- readGrantData: typeof readGrantData;
33
- isModified: typeof isModified;
34
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
35
- initialValue: {
36
- type: PropType<MemberGrantInitialValue | null>;
37
- };
38
- /** Name to fall back on when neither the saved grant nor the POS user has one. */
39
- fallbackName: {
40
- type: StringConstructor;
41
- default: string;
42
- };
43
- loading: {
44
- type: BooleanConstructor;
45
- default: boolean;
46
- };
47
- }>> & Readonly<{}>, {
48
- loading: boolean;
49
- fallbackName: string;
50
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
51
- export default _default;
@@ -1,44 +0,0 @@
1
- import { type PropType } from 'vue';
2
- import type { HrmRestaurant } from '@/types/restaurant';
3
- import type { Role } from '@/types/role';
4
- import type { IFdtoPermissionPosUserRole } from '@/types/team';
5
- declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
6
- modelValue: {
7
- type: PropType<IFdtoPermissionPosUserRole[]>;
8
- required: true;
9
- };
10
- restaurants: {
11
- type: PropType<HrmRestaurant[]>;
12
- required: true;
13
- };
14
- roles: {
15
- type: PropType<Role[]>;
16
- required: true;
17
- };
18
- isRoleUsable: {
19
- type: PropType<(role: Role) => boolean>;
20
- required: true;
21
- };
22
- }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
23
- "update:modelValue": (roles: IFdtoPermissionPosUserRole[]) => any;
24
- }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
25
- modelValue: {
26
- type: PropType<IFdtoPermissionPosUserRole[]>;
27
- required: true;
28
- };
29
- restaurants: {
30
- type: PropType<HrmRestaurant[]>;
31
- required: true;
32
- };
33
- roles: {
34
- type: PropType<Role[]>;
35
- required: true;
36
- };
37
- isRoleUsable: {
38
- type: PropType<(role: Role) => boolean>;
39
- required: true;
40
- };
41
- }>> & Readonly<{
42
- "onUpdate:modelValue"?: ((roles: IFdtoPermissionPosUserRole[]) => any) | undefined;
43
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
44
- export default _default;
@@ -1,11 +0,0 @@
1
- import type { IFdtoStaffInviteLookup, StaffInviteMatch } from '@/types/staff-invite';
2
- type __VLS_Props = {
3
- existing: IFdtoStaffInviteLookup;
4
- match: StaffInviteMatch;
5
- };
6
- declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
7
- update: () => any;
8
- }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
9
- onUpdate?: (() => any) | undefined;
10
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
11
- export default _default;
@@ -1,35 +0,0 @@
1
- import { type PropType } from 'vue';
2
- import type { IFdtoStaffInviteLookup, IFdtoStaffInviteProvider, StaffInviteMatch } from '@/types/staff-invite';
3
- /** What the Member details card contributes to an invite. */
4
- export interface MemberDetails {
5
- provider: string;
6
- match: StaffInviteMatch;
7
- mobile?: string;
8
- email?: string;
9
- displayName: string;
10
- employeeId?: string;
11
- }
12
- declare function readDetails(): MemberDetails;
13
- declare function isModified(): boolean;
14
- declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
15
- providers: {
16
- type: PropType<IFdtoStaffInviteProvider[]>;
17
- required: true;
18
- };
19
- }>, {
20
- readDetails: typeof readDetails;
21
- isModified: typeof isModified;
22
- /** Add is blocked while the key belongs to someone already. */
23
- hasExisting: import("vue").ComputedRef<boolean>;
24
- providerLabel: import("vue").ComputedRef<string>;
25
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
26
- "update-existing": (existing: IFdtoStaffInviteLookup) => any;
27
- }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
28
- providers: {
29
- type: PropType<IFdtoStaffInviteProvider[]>;
30
- required: true;
31
- };
32
- }>> & Readonly<{
33
- "onUpdate-existing"?: ((existing: IFdtoStaffInviteLookup) => any) | undefined;
34
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
35
- export default _default;
@@ -1,19 +0,0 @@
1
- import type { TeamMemberStatus } from '@/types/team';
2
- type __VLS_Props = {
3
- name: string;
4
- status: TeamMemberStatus;
5
- email?: string;
6
- phoneNumber?: string;
7
- };
8
- declare var __VLS_4: {};
9
- type __VLS_Slots = {} & {
10
- default?: (props: typeof __VLS_4) => any;
11
- };
12
- declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
- declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
14
- export default _default;
15
- type __VLS_WithSlots<T, S> = T & {
16
- new (): {
17
- $slots: S;
18
- };
19
- };
@@ -1,22 +0,0 @@
1
- function a(r, t) {
2
- let n = "", e = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
3
- const l = e.length;
4
- for (let i = 0; i < r; i++)
5
- n += e.charAt(Math.floor(Math.random() * l));
6
- return n;
7
- }
8
- function c(r, t, n = 2) {
9
- if (r === null) return t.all;
10
- if (r.length === 0) return t.none;
11
- const e = r.slice(0, n).join(", ");
12
- return r.length > n ? `${e} ${t.more(r.length - n)}` : e;
13
- }
14
- function o(r) {
15
- const t = (r ?? "").trim().split(/\s+/).filter(Boolean);
16
- return t.length === 0 ? "" : t.length === 1 ? t[0].slice(0, 2) : t[0].charAt(0) + t[1].charAt(0);
17
- }
18
- export {
19
- o as n,
20
- a as r,
21
- c as s
22
- };
@@ -1,76 +0,0 @@
1
- import { d as f } from "./dayjs.min-C0MqTPg1.js";
2
- import { defineStore as I, storeToRefs as v } from "pinia";
3
- import { ref as w } from "vue";
4
- import { b as T, g as D } from "./app-BohKQtlz.js";
5
- import { s as y } from "./iteration-CcXrOMQe.js";
6
- import { i as S, f as O } from "./utils-BZkjJbju.js";
7
- import { u as Y } from "./restaurant-pL7vHt-H.js";
8
- const d = {
9
- async readTimesheets(t, r, a) {
10
- return D(
11
- await T().get("timesheet", {
12
- params: { start: t, end: r, restaurantIds: a }
13
- })
14
- );
15
- },
16
- async updateTimesheet(t, r) {
17
- await T().put(`timesheet/${t}`, r);
18
- }
19
- };
20
- function g(t) {
21
- const r = t.map((a) => {
22
- const { startedAt: o, endedAt: n } = a, i = f(S(o)), e = n ? f(S(n)) : null, m = (e == null ? void 0 : e.diff(i, "minute", !1)) || 0, u = e ? O(m) : "", c = "YYYY-MM-DD hh:mm a";
23
- return {
24
- ...a,
25
- start: i.format(c),
26
- end: e ? e.format(c) : "",
27
- totalMin: m,
28
- duration: u
29
- };
30
- });
31
- return y(r, { selector: "start" });
32
- }
33
- let h = 0;
34
- const q = I("hrm-timesheet", () => {
35
- const t = w([]);
36
- async function r(o, n, i) {
37
- const e = f(o).startOf("day").toISOString(), m = f(n).endOf("day").toISOString(), u = i ?? Y().restaurants.value.map((s) => s._id), c = ++h;
38
- if (u.length === 0) {
39
- const s = await d.readTimesheets(e, m);
40
- c === h && (t.value = g(s));
41
- return;
42
- }
43
- t.value = [];
44
- const l = 10, p = [];
45
- for (let s = 0; s < u.length; s += l)
46
- p.push(
47
- d.readTimesheets(e, m, u.slice(s, s + l)).then((A) => {
48
- c === h && (t.value = y([...t.value, ...g(A)], {
49
- selector: "start"
50
- }));
51
- })
52
- );
53
- await Promise.all(p);
54
- }
55
- async function a(o, n, i) {
56
- await d.updateTimesheet(o.restaurantId, {
57
- id: o._id,
58
- startAt: n,
59
- endAt: i
60
- });
61
- }
62
- return {
63
- timesheets: t,
64
- readTimesheet: r,
65
- updateTimesheet: a
66
- };
67
- }), j = () => {
68
- const t = q();
69
- return {
70
- ...t,
71
- ...v(t)
72
- };
73
- };
74
- export {
75
- j as u
76
- };