@feedmepos/mf-hrm-portal 2.3.2-dev.2 → 2.3.2-dev.20
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-sHnINTik.js → ApprovalCodeList-eCTF8Rwt.js} +7 -7
- package/dist/AuditLogList-YzR5ysmN.js +2021 -0
- package/dist/{ConditionBuilderForm.vue_vue_type_script_setup_true_lang-BbsPesWY.js → ConditionBuilderForm.vue_vue_type_script_setup_true_lang--660w-zJ.js} +2 -2
- package/dist/{EmployeeList-D4oy5hXz.js → EmployeeList-C2ctTGCo.js} +8 -8
- package/dist/{FormSection.vue_vue_type_script_setup_true_lang-Cl053Tg1.js → FormSection.vue_vue_type_script_setup_true_lang-DWvJM14K.js} +1 -1
- package/dist/{GrantUserList-LWpqhl-5.js → GrantUserList-BoN1MUkB.js} +8 -8
- package/dist/{Main-PBJjfzBg.js → Main-BLmTdeYO.js} +5 -5
- package/dist/{Main-BWKb-QIE.js → Main-CIldvI5X.js} +2274 -2280
- package/dist/{Main-CVGiOYpC.js → Main-Di-083Pw.js} +29 -29
- package/dist/MyPosProfile-CctvT3RF.js +360 -0
- package/dist/{PermissionSetList-D2qZVlF4.js → PermissionSetList-BzvVAzwG.js} +126 -126
- package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-JgrJvMly.js +4212 -0
- package/dist/{PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-DRGTxOMW.js → PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-BdjAh48A.js} +414 -448
- package/dist/{RoleForm.vue_vue_type_script_setup_true_lang-DFDTw0lj.js → RoleForm.vue_vue_type_script_setup_true_lang-WCNUeA3G.js} +74 -74
- package/dist/{RoleList-DG0crFzW.js → RoleList-wPupuMBG.js} +7 -7
- package/dist/{ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-Cs0rhCa3.js → ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-DcBIt4DL.js} +1 -1
- package/dist/{ScheduleGeneralPage-C4J6jYtG.js → ScheduleGeneralPage-NCKqPyt5.js} +2 -2
- package/dist/{ScheduleModal.vue_vue_type_script_setup_true_lang-3UqO6uPu.js → ScheduleModal.vue_vue_type_script_setup_true_lang-CG5Xxj3Q.js} +4 -4
- package/dist/{SchedulePage-ICzggri0.js → SchedulePage-BZ5bKLly.js} +197 -209
- package/dist/{SchedulePositionPage-BshUCd_C.js → SchedulePositionPage-CwHd3rf2.js} +3 -3
- package/dist/{SelectFilter-D9T0nFvG.js → SelectFilter-DLZNvKwI.js} +2 -3
- package/dist/TeamMemberList-D8uWsS0J.js +2082 -0
- package/dist/TimesheetList-K6doo0BX.js +408 -0
- package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-BLqgALLe.js → TimesheetList.vue_vue_type_style_index_0_scoped_ffd7f807_lang-DFoIix3D.js} +7 -7
- package/dist/{app-n6d4AmtP.js → app-BGzac7xv.js} +5618 -4632
- package/dist/app.js +1 -1
- package/dist/{approval-code-1j1OoXt1.js → approval-code-BBNbWSqR.js} +4 -4
- package/dist/{dayjs.min-DdNivv4b.js → dayjs.min-ey-9Jb-9.js} +20 -20
- package/dist/employee-D_COMGXq.js +237 -0
- package/dist/{grant-user-BmTyexk3.js → grant-user-CTTTpewT.js} +2 -2
- package/dist/{iteration-y_jodvfN.js → index-CTqdA7gA.js} +573 -558
- package/dist/{lodash-B2eWEGH4.js → lodash-DNSDZgnL.js} +1 -1
- package/dist/member-grant-5DnD17dB.js +54 -0
- package/dist/restaurant-qoOY3iMJ.js +49 -0
- package/dist/role-BEbd5Qsi.js +91 -0
- package/dist/rule-BLG5i_xT.js +845 -0
- package/dist/src/api/audit-log/index.d.ts +2 -0
- package/dist/src/api/my-pos-profile/index.d.ts +1 -3
- package/dist/src/composables/useTenant.d.ts +11 -0
- package/dist/src/helpers/employee-merge.d.ts +33 -0
- package/dist/src/helpers/iteration.d.ts +9 -2
- package/dist/src/helpers/permission-set.d.ts +1 -102
- package/dist/src/helpers/restaurant-lookup.d.ts +19 -0
- package/dist/src/helpers/role-merge.d.ts +11 -0
- package/dist/src/helpers/rule.d.ts +2 -2
- package/dist/src/router/courtGuard.d.ts +4 -0
- package/dist/src/stores/approval-code.d.ts +1 -1
- package/dist/src/stores/employee.d.ts +2 -2
- package/dist/src/stores/grant-user.d.ts +1 -1
- package/dist/src/stores/permission-assignment.d.ts +2 -2
- package/dist/src/stores/permission-set.d.ts +2 -2
- package/dist/src/stores/restaurant.d.ts +2 -2
- package/dist/src/stores/role.d.ts +2 -2
- package/dist/src/stores/team.d.ts +2 -2
- package/dist/src/stores/timesheet.d.ts +2 -2
- package/dist/src/types/my-pos-profile.d.ts +2 -3
- package/dist/src/views/audit-log/constants.d.ts +1 -1
- package/dist/src/views/audit-log/locales/index.d.ts +56 -0
- package/dist/src/views/audit-log/useTraceIdDeepLink.d.ts +19 -0
- package/dist/src/views/hr/locales/index.d.ts +4 -4
- package/dist/src/views/hr/timesheet/timesheet-view.d.ts +29 -0
- package/dist/src/views/my-pos-profile/components/PasscodeChangedDialog.vue.d.ts +1 -1
- package/dist/src/views/my-pos-profile/locales/index.d.ts +40 -4
- package/dist/style.css +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{useAppStore-BPARQyvJ.js → useAppStore-BwUs5XGY.js} +1 -1
- package/dist/{useLoading-iPESFb6R.js → useLoading-DmAqc_Gx.js} +1 -1
- package/dist/useMessage-_ywT_N9X.js +17 -0
- package/dist/useReportPermissions-PEzIBX1U.js +80 -0
- package/dist/useSsoProviders-CwLbvOdH.js +41 -0
- package/package.json +5 -5
- package/dist/AuditLogList-C9C2emU9.js +0 -1950
- package/dist/MyPosProfile-BQCBFMFw.js +0 -301
- package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-ZSREAS1r.js +0 -4243
- package/dist/TeamMemberList-C970Iqlj.js +0 -2086
- package/dist/TimesheetList-nxhr0EWj.js +0 -402
- package/dist/employee-BlfleiCU.js +0 -210
- package/dist/member-grant-CzZUdO_s.js +0 -55
- package/dist/restaurant-Dl6yx37M.js +0 -51
- package/dist/role-DfZi7Ssk.js +0 -93
- package/dist/rule-ChmhcGgA.js +0 -788
- package/dist/useReportPermissions-By-BoJZb.js +0 -82
|
@@ -14,6 +14,7 @@ declare const AuditLogAPI: {
|
|
|
14
14
|
searchSubjects?: string[];
|
|
15
15
|
sources?: string[];
|
|
16
16
|
restaurantIds?: string[];
|
|
17
|
+
traceId?: string;
|
|
17
18
|
}): Promise<number>;
|
|
18
19
|
read(params?: {
|
|
19
20
|
limit?: number;
|
|
@@ -31,6 +32,7 @@ declare const AuditLogAPI: {
|
|
|
31
32
|
searchSubjects?: string[];
|
|
32
33
|
sources?: string[];
|
|
33
34
|
restaurantIds?: string[];
|
|
35
|
+
traceId?: string;
|
|
34
36
|
}): Promise<AuditLogEntry[]>;
|
|
35
37
|
/**
|
|
36
38
|
* FeedMe-admin options for the User filter. `actors` is the named admin list (internal
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { FdtoMyPosProfile, FdtoRegenerateMyPosPasscodeRes } from '@/types/my-pos-profile';
|
|
2
2
|
export declare const readMyPosProfile: () => Promise<FdtoMyPosProfile>;
|
|
3
|
-
/** D50: the signed-in user's own current passcode. */
|
|
4
|
-
export declare const readMyPosPasscode: () => Promise<FdtoMyPosPasscode>;
|
|
5
3
|
export declare const regenerateMyPosPasscode: () => Promise<FdtoRegenerateMyPosPasscodeRes>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type ComputedRef } from 'vue';
|
|
2
|
+
import { type PortalTenantType as TenantType } from '@feedmepos/hrm-permission';
|
|
3
|
+
export type { PortalTenantType as TenantType } from '@feedmepos/hrm-permission';
|
|
4
|
+
export interface Tenant {
|
|
5
|
+
type: ComputedRef<TenantType>;
|
|
6
|
+
isFoodCourt: ComputedRef<boolean>;
|
|
7
|
+
id: ComputedRef<string | undefined>;
|
|
8
|
+
name: ComputedRef<string>;
|
|
9
|
+
}
|
|
10
|
+
/** The business or food court the portal is currently in. */
|
|
11
|
+
export declare function useTenant(): Tenant;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Employee, IFdtoPosUser, IFdtoPosUserSummary } from '@/types/employee';
|
|
2
|
+
import type { HrmRestaurant } from '@/types/restaurant';
|
|
3
|
+
import type { Role } from '@/types/role';
|
|
4
|
+
import { type NamedRestaurant } from './restaurant-lookup';
|
|
5
|
+
/** One spreadsheet row of the employee export; keys are in column order. */
|
|
6
|
+
export interface EmployeeExportRow {
|
|
7
|
+
code: unknown;
|
|
8
|
+
name: string;
|
|
9
|
+
passcode: string;
|
|
10
|
+
since: string;
|
|
11
|
+
restaurant: string;
|
|
12
|
+
role: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Merges `pos-users` rows (one per employee per outlet) into one employee per `_id`.
|
|
16
|
+
*
|
|
17
|
+
* Each employee keeps the fields of its first row and lists every distinct outlet it is
|
|
18
|
+
* in, sorted by outlet name; employees are sorted by name. Ties keep first-seen order.
|
|
19
|
+
* Outlet and role names come from `new Map(...)`, so a duplicated id resolves to the last
|
|
20
|
+
* entry. One pass and one sort per list, so HQ staff in ~1,000 outlets stay cheap.
|
|
21
|
+
*/
|
|
22
|
+
export declare function mergeEmployees(employees: readonly IFdtoPosUser[], restaurants: readonly HrmRestaurant[], roles: readonly Role[]): Employee[];
|
|
23
|
+
/**
|
|
24
|
+
* Returns a mapper from a `pos-users/paged` summary to an `Employee`. The outlet and role
|
|
25
|
+
* maps are built once here (duplicated id → last entry, as `new Map(...)`), not per summary.
|
|
26
|
+
*/
|
|
27
|
+
export declare function createEmployeeSummaryMapper(restaurants: readonly HrmRestaurant[], roles: readonly Role[]): (summary: IFdtoPosUserSummary) => Employee;
|
|
28
|
+
/**
|
|
29
|
+
* Spreadsheet rows for the employee export: one row per employee outlet, with the
|
|
30
|
+
* employee's own fields on its first row only. Outlet and role names resolve to the first
|
|
31
|
+
* entry with that id, as `Array.find` did.
|
|
32
|
+
*/
|
|
33
|
+
export declare function toEmployeeExportRows(employees: readonly Employee[], restaurants: readonly NamedRestaurant[], roles: readonly Role[]): EmployeeExportRow[];
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
export declare function clone<T>(value: T, exceptKey?: string[]): T;
|
|
2
2
|
type Selector<T> = keyof T | ((item: T) => string);
|
|
3
|
-
|
|
3
|
+
interface SortOption<T> {
|
|
4
4
|
selector?: Selector<T>;
|
|
5
5
|
descending?: boolean;
|
|
6
|
-
}
|
|
6
|
+
}
|
|
7
|
+
/** Sorted JSON deep clone of `arr` (drops `undefined`, stringifies `Date`s, unwraps proxies). */
|
|
8
|
+
export declare function sort<T>(arr: T[], option?: SortOption<T> | undefined): T[];
|
|
9
|
+
/**
|
|
10
|
+
* Same order as `sort`, but returns a new array holding the original elements (no clone)
|
|
11
|
+
* and leaves `arr` untouched. Only use it on arrays the caller has just built.
|
|
12
|
+
*/
|
|
13
|
+
export declare function sortShallow<T>(arr: readonly T[], option?: SortOption<T>): T[];
|
|
7
14
|
export declare function group<T>(arr: T[], by: Selector<T>): {
|
|
8
15
|
[key: string]: T[];
|
|
9
16
|
};
|
|
@@ -1,21 +1,5 @@
|
|
|
1
1
|
import type { InheritedPermission, IFdtoPermissionSet } from '@/types/permission-set';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Recursively collect all permission sets following permissionSetIds links.
|
|
5
|
-
* Returns a flat, deduplicated list in depth-first order (parent before children).
|
|
6
|
-
* Cycle-safe via the visited set.
|
|
7
|
-
*/
|
|
8
|
-
export declare function collectAllPermissionSets(setIds: string[], allSets: IFdtoPermissionSet[], visited?: Set<string>): IFdtoPermissionSet[];
|
|
9
|
-
/**
|
|
10
|
-
* Compute the effective permissions from a list of permission sets.
|
|
11
|
-
*
|
|
12
|
-
* Unlike a raw `mergePermissionSet().map(...)`, this correctly handles sets that store
|
|
13
|
-
* override diffs (inverted rules): it first merges all grants and denials from the sets,
|
|
14
|
-
* then applies the denials on top of the grants via `getEffectivePermissions`, producing a
|
|
15
|
-
* clean list of effective grants only. This ensures that subjects removed by a child set's
|
|
16
|
-
* inversion are not incorrectly shown as granted.
|
|
17
|
-
*/
|
|
18
|
-
export declare function mergeToEffectivePermissions(sets: IFdtoPermissionSet[]): FdoPermissionRule[];
|
|
2
|
+
export { collectAllPermissionSets, mergeToEffectivePermissions, getOverridePermissions, materializeSystemPermissionSetOverrides, stripSystemExpandedPositives, REPORT_SUBJECT_PREFIX, filterStalePermissions, filterRedundantReportPermissions, getEffectivePermissions, getEditorPermissions, } from '@feedmepos/hrm-permission/utils';
|
|
19
3
|
/**
|
|
20
4
|
* Transform permission sets by grouping role names by collection IDs for a specific field
|
|
21
5
|
* @param permissionSets - Array of permission sets with their permissions
|
|
@@ -24,88 +8,3 @@ export declare function mergeToEffectivePermissions(sets: IFdtoPermissionSet[]):
|
|
|
24
8
|
* @returns Array of objects containing collection ID and associated role names
|
|
25
9
|
*/
|
|
26
10
|
export declare function transformByCollection(permissionSets: IFdtoPermissionSet[], field: string, resourceIds: string[]): InheritedPermission[];
|
|
27
|
-
/**
|
|
28
|
-
* Combine base permissions (permissions set) with user permissions
|
|
29
|
-
* @param basePermissions - Base permissions
|
|
30
|
-
* @param overridePermissions - User permissions
|
|
31
|
-
* @returns Combined permissions
|
|
32
|
-
* Return combined result with below criteria:
|
|
33
|
-
* - If base has it and user doesn't, return base permission with { inverted: true }
|
|
34
|
-
* - If user has it and base doesn't, return user permission
|
|
35
|
-
* - If base and user has it, nothing return
|
|
36
|
-
* For permission with conditions (collection: warehouses, roles, restaurants)
|
|
37
|
-
* - If base conditions different from user conditions, return rule with { inverted: true } and conditions on collection ids to be denied
|
|
38
|
-
* - If base has conditions and user doesn't, return base with { inverted: true } without conditions, essentially denied all access
|
|
39
|
-
* - If user has conditions and base doesn't, return user's rule (user added)
|
|
40
|
-
*/
|
|
41
|
-
export declare function getOverridePermissions(basePermissions: FdoPermissionRule[], overridePermissions: FdoPermissionRule[]): FdoPermissionRule[];
|
|
42
|
-
export declare function materializeSystemPermissionSetOverrides(overridePermissions: FdoPermissionRule[]): FdoPermissionRule[];
|
|
43
|
-
/**
|
|
44
|
-
* Strip positive rules whose subject would be re-injected by system permission set expansion.
|
|
45
|
-
* These need not be persisted to DB — expansion re-adds them at runtime.
|
|
46
|
-
*
|
|
47
|
-
* Also strips inverted rules for subjects that are ONLY reachable as non-manage via permissions[]
|
|
48
|
-
* leaf injection. Such inverted rules cannot block permissions[] injection (only visitedSetIds/
|
|
49
|
-
* permissionSets[] expansion is blockable), are useless, and cause a CASL side-effect where an
|
|
50
|
-
* inverted `manage` rule inadvertently blocks `read` access.
|
|
51
|
-
*
|
|
52
|
-
* Inverted rules targeting subjects reachable as `manage` (via permissionSets[] chaining) are
|
|
53
|
-
* always preserved — they seed visitedSetIds to block system set re-expansion.
|
|
54
|
-
*/
|
|
55
|
-
export declare function stripSystemExpandedPositives(permissions: FdoPermissionRule[]): FdoPermissionRule[];
|
|
56
|
-
export declare const REPORT_SUBJECT_PREFIX = "business::report::";
|
|
57
|
-
/**
|
|
58
|
-
* Filter out stale report permission rules.
|
|
59
|
-
*
|
|
60
|
-
* Only rules whose subject starts with `business::report::` are candidates for removal —
|
|
61
|
-
* any other subject (restaurant, role, warehouse, etc.) passes through untouched.
|
|
62
|
-
* A report-prefixed subject is kept only if it exists in `knownReportSubjects`.
|
|
63
|
-
*
|
|
64
|
-
* This handles:
|
|
65
|
-
* - Deprecated/renamed subjects (e.g. `business::report::closeup` → `business::report::reports::closeup`)
|
|
66
|
-
* - Deleted dynamic reports that no longer exist
|
|
67
|
-
*/
|
|
68
|
-
export declare function filterStalePermissions(permissions: FdoPermissionRule[], knownReportSubjects: Set<string>): FdoPermissionRule[];
|
|
69
|
-
/**
|
|
70
|
-
* Strip individual-report actions already covered by an `allDefaultReports` or
|
|
71
|
-
* `allCustomReports` positive grant, preventing redundant data from being saved.
|
|
72
|
-
*
|
|
73
|
-
* - If the cover rule has `manage` selected → every individual rule in that bucket is
|
|
74
|
-
* fully covered and dropped entirely only when the cover condition also covers the
|
|
75
|
-
* individual rule.
|
|
76
|
-
* - Otherwise, only covered non-manage actions are stripped from individual rules when
|
|
77
|
-
* the cover condition also covers the individual rule.
|
|
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.
|
|
82
|
-
* Rules that end up with no remaining actions are dropped.
|
|
83
|
-
*
|
|
84
|
-
* Inverted rules and the cover subjects themselves pass through untouched.
|
|
85
|
-
*
|
|
86
|
-
* @param defaultReportSubjects Full set of subjects in the "Default Report" UI category —
|
|
87
|
-
* includes static hardcoded subjects AND dynamic reports with `isDefault: true`.
|
|
88
|
-
* Built by the caller from `portalTeamPermissions` + `customReportPermissions`.
|
|
89
|
-
*/
|
|
90
|
-
export declare function filterRedundantReportPermissions(permissions: FdoPermissionRule[], defaultReportSubjects: Set<string>): FdoPermissionRule[];
|
|
91
|
-
/**
|
|
92
|
-
* Combine base permissions with override permissions to get effective permissions
|
|
93
|
-
* @param basePermissions - Base permissions from permission sets
|
|
94
|
-
* @param overridePermissions - Override permissions from permission user
|
|
95
|
-
* @returns - Combined effective permissions
|
|
96
|
-
*/
|
|
97
|
-
export declare function getEffectivePermissions(basePermissions: FdoPermissionRule[], overridePermissions: FdoPermissionRule[]): FdoPermissionRule[];
|
|
98
|
-
/**
|
|
99
|
-
* Compute the initial permissions for the permission editor.
|
|
100
|
-
*
|
|
101
|
-
* Like `getEffectivePermissions`, but also preserves "orphaned" inverted rules — denials whose
|
|
102
|
-
* subject is NOT present in any base permission set (i.e. they target system-expanded subjects,
|
|
103
|
-
* not permission-set-inherited subjects). These denials seed `visitedSetIds` in
|
|
104
|
-
* `expandWithSystemPermissionSets` to block runtime re-expansion of system sets that the user
|
|
105
|
-
* explicitly unchecked. Without them the editor would initialize without the denial guard and
|
|
106
|
-
* those subjects would reappear as checked the next time the form opens.
|
|
107
|
-
*
|
|
108
|
-
* Inverted rules whose subject IS in base are handled correctly by `getEffectivePermissions`
|
|
109
|
-
* already (they cancel the inherited grant) and do not need special treatment here.
|
|
110
|
-
*/
|
|
111
|
-
export declare function getEditorPermissions(basePermissions: FdoPermissionRule[], customPermissions: FdoPermissionRule[]): FdoPermissionRule[];
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** The fields a lookup reads; HRM-store and mf-common core-store restaurants both fit. */
|
|
2
|
+
export interface NamedRestaurant {
|
|
3
|
+
_id: string;
|
|
4
|
+
profile: {
|
|
5
|
+
name: string;
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
export interface RestaurantLookup {
|
|
9
|
+
/** Outlet name by outlet id; the first restaurant with an id wins, like `Array.find`. */
|
|
10
|
+
nameById: ReadonlyMap<string, string>;
|
|
11
|
+
/** The name of every restaurant in the list, sorted like `sort()` (ties keep list order). */
|
|
12
|
+
allNamesSorted: readonly string[];
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Lookup over a restaurant list, built once per list. Use it instead of
|
|
16
|
+
* `restaurants.find((r) => r._id === id)` inside loops: on a business with ~1,000 outlets
|
|
17
|
+
* that scan, repeated per row, freezes the tab.
|
|
18
|
+
*/
|
|
19
|
+
export declare function getRestaurantLookup(restaurants: readonly NamedRestaurant[]): RestaurantLookup;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { HrmRestaurant } from '@/types/restaurant';
|
|
2
|
+
import type { IFdtoPosRole, Role } from '@/types/role';
|
|
3
|
+
/**
|
|
4
|
+
* Merges `pos-roles` rows (one per role per outlet) into one role per `_id`.
|
|
5
|
+
*
|
|
6
|
+
* Each role keeps the fields of its first row and lists every distinct outlet it is in
|
|
7
|
+
* (unknown outlet → empty name), sorted by outlet name; roles are sorted by name. Ties
|
|
8
|
+
* keep first-seen order. One pass and one sort per list, so it stays fast with ~1,000
|
|
9
|
+
* outlets × 8 roles.
|
|
10
|
+
*/
|
|
11
|
+
export declare function mergeRoles(roles: readonly IFdtoPosRole[], restaurants: readonly HrmRestaurant[]): Role[];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { RawRule } from '@casl/ability';
|
|
2
2
|
import { F_RULE_SUBJECT, type FdoPermissionRule } from '@feedmepos/core/entity';
|
|
3
|
+
import { getManagableRestaurantIds, usableRoleIds } from '@feedmepos/hrm-permission/utils';
|
|
3
4
|
import type { Rule } from '../types/role';
|
|
4
5
|
export declare function filterPermissions(permissions: FdoPermissionRule[], subject: F_RULE_SUBJECT, availablePermissions?: FdoPermissionRule[]): string;
|
|
5
6
|
export declare function ruleExtension(rule: FdoPermissionRule): {
|
|
@@ -19,7 +20,7 @@ export declare function ruleExtension(rule: FdoPermissionRule): {
|
|
|
19
20
|
actions: ("update" | "create" | "read" | "delete" | "manage")[];
|
|
20
21
|
};
|
|
21
22
|
export declare function getMaxDiscount(rules: FdoPermissionRule[]): number;
|
|
22
|
-
export
|
|
23
|
+
export { getManagableRestaurantIds, usableRoleIds };
|
|
23
24
|
export interface MasterUserAccess {
|
|
24
25
|
/** null = every restaurant, [] = none */
|
|
25
26
|
restaurantIds: string[] | null;
|
|
@@ -36,7 +37,6 @@ export declare function resolveMasterUserAccess(rules: (FdoPermissionRule | RawR
|
|
|
36
37
|
isOwner: boolean;
|
|
37
38
|
}): MasterUserAccess;
|
|
38
39
|
export declare function hasAdminRule(rules: FdoPermissionRule[]): boolean;
|
|
39
|
-
export declare function usableRoleIds(rules: (FdoPermissionRule | RawRule)[]): string[] | null;
|
|
40
40
|
export declare function extractReportExtraCondition(rule: FdoPermissionRule): Record<string, unknown> | undefined;
|
|
41
41
|
export declare function fromValue(values: string[], maxDiscountPercentage: number, periodConditions?: Map<string, Record<string, unknown>>): {
|
|
42
42
|
subject: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IFdtoApprovalCode, IFdtoCreateApprovalCodeReq } from '@/types/approval-code';
|
|
2
|
-
export declare const useApprovalCodeStore: import("pinia").StoreDefinition<"
|
|
2
|
+
export declare const useApprovalCodeStore: import("pinia").StoreDefinition<"hrm-approval-code", Pick<{
|
|
3
3
|
approvalCodes: import("vue").Ref<{
|
|
4
4
|
_id: string;
|
|
5
5
|
businessId: string;
|
|
@@ -706,7 +706,7 @@ export declare const useEmployeeStore: () => {
|
|
|
706
706
|
}, "isLoading" | "employees" | "listEmployees" | "totalEmployees">>, options?: {
|
|
707
707
|
detached?: boolean;
|
|
708
708
|
} & import("vue").WatchOptions): () => void;
|
|
709
|
-
$onAction(callback: import("pinia").StoreOnActionListener<"employee", Pick<{
|
|
709
|
+
$onAction(callback: import("pinia").StoreOnActionListener<"hrm-employee", Pick<{
|
|
710
710
|
employees: import("vue").Ref<({
|
|
711
711
|
faceId?: unknown;
|
|
712
712
|
name: string;
|
|
@@ -1188,7 +1188,7 @@ export declare const useEmployeeStore: () => {
|
|
|
1188
1188
|
syncUsersMeta: () => Promise<void>;
|
|
1189
1189
|
}, "readEmployees" | "readEmployeesPage" | "readAllEmployeesPage" | "createEmployee" | "updateEmployee" | "deleteEmployee" | "createMasterEmployee" | "updateMasterEmployee" | "deleteMasterEmployee" | "migrateToMasterUser" | "syncUsersMeta">>, detached?: boolean): () => void;
|
|
1190
1190
|
$dispose(): void;
|
|
1191
|
-
$id: "employee";
|
|
1191
|
+
$id: "hrm-employee";
|
|
1192
1192
|
_customProperties: Set<string>;
|
|
1193
1193
|
readEmployees: () => Promise<void>;
|
|
1194
1194
|
readEmployeesPage: (query: IReadEmployeesPageReq) => Promise<void>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IFdtoGrantUser, IFdtoCreateGrantUserReq } from '@/types/grant-user';
|
|
2
|
-
export declare const useGrantUserStore: import("pinia").StoreDefinition<"
|
|
2
|
+
export declare const useGrantUserStore: import("pinia").StoreDefinition<"hrm-grant-user", Pick<{
|
|
3
3
|
grantUsers: import("vue").Ref<{
|
|
4
4
|
_id: string;
|
|
5
5
|
passcode: string;
|
|
@@ -156,7 +156,7 @@ export declare const usePermissionAssignmentStore: () => {
|
|
|
156
156
|
}, "permissionAssignments">>, options?: {
|
|
157
157
|
detached?: boolean;
|
|
158
158
|
} & import("vue").WatchOptions): () => void;
|
|
159
|
-
$onAction(callback: import("pinia").StoreOnActionListener<"
|
|
159
|
+
$onAction(callback: import("pinia").StoreOnActionListener<"hrm-permission-assignment", Pick<{
|
|
160
160
|
permissionAssignments: import("vue").Ref<{
|
|
161
161
|
id: string;
|
|
162
162
|
customPermissions: {
|
|
@@ -266,7 +266,7 @@ export declare const usePermissionAssignmentStore: () => {
|
|
|
266
266
|
getPermissionAssignmentByUserId: (userId: string) => IFdtoPermissionAssignment | undefined;
|
|
267
267
|
}, "readPermissionAssignments" | "readPermissionAssignmentByUserId" | "createPermissionAssignment" | "updatePermissionAssignment" | "deletePermissionAssignment" | "getPermissionAssignmentByUserId">>, detached?: boolean): () => void;
|
|
268
268
|
$dispose(): void;
|
|
269
|
-
$id: "
|
|
269
|
+
$id: "hrm-permission-assignment";
|
|
270
270
|
_customProperties: Set<string>;
|
|
271
271
|
readPermissionAssignments: () => Promise<void>;
|
|
272
272
|
readPermissionAssignmentByUserId: (userId: string) => Promise<IFdtoPermissionAssignment | null>;
|
|
@@ -158,7 +158,7 @@ export declare const usePermissionSetStore: () => {
|
|
|
158
158
|
}, "isLoading" | "permissionSets">>, options?: {
|
|
159
159
|
detached?: boolean;
|
|
160
160
|
} & import("vue").WatchOptions): () => void;
|
|
161
|
-
$onAction(callback: import("pinia").StoreOnActionListener<"
|
|
161
|
+
$onAction(callback: import("pinia").StoreOnActionListener<"hrm-permission-set", Pick<{
|
|
162
162
|
permissionSets: import("vue").Ref<{
|
|
163
163
|
id: string;
|
|
164
164
|
permissions: {
|
|
@@ -265,7 +265,7 @@ export declare const usePermissionSetStore: () => {
|
|
|
265
265
|
deletePermissionSet: (id: string) => Promise<void>;
|
|
266
266
|
}, "readPermissionSets" | "createPermissionSet" | "updatePermissionSet" | "deletePermissionSet">>, detached?: boolean): () => void;
|
|
267
267
|
$dispose(): void;
|
|
268
|
-
$id: "
|
|
268
|
+
$id: "hrm-permission-set";
|
|
269
269
|
_customProperties: Set<string>;
|
|
270
270
|
readPermissionSets: () => Promise<void>;
|
|
271
271
|
createPermissionSet: (dto: IFdtoCreatePermissionSetReq) => Promise<void>;
|
|
@@ -107,7 +107,7 @@ export declare const useRestaurantStore: () => {
|
|
|
107
107
|
}, "isLoading" | "restaurants">>, options?: {
|
|
108
108
|
detached?: boolean;
|
|
109
109
|
} & import("vue").WatchOptions): () => void;
|
|
110
|
-
$onAction(callback: import("pinia").StoreOnActionListener<"restaurant", Pick<{
|
|
110
|
+
$onAction(callback: import("pinia").StoreOnActionListener<"hrm-restaurant", Pick<{
|
|
111
111
|
restaurants: import("vue").Ref<{
|
|
112
112
|
_id: string;
|
|
113
113
|
businessId: string;
|
|
@@ -175,7 +175,7 @@ export declare const useRestaurantStore: () => {
|
|
|
175
175
|
readRestaurants: (force?: boolean) => Promise<void>;
|
|
176
176
|
}, "readRestaurants">>, detached?: boolean): () => void;
|
|
177
177
|
$dispose(): void;
|
|
178
|
-
$id: "restaurant";
|
|
178
|
+
$id: "hrm-restaurant";
|
|
179
179
|
_customProperties: Set<string>;
|
|
180
180
|
readRestaurants: (force?: boolean) => Promise<void>;
|
|
181
181
|
};
|
|
@@ -122,7 +122,7 @@ export declare const useRoleStore: () => {
|
|
|
122
122
|
}, "isLoading" | "roles">>, options?: {
|
|
123
123
|
detached?: boolean;
|
|
124
124
|
} & import("vue").WatchOptions): () => void;
|
|
125
|
-
$onAction(callback: import("pinia").StoreOnActionListener<"role", Pick<{
|
|
125
|
+
$onAction(callback: import("pinia").StoreOnActionListener<"hrm-role", Pick<{
|
|
126
126
|
roles: import("vue").Ref<{
|
|
127
127
|
restaurants: {
|
|
128
128
|
id: string;
|
|
@@ -205,7 +205,7 @@ export declare const useRoleStore: () => {
|
|
|
205
205
|
deleteRole: (role: Role) => Promise<void>;
|
|
206
206
|
}, "readRoles" | "createRole" | "updateRole" | "deleteRole">>, detached?: boolean): () => void;
|
|
207
207
|
$dispose(): void;
|
|
208
|
-
$id: "role";
|
|
208
|
+
$id: "hrm-role";
|
|
209
209
|
_customProperties: Set<string>;
|
|
210
210
|
readRoles: (force?: boolean) => Promise<void>;
|
|
211
211
|
createRole: (dto: IFdtoUpdateRoleReq) => Promise<void>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { FTeamMember } from '@/types/team';
|
|
2
|
-
declare const useTeamStore: import("pinia").StoreDefinition<"team", Pick<{
|
|
2
|
+
declare const useTeamStore: import("pinia").StoreDefinition<"hrm-team", Pick<{
|
|
3
3
|
members: import("vue").Ref<{
|
|
4
4
|
id: string;
|
|
5
5
|
name: string;
|
|
@@ -111,7 +111,7 @@ declare const useTeamStore: import("pinia").StoreDefinition<"team", Pick<{
|
|
|
111
111
|
readTeamMembers: ({ force }?: {
|
|
112
112
|
force?: boolean | undefined;
|
|
113
113
|
}) => Promise<void>;
|
|
114
|
-
}, "
|
|
114
|
+
}, "members" | "isLoading" | "hasLoaded">, Pick<{
|
|
115
115
|
members: import("vue").Ref<{
|
|
116
116
|
id: string;
|
|
117
117
|
name: string;
|
|
@@ -148,7 +148,7 @@ export declare const useTimesheetStore: () => {
|
|
|
148
148
|
}, "timesheets">>, options?: {
|
|
149
149
|
detached?: boolean;
|
|
150
150
|
} & import("vue").WatchOptions): () => void;
|
|
151
|
-
$onAction(callback: import("pinia").StoreOnActionListener<"timesheet", Pick<{
|
|
151
|
+
$onAction(callback: import("pinia").StoreOnActionListener<"hrm-timesheet", Pick<{
|
|
152
152
|
timesheets: import("vue").Ref<{
|
|
153
153
|
start: string;
|
|
154
154
|
end: string;
|
|
@@ -246,7 +246,7 @@ export declare const useTimesheetStore: () => {
|
|
|
246
246
|
updateTimesheet: (timesheet: IFdtoTimesheet, start: string, end: string) => Promise<void>;
|
|
247
247
|
}, "readTimesheet" | "updateTimesheet">>, detached?: boolean): () => void;
|
|
248
248
|
$dispose(): void;
|
|
249
|
-
$id: "timesheet";
|
|
249
|
+
$id: "hrm-timesheet";
|
|
250
250
|
_customProperties: Set<string>;
|
|
251
251
|
readTimesheet: (start: Date, end: Date) => Promise<void>;
|
|
252
252
|
updateTimesheet: (timesheet: IFdtoTimesheet, start: string, end: string) => Promise<void>;
|
|
@@ -3,6 +3,8 @@ export interface FdtoMyPosProfile {
|
|
|
3
3
|
hasPosUser: boolean;
|
|
4
4
|
profile: null | {
|
|
5
5
|
name: string;
|
|
6
|
+
/** The caller's own current passcode, shown on reveal (D50). */
|
|
7
|
+
passcode: string;
|
|
6
8
|
phoneNumber: string | null;
|
|
7
9
|
email: string | null;
|
|
8
10
|
assignments: {
|
|
@@ -16,9 +18,6 @@ export interface FdtoMyPosProfile {
|
|
|
16
18
|
};
|
|
17
19
|
}
|
|
18
20
|
export type FdtoMyPosProfileAssignment = NonNullable<FdtoMyPosProfile['profile']>['assignments'][number];
|
|
19
|
-
export interface FdtoMyPosPasscode {
|
|
20
|
-
passcode: string;
|
|
21
|
-
}
|
|
22
21
|
export interface FdtoRegenerateMyPosPasscodeRes {
|
|
23
22
|
passcode: string;
|
|
24
23
|
passcodeUpdatedAt: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export interface AuditLogModuleTab {
|
|
2
|
-
key: 'all' | 'inventory' | 'report' | 'hrm' | 'payment' | 'menu' | 'crm' | 'pos';
|
|
2
|
+
key: 'all' | 'inventory' | 'report' | 'hrm' | 'payment' | 'menu' | 'crm' | 'operation' | 'settings' | 'miniProgram' | 'media' | 'pos';
|
|
3
3
|
label: string;
|
|
4
4
|
/** Portal modules filter by subject namespace. */
|
|
5
5
|
subjectPrefixes: string[];
|
|
@@ -54,6 +54,10 @@ export declare const i18nMessages: {
|
|
|
54
54
|
payment: string;
|
|
55
55
|
menu: string;
|
|
56
56
|
crm: string;
|
|
57
|
+
operation: string;
|
|
58
|
+
settings: string;
|
|
59
|
+
miniProgram: string;
|
|
60
|
+
media: string;
|
|
57
61
|
pos: string;
|
|
58
62
|
other: string;
|
|
59
63
|
more: string;
|
|
@@ -130,7 +134,14 @@ export declare const i18nMessages: {
|
|
|
130
134
|
requestPath: string;
|
|
131
135
|
traceId: string;
|
|
132
136
|
};
|
|
137
|
+
deepLink: {
|
|
138
|
+
notFound: string;
|
|
139
|
+
loadFailed: string;
|
|
140
|
+
};
|
|
133
141
|
detail: {
|
|
142
|
+
copyLink: string;
|
|
143
|
+
linkCopied: string;
|
|
144
|
+
linkCopyFailed: string;
|
|
134
145
|
header: string;
|
|
135
146
|
date: string;
|
|
136
147
|
timestamp: string;
|
|
@@ -257,6 +268,9 @@ export declare const i18nMessages: {
|
|
|
257
268
|
update: string;
|
|
258
269
|
delete: string;
|
|
259
270
|
"generate-passcode": string;
|
|
271
|
+
invite: string;
|
|
272
|
+
"invite-update": string;
|
|
273
|
+
"invite-revoke": string;
|
|
260
274
|
};
|
|
261
275
|
"pos-user": {
|
|
262
276
|
list: string;
|
|
@@ -401,6 +415,10 @@ export declare const i18nMessages: {
|
|
|
401
415
|
payment: string;
|
|
402
416
|
menu: string;
|
|
403
417
|
crm: string;
|
|
418
|
+
operation: string;
|
|
419
|
+
settings: string;
|
|
420
|
+
miniProgram: string;
|
|
421
|
+
media: string;
|
|
404
422
|
pos: string;
|
|
405
423
|
other: string;
|
|
406
424
|
more: string;
|
|
@@ -477,7 +495,14 @@ export declare const i18nMessages: {
|
|
|
477
495
|
requestPath: string;
|
|
478
496
|
traceId: string;
|
|
479
497
|
};
|
|
498
|
+
deepLink: {
|
|
499
|
+
notFound: string;
|
|
500
|
+
loadFailed: string;
|
|
501
|
+
};
|
|
480
502
|
detail: {
|
|
503
|
+
copyLink: string;
|
|
504
|
+
linkCopied: string;
|
|
505
|
+
linkCopyFailed: string;
|
|
481
506
|
header: string;
|
|
482
507
|
date: string;
|
|
483
508
|
timestamp: string;
|
|
@@ -605,6 +630,9 @@ export declare const i18nMessages: {
|
|
|
605
630
|
update: string;
|
|
606
631
|
delete: string;
|
|
607
632
|
"generate-passcode": string;
|
|
633
|
+
invite: string;
|
|
634
|
+
"invite-update": string;
|
|
635
|
+
"invite-revoke": string;
|
|
608
636
|
};
|
|
609
637
|
"pos-user": {
|
|
610
638
|
list: string;
|
|
@@ -749,6 +777,10 @@ export declare const i18nMessages: {
|
|
|
749
777
|
payment: string;
|
|
750
778
|
menu: string;
|
|
751
779
|
crm: string;
|
|
780
|
+
operation: string;
|
|
781
|
+
settings: string;
|
|
782
|
+
miniProgram: string;
|
|
783
|
+
media: string;
|
|
752
784
|
pos: string;
|
|
753
785
|
other: string;
|
|
754
786
|
more: string;
|
|
@@ -825,7 +857,14 @@ export declare const i18nMessages: {
|
|
|
825
857
|
requestPath: string;
|
|
826
858
|
traceId: string;
|
|
827
859
|
};
|
|
860
|
+
deepLink: {
|
|
861
|
+
notFound: string;
|
|
862
|
+
loadFailed: string;
|
|
863
|
+
};
|
|
828
864
|
detail: {
|
|
865
|
+
copyLink: string;
|
|
866
|
+
linkCopied: string;
|
|
867
|
+
linkCopyFailed: string;
|
|
829
868
|
header: string;
|
|
830
869
|
date: string;
|
|
831
870
|
timestamp: string;
|
|
@@ -953,6 +992,9 @@ export declare const i18nMessages: {
|
|
|
953
992
|
update: string;
|
|
954
993
|
delete: string;
|
|
955
994
|
"generate-passcode": string;
|
|
995
|
+
invite: string;
|
|
996
|
+
"invite-update": string;
|
|
997
|
+
"invite-revoke": string;
|
|
956
998
|
};
|
|
957
999
|
"pos-user": {
|
|
958
1000
|
list: string;
|
|
@@ -1097,6 +1139,10 @@ export declare const i18nMessages: {
|
|
|
1097
1139
|
payment: string;
|
|
1098
1140
|
menu: string;
|
|
1099
1141
|
crm: string;
|
|
1142
|
+
operation: string;
|
|
1143
|
+
settings: string;
|
|
1144
|
+
miniProgram: string;
|
|
1145
|
+
media: string;
|
|
1100
1146
|
pos: string;
|
|
1101
1147
|
other: string;
|
|
1102
1148
|
more: string;
|
|
@@ -1173,7 +1219,14 @@ export declare const i18nMessages: {
|
|
|
1173
1219
|
requestPath: string;
|
|
1174
1220
|
traceId: string;
|
|
1175
1221
|
};
|
|
1222
|
+
deepLink: {
|
|
1223
|
+
notFound: string;
|
|
1224
|
+
loadFailed: string;
|
|
1225
|
+
};
|
|
1176
1226
|
detail: {
|
|
1227
|
+
copyLink: string;
|
|
1228
|
+
linkCopied: string;
|
|
1229
|
+
linkCopyFailed: string;
|
|
1177
1230
|
header: string;
|
|
1178
1231
|
date: string;
|
|
1179
1232
|
timestamp: string;
|
|
@@ -1301,6 +1354,9 @@ export declare const i18nMessages: {
|
|
|
1301
1354
|
update: string;
|
|
1302
1355
|
delete: string;
|
|
1303
1356
|
"generate-passcode": string;
|
|
1357
|
+
invite: string;
|
|
1358
|
+
"invite-update": string;
|
|
1359
|
+
"invite-revoke": string;
|
|
1304
1360
|
};
|
|
1305
1361
|
"pos-user": {
|
|
1306
1362
|
list: string;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type Ref } from 'vue';
|
|
2
|
+
import type { AuditLogEntry } from '@/types/audit-log';
|
|
3
|
+
interface Options {
|
|
4
|
+
logs: Ref<AuditLogEntry[]>;
|
|
5
|
+
selectedLog: Ref<AuditLogEntry | null>;
|
|
6
|
+
isSheetOpen: Ref<boolean>;
|
|
7
|
+
/** Current tenant id (business or food court); the lookup waits until this is available. */
|
|
8
|
+
businessId: () => string | undefined;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Keeps the open request-log side sheet in sync with `?traceId=` in the URL, so a log can
|
|
12
|
+
* be shared as a link (and survives reload / back / forward).
|
|
13
|
+
*/
|
|
14
|
+
export declare function useTraceIdDeepLink({ logs, selectedLog, isSheetOpen, businessId }: Options): {
|
|
15
|
+
onSheetOpened: (row: AuditLogEntry) => void;
|
|
16
|
+
onSheetClosed: () => void;
|
|
17
|
+
copyLink: () => Promise<void>;
|
|
18
|
+
};
|
|
19
|
+
export {};
|
|
@@ -134,7 +134,7 @@ export declare const i18nMessages: {
|
|
|
134
134
|
deposit: string;
|
|
135
135
|
delivery: string;
|
|
136
136
|
counterRecord: string;
|
|
137
|
-
|
|
137
|
+
setting: string;
|
|
138
138
|
display: string;
|
|
139
139
|
printer: string;
|
|
140
140
|
table: string;
|
|
@@ -347,7 +347,7 @@ export declare const i18nMessages: {
|
|
|
347
347
|
deposit: string;
|
|
348
348
|
delivery: string;
|
|
349
349
|
counterRecord: string;
|
|
350
|
-
|
|
350
|
+
setting: string;
|
|
351
351
|
display: string;
|
|
352
352
|
printer: string;
|
|
353
353
|
table: string;
|
|
@@ -560,7 +560,7 @@ export declare const i18nMessages: {
|
|
|
560
560
|
deposit: string;
|
|
561
561
|
delivery: string;
|
|
562
562
|
counterRecord: string;
|
|
563
|
-
|
|
563
|
+
setting: string;
|
|
564
564
|
display: string;
|
|
565
565
|
printer: string;
|
|
566
566
|
table: string;
|
|
@@ -772,7 +772,7 @@ export declare const i18nMessages: {
|
|
|
772
772
|
deposit: string;
|
|
773
773
|
delivery: string;
|
|
774
774
|
counterRecord: string;
|
|
775
|
-
|
|
775
|
+
setting: string;
|
|
776
776
|
display: string;
|
|
777
777
|
printer: string;
|
|
778
778
|
table: string;
|