@feedmepos/mf-hrm-portal 2.0.10-dev → 2.0.10-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.
Files changed (52) hide show
  1. package/dist/AuditLogList-DaFC8LUT.js +915 -0
  2. package/dist/{EmployeeList-B3qXFaOz.js → EmployeeList-fzS5kLyE.js} +164 -169
  3. package/dist/FormSection.vue_vue_type_script_setup_true_lang-BVb8c4YU.js +71 -0
  4. package/dist/HorizontalSplitter-o860F4xM.js +12 -0
  5. package/dist/Main-CvuyDkkJ.js +560 -0
  6. package/dist/{Main-JUX88mXA.js → Main-g0xYhlQL.js} +11 -10
  7. package/dist/{Main-urBwZXUq.js → Main-pViKokej.js} +8 -7
  8. package/dist/PermissionSetList-C71zXeNi.js +338 -0
  9. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-Dx9qaSOy.js +3479 -0
  10. package/dist/{RoleList-Dl7042_3.js → RoleList-CAGV8HIy.js} +26 -24
  11. package/dist/TeamMemberList-BOSxsyhc.js +989 -0
  12. package/dist/{TimesheetList-B3cmnZN5.js → TimesheetList-bEatYw_W.js} +11 -10
  13. package/dist/{app-DHFWqcG2.js → app-CXo7sYZ7.js} +2376 -1092
  14. package/dist/app.js +2 -2
  15. package/dist/{dayjs.min-faWeeWGk.js → dayjs.min-DDneYlAk.js} +1 -1
  16. package/dist/{employee-sOy9OKvU.js → employee-CfNSjKLV.js} +21 -20
  17. package/dist/{index-DNsMh7eu.js → index-BAlO0GI7.js} +1 -1
  18. package/dist/index-CiQs6mxE.js +975 -0
  19. package/dist/{index-EeD0w_Es.js → iteration-BxC7Vx_7.js} +3444 -4352
  20. package/dist/{lodash-CfsS7nDC.js → lodash-Cgp0qhfw.js} +1 -1
  21. package/dist/src/api/audit-log/index.d.ts +1 -0
  22. package/dist/src/api/grant-user/index.d.ts +8 -0
  23. package/dist/src/api/index.d.ts +3 -1
  24. package/dist/src/composables/useBasePermission.d.ts +37 -0
  25. package/dist/src/helpers/permission-set.d.ts +34 -5
  26. package/dist/src/helpers/permission-set.test.d.ts +1 -0
  27. package/dist/src/helpers/permission-sync.d.ts +12 -0
  28. package/dist/src/router/shared.d.ts +2 -1
  29. package/dist/src/stores/grant-user.d.ts +86 -0
  30. package/dist/src/types/grant-user.d.ts +27 -0
  31. package/dist/src/views/audit-log/components/AuditLogModuleTabs.vue.d.ts +17 -0
  32. package/dist/src/views/audit-log/constants.d.ts +30 -0
  33. package/dist/src/views/audit-log/locales/index.d.ts +244 -0
  34. package/dist/src/views/grant/GrantUserList.vue.d.ts +17 -0
  35. package/dist/src/views/grant/Main.vue.d.ts +2 -0
  36. package/dist/src/views/grant/components/GrantUserForm.vue.d.ts +17 -0
  37. package/dist/src/views/grant/locales/index.d.ts +232 -0
  38. package/dist/src/views/team/components/BasePermission.vue.d.ts +3 -3
  39. package/dist/style.css +1 -1
  40. package/dist/{team-CTYZ-AfE.js → team-DYjRRZA-.js} +1 -1
  41. package/dist/{timesheet-CP-usx78.js → timesheet-DtpxRbZd.js} +10 -9
  42. package/dist/tsconfig.app.tsbuildinfo +1 -1
  43. package/dist/{useAppStore-DpKptyzk.js → useAppStore-4gHWq2VT.js} +1 -1
  44. package/dist/{useLoading-D0NWMSr4.js → useLoading-Ef4IqHD8.js} +1 -1
  45. package/dist/{useReportPermissions-CtnMIyaq.js → useReportPermissions-C4HbISVo.js} +12 -11
  46. package/dist/useRestaurantMap-e9fQJiLC.js +39 -0
  47. package/package.json +3 -3
  48. package/dist/AuditLogList-BqKDq3NZ.js +0 -492
  49. package/dist/PermissionSetList-BfCuoHa3.js +0 -327
  50. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-BYZbAUtK.js +0 -3334
  51. package/dist/TeamMemberList-BrZDh51J.js +0 -979
  52. package/dist/useRestaurantMap-D5BNPLKh.js +0 -107
@@ -1,4 +1,4 @@
1
- import { c as jt } from "./app-DHFWqcG2.js";
1
+ import { c as jt } from "./app-CXo7sYZ7.js";
2
2
  var Jr = { exports: {} };
3
3
  /**
4
4
  * @license
@@ -7,6 +7,7 @@ declare const AuditLogAPI: {
7
7
  to?: string;
8
8
  userIds?: string[];
9
9
  subjects?: string[];
10
+ subjectPrefixes?: string[];
10
11
  actions?: string[];
11
12
  outcomes?: string[];
12
13
  }): Promise<AuditLogEntry[]>;
@@ -0,0 +1,8 @@
1
+ import type { IFdtoGrantUser, IFdtoCreateGrantUserReq, IFdtoGrantValidationRes } from '@/types/grant-user';
2
+ declare const GrantUserAPI: {
3
+ getGrantUsers(): Promise<IFdtoGrantUser[]>;
4
+ createGrantUser(dto: IFdtoCreateGrantUserReq): Promise<IFdtoGrantUser>;
5
+ revokeGrantUser(id: string, restaurantId: string): Promise<IFdtoGrantUser>;
6
+ validatePasscode(passcode: string, restaurantId: string): Promise<IFdtoGrantValidationRes>;
7
+ };
8
+ export default GrantUserAPI;
@@ -3,6 +3,8 @@ export declare class ApiError extends Error {
3
3
  readonly status: number;
4
4
  constructor(message: string, status: number);
5
5
  }
6
- export declare const businessClientInstance: () => AxiosInstance;
6
+ export declare const businessClientInstance: (subPath?: string) => AxiosInstance;
7
7
  export declare const queryEngineClientInstance: () => AxiosInstance;
8
+ export declare const grantClientInstance: () => AxiosInstance;
9
+ export declare const grantValidateClientInstance: () => AxiosInstance;
8
10
  export declare function getAxiosData<T>(response: AxiosResponse<T>): T;
@@ -0,0 +1,37 @@
1
+ import { type ComputedRef, type Ref } from 'vue';
2
+ import { type IFdtoPortalPermissionsWithVisibilityCondition } from '@feedmepos/hrm-permission';
3
+ import type { FdoPermissionRule } from '@feedmepos/core/entity';
4
+ export type CategoryGroup = {
5
+ category: string;
6
+ options: {
7
+ label: string;
8
+ value: string;
9
+ }[];
10
+ selectedSubjects: string[];
11
+ isMultiAction: boolean;
12
+ actionColumns: string[];
13
+ permissionActionsMap: Map<string, string[]>;
14
+ selectedActionsMap: Map<string, Set<string>>;
15
+ coverSubject: string | null;
16
+ coverSelectedActions: Set<string>;
17
+ coverCoversAll: boolean;
18
+ };
19
+ export declare function useBasePermission(modelValue: Readonly<Ref<FdoPermissionRule[]>>, allPermissions: ComputedRef<IFdtoPortalPermissionsWithVisibilityCondition[]>, excludedSubjects: Readonly<Ref<string[]>>, emit: (event: 'update:model-value', value: FdoPermissionRule[]) => void): {
20
+ categoryGroups: ComputedRef<CategoryGroup[]>;
21
+ toggleCategory: (category: string, subjects: unknown[]) => void;
22
+ isAllManageChecked: (group: CategoryGroup) => boolean;
23
+ toggleAllManage: (group: CategoryGroup) => void;
24
+ isManageChecked: (group: CategoryGroup, subject: string) => boolean;
25
+ isManageIndeterminate: (group: CategoryGroup, subject: string) => boolean;
26
+ toggleManage: (_group: CategoryGroup, subject: string, checked: boolean) => void;
27
+ hasNonManageActions: (group: CategoryGroup, subject: string) => boolean;
28
+ isActionChecked: (group: CategoryGroup, subject: string, action: string) => boolean;
29
+ isRowFullyCoveredByCover: (group: CategoryGroup, subject: string) => boolean;
30
+ isActionCoveredByCover: (group: CategoryGroup, subject: string, action: string) => boolean;
31
+ permissionDefinesAction: (group: CategoryGroup, subject: string, action: string) => boolean;
32
+ toggleAction: (subject: string, action: string, checked: boolean) => void;
33
+ isAllActionChecked: (group: CategoryGroup, action: string) => boolean;
34
+ isAllActionIndeterminate: (group: CategoryGroup, action: string) => boolean;
35
+ toggleAllAction: (group: CategoryGroup, action: string, checked: boolean) => void;
36
+ actionLabel: (action: string) => string;
37
+ };
@@ -43,18 +43,47 @@ export declare function materializeSystemPermissionSetOverrides(overridePermissi
43
43
  /**
44
44
  * Strip positive rules whose subject would be re-injected by system permission set expansion.
45
45
  * These need not be persisted to DB — expansion re-adds them at runtime.
46
- * Inverted rules (explicit user denials) are always preserved.
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.
47
54
  */
48
55
  export declare function stripSystemExpandedPositives(permissions: FdoPermissionRule[]): FdoPermissionRule[];
56
+ export declare const REPORT_SUBJECT_PREFIX = "business::report::";
49
57
  /**
50
- * Filter out permissions whose subject no longer exists in the known permission definitions.
51
- * Removes both positive and inverted rules for stale subjects.
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`.
52
63
  *
53
64
  * This handles:
54
65
  * - Deprecated/renamed subjects (e.g. `business::report::closeup` → `business::report::reports::closeup`)
55
66
  * - Deleted dynamic reports that no longer exist
56
67
  */
57
- export declare function filterStalePermissions(permissions: FdoPermissionRule[], knownSubjects: Set<string>): FdoPermissionRule[];
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.
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.
78
+ * Rules that end up with no remaining actions are dropped.
79
+ *
80
+ * Inverted rules and the cover subjects themselves pass through untouched.
81
+ *
82
+ * @param defaultReportSubjects Full set of subjects in the "Default Report" UI category —
83
+ * includes static hardcoded subjects AND dynamic reports with `isDefault: true`.
84
+ * Built by the caller from `portalTeamPermissions` + `customReportPermissions`.
85
+ */
86
+ export declare function filterRedundantReportPermissions(permissions: FdoPermissionRule[], defaultReportSubjects: Set<string>): FdoPermissionRule[];
58
87
  /**
59
88
  * Combine base permissions with override permissions to get effective permissions
60
89
  * @param basePermissions - Base permissions from permission sets
@@ -69,7 +98,7 @@ export declare function getEffectivePermissions(basePermissions: FdoPermissionRu
69
98
  * subject is NOT present in any base permission set (i.e. they target system-expanded subjects,
70
99
  * not permission-set-inherited subjects). These denials seed `visitedSetIds` in
71
100
  * `expandWithSystemPermissionSets` to block runtime re-expansion of system sets that the user
72
- * explicitly unchecked. Without them the editor would initialise without the denial guard and
101
+ * explicitly unchecked. Without them the editor would initialize without the denial guard and
73
102
  * those subjects would reappear as checked the next time the form opens.
74
103
  *
75
104
  * Inverted rules whose subject IS in base are handled correctly by `getEffectivePermissions`
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,12 @@
1
+ import type { FdoPermissionRule } from '@feedmepos/core/entity';
2
+ /**
3
+ * Keeps the `manage` action in sync with non-manage actions for a given subject.
4
+ *
5
+ * - Adds `manage` when every non-manage action in `definedActions` is selected.
6
+ * - Removes `manage` (and splices the rule if it becomes empty) when any
7
+ * non-manage action is unselected.
8
+ * - No-op when the subject defines only `manage` (or no non-manage actions).
9
+ *
10
+ * Mutates `newRules` in place.
11
+ */
12
+ export declare function applyManageSync(newRules: FdoPermissionRule[], subject: string, definedActions: string[]): void;
@@ -7,7 +7,8 @@ export declare enum RouteName {
7
7
  AUDIT_LOG = "audit-log",
8
8
  TEAM = "team",
9
9
  TEAM_MEMBER = "team-member",
10
- TEAM_ROLE = "team-role"
10
+ TEAM_ROLE = "team-role",
11
+ POS_GRANT = "pos-grant"
11
12
  }
12
13
  declare const routes: RouteRecordRaw[];
13
14
  export { routes };
@@ -0,0 +1,86 @@
1
+ import type { IFdtoGrantUser, IFdtoCreateGrantUserReq } from '@/types/grant-user';
2
+ export declare const useGrantUserStore: import("pinia").StoreDefinition<"grantUser", Pick<{
3
+ grantUsers: import("vue").Ref<{
4
+ _id: string;
5
+ passcode: string;
6
+ name: string;
7
+ restaurantId: string;
8
+ roleId: string;
9
+ status: "active" | "used" | "revoked";
10
+ grantById: string;
11
+ grantByName: string;
12
+ createdAt: string;
13
+ updatedAt: string;
14
+ }[], IFdtoGrantUser[] | {
15
+ _id: string;
16
+ passcode: string;
17
+ name: string;
18
+ restaurantId: string;
19
+ roleId: string;
20
+ status: "active" | "used" | "revoked";
21
+ grantById: string;
22
+ grantByName: string;
23
+ createdAt: string;
24
+ updatedAt: string;
25
+ }[]>;
26
+ isLoading: import("vue").Ref<boolean, boolean>;
27
+ readGrantUsers: () => Promise<void>;
28
+ createGrantUser: (dto: IFdtoCreateGrantUserReq) => Promise<IFdtoGrantUser>;
29
+ revokeGrantUser: (id: string, restaurantId: string) => Promise<void>;
30
+ }, "isLoading" | "grantUsers">, Pick<{
31
+ grantUsers: import("vue").Ref<{
32
+ _id: string;
33
+ passcode: string;
34
+ name: string;
35
+ restaurantId: string;
36
+ roleId: string;
37
+ status: "active" | "used" | "revoked";
38
+ grantById: string;
39
+ grantByName: string;
40
+ createdAt: string;
41
+ updatedAt: string;
42
+ }[], IFdtoGrantUser[] | {
43
+ _id: string;
44
+ passcode: string;
45
+ name: string;
46
+ restaurantId: string;
47
+ roleId: string;
48
+ status: "active" | "used" | "revoked";
49
+ grantById: string;
50
+ grantByName: string;
51
+ createdAt: string;
52
+ updatedAt: string;
53
+ }[]>;
54
+ isLoading: import("vue").Ref<boolean, boolean>;
55
+ readGrantUsers: () => Promise<void>;
56
+ createGrantUser: (dto: IFdtoCreateGrantUserReq) => Promise<IFdtoGrantUser>;
57
+ revokeGrantUser: (id: string, restaurantId: string) => Promise<void>;
58
+ }, never>, Pick<{
59
+ grantUsers: import("vue").Ref<{
60
+ _id: string;
61
+ passcode: string;
62
+ name: string;
63
+ restaurantId: string;
64
+ roleId: string;
65
+ status: "active" | "used" | "revoked";
66
+ grantById: string;
67
+ grantByName: string;
68
+ createdAt: string;
69
+ updatedAt: string;
70
+ }[], IFdtoGrantUser[] | {
71
+ _id: string;
72
+ passcode: string;
73
+ name: string;
74
+ restaurantId: string;
75
+ roleId: string;
76
+ status: "active" | "used" | "revoked";
77
+ grantById: string;
78
+ grantByName: string;
79
+ createdAt: string;
80
+ updatedAt: string;
81
+ }[]>;
82
+ isLoading: import("vue").Ref<boolean, boolean>;
83
+ readGrantUsers: () => Promise<void>;
84
+ createGrantUser: (dto: IFdtoCreateGrantUserReq) => Promise<IFdtoGrantUser>;
85
+ revokeGrantUser: (id: string, restaurantId: string) => Promise<void>;
86
+ }, "readGrantUsers" | "createGrantUser" | "revokeGrantUser">>;
@@ -0,0 +1,27 @@
1
+ export interface IFdtoGrantUser {
2
+ _id: string;
3
+ passcode: string;
4
+ name: string;
5
+ restaurantId: string;
6
+ roleId: string;
7
+ status: 'active' | 'used' | 'revoked';
8
+ grantById: string;
9
+ grantByName: string;
10
+ createdAt: string;
11
+ updatedAt: string;
12
+ }
13
+ export interface IFdtoCreateGrantUserReq {
14
+ name: string;
15
+ restaurantId: string;
16
+ roleId: string;
17
+ }
18
+ export interface IFdtoBypassUser {
19
+ id: string;
20
+ name: string;
21
+ role: string;
22
+ passcode: string;
23
+ }
24
+ export interface IFdtoGrantValidationRes {
25
+ bypass: boolean;
26
+ user: IFdtoBypassUser;
27
+ }
@@ -0,0 +1,17 @@
1
+ type TabValue = string | number;
2
+ type TabItem = {
3
+ label: string;
4
+ value: TabValue;
5
+ disabled?: boolean;
6
+ badge?: number;
7
+ };
8
+ type __VLS_Props = {
9
+ modelValue: TabValue | null;
10
+ items: TabItem[];
11
+ };
12
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
13
+ "update:modelValue": (value: TabValue) => any;
14
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
15
+ "onUpdate:modelValue"?: ((value: TabValue) => any) | undefined;
16
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
17
+ export default _default;
@@ -0,0 +1,30 @@
1
+ export declare const AUDIT_LOG_MODULE_TABS: readonly [{
2
+ readonly key: "all";
3
+ readonly label: "All";
4
+ readonly subjectPrefixes: string[];
5
+ }, {
6
+ readonly key: "inventory";
7
+ readonly label: "Inventory";
8
+ readonly subjectPrefixes: readonly ["business::inventory", "inventory"];
9
+ }, {
10
+ readonly key: "report";
11
+ readonly label: "Report";
12
+ readonly subjectPrefixes: readonly ["business::report", "report"];
13
+ }, {
14
+ readonly key: "hrm";
15
+ readonly label: "HRM";
16
+ readonly subjectPrefixes: readonly ["business::hrm", "hrm"];
17
+ }, {
18
+ readonly key: "payment";
19
+ readonly label: "Payment";
20
+ readonly subjectPrefixes: readonly ["business::payment", "payment"];
21
+ }, {
22
+ readonly key: "menu";
23
+ readonly label: "Menu";
24
+ readonly subjectPrefixes: readonly ["business::menu", "menu"];
25
+ }, {
26
+ readonly key: "crm";
27
+ readonly label: "CRM";
28
+ readonly subjectPrefixes: readonly ["business::crm", "crm"];
29
+ }];
30
+ export type AuditLogModuleTab = (typeof AUDIT_LOG_MODULE_TABS)[number];