@feedmepos/mf-hrm-portal 2.1.1-dev → 2.1.1-dev.3
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.
- package/dist/ApprovalCodeList-BH5sgVMU.js +638 -0
- package/dist/AuditLogList-Q4L5Te8O.js +1145 -0
- package/dist/CollapsibleWrapper.vue_vue_type_script_setup_true_lang-BLJlmPVa.js +58 -0
- package/dist/EmployeeList-GtKmJZbf.js +899 -0
- package/dist/GrantUserList-CnLjOi5_.js +468 -0
- package/dist/Main-Cn7Dawg4.js +120 -0
- package/dist/{Main-mTxcltDY.js → Main-DLlpEU3j.js} +11 -9
- package/dist/{Main-BLRr_ORG.js → Main-cskEZ3k_.js} +1033 -1035
- package/dist/PermissionSetList-C2fK2pTz.js +357 -0
- package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-CMh0DL1_.js +3458 -0
- package/dist/{PortalUserSearcher.vue_vue_type_style_index_0_scoped_79737e32_lang-Czo3FLbc.js → PortalUserSearcher.vue_vue_type_style_index_0_scoped_a439fdd8_lang-BJp9hEfv.js} +1 -2
- package/dist/ResponsiveFabButton.vue_vue_type_script_setup_true_lang-Cn-3MRBO.js +38 -0
- package/dist/RoleList-CcuT1ERb.js +567 -0
- package/dist/TeamMemberList-Dfs2iNdC.js +1131 -0
- package/dist/{TimesheetList-D21j4zLV.js → TimesheetList-B1H_6zfP.js} +136 -141
- package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_2c7a177a_lang-CRmmIfTk.js → TimesheetList.vue_vue_type_style_index_0_scoped_91afda4e_lang-DeTpbaRk.js} +14 -13
- package/dist/{app-CX-St7pv.js → app-DX-PG6wx.js} +2725 -5281
- package/dist/app.js +1 -1
- package/dist/approval-code-Q4666xp5.js +58 -0
- package/dist/{dayjs.min-MDoe5X-P.js → dayjs.min-BJrHE7oz.js} +1 -1
- package/dist/{employee-B2cdx2t4.js → employee-BJcqtqLM.js} +27 -26
- package/dist/grant-user-CQZaTzVt.js +67 -0
- package/dist/{TableEmptyState.vue_vue_type_script_setup_true_lang-Ci_MVqGK.js → index.vue_vue_type_script_setup_true_lang-BVVwfd7B.js} +19 -50
- package/dist/iteration-Cfaqt-0s.js +7682 -0
- package/dist/{lodash-DZAGPZLQ.js → lodash-ClKqCmlZ.js} +1 -1
- package/dist/restaurant-YOVMuuFY.js +1876 -0
- package/dist/role-CR_-nBDY.js +82 -0
- package/dist/rule-BB-3S-2R.js +996 -0
- package/dist/src/api/approval-code/index.d.ts +7 -0
- package/dist/src/api/audit-log/index.d.ts +0 -6
- package/dist/src/components/CheckboxInput.vue.d.ts +1 -1
- package/dist/src/components/button/ResponsiveFabButton.vue.d.ts +1 -7
- package/dist/src/components/table/TableEmptyState.vue.d.ts +15 -7
- package/dist/src/composables/useBasePermission.d.ts +1 -2
- package/dist/src/helpers/permission-set.d.ts +4 -8
- package/dist/src/helpers/rule.d.ts +1 -2
- package/dist/src/router/shared.d.ts +3 -1
- package/dist/src/stores/approval-code.d.ts +140 -0
- package/dist/src/stores/permission-set.d.ts +3 -12
- package/dist/src/types/approval-code.d.ts +99 -0
- package/dist/src/types/audit-log.d.ts +1 -1
- package/dist/src/views/approval-code/ApprovalCodeList.vue.d.ts +26 -0
- package/dist/src/views/approval-code/components/ApprovalCodeForm.vue.d.ts +17 -0
- package/dist/src/views/approval-code/locales/index.d.ts +320 -0
- package/dist/src/views/audit-log/locales/index.d.ts +0 -296
- package/dist/src/views/hr/employee/EmployeeList.vue.d.ts +0 -1
- package/dist/src/views/pos-access/locales/index.d.ts +48 -0
- package/dist/src/views/team/components/BasePermission.vue.d.ts +0 -13
- package/dist/src/views/team/locales/index.d.ts +0 -72
- package/dist/style.css +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/useAppStore-DNTlIeMv.js +93 -0
- package/dist/useDebounce-CWb5QR9G.js +28 -0
- package/dist/{useLoading-qgSjOzRD.js → useLoading-BH02lYns.js} +1 -1
- package/dist/{useReportPermissions-CIhkjN3B.js → useReportPermissions-ybHA26cJ.js} +3 -3
- package/package.json +2 -2
- package/dist/AuditLogList-Cvp-5_0y.js +0 -1608
- package/dist/ConditionFormHost.vue_vue_type_script_setup_true_lang-Cb8-YaiH.js +0 -387
- package/dist/EmployeeList-DgrD3Hjm.js +0 -884
- package/dist/Main-G3am-0Xi.js +0 -577
- package/dist/PermissionSetList-OzyfE-Yg.js +0 -392
- package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-Ca2NnAAF.js +0 -4121
- package/dist/ResponsiveFabButton.vue_vue_type_script_setup_true_lang-QrqYEy8i.js +0 -42
- package/dist/RoleList-DOZ5RJ6A.js +0 -684
- package/dist/Skeleton.vue_vue_type_script_setup_true_lang-B4PxNMwq.js +0 -16
- package/dist/TeamMemberList-CAqLUyQK.js +0 -1186
- package/dist/iteration-B38iapI_.js +0 -9556
- package/dist/rule-DftQBR76.js +0 -1057
- package/dist/src/composables/useConditionDraft.d.ts +0 -40
- package/dist/src/composables/useCoverConditionOverride.d.ts +0 -61
- package/dist/src/helpers/business-timezone.d.ts +0 -22
- package/dist/src/helpers/filter.d.ts +0 -15
- package/dist/src/helpers/permission-reconcile.d.ts +0 -15
- package/dist/src/helpers/permission-reconcile.test.d.ts +0 -1
- package/dist/src/views/audit-log/event-line.d.ts +0 -13
- package/dist/src/views/audit-log/snapshot-diff.d.ts +0 -11
- package/dist/src/views/team/condition-builders/ConditionFormHost.vue.d.ts +0 -22
- package/dist/src/views/team/condition-builders/ConditionFormRenderer.vue.d.ts +0 -23
- package/dist/src/views/team/condition-builders/component-map.d.ts +0 -4
- package/dist/src/views/team/condition-builders/condition-form-dedupe.d.ts +0 -23
- package/dist/useAppStore-BBsP5C3E.js +0 -169
- package/dist/useDebounce-B8ZPVS5C.js +0 -15
- /package/dist/src/views/{grant → pos-access}/Main.vue.d.ts +0 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { IFdtoApprovalCode, IFdtoCreateApprovalCodeReq } from '@/types/approval-code';
|
|
2
|
+
declare const ApprovalCodeAPI: {
|
|
3
|
+
getApprovalCodes(): Promise<IFdtoApprovalCode[]>;
|
|
4
|
+
createApprovalCodes(dto: IFdtoCreateApprovalCodeReq): Promise<IFdtoApprovalCode[]>;
|
|
5
|
+
revokeApprovalCode(id: string, restaurantId: string): Promise<IFdtoApprovalCode>;
|
|
6
|
+
};
|
|
7
|
+
export default ApprovalCodeAPI;
|
|
@@ -9,9 +9,6 @@ declare const AuditLogAPI: {
|
|
|
9
9
|
actions?: string[];
|
|
10
10
|
outcomes?: string[];
|
|
11
11
|
feedmeAdminActors?: boolean;
|
|
12
|
-
search?: string;
|
|
13
|
-
searchUserIds?: string[];
|
|
14
|
-
searchSubjects?: string[];
|
|
15
12
|
}): Promise<number>;
|
|
16
13
|
read(params?: {
|
|
17
14
|
limit?: number;
|
|
@@ -24,9 +21,6 @@ declare const AuditLogAPI: {
|
|
|
24
21
|
actions?: string[];
|
|
25
22
|
outcomes?: string[];
|
|
26
23
|
feedmeAdminActors?: boolean;
|
|
27
|
-
search?: string;
|
|
28
|
-
searchUserIds?: string[];
|
|
29
|
-
searchSubjects?: string[];
|
|
30
24
|
}): Promise<AuditLogEntry[]>;
|
|
31
25
|
/**
|
|
32
26
|
* FeedMe-admin options for the User filter. `actors` is the named admin list (internal
|
|
@@ -141,8 +141,8 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
141
141
|
}>> & Readonly<{
|
|
142
142
|
"onUpdate:model-value"?: ((...args: any[]) => any) | undefined;
|
|
143
143
|
}>, {
|
|
144
|
-
min: number;
|
|
145
144
|
max: number;
|
|
145
|
+
min: number;
|
|
146
146
|
disable: boolean;
|
|
147
147
|
showAllToggle: string | boolean;
|
|
148
148
|
includeDisabledOptionsWhenSelectAll: boolean;
|
|
@@ -1,9 +1,3 @@
|
|
|
1
1
|
import { type FmButtonProps } from '@feedmepos/ui-library';
|
|
2
|
-
|
|
3
|
-
/** Whether the page has a fixed bottom footer (e.g. a pagination bar) the mobile FAB should raise above. */
|
|
4
|
-
hasFooterBelow?: boolean;
|
|
5
|
-
}
|
|
6
|
-
declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
7
|
-
hasFooterBelow: boolean;
|
|
8
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
2
|
+
declare const _default: import("vue").DefineComponent<FmButtonProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<FmButtonProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
3
|
export default _default;
|
|
@@ -5,22 +5,30 @@ interface Props {
|
|
|
5
5
|
isEmpty: boolean;
|
|
6
6
|
isLoading?: boolean;
|
|
7
7
|
/**
|
|
8
|
-
* At what width do the column titles disappear?
|
|
9
|
-
*
|
|
10
|
-
* mirror the wrapped FmTable's own `shrink-at` prop (both default to "sm"); pass
|
|
11
|
-
* the table never collapses.
|
|
8
|
+
* At what width do the column titles disappear? The table's column labels are gone at/below
|
|
9
|
+
* this breakpoint, so the empty state should move outside instead of overlaying the table
|
|
10
|
+
* body. Must mirror the wrapped FmTable's own `shrink-at` prop (both default to "sm"); pass
|
|
11
|
+
* `false` if the table never collapses.
|
|
12
12
|
*/
|
|
13
13
|
collapseAt?: Breakpoints | false;
|
|
14
|
+
/**
|
|
15
|
+
* At what width do we hide the table completely because there's a separate mobile view taking
|
|
16
|
+
* over? For callers that render their own alternate view (e.g. a mobile FmList) at/below this
|
|
17
|
+
* breakpoint. Pass `false` if the table has no alternate view and should stay visible at every
|
|
18
|
+
* breakpoint.
|
|
19
|
+
*/
|
|
20
|
+
hideTableBelow?: Breakpoints | false;
|
|
14
21
|
}
|
|
15
|
-
declare var
|
|
16
|
-
|
|
22
|
+
declare var __VLS_5: {
|
|
23
|
+
isTableCollapsed: boolean;
|
|
17
24
|
};
|
|
18
25
|
type __VLS_Slots = {} & {
|
|
19
|
-
default?: (props: typeof
|
|
26
|
+
default?: (props: typeof __VLS_5) => any;
|
|
20
27
|
};
|
|
21
28
|
declare const __VLS_component: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
22
29
|
isLoading: boolean;
|
|
23
30
|
collapseAt: Breakpoints | false;
|
|
31
|
+
hideTableBelow: Breakpoints | false;
|
|
24
32
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
25
33
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
26
34
|
export default _default;
|
|
@@ -7,7 +7,6 @@ export type CategoryGroup = {
|
|
|
7
7
|
options: {
|
|
8
8
|
label: string;
|
|
9
9
|
value: string;
|
|
10
|
-
optionKey: string;
|
|
11
10
|
}[];
|
|
12
11
|
selectedSubjects: string[];
|
|
13
12
|
isMultiAction: boolean;
|
|
@@ -26,7 +25,7 @@ export declare function useBasePermission(modelValue: Readonly<Ref<FdoPermission
|
|
|
26
25
|
toggleAllManage: (group: CategoryGroup) => void;
|
|
27
26
|
isManageChecked: (group: CategoryGroup, subject: string) => boolean;
|
|
28
27
|
isManageIndeterminate: (group: CategoryGroup, subject: string) => boolean;
|
|
29
|
-
toggleManage: (
|
|
28
|
+
toggleManage: (_group: CategoryGroup, subject: string, checked: boolean) => void;
|
|
30
29
|
hasNonManageActions: (group: CategoryGroup, subject: string) => boolean;
|
|
31
30
|
isActionChecked: (group: CategoryGroup, subject: string, action: string) => boolean;
|
|
32
31
|
isRowFullyCoveredByCover: (group: CategoryGroup, subject: string) => boolean;
|
|
@@ -71,14 +71,10 @@ export declare function filterStalePermissions(permissions: FdoPermissionRule[],
|
|
|
71
71
|
* `allCustomReports` positive grant, preventing redundant data from being saved.
|
|
72
72
|
*
|
|
73
73
|
* - If the cover rule has `manage` selected → every individual rule in that bucket is
|
|
74
|
-
* fully covered and dropped entirely
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
* `manage` is a real CASL wildcard grant that implies every action, not merely a
|
|
79
|
-
* shorthand for "all non-manage actions selected" — a rule carrying `manage` is
|
|
80
|
-
* pushed through UNCHANGED (a cover lacking `manage` cannot cover it). Stripping its
|
|
81
|
-
* constituent actions and then dropping `manage` would destroy the user's grant.
|
|
74
|
+
* fully covered and dropped entirely.
|
|
75
|
+
* - Otherwise, only covered non-manage actions are stripped from individual rules.
|
|
76
|
+
* If `manage` was present and any non-manage action is stripped (breaking the
|
|
77
|
+
* "manage = all non-manage selected" invariant), `manage` is also stripped.
|
|
82
78
|
* Rules that end up with no remaining actions are dropped.
|
|
83
79
|
*
|
|
84
80
|
* Inverted rules and the cover subjects themselves pass through untouched.
|
|
@@ -20,8 +20,7 @@ export declare function getMaxDiscount(rules: FdoPermissionRule[]): number;
|
|
|
20
20
|
export declare function getManagableRestaurantIds(rules: (FdoPermissionRule | RawRule)[]): string[] | null;
|
|
21
21
|
export declare function hasAdminRule(rules: FdoPermissionRule[]): boolean;
|
|
22
22
|
export declare function usableRoleIds(rules: (FdoPermissionRule | RawRule)[]): string[] | null;
|
|
23
|
-
export declare function
|
|
24
|
-
export declare function fromValue(values: string[], maxDiscountPercentage: number, periodConditions?: Map<string, Record<string, unknown>>): {
|
|
23
|
+
export declare function fromValue(values: string[], maxDiscountPercentage: number): {
|
|
25
24
|
subject: string;
|
|
26
25
|
actions: ("delete" | "create" | "update" | "read" | "manage")[];
|
|
27
26
|
conditions: object;
|
|
@@ -8,7 +8,9 @@ export declare enum RouteName {
|
|
|
8
8
|
TEAM = "team",
|
|
9
9
|
TEAM_MEMBER = "team-member",
|
|
10
10
|
TEAM_ROLE = "team-role",
|
|
11
|
-
|
|
11
|
+
POS_ACCESS = "pos-access",
|
|
12
|
+
POS_GRANT = "pos-grant",
|
|
13
|
+
APPROVAL_CODE = "approval-code"
|
|
12
14
|
}
|
|
13
15
|
declare const routes: RouteRecordRaw[];
|
|
14
16
|
export { routes };
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import type { IFdtoApprovalCode, IFdtoCreateApprovalCodeReq } from '@/types/approval-code';
|
|
2
|
+
export declare const useApprovalCodeStore: import("pinia").StoreDefinition<"approvalCode", Pick<{
|
|
3
|
+
approvalCodes: import("vue").Ref<{
|
|
4
|
+
_id: string;
|
|
5
|
+
businessId: string;
|
|
6
|
+
restaurantId: string;
|
|
7
|
+
passcode: string;
|
|
8
|
+
name: string;
|
|
9
|
+
type: "approval";
|
|
10
|
+
permissions: {
|
|
11
|
+
key: import("@/types/approval-code").ApprovalCodePermission;
|
|
12
|
+
subject: string;
|
|
13
|
+
actions: string[];
|
|
14
|
+
conditions?: Record<string, unknown> | undefined;
|
|
15
|
+
}[];
|
|
16
|
+
status: "active" | "used" | "revoked";
|
|
17
|
+
usedAt?: string | undefined;
|
|
18
|
+
revokedAt?: string | undefined;
|
|
19
|
+
grantById: string;
|
|
20
|
+
grantByName: string;
|
|
21
|
+
createdAt: string;
|
|
22
|
+
updatedAt: string;
|
|
23
|
+
}[], IFdtoApprovalCode[] | {
|
|
24
|
+
_id: string;
|
|
25
|
+
businessId: string;
|
|
26
|
+
restaurantId: string;
|
|
27
|
+
passcode: string;
|
|
28
|
+
name: string;
|
|
29
|
+
type: "approval";
|
|
30
|
+
permissions: {
|
|
31
|
+
key: import("@/types/approval-code").ApprovalCodePermission;
|
|
32
|
+
subject: string;
|
|
33
|
+
actions: string[];
|
|
34
|
+
conditions?: Record<string, unknown> | undefined;
|
|
35
|
+
}[];
|
|
36
|
+
status: "active" | "used" | "revoked";
|
|
37
|
+
usedAt?: string | undefined;
|
|
38
|
+
revokedAt?: string | undefined;
|
|
39
|
+
grantById: string;
|
|
40
|
+
grantByName: string;
|
|
41
|
+
createdAt: string;
|
|
42
|
+
updatedAt: string;
|
|
43
|
+
}[]>;
|
|
44
|
+
isLoading: import("vue").Ref<boolean, boolean>;
|
|
45
|
+
readApprovalCodes: () => Promise<void>;
|
|
46
|
+
createApprovalCodes: (dto: IFdtoCreateApprovalCodeReq) => Promise<IFdtoApprovalCode[]>;
|
|
47
|
+
revokeApprovalCode: (id: string, restaurantId: string) => Promise<void>;
|
|
48
|
+
}, "isLoading" | "approvalCodes">, Pick<{
|
|
49
|
+
approvalCodes: import("vue").Ref<{
|
|
50
|
+
_id: string;
|
|
51
|
+
businessId: string;
|
|
52
|
+
restaurantId: string;
|
|
53
|
+
passcode: string;
|
|
54
|
+
name: string;
|
|
55
|
+
type: "approval";
|
|
56
|
+
permissions: {
|
|
57
|
+
key: import("@/types/approval-code").ApprovalCodePermission;
|
|
58
|
+
subject: string;
|
|
59
|
+
actions: string[];
|
|
60
|
+
conditions?: Record<string, unknown> | undefined;
|
|
61
|
+
}[];
|
|
62
|
+
status: "active" | "used" | "revoked";
|
|
63
|
+
usedAt?: string | undefined;
|
|
64
|
+
revokedAt?: string | undefined;
|
|
65
|
+
grantById: string;
|
|
66
|
+
grantByName: string;
|
|
67
|
+
createdAt: string;
|
|
68
|
+
updatedAt: string;
|
|
69
|
+
}[], IFdtoApprovalCode[] | {
|
|
70
|
+
_id: string;
|
|
71
|
+
businessId: string;
|
|
72
|
+
restaurantId: string;
|
|
73
|
+
passcode: string;
|
|
74
|
+
name: string;
|
|
75
|
+
type: "approval";
|
|
76
|
+
permissions: {
|
|
77
|
+
key: import("@/types/approval-code").ApprovalCodePermission;
|
|
78
|
+
subject: string;
|
|
79
|
+
actions: string[];
|
|
80
|
+
conditions?: Record<string, unknown> | undefined;
|
|
81
|
+
}[];
|
|
82
|
+
status: "active" | "used" | "revoked";
|
|
83
|
+
usedAt?: string | undefined;
|
|
84
|
+
revokedAt?: string | undefined;
|
|
85
|
+
grantById: string;
|
|
86
|
+
grantByName: string;
|
|
87
|
+
createdAt: string;
|
|
88
|
+
updatedAt: string;
|
|
89
|
+
}[]>;
|
|
90
|
+
isLoading: import("vue").Ref<boolean, boolean>;
|
|
91
|
+
readApprovalCodes: () => Promise<void>;
|
|
92
|
+
createApprovalCodes: (dto: IFdtoCreateApprovalCodeReq) => Promise<IFdtoApprovalCode[]>;
|
|
93
|
+
revokeApprovalCode: (id: string, restaurantId: string) => Promise<void>;
|
|
94
|
+
}, never>, Pick<{
|
|
95
|
+
approvalCodes: import("vue").Ref<{
|
|
96
|
+
_id: string;
|
|
97
|
+
businessId: string;
|
|
98
|
+
restaurantId: string;
|
|
99
|
+
passcode: string;
|
|
100
|
+
name: string;
|
|
101
|
+
type: "approval";
|
|
102
|
+
permissions: {
|
|
103
|
+
key: import("@/types/approval-code").ApprovalCodePermission;
|
|
104
|
+
subject: string;
|
|
105
|
+
actions: string[];
|
|
106
|
+
conditions?: Record<string, unknown> | undefined;
|
|
107
|
+
}[];
|
|
108
|
+
status: "active" | "used" | "revoked";
|
|
109
|
+
usedAt?: string | undefined;
|
|
110
|
+
revokedAt?: string | undefined;
|
|
111
|
+
grantById: string;
|
|
112
|
+
grantByName: string;
|
|
113
|
+
createdAt: string;
|
|
114
|
+
updatedAt: string;
|
|
115
|
+
}[], IFdtoApprovalCode[] | {
|
|
116
|
+
_id: string;
|
|
117
|
+
businessId: string;
|
|
118
|
+
restaurantId: string;
|
|
119
|
+
passcode: string;
|
|
120
|
+
name: string;
|
|
121
|
+
type: "approval";
|
|
122
|
+
permissions: {
|
|
123
|
+
key: import("@/types/approval-code").ApprovalCodePermission;
|
|
124
|
+
subject: string;
|
|
125
|
+
actions: string[];
|
|
126
|
+
conditions?: Record<string, unknown> | undefined;
|
|
127
|
+
}[];
|
|
128
|
+
status: "active" | "used" | "revoked";
|
|
129
|
+
usedAt?: string | undefined;
|
|
130
|
+
revokedAt?: string | undefined;
|
|
131
|
+
grantById: string;
|
|
132
|
+
grantByName: string;
|
|
133
|
+
createdAt: string;
|
|
134
|
+
updatedAt: string;
|
|
135
|
+
}[]>;
|
|
136
|
+
isLoading: import("vue").Ref<boolean, boolean>;
|
|
137
|
+
readApprovalCodes: () => Promise<void>;
|
|
138
|
+
createApprovalCodes: (dto: IFdtoCreateApprovalCodeReq) => Promise<IFdtoApprovalCode[]>;
|
|
139
|
+
revokeApprovalCode: (id: string, restaurantId: string) => Promise<void>;
|
|
140
|
+
}, "readApprovalCodes" | "createApprovalCodes" | "revokeApprovalCode">>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { IFdtoPermissionSet, IFdtoCreatePermissionSetReq, IFdtoUpdatePermissionSetReq } from '@/types/permission-set';
|
|
2
2
|
export declare const usePermissionSetStore: () => {
|
|
3
|
-
isLoading: import("vue").Ref<boolean, boolean>;
|
|
4
3
|
permissionSets: import("vue").Ref<{
|
|
5
4
|
id: string;
|
|
6
5
|
permissions: {
|
|
@@ -31,7 +30,6 @@ export declare const usePermissionSetStore: () => {
|
|
|
31
30
|
name: string;
|
|
32
31
|
}[]>;
|
|
33
32
|
$state: {
|
|
34
|
-
isLoading: boolean;
|
|
35
33
|
permissionSets: {
|
|
36
34
|
id: string;
|
|
37
35
|
permissions: {
|
|
@@ -77,14 +75,12 @@ export declare const usePermissionSetStore: () => {
|
|
|
77
75
|
businessId: string;
|
|
78
76
|
name: string;
|
|
79
77
|
}[]>;
|
|
80
|
-
isLoading: import("vue").Ref<boolean, boolean>;
|
|
81
78
|
readPermissionSets: () => Promise<void>;
|
|
82
79
|
createPermissionSet: (dto: IFdtoCreatePermissionSetReq) => Promise<void>;
|
|
83
80
|
updatePermissionSet: (id: string, dto: IFdtoUpdatePermissionSetReq) => Promise<void>;
|
|
84
81
|
deletePermissionSet: (id: string) => Promise<void>;
|
|
85
|
-
}, "
|
|
82
|
+
}, "permissionSets">>;
|
|
86
83
|
$patch(partialState: import("pinia")._DeepPartial<{
|
|
87
|
-
isLoading: boolean;
|
|
88
84
|
permissionSets: {
|
|
89
85
|
id: string;
|
|
90
86
|
permissions: {
|
|
@@ -102,7 +98,6 @@ export declare const usePermissionSetStore: () => {
|
|
|
102
98
|
}[];
|
|
103
99
|
}>): void;
|
|
104
100
|
$patch<F extends (state: {
|
|
105
|
-
isLoading: boolean;
|
|
106
101
|
permissionSets: {
|
|
107
102
|
id: string;
|
|
108
103
|
permissions: {
|
|
@@ -150,12 +145,11 @@ export declare const usePermissionSetStore: () => {
|
|
|
150
145
|
businessId: string;
|
|
151
146
|
name: string;
|
|
152
147
|
}[]>;
|
|
153
|
-
isLoading: import("vue").Ref<boolean, boolean>;
|
|
154
148
|
readPermissionSets: () => Promise<void>;
|
|
155
149
|
createPermissionSet: (dto: IFdtoCreatePermissionSetReq) => Promise<void>;
|
|
156
150
|
updatePermissionSet: (id: string, dto: IFdtoUpdatePermissionSetReq) => Promise<void>;
|
|
157
151
|
deletePermissionSet: (id: string) => Promise<void>;
|
|
158
|
-
}, "
|
|
152
|
+
}, "permissionSets">>, options?: {
|
|
159
153
|
detached?: boolean;
|
|
160
154
|
} & import("vue").WatchOptions): () => void;
|
|
161
155
|
$onAction(callback: import("pinia").StoreOnActionListener<"permissionSet", Pick<{
|
|
@@ -188,12 +182,11 @@ export declare const usePermissionSetStore: () => {
|
|
|
188
182
|
businessId: string;
|
|
189
183
|
name: string;
|
|
190
184
|
}[]>;
|
|
191
|
-
isLoading: import("vue").Ref<boolean, boolean>;
|
|
192
185
|
readPermissionSets: () => Promise<void>;
|
|
193
186
|
createPermissionSet: (dto: IFdtoCreatePermissionSetReq) => Promise<void>;
|
|
194
187
|
updatePermissionSet: (id: string, dto: IFdtoUpdatePermissionSetReq) => Promise<void>;
|
|
195
188
|
deletePermissionSet: (id: string) => Promise<void>;
|
|
196
|
-
}, "
|
|
189
|
+
}, "permissionSets">, Pick<{
|
|
197
190
|
permissionSets: import("vue").Ref<{
|
|
198
191
|
id: string;
|
|
199
192
|
permissions: {
|
|
@@ -223,7 +216,6 @@ export declare const usePermissionSetStore: () => {
|
|
|
223
216
|
businessId: string;
|
|
224
217
|
name: string;
|
|
225
218
|
}[]>;
|
|
226
|
-
isLoading: import("vue").Ref<boolean, boolean>;
|
|
227
219
|
readPermissionSets: () => Promise<void>;
|
|
228
220
|
createPermissionSet: (dto: IFdtoCreatePermissionSetReq) => Promise<void>;
|
|
229
221
|
updatePermissionSet: (id: string, dto: IFdtoUpdatePermissionSetReq) => Promise<void>;
|
|
@@ -258,7 +250,6 @@ export declare const usePermissionSetStore: () => {
|
|
|
258
250
|
businessId: string;
|
|
259
251
|
name: string;
|
|
260
252
|
}[]>;
|
|
261
|
-
isLoading: import("vue").Ref<boolean, boolean>;
|
|
262
253
|
readPermissionSets: () => Promise<void>;
|
|
263
254
|
createPermissionSet: (dto: IFdtoCreatePermissionSetReq) => Promise<void>;
|
|
264
255
|
updatePermissionSet: (id: string, dto: IFdtoUpdatePermissionSetReq) => Promise<void>;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
export declare const APPROVAL_CODE_PERMISSIONS: readonly ["void", "refund", "discount", "changePrice", "claimDeposit", "payment", "resend", "changePaymentType", "openDrawer", "openCounter", "closeCounter", "printReceipt"];
|
|
2
|
+
export type ApprovalCodePermission = (typeof APPROVAL_CODE_PERMISSIONS)[number];
|
|
3
|
+
/**
|
|
4
|
+
* A single CASL-shaped rule keyed by the approval-code action it grants, as
|
|
5
|
+
* stored/returned by the backend. Mirrors `FdoApprovalCodeRule` from
|
|
6
|
+
* `apps/hrm-backend/src/grant-user/grant-user.entity.ts`.
|
|
7
|
+
*/
|
|
8
|
+
export interface IFdtoApprovalCodeRule {
|
|
9
|
+
key: ApprovalCodePermission;
|
|
10
|
+
subject: string;
|
|
11
|
+
actions: string[];
|
|
12
|
+
conditions?: Record<string, unknown>;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The rule template (subject/actions/conditions, minus `key`) for every
|
|
16
|
+
* approval-code permission the portal can grant. The portal is now the
|
|
17
|
+
* owner of these shapes (KDI-4982 Task A2) — the backend only validates the
|
|
18
|
+
* shape of whatever rule it receives, it no longer composes rules itself.
|
|
19
|
+
* These values were copied verbatim from the backend's server-side
|
|
20
|
+
* key-to-rule manifest before it was deleted; they must keep matching
|
|
21
|
+
* `FdoApprovalCodeRule`'s shape validation in
|
|
22
|
+
* `apps/hrm-backend/src/grant-user/grant-user.entity.ts`.
|
|
23
|
+
*/
|
|
24
|
+
export declare const APPROVAL_CODE_RULE_TEMPLATES: Record<ApprovalCodePermission, {
|
|
25
|
+
subject: string;
|
|
26
|
+
actions: string[];
|
|
27
|
+
conditions: Record<string, unknown>;
|
|
28
|
+
}>;
|
|
29
|
+
/**
|
|
30
|
+
* Compose the full CASL-shaped rule for `key`, ready to send to the backend
|
|
31
|
+
* as-is. Only `discount` honors `params.maxPercentage`, appending it as an
|
|
32
|
+
* `adjustment: { $lte: maxPercentage / 100 } }` condition — every other key
|
|
33
|
+
* ignores `params` if passed, matching the deleted backend manifest's
|
|
34
|
+
* `buildRule` behavior.
|
|
35
|
+
*/
|
|
36
|
+
export declare function buildApprovalCodeRule(key: ApprovalCodePermission, params?: {
|
|
37
|
+
maxPercentage?: number;
|
|
38
|
+
}): IFdtoApprovalCodeRule;
|
|
39
|
+
export interface IFdtoApprovalCode {
|
|
40
|
+
_id: string;
|
|
41
|
+
businessId: string;
|
|
42
|
+
restaurantId: string;
|
|
43
|
+
passcode: string;
|
|
44
|
+
name: string;
|
|
45
|
+
type: 'approval';
|
|
46
|
+
permissions: IFdtoApprovalCodeRule[];
|
|
47
|
+
status: 'active' | 'used' | 'revoked';
|
|
48
|
+
usedAt?: string;
|
|
49
|
+
revokedAt?: string;
|
|
50
|
+
grantById: string;
|
|
51
|
+
grantByName: string;
|
|
52
|
+
createdAt: string;
|
|
53
|
+
updatedAt: string;
|
|
54
|
+
}
|
|
55
|
+
export interface IFdtoCreateApprovalCodeReq {
|
|
56
|
+
name: string;
|
|
57
|
+
restaurantId: string;
|
|
58
|
+
permissions: IFdtoApprovalCodeRule[];
|
|
59
|
+
count: number;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Read the discount ceiling back out of a rule's `conditions.adjustment.$lte`
|
|
63
|
+
* fraction (0-1) as a whole percentage (1-100). Returns `undefined` when the
|
|
64
|
+
* rule has no adjustment ceiling.
|
|
65
|
+
*/
|
|
66
|
+
export declare function getRuleAdjustmentCeilingPercentage(rule: IFdtoApprovalCodeRule): number | undefined;
|
|
67
|
+
/**
|
|
68
|
+
* Validate the optional discount max-percentage input. Undefined, empty, or
|
|
69
|
+
* whitespace-only means "no ceiling" and is valid; otherwise the value must
|
|
70
|
+
* be an integer in `[1, 100]`.
|
|
71
|
+
*/
|
|
72
|
+
export declare function validateMaxPercentage(value: number | string | undefined): boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Resolve the discount max-percentage input into a definite number for the
|
|
75
|
+
* create-request payload, or `undefined` when it represents "no ceiling".
|
|
76
|
+
* Assumes the value has already passed `validateMaxPercentage`.
|
|
77
|
+
*/
|
|
78
|
+
export declare function resolveMaxPercentage(value: number | string | undefined): number | undefined;
|
|
79
|
+
/**
|
|
80
|
+
* A selectable action option in the create form / list filter (KDI-4982 UI
|
|
81
|
+
* redesign). The 8 options mirror the POS v7 passcode prompts exactly:
|
|
82
|
+
* `changePrice`, `claimDeposit`, `payment` are not offered (the latter two
|
|
83
|
+
* have no passcode prompt on POS v7 at all), and open/close counter share one
|
|
84
|
+
* option because POS guards both with the same `counterRecord` permission.
|
|
85
|
+
* The 12-key `APPROVAL_CODE_PERMISSIONS` enum is untouched — stored rules and
|
|
86
|
+
* the wire format still use the full key set, so legacy codes keep rendering.
|
|
87
|
+
*/
|
|
88
|
+
export interface AccessCodeActionOption {
|
|
89
|
+
key: 'printReceipt' | 'resend' | 'openDrawer' | 'counter' | 'discount' | 'void' | 'changePaymentType' | 'refund';
|
|
90
|
+
ruleKeys: ApprovalCodePermission[];
|
|
91
|
+
}
|
|
92
|
+
export type AccessCodeActionOptionKey = AccessCodeActionOption['key'];
|
|
93
|
+
export declare const ACCESS_CODE_ACTION_OPTIONS: AccessCodeActionOption[];
|
|
94
|
+
/** When a code stopped being usable: used wins over revoked (a code can only
|
|
95
|
+
* be one or the other, but usedAt is the historically-populated field). */
|
|
96
|
+
export declare function getResolvedAt(code: Pick<IFdtoApprovalCode, 'usedAt' | 'revokedAt'>): string | undefined;
|
|
97
|
+
/** List-filter predicate: does this code grant any of the selected options?
|
|
98
|
+
* Empty/undefined selection means "no filter". */
|
|
99
|
+
export declare function codeMatchesActionFilter(code: Pick<IFdtoApprovalCode, 'permissions'>, selected: AccessCodeActionOptionKey[] | undefined): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type { AuditLogEntry, AuditLogMetadata,
|
|
1
|
+
export type { AuditLogEntry, AuditLogMetadata, AuditLogOutcome, AuditLogResolvedFrom } from '@feedmepos/hrm-permission';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
declare function create(): void;
|
|
2
|
+
declare const _default: import("vue").DefineComponent<{}, {
|
|
3
|
+
create: typeof create;
|
|
4
|
+
filteredApprovalCodes: import("vue").ComputedRef<{
|
|
5
|
+
_id: string;
|
|
6
|
+
businessId: string;
|
|
7
|
+
restaurantId: string;
|
|
8
|
+
passcode: string;
|
|
9
|
+
name: string;
|
|
10
|
+
type: "approval";
|
|
11
|
+
permissions: {
|
|
12
|
+
key: import("@/types/approval-code").ApprovalCodePermission;
|
|
13
|
+
subject: string;
|
|
14
|
+
actions: string[];
|
|
15
|
+
conditions?: Record<string, unknown> | undefined;
|
|
16
|
+
}[];
|
|
17
|
+
status: "active" | "used" | "revoked";
|
|
18
|
+
usedAt?: string | undefined;
|
|
19
|
+
revokedAt?: string | undefined;
|
|
20
|
+
grantById: string;
|
|
21
|
+
grantByName: string;
|
|
22
|
+
createdAt: string;
|
|
23
|
+
updatedAt: string;
|
|
24
|
+
}[]>;
|
|
25
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
26
|
+
export default _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
declare var __VLS_1: {
|
|
2
|
+
trigger: () => void;
|
|
3
|
+
};
|
|
4
|
+
type __VLS_Slots = {} & {
|
|
5
|
+
default?: (props: typeof __VLS_1) => any;
|
|
6
|
+
};
|
|
7
|
+
declare const __VLS_component: import("vue").DefineComponent<{}, {
|
|
8
|
+
show: import("vue").Ref<boolean, boolean>;
|
|
9
|
+
trigger: () => void;
|
|
10
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
11
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
12
|
+
export default _default;
|
|
13
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
14
|
+
new (): {
|
|
15
|
+
$slots: S;
|
|
16
|
+
};
|
|
17
|
+
};
|