@feedmepos/mf-hrm-portal 2.3.1 → 2.3.2-dev.10
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-CcvVEriB.js → ApprovalCodeList-RKU5B8SO.js} +14 -15
- package/dist/{AuditLogList-C61-SnWG.js → AuditLogList-DuDCMjGR.js} +796 -720
- package/dist/ConditionBuilderForm.vue_vue_type_script_setup_true_lang-pL2zRc67.js +459 -0
- package/dist/EmployeeList-nrYsS5uz.js +896 -0
- package/dist/FormSection.vue_vue_type_script_setup_true_lang-7S2w36aY.js +90 -0
- package/dist/{GrantUserList-1ErIV7b7.js → GrantUserList-BSjeC4MC.js} +15 -16
- package/dist/{Main-R0qyd8Ea.js → Main-CpuHaXU6.js} +5 -5
- package/dist/Main-DbdoVLCE.js +101 -0
- package/dist/{Main-CD8OS1rM.js → Main-DtmCBbTR.js} +1005 -999
- package/dist/MyPosProfile-CsTCfGNT.js +360 -0
- package/dist/PasscodePinField.vue_vue_type_script_setup_true_lang-TXPEqa46.js +126 -0
- package/dist/{PermissionSetList-ig3oxdhh.js → PermissionSetList-B1c-uGZO.js} +80 -80
- package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-Toq6qrLx.js +4208 -0
- package/dist/PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-D6Z9z_Yt.js +1831 -0
- package/dist/RoleForm.vue_vue_type_script_setup_true_lang-TWTVo_9Y.js +547 -0
- package/dist/RoleList-CwaGNsFy.js +265 -0
- package/dist/{ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-Dg7S6nFO.js → ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-C2ekVXdR.js} +1 -1
- package/dist/{ScheduleGeneralPage-QYijA95u.js → ScheduleGeneralPage-BVtXmxtp.js} +2 -2
- package/dist/{ScheduleModal.vue_vue_type_script_setup_true_lang-Bnyqna_E.js → ScheduleModal.vue_vue_type_script_setup_true_lang-DdsQ8v-5.js} +187 -186
- package/dist/{SchedulePage-BrBZmuMj.js → SchedulePage-3qksmT2I.js} +193 -205
- package/dist/{SchedulePositionPage-NCvNg8v5.js → SchedulePositionPage-DAU20KPZ.js} +3 -3
- package/dist/{SelectFilter-r-QOCO99.js → SelectFilter-BpzBwBmQ.js} +2 -3
- package/dist/TeamMemberList-Bdpm40i3.js +2087 -0
- package/dist/TimesheetList-CL_eJp2h.js +437 -0
- package/dist/{app-DKHtjxyC.js → app-DEZT4wdV.js} +7789 -3967
- package/dist/app.js +3 -3
- package/dist/{approval-code-BIpLingm.js → approval-code-BZTz5OXK.js} +4 -4
- package/dist/{dayjs.min-CNNMpacl.js → dayjs.min-B55I-uhI.js} +21 -21
- package/dist/employee-C6z5i6O4.js +172 -0
- package/dist/{grant-user-uZmvD_bw.js → grant-user-B2rYztyf.js} +2 -2
- package/dist/{iteration-DkcNkScw.js → index-Bfdseotz.js} +698 -726
- package/dist/iteration-CcXrOMQe.js +30 -0
- package/dist/{lodash-g-62RoFP.js → lodash-B8bqa6a9.js} +1 -1
- package/dist/member-grant-BIpKkuu8.js +54 -0
- package/dist/restaurant-ejyX2jEG.js +52 -0
- package/dist/role-C_t3DDlG.js +98 -0
- package/dist/rule-Ccopk8R_.js +843 -0
- package/dist/src/api/audit-log/index.d.ts +2 -0
- package/dist/src/api/employee/index.d.ts +1 -2
- package/dist/src/api/my-pos-profile/index.d.ts +3 -0
- package/dist/src/api/sso-provider/index.d.ts +5 -0
- package/dist/src/api/staff-invite/index.d.ts +16 -0
- package/dist/src/api/timesheet/index.d.ts +1 -1
- package/dist/src/components/CollapsibleWrapper.vue.d.ts +11 -3
- package/dist/src/components/form/SegmentedTabs.vue.d.ts +23 -0
- package/dist/src/composables/useMenuAccess.d.ts +56 -0
- package/dist/src/composables/useSsoProviders.d.ts +19 -0
- package/dist/src/composables/useStaffInviteProviders.d.ts +8 -0
- package/dist/src/helpers/member-grant.d.ts +36 -0
- package/dist/src/helpers/my-pos-profile.d.ts +37 -0
- package/dist/src/helpers/permission-set.d.ts +1 -102
- package/dist/src/helpers/pos-assignment-rows.d.ts +28 -0
- package/dist/src/helpers/rule.d.ts +2 -2
- package/dist/src/helpers/staff-invite.d.ts +54 -0
- package/dist/src/helpers/string.d.ts +10 -1
- package/dist/src/router/menu-access-guard.d.ts +17 -0
- package/dist/src/router/shared.d.ts +3 -1
- package/dist/src/stores/approval-code.d.ts +1 -1
- package/dist/src/stores/employee.d.ts +3 -9
- 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 +70 -10
- package/dist/src/stores/role.d.ts +2 -2
- package/dist/src/stores/team.d.ts +31 -1
- package/dist/src/stores/timesheet.d.ts +68 -53
- package/dist/src/types/my-pos-profile.d.ts +24 -0
- package/dist/src/types/sso-provider.d.ts +10 -0
- package/dist/src/types/staff-invite.d.ts +100 -0
- package/dist/src/types/team.d.ts +17 -1
- package/dist/src/types/timesheet.d.ts +3 -0
- package/dist/src/views/audit-log/locales/index.d.ts +40 -0
- package/dist/src/views/audit-log/useTraceIdDeepLink.d.ts +19 -0
- package/dist/src/views/hr/locales/index.d.ts +24 -4
- package/dist/src/views/hr/role/RoleForm.vue.d.ts +29 -2
- package/dist/src/views/my-pos-profile/MyPosProfile.vue.d.ts +2 -0
- package/dist/src/views/my-pos-profile/components/PasscodeChangedDialog.vue.d.ts +4 -0
- package/dist/src/views/my-pos-profile/locales/index.d.ts +236 -0
- package/dist/src/views/scheduling/composables/useScheduleOnboardingAvailability.d.ts +1 -1
- package/dist/src/views/scheduling/composables/useScheduleOnboardingWizard.d.ts +1 -1
- package/dist/src/views/scheduling/composables/useScheduleShiftDraft.d.ts +1 -1
- package/dist/src/views/scheduling/composables/useScheduleShiftPopover.d.ts +1 -1
- package/dist/src/views/team/components/BasePermission.vue.d.ts +11 -0
- package/dist/src/views/team/components/ConditionPermission.vue.d.ts +11 -0
- package/dist/src/views/team/components/MemberGrantFields.vue.d.ts +51 -0
- package/dist/src/views/team/{member/MemberInfo.vue.d.ts → components/MemberStatusBadge.vue.d.ts} +2 -2
- package/dist/src/views/team/components/PortalPermissionEditor.vue.d.ts +21 -0
- package/dist/src/views/team/components/PosAssignmentRows.vue.d.ts +44 -0
- package/dist/src/views/team/components/PosRolePermission.vue.d.ts +11 -0
- package/dist/src/views/team/locales/index.d.ts +716 -0
- package/dist/src/views/team/member/AddMemberForm.vue.d.ts +48 -3
- package/dist/src/views/team/member/ExistingMemberNotice.vue.d.ts +11 -0
- package/dist/src/views/team/member/MemberDetailsCard.vue.d.ts +35 -0
- package/dist/src/views/team/member/MemberHeaderCard.vue.d.ts +19 -0
- package/dist/src/views/team/member/TeamMemberList.vue.d.ts +1 -0
- package/dist/string-DZQ1uNjn.js +22 -0
- package/dist/style.css +1 -1
- package/dist/timesheet-CZHcebqS.js +76 -0
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{useAppStore-Bp0PwbAN.js → useAppStore-DfqsbhT2.js} +1 -1
- package/dist/{useLoading-sgL8DRUz.js → useLoading-CQnX5WjI.js} +1 -1
- package/dist/useMessage-_ywT_N9X.js +17 -0
- package/dist/{useReportPermissions-CcIHwTRI.js → useReportPermissions-kTjftFk7.js} +13 -13
- package/package.json +4 -4
- package/dist/ConditionBuilderForm.vue_vue_type_script_setup_true_lang-BZ-ZDviW.js +0 -438
- package/dist/EmployeeList-Cucr2mxn.js +0 -776
- package/dist/FormItem.vue_vue_type_script_setup_true_lang-4XV2qPxn.js +0 -45
- package/dist/FormSection.vue_vue_type_script_setup_true_lang-DknXTYiK.js +0 -49
- package/dist/Main-B-F_cdM_.js +0 -96
- package/dist/PasscodePinField.vue_vue_type_script_setup_true_lang-CqG0v0Sz.js +0 -243
- package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-ClG4YhnF.js +0 -4167
- package/dist/PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-DaAx79pC.js +0 -35
- package/dist/RoleList-BqR_Vf8H.js +0 -740
- package/dist/TeamMemberList-B6ZnfKV0.js +0 -1154
- package/dist/TimesheetList-BvsUk6kd.js +0 -402
- package/dist/TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-D3--3EhR.js +0 -58
- package/dist/employee-H2J0xRqJ.js +0 -209
- package/dist/restaurant-CHpkjUPy.js +0 -1880
- package/dist/role-CkxDtfst.js +0 -92
- package/dist/rule-BWvSqhBk.js +0 -783
- package/dist/string-VNuQNweN.js +0 -15
|
@@ -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,11 +1,10 @@
|
|
|
1
1
|
import { FdtoUpdatePosUserReq, FdtoUpdatePosMasterUserReq } from '@feedmepos/core/entity';
|
|
2
|
-
import type { Employee, IFdtoEmployeePage,
|
|
2
|
+
import type { Employee, IFdtoEmployeePage, IReadEmployeesPageReq } from '@/types/employee';
|
|
3
3
|
export interface IGeneratePasscodeParams {
|
|
4
4
|
restaurantIds: string[];
|
|
5
5
|
excludePosUserId?: string;
|
|
6
6
|
}
|
|
7
7
|
declare const EmployeeAPI: {
|
|
8
|
-
readEmployees(): Promise<IFdtoPosUser[]>;
|
|
9
8
|
readEmployeesPage(query: IReadEmployeesPageReq): Promise<IFdtoEmployeePage>;
|
|
10
9
|
createEmployee(dto: FdtoUpdatePosUserReq): Promise<string>;
|
|
11
10
|
createMasterEmployee(dto: FdtoUpdatePosMasterUserReq): Promise<string>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { IFdtoCreateStaffInviteReq, IFdtoCreateStaffInviteRes, IFdtoResendStaffInviteRes, IFdtoStaffInvite, IFdtoStaffInviteLookup, IFdtoUpdateStaffInviteReq } from '@/types/staff-invite';
|
|
2
|
+
declare const StaffInviteAPI: {
|
|
3
|
+
readInvites(status?: IFdtoStaffInvite["status"]): Promise<IFdtoStaffInvite[]>;
|
|
4
|
+
lookup(key: {
|
|
5
|
+
mobile: string;
|
|
6
|
+
} | {
|
|
7
|
+
email: string;
|
|
8
|
+
}, provider?: string): Promise<IFdtoStaffInviteLookup | null>;
|
|
9
|
+
createInvite(req: IFdtoCreateStaffInviteReq): Promise<IFdtoCreateStaffInviteRes>;
|
|
10
|
+
updateInvite(id: string, req: IFdtoUpdateStaffInviteReq): Promise<IFdtoStaffInvite>;
|
|
11
|
+
revokeInvite(id: string): Promise<{
|
|
12
|
+
ok: true;
|
|
13
|
+
}>;
|
|
14
|
+
resendInvite(id: string): Promise<IFdtoResendStaffInviteRes>;
|
|
15
|
+
};
|
|
16
|
+
export default StaffInviteAPI;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { IFdtoTimesheet, UpdateTimesheetDTO } from '@/types/timesheet';
|
|
2
2
|
declare const TimesheetAPI: {
|
|
3
|
-
readTimesheets(startIso: string, endIso: string): Promise<IFdtoTimesheet[]>;
|
|
3
|
+
readTimesheets(startIso: string, endIso: string, restaurantIds?: string[]): Promise<IFdtoTimesheet[]>;
|
|
4
4
|
updateTimesheet(restaurantId: string, dto: UpdateTimesheetDTO): Promise<void>;
|
|
5
5
|
};
|
|
6
6
|
export default TimesheetAPI;
|
|
@@ -2,17 +2,25 @@ interface Props {
|
|
|
2
2
|
title?: string;
|
|
3
3
|
subtitle?: string;
|
|
4
4
|
initiallyCollapsed?: boolean;
|
|
5
|
+
/**
|
|
6
|
+
* 'trailing': toggle on the right, subtitle beside the title while collapsed.
|
|
7
|
+
* 'leading': chevron before the title, subtitle always under it (member sheet cards).
|
|
8
|
+
*/
|
|
9
|
+
layout?: 'trailing' | 'leading';
|
|
5
10
|
}
|
|
6
|
-
declare var
|
|
11
|
+
declare var __VLS_5: {}, __VLS_7: {}, __VLS_13: {};
|
|
7
12
|
type __VLS_Slots = {} & {
|
|
8
|
-
title?: (props: typeof
|
|
13
|
+
title?: (props: typeof __VLS_5) => any;
|
|
9
14
|
} & {
|
|
10
|
-
|
|
15
|
+
title?: (props: typeof __VLS_7) => any;
|
|
16
|
+
} & {
|
|
17
|
+
default?: (props: typeof __VLS_13) => any;
|
|
11
18
|
};
|
|
12
19
|
declare const __VLS_component: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
13
20
|
title: string;
|
|
14
21
|
subtitle: string;
|
|
15
22
|
initiallyCollapsed: boolean;
|
|
23
|
+
layout: "trailing" | "leading";
|
|
16
24
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
17
25
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
18
26
|
export default _default;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
declare const _default: <T extends string>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
2
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
3
|
+
readonly "onUpdate:modelValue"?: ((value: T) => any) | undefined;
|
|
4
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onUpdate:modelValue"> & ({
|
|
5
|
+
items: {
|
|
6
|
+
label: string;
|
|
7
|
+
value: T;
|
|
8
|
+
}[];
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
} & {
|
|
11
|
+
modelValue: T;
|
|
12
|
+
}) & Partial<{}>> & import("vue").PublicProps;
|
|
13
|
+
expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
|
|
14
|
+
attrs: any;
|
|
15
|
+
slots: {};
|
|
16
|
+
emit: (evt: "update:modelValue", value: T) => void;
|
|
17
|
+
}>) => import("vue").VNode & {
|
|
18
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
19
|
+
};
|
|
20
|
+
export default _default;
|
|
21
|
+
type __VLS_PrettifyLocal<T> = {
|
|
22
|
+
[K in keyof T]: T[K];
|
|
23
|
+
} & {};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { type ComputedRef } from 'vue';
|
|
2
|
+
import { type LocationQuery, type RouteLocationMatched } from 'vue-router';
|
|
3
|
+
import { RouteName } from '@/router/shared';
|
|
4
|
+
/**
|
|
5
|
+
* One HRM side-menu entry. `to` is the route the item opens; its accessibility is the
|
|
6
|
+
* accessibility of that route, so the menu and the route guards can never disagree.
|
|
7
|
+
*/
|
|
8
|
+
export interface MenuItemDef {
|
|
9
|
+
/** FmCollapsibleTabs value; kept identical to the values the Navigator always used. */
|
|
10
|
+
value: string;
|
|
11
|
+
labelKey: string;
|
|
12
|
+
to: RouteName;
|
|
13
|
+
/** Carry the current query (business query state) along when navigating. */
|
|
14
|
+
keepQuery: boolean;
|
|
15
|
+
/** Route names that highlight this item. */
|
|
16
|
+
activeRoutes: RouteName[];
|
|
17
|
+
}
|
|
18
|
+
export interface MenuAccessItem extends MenuItemDef {
|
|
19
|
+
accessible: boolean;
|
|
20
|
+
/** Access is not known yet (only My POS Profile, while its lookup runs). */
|
|
21
|
+
loading: boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Menu order: existing items first, My POS Profile last. Built lazily because
|
|
25
|
+
* `@/router/shared` imports this module (through the route guard), so `RouteName` is not
|
|
26
|
+
* initialised yet while this module is first evaluated.
|
|
27
|
+
*/
|
|
28
|
+
export declare function menuItemDefs(): MenuItemDef[];
|
|
29
|
+
type SessionUser = {
|
|
30
|
+
_role?: string;
|
|
31
|
+
permissions: unknown[];
|
|
32
|
+
} | null | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* Same rule `withPermission` applies (hrm-permission `validateRoute` → `validate`): every
|
|
35
|
+
* matched record's `meta.validationManifest` must pass its role list and its CASL
|
|
36
|
+
* requirements, checked with the package's own `checkAccess`. `validateRoute` itself is not
|
|
37
|
+
* exported, so this walks the manifests and delegates the rule to `checkAccess`.
|
|
38
|
+
* No route here uses `customValidationFunction`; a manifest that has one is left to
|
|
39
|
+
* `withPermission` (treated as passing here).
|
|
40
|
+
*/
|
|
41
|
+
export declare function passesRouteManifests(matched: readonly Pick<RouteLocationMatched, 'meta'>[], sessionUser: SessionUser): boolean;
|
|
42
|
+
/** Test hook: forget every cached lookup. */
|
|
43
|
+
export declare function resetMenuAccessCache(): void;
|
|
44
|
+
export declare function useMenuAccess(): {
|
|
45
|
+
items: ComputedRef<MenuAccessItem[]>;
|
|
46
|
+
visibleItems: ComputedRef<MenuAccessItem[]>;
|
|
47
|
+
firstAccessible: ComputedRef<MenuAccessItem | undefined>;
|
|
48
|
+
hasPosUser: ComputedRef<boolean | undefined>;
|
|
49
|
+
isLoading: ComputedRef<boolean>;
|
|
50
|
+
canOpenMatched: (matched: readonly RouteLocationMatched[]) => boolean | undefined;
|
|
51
|
+
locationFor: (item: MenuItemDef, query?: LocationQuery) => {
|
|
52
|
+
query?: LocationQuery | undefined;
|
|
53
|
+
name: RouteName;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { IFdtoSsoProvider } from '@/types/sso-provider';
|
|
2
|
+
export declare function useSsoProviders(): {
|
|
3
|
+
providers: import("vue").Ref<{
|
|
4
|
+
slug: string;
|
|
5
|
+
label: string;
|
|
6
|
+
type: string;
|
|
7
|
+
enabled: boolean;
|
|
8
|
+
inviteMatch: import("../types/staff-invite").StaffInviteMatch | "none";
|
|
9
|
+
}[], IFdtoSsoProvider[] | {
|
|
10
|
+
slug: string;
|
|
11
|
+
label: string;
|
|
12
|
+
type: string;
|
|
13
|
+
enabled: boolean;
|
|
14
|
+
inviteMatch: import("../types/staff-invite").StaffInviteMatch | "none";
|
|
15
|
+
}[]>;
|
|
16
|
+
isLoaded: import("vue").ComputedRef<boolean>;
|
|
17
|
+
loadProviders: () => Promise<void>;
|
|
18
|
+
providerLabel: (slug: string) => string;
|
|
19
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare function useStaffInviteProviders(): {
|
|
2
|
+
providers: import("vue").ComputedRef<import("../types/staff-invite").IFdtoStaffInviteProvider[]>;
|
|
3
|
+
isLoaded: import("vue").ComputedRef<boolean>;
|
|
4
|
+
hasProviders: import("vue").ComputedRef<boolean>;
|
|
5
|
+
canInvite: import("vue").ComputedRef<boolean>;
|
|
6
|
+
loadProviders: () => Promise<void>;
|
|
7
|
+
providerLabel: (slug: string) => string;
|
|
8
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { FdoPermissionRule } from '@feedmepos/core/entity';
|
|
2
|
+
import type { IFdtoPermissionSet } from '@/types/permission-set';
|
|
3
|
+
import type { IFdtoCreatePortalUserReq, IFdtoPermissionPosUser, IFdtoUpdatePortalUserReq } from '@/types/team';
|
|
4
|
+
/** The grant half of a portal user request: roles, custom permissions and POS master user. */
|
|
5
|
+
export type MemberGrantPayload = Required<Pick<IFdtoCreatePortalUserReq, 'customPermissions' | 'permissions' | 'permissionSetIds'>> & Pick<IFdtoCreatePortalUserReq, 'posUser'>;
|
|
6
|
+
export interface MemberGrantState {
|
|
7
|
+
userPermissions: FdoPermissionRule[];
|
|
8
|
+
/** Permission sets collected from the selected roles. */
|
|
9
|
+
inheritedPermissions: IFdtoPermissionSet[];
|
|
10
|
+
permissionSetIds: string[];
|
|
11
|
+
posUser: IFdtoPermissionPosUser | null | undefined;
|
|
12
|
+
/** Report subjects still known; report rules outside it are stale. */
|
|
13
|
+
reportSubjects: Set<string>;
|
|
14
|
+
defaultReportSubjects: Set<string>;
|
|
15
|
+
/** Saved POS user, used when the form leaves name or code empty. */
|
|
16
|
+
savedPosUser?: IFdtoPermissionPosUser;
|
|
17
|
+
fallbackName: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Rules that scope where a member works (outlets, warehouses, usable POS roles) rather
|
|
21
|
+
* than which portal pages they open. "Where they work" edits these; "Portal access" the rest.
|
|
22
|
+
*/
|
|
23
|
+
export declare const WORKPLACE_SUBJECTS: readonly string[];
|
|
24
|
+
/** Whether a grant opens any portal page: a role, or a granted rule beyond the workplace ones. */
|
|
25
|
+
export declare function hasPortalAccess(rules: FdoPermissionRule[], permissionSetIds: string[]): boolean;
|
|
26
|
+
/** Portal access off: keep only where they work, so they get My POS Profile and nothing else. */
|
|
27
|
+
export declare function withoutPortalAccess(rules: FdoPermissionRule[]): FdoPermissionRule[];
|
|
28
|
+
/** What an untouched grant section submits. */
|
|
29
|
+
export declare const EMPTY_MEMBER_GRANT: MemberGrantPayload;
|
|
30
|
+
export declare function buildMemberGrantPayload(state: MemberGrantState): MemberGrantPayload;
|
|
31
|
+
/**
|
|
32
|
+
* Member edit request: the passcode goes out only when the admin changed it. The form
|
|
33
|
+
* holds the passcode loaded when it opened; sending that back would overwrite a newer one
|
|
34
|
+
* the member set in My POS Profile (KDI-5225 review #2). Add member sends it as is.
|
|
35
|
+
*/
|
|
36
|
+
export declare function toMemberUpdateReq(req: IFdtoCreatePortalUserReq, saved: IFdtoPermissionPosUser | undefined): IFdtoUpdatePortalUserReq;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { FdtoMyPosProfile, FdtoMyPosProfileAssignment } from '@/types/my-pos-profile';
|
|
2
|
+
type Profile = NonNullable<FdtoMyPosProfile['profile']>;
|
|
3
|
+
export interface MyPosProfileRow {
|
|
4
|
+
/** Name and contact show on the first row only, as in the design. */
|
|
5
|
+
name: string | null;
|
|
6
|
+
contact: string | null;
|
|
7
|
+
restaurant: string;
|
|
8
|
+
role: string;
|
|
9
|
+
assignment: FdtoMyPosProfileAssignment;
|
|
10
|
+
}
|
|
11
|
+
/** A null phone number shows the email instead (contract). */
|
|
12
|
+
export declare const profileContact: (profile: Profile) => string;
|
|
13
|
+
/** One row per assignment; name and contact on the first row only. */
|
|
14
|
+
export declare function toProfileRows(profile: Profile): MyPosProfileRow[];
|
|
15
|
+
/**
|
|
16
|
+
* "Updated …" for the passcode card: null when the change time is unknown (D53: the line
|
|
17
|
+
* is hidden), "just now" under a minute, else a localized relative time. Weeks run to 13
|
|
18
|
+
* (the design shows "12 weeks ago") before months take over.
|
|
19
|
+
*/
|
|
20
|
+
export declare function formatPasscodeUpdated(updatedAt: string | null, t: (key: string, values?: Record<string, unknown>) => string, locale: string, now?: number): string | null;
|
|
21
|
+
/**
|
|
22
|
+
* Opens account-service's Manage Account page through the FeedMeAuth that
|
|
23
|
+
* @feedmepos/mf-common exposes (the same page the portal shell's "Manage Account" leads
|
|
24
|
+
* to). openManageProfile is newer than the @feedmepos/auth types this app builds against,
|
|
25
|
+
* so it is looked up at runtime. Returns false when it is missing or throws (e.g. no
|
|
26
|
+
* FeedMe session), for the caller to report.
|
|
27
|
+
*/
|
|
28
|
+
export declare function openManageAccount(auth: object): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* 409 `pos_user_shared`: the POS user's id is shared with another team member, so the
|
|
31
|
+
* backend refuses to show or change it (KDI-5225 review #1). Checked structurally, so
|
|
32
|
+
* callers need not import the API client.
|
|
33
|
+
*/
|
|
34
|
+
export declare const isPosUserSharedError: (err: unknown) => boolean;
|
|
35
|
+
/** Locale key for a failed Change passcode. */
|
|
36
|
+
export declare function passcodeChangeErrorKey(err: unknown): string;
|
|
37
|
+
export {};
|
|
@@ -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,28 @@
|
|
|
1
|
+
import type { HrmRestaurant } from '@/types/restaurant';
|
|
2
|
+
import type { Role } from '@/types/role';
|
|
3
|
+
import type { IFdtoPermissionPosUserRole } from '@/types/team';
|
|
4
|
+
/** One row of the POS access card: the outlets that share a POS role. */
|
|
5
|
+
export interface PosAssignmentRow {
|
|
6
|
+
restaurantIds: string[];
|
|
7
|
+
roleId: string;
|
|
8
|
+
}
|
|
9
|
+
export interface SelectOption {
|
|
10
|
+
label: string;
|
|
11
|
+
value: string;
|
|
12
|
+
disabled: boolean;
|
|
13
|
+
}
|
|
14
|
+
/** Groups a POS user's per-outlet roles into rows by role, in first-seen order. */
|
|
15
|
+
export declare function toRows(roles: IFdtoPermissionPosUserRole[]): PosAssignmentRow[];
|
|
16
|
+
/** The per-outlet roles a POS user stores. A row without outlets adds nothing. */
|
|
17
|
+
export declare function toRoles(rows: PosAssignmentRow[]): IFdtoPermissionPosUserRole[];
|
|
18
|
+
export declare function sameRoles(a: IFdtoPermissionPosUserRole[], b: IFdtoPermissionPosUserRole[]): boolean;
|
|
19
|
+
export declare function restaurantLabel(restaurant: HrmRestaurant): string;
|
|
20
|
+
/** The row's outlets as one line for its select field, in the order the list shows them. */
|
|
21
|
+
export declare function rowRestaurantSummary(restaurants: HrmRestaurant[], row: PosAssignmentRow): string;
|
|
22
|
+
/** Outlets for a row; one already in another row can't be picked twice. */
|
|
23
|
+
export declare function rowRestaurantOptions(restaurants: HrmRestaurant[], rows: PosAssignmentRow[], index: number): SelectOption[];
|
|
24
|
+
/** Roles that exist at every outlet of the row; unusable ones stay visible but disabled. */
|
|
25
|
+
export declare function rowRoleOptions(roles: Role[], row: PosAssignmentRow, isRoleUsable: (role: Role) => boolean): SelectOption[];
|
|
26
|
+
/** Keeps the row's role when it still applies to all its outlets, else the first usable one. */
|
|
27
|
+
export declare function pickRowRole(roles: Role[], row: PosAssignmentRow, isRoleUsable: (role: Role) => boolean): string;
|
|
28
|
+
export declare function canAddRow(restaurants: HrmRestaurant[], rows: PosAssignmentRow[]): boolean;
|
|
@@ -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;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { RawRule } from '@casl/ability';
|
|
2
|
+
import { type IFdtoCreateStaffInviteReq, type IFdtoCreateStaffInviteRes, type IFdtoStaffInvite, type IFdtoStaffInviteProvider, type IFdtoUpdateStaffInviteReq, type StaffInviteMatch, type StaffInviteWarning } from '@/types/staff-invite';
|
|
3
|
+
import type { IFdtoSsoProvider } from '@/types/sso-provider';
|
|
4
|
+
type Translate = (key: string, params?: Record<string, unknown>) => string;
|
|
5
|
+
/**
|
|
6
|
+
* Same check the backend makes for POST /portal-users: create on hrm::portalUsers, which the
|
|
7
|
+
* Team member toggle (hrm_teamMember:manage) grants through its system permission set.
|
|
8
|
+
*/
|
|
9
|
+
export declare function canCreatePortalUsers(permissions: RawRule[]): boolean;
|
|
10
|
+
/** The providers invites can go through: switched on, with a key to match people on. */
|
|
11
|
+
export declare function invitableProviders(providers: IFdtoSsoProvider[]): IFdtoStaffInviteProvider[];
|
|
12
|
+
export declare function canInviteStaff(providers: IFdtoStaffInviteProvider[], permissions: RawRule[]): boolean;
|
|
13
|
+
/** E.164 form of a valid phone number, or null. */
|
|
14
|
+
export declare function toE164(phone: string): string | null;
|
|
15
|
+
/** False for an empty field, including the bare dial code FmPhoneNumber keeps in its model. */
|
|
16
|
+
export declare function hasPhoneInput(phone: string): boolean;
|
|
17
|
+
export declare function isValidEmail(email: string): boolean;
|
|
18
|
+
export declare const DISPLAY_NAME_MAX_LENGTH = 100;
|
|
19
|
+
export declare const EMPLOYEE_ID_MAX_LENGTH = 50;
|
|
20
|
+
export declare function staffInviteKey(invite: IFdtoStaffInvite): string;
|
|
21
|
+
/** What the Update member sheet edits besides the grant. */
|
|
22
|
+
export interface InviteDetailsEdit {
|
|
23
|
+
displayName: string;
|
|
24
|
+
employeeId: string;
|
|
25
|
+
/** The contact that isn't the sign-in key; '' clears it. */
|
|
26
|
+
contact: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* An invite edit from the Update member sheet. Without `details` the name, employee ID and
|
|
30
|
+
* contact stay as saved (the backend clears a contact that is left out, so it is resent).
|
|
31
|
+
*/
|
|
32
|
+
export declare function toInviteGrantUpdateReq(invite: IFdtoStaffInvite, grant: Pick<IFdtoCreateStaffInviteReq, 'permissions' | 'customPermissions' | 'permissionSetIds' | 'posUser'>, details?: InviteDetailsEdit): IFdtoUpdateStaffInviteReq;
|
|
33
|
+
/** Provider label and key type, for copy that names the IdP or says "number"/"email". */
|
|
34
|
+
export interface StaffInviteCopyContext {
|
|
35
|
+
label: string;
|
|
36
|
+
match: StaffInviteMatch;
|
|
37
|
+
}
|
|
38
|
+
/** One message per warning. A direct add has no invite, so its copy says so. */
|
|
39
|
+
export declare function staffInviteWarningMessages(warnings: StaffInviteWarning[], ctx: StaffInviteCopyContext, t: Translate, result?: IFdtoCreateStaffInviteRes['result']): string[];
|
|
40
|
+
export declare function staffInviteResultMessage(res: IFdtoCreateStaffInviteRes, ctx: StaffInviteCopyContext, t: Translate): {
|
|
41
|
+
title: string;
|
|
42
|
+
lines: string[];
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* The message of a rejected request. The portal's own client rejects with an `ApiError`;
|
|
46
|
+
* mf-common's `baseClientInstance` (used when no backend URL is configured) rejects with the
|
|
47
|
+
* plain message string.
|
|
48
|
+
*/
|
|
49
|
+
export declare function errorMessageOf(err: unknown): string;
|
|
50
|
+
/** The invite was claimed, revoked or deleted elsewhere: the row is stale. */
|
|
51
|
+
export declare function isStaleInviteError(err: unknown): boolean;
|
|
52
|
+
/** Copy for a backend error code; any other message is shown as is. */
|
|
53
|
+
export declare function staffInviteErrorMessage(err: unknown, ctx: StaffInviteCopyContext, t: Translate): string;
|
|
54
|
+
export {};
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
declare function randomString(length: number, config?: {
|
|
2
2
|
includeSpecialCase: boolean;
|
|
3
3
|
}): string;
|
|
4
|
+
/**
|
|
5
|
+
* "A, B +2 more" for a selection; null means everything (the "include future" choice).
|
|
6
|
+
* Collapsed permission rows show it under their title.
|
|
7
|
+
*/
|
|
8
|
+
declare function summarizeNames(names: string[] | null, labels: {
|
|
9
|
+
all: string;
|
|
10
|
+
none: string;
|
|
11
|
+
more: (count: number) => string;
|
|
12
|
+
}, shown?: number): string;
|
|
4
13
|
declare const filter: {
|
|
5
14
|
alphabetOnly(word: string): string;
|
|
6
15
|
alphaNumeric(word: string): string;
|
|
@@ -10,4 +19,4 @@ declare const validate: {
|
|
|
10
19
|
email(input: string): RegExpMatchArray | null;
|
|
11
20
|
};
|
|
12
21
|
declare function nameInitials(name: string | null | undefined): string;
|
|
13
|
-
export { filter, validate, randomString, nameInitials };
|
|
22
|
+
export { filter, validate, randomString, nameInitials, summarizeNames };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type Component } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Wraps a top-level route component so a user who can't open the current route lands on
|
|
4
|
+
* the first menu item they can open (D52). It lives in the route records, so it works in
|
|
5
|
+
* the standalone router and in the host portal that mounts `routes`.
|
|
6
|
+
*
|
|
7
|
+
* - Accessible: render the page.
|
|
8
|
+
* - Not accessible, access still loading: render nothing (no flash of the no-permission page).
|
|
9
|
+
* - Not accessible, some item accessible: replace with that item.
|
|
10
|
+
* - Nothing accessible: today's behaviour. A route with a permission manifest renders its
|
|
11
|
+
* page, whose `withPermission` shows the no-permission screen; any other route (landing,
|
|
12
|
+
* My POS Profile) goes to Employee, which does the same. Targets are always either
|
|
13
|
+
* accessible or manifest-guarded, so this never loops.
|
|
14
|
+
*/
|
|
15
|
+
export declare function withMenuAccess(Comp?: Component): Component;
|
|
16
|
+
/** `/`: shows nothing and sends the user to the first page they can open. */
|
|
17
|
+
export declare const MenuLanding: Component;
|
|
@@ -8,12 +8,14 @@ export declare enum RouteName {
|
|
|
8
8
|
TEAM = "team",
|
|
9
9
|
TEAM_MEMBER = "team-member",
|
|
10
10
|
TEAM_ROLE = "team-role",
|
|
11
|
+
TEAM_INVITE = "team-invite",
|
|
11
12
|
POS_ACCESS = "pos-access",
|
|
12
13
|
POS_GRANT = "pos-grant",
|
|
13
14
|
APPROVAL_CODE = "approval-code",
|
|
14
15
|
SCHEDULE = "schedule",
|
|
15
16
|
SCHEDULE_POSITION = "schedule-position",
|
|
16
|
-
SCHEDULE_GENERAL = "schedule-general"
|
|
17
|
+
SCHEDULE_GENERAL = "schedule-general",
|
|
18
|
+
MY_POS_PROFILE = "my-pos-profile"
|
|
17
19
|
}
|
|
18
20
|
declare const routes: RouteRecordRaw[];
|
|
19
21
|
export { routes };
|
|
@@ -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;
|
|
@@ -374,7 +374,6 @@ export declare const useEmployeeStore: () => {
|
|
|
374
374
|
})[]>;
|
|
375
375
|
totalEmployees: import("vue").Ref<number, number>;
|
|
376
376
|
isLoading: import("vue").Ref<boolean, boolean>;
|
|
377
|
-
readEmployees: () => Promise<void>;
|
|
378
377
|
readEmployeesPage: (query: IReadEmployeesPageReq) => Promise<void>;
|
|
379
378
|
readAllEmployeesPage: (query: Omit<IReadEmployeesPageReq, "limit" | "offset">, knownTotal?: number) => Promise<Employee[]>;
|
|
380
379
|
createEmployee: (dto: FdtoUpdatePosUserReq) => Promise<string>;
|
|
@@ -692,7 +691,6 @@ export declare const useEmployeeStore: () => {
|
|
|
692
691
|
})[]>;
|
|
693
692
|
totalEmployees: import("vue").Ref<number, number>;
|
|
694
693
|
isLoading: import("vue").Ref<boolean, boolean>;
|
|
695
|
-
readEmployees: () => Promise<void>;
|
|
696
694
|
readEmployeesPage: (query: IReadEmployeesPageReq) => Promise<void>;
|
|
697
695
|
readAllEmployeesPage: (query: Omit<IReadEmployeesPageReq, "limit" | "offset">, knownTotal?: number) => Promise<Employee[]>;
|
|
698
696
|
createEmployee: (dto: FdtoUpdatePosUserReq) => Promise<string>;
|
|
@@ -706,7 +704,7 @@ export declare const useEmployeeStore: () => {
|
|
|
706
704
|
}, "isLoading" | "employees" | "listEmployees" | "totalEmployees">>, options?: {
|
|
707
705
|
detached?: boolean;
|
|
708
706
|
} & import("vue").WatchOptions): () => void;
|
|
709
|
-
$onAction(callback: import("pinia").StoreOnActionListener<"employee", Pick<{
|
|
707
|
+
$onAction(callback: import("pinia").StoreOnActionListener<"hrm-employee", Pick<{
|
|
710
708
|
employees: import("vue").Ref<({
|
|
711
709
|
faceId?: unknown;
|
|
712
710
|
name: string;
|
|
@@ -855,7 +853,6 @@ export declare const useEmployeeStore: () => {
|
|
|
855
853
|
})[]>;
|
|
856
854
|
totalEmployees: import("vue").Ref<number, number>;
|
|
857
855
|
isLoading: import("vue").Ref<boolean, boolean>;
|
|
858
|
-
readEmployees: () => Promise<void>;
|
|
859
856
|
readEmployeesPage: (query: IReadEmployeesPageReq) => Promise<void>;
|
|
860
857
|
readAllEmployeesPage: (query: Omit<IReadEmployeesPageReq, "limit" | "offset">, knownTotal?: number) => Promise<Employee[]>;
|
|
861
858
|
createEmployee: (dto: FdtoUpdatePosUserReq) => Promise<string>;
|
|
@@ -1015,7 +1012,6 @@ export declare const useEmployeeStore: () => {
|
|
|
1015
1012
|
})[]>;
|
|
1016
1013
|
totalEmployees: import("vue").Ref<number, number>;
|
|
1017
1014
|
isLoading: import("vue").Ref<boolean, boolean>;
|
|
1018
|
-
readEmployees: () => Promise<void>;
|
|
1019
1015
|
readEmployeesPage: (query: IReadEmployeesPageReq) => Promise<void>;
|
|
1020
1016
|
readAllEmployeesPage: (query: Omit<IReadEmployeesPageReq, "limit" | "offset">, knownTotal?: number) => Promise<Employee[]>;
|
|
1021
1017
|
createEmployee: (dto: FdtoUpdatePosUserReq) => Promise<string>;
|
|
@@ -1175,7 +1171,6 @@ export declare const useEmployeeStore: () => {
|
|
|
1175
1171
|
})[]>;
|
|
1176
1172
|
totalEmployees: import("vue").Ref<number, number>;
|
|
1177
1173
|
isLoading: import("vue").Ref<boolean, boolean>;
|
|
1178
|
-
readEmployees: () => Promise<void>;
|
|
1179
1174
|
readEmployeesPage: (query: IReadEmployeesPageReq) => Promise<void>;
|
|
1180
1175
|
readAllEmployeesPage: (query: Omit<IReadEmployeesPageReq, "limit" | "offset">, knownTotal?: number) => Promise<Employee[]>;
|
|
1181
1176
|
createEmployee: (dto: FdtoUpdatePosUserReq) => Promise<string>;
|
|
@@ -1186,11 +1181,10 @@ export declare const useEmployeeStore: () => {
|
|
|
1186
1181
|
deleteMasterEmployee: (employee: Employee) => Promise<void>;
|
|
1187
1182
|
migrateToMasterUser: (userId: string, dto: FdtoUpdatePosMasterUserReq) => Promise<void>;
|
|
1188
1183
|
syncUsersMeta: () => Promise<void>;
|
|
1189
|
-
}, "
|
|
1184
|
+
}, "readEmployeesPage" | "readAllEmployeesPage" | "createEmployee" | "updateEmployee" | "deleteEmployee" | "createMasterEmployee" | "updateMasterEmployee" | "deleteMasterEmployee" | "migrateToMasterUser" | "syncUsersMeta">>, detached?: boolean): () => void;
|
|
1190
1185
|
$dispose(): void;
|
|
1191
|
-
$id: "employee";
|
|
1186
|
+
$id: "hrm-employee";
|
|
1192
1187
|
_customProperties: Set<string>;
|
|
1193
|
-
readEmployees: () => Promise<void>;
|
|
1194
1188
|
readEmployeesPage: (query: IReadEmployeesPageReq) => Promise<void>;
|
|
1195
1189
|
readAllEmployeesPage: (query: Omit<IReadEmployeesPageReq, "limit" | "offset">, knownTotal?: number) => Promise<Employee[]>;
|
|
1196
1190
|
createEmployee: (dto: FdtoUpdatePosUserReq) => Promise<string>;
|