@feedmepos/mf-hrm-portal 2.4.2-dev → 2.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/dist/{ApprovalCodeList-DpNF0wL7.js → ApprovalCodeList-DGLPcQcv.js} +15 -14
  2. package/dist/{AuditLogList-D2bUFsuK.js → AuditLogList-ahJwTF7N.js} +12 -12
  3. package/dist/ConditionBuilderForm.vue_vue_type_script_setup_true_lang-IPkyxwIF.js +438 -0
  4. package/dist/EmployeeList-B18mlY4V.js +776 -0
  5. package/dist/FormItem.vue_vue_type_script_setup_true_lang-Dvo9AiKf.js +45 -0
  6. package/dist/FormSection.vue_vue_type_script_setup_true_lang-DknXTYiK.js +49 -0
  7. package/dist/{GrantUserList-ClliuQ8h.js → GrantUserList-C8BbP99C.js} +16 -15
  8. package/dist/{Main-CBuOW87D.js → Main-BA29_N_p.js} +2280 -2274
  9. package/dist/{Main-DlPdGefL.js → Main-BN3b_yie.js} +5 -5
  10. package/dist/Main-Clux_qKN.js +96 -0
  11. package/dist/PasscodePinField.vue_vue_type_script_setup_true_lang-CqG0v0Sz.js +243 -0
  12. package/dist/{PermissionSetList-Dd0fkW0L.js → PermissionSetList-BSOJ8ftd.js} +108 -107
  13. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-Hz_rFmbH.js +4181 -0
  14. package/dist/PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-BwuBk683.js +35 -0
  15. package/dist/RoleList-EnfxydGa.js +740 -0
  16. package/dist/{ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-yJwTtFyF.js → ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-yIdd8r7y.js} +1 -1
  17. package/dist/{ScheduleGeneralPage-_cqIJY8R.js → ScheduleGeneralPage-CFUqm5-r.js} +2 -2
  18. package/dist/{ScheduleModal.vue_vue_type_script_setup_true_lang-C6M76KUA.js → ScheduleModal.vue_vue_type_script_setup_true_lang-BmPrGRG2.js} +186 -187
  19. package/dist/{SchedulePage-DHkWe1KO.js → SchedulePage-DEFQwipO.js} +16 -16
  20. package/dist/{SchedulePositionPage-5JUJwlJc.js → SchedulePositionPage-CM5NS5-F.js} +3 -3
  21. package/dist/{SelectFilter-DWRvb1Yl.js → SelectFilter-DgjR5o5E.js} +1 -1
  22. package/dist/TeamMemberList-BKvhHLNG.js +1150 -0
  23. package/dist/TimesheetList-EQRMimP7.js +402 -0
  24. package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_ffd7f807_lang-Co2GtU1N.js → TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-BumkwWvb.js} +7 -7
  25. package/dist/{app-BA3UHSk0.js → app-Bkc0pF3P.js} +3935 -7718
  26. package/dist/app.js +3 -3
  27. package/dist/{approval-code-BR4FD3sx.js → approval-code-BKMu1GDn.js} +1 -1
  28. package/dist/{dayjs.min-JyaQ6PUU.js → dayjs.min-CkI2q2aC.js} +34 -34
  29. package/dist/employee-BfkxCdPL.js +209 -0
  30. package/dist/{grant-user-DKUZdzrY.js → grant-user-ClN_vTOv.js} +1 -1
  31. package/dist/{index-CkC2sfPK.js → iteration-CsNIceUp.js} +558 -573
  32. package/dist/{lodash-BJMVlo9i.js → lodash-BgraJgCc.js} +1 -1
  33. package/dist/restaurant-CRNgiIa4.js +2685 -0
  34. package/dist/role-CZYSdVn2.js +91 -0
  35. package/dist/rule-_4roLZrG.js +780 -0
  36. package/dist/src/components/CollapsibleWrapper.vue.d.ts +3 -11
  37. package/dist/src/helpers/iteration.d.ts +2 -9
  38. package/dist/src/helpers/permission-set.d.ts +102 -1
  39. package/dist/src/helpers/rule.d.ts +2 -2
  40. package/dist/src/helpers/string.d.ts +1 -10
  41. package/dist/src/router/shared.d.ts +1 -3
  42. package/dist/src/stores/restaurant.d.ts +7 -7
  43. package/dist/src/stores/team.d.ts +0 -30
  44. package/dist/src/types/team.d.ts +1 -17
  45. package/dist/src/views/audit-log/locales/index.d.ts +0 -12
  46. package/dist/src/views/hr/locales/index.d.ts +0 -20
  47. package/dist/src/views/hr/role/RoleForm.vue.d.ts +2 -29
  48. package/dist/src/views/scheduling/composables/useScheduleOnboardingAvailability.d.ts +1 -1
  49. package/dist/src/views/scheduling/composables/useScheduleOnboardingWizard.d.ts +1 -1
  50. package/dist/src/views/scheduling/composables/useScheduleShiftDraft.d.ts +1 -1
  51. package/dist/src/views/scheduling/composables/useScheduleShiftPopover.d.ts +1 -1
  52. package/dist/src/views/team/components/BasePermission.vue.d.ts +0 -11
  53. package/dist/src/views/team/components/ConditionPermission.vue.d.ts +0 -11
  54. package/dist/src/views/team/components/PortalPermissionEditor.vue.d.ts +0 -21
  55. package/dist/src/views/team/components/PosRolePermission.vue.d.ts +0 -11
  56. package/dist/src/views/team/locales/index.d.ts +4 -716
  57. package/dist/src/views/team/member/AddMemberForm.vue.d.ts +3 -48
  58. package/dist/src/views/team/{components/MemberStatusBadge.vue.d.ts → member/MemberInfo.vue.d.ts} +2 -2
  59. package/dist/src/views/team/member/TeamMemberList.vue.d.ts +0 -1
  60. package/dist/string-VNuQNweN.js +15 -0
  61. package/dist/style.css +1 -1
  62. package/dist/tsconfig.app.tsbuildinfo +1 -1
  63. package/dist/{useAppStore-DiGaOhje.js → useAppStore-DYmF1kgk.js} +1 -1
  64. package/dist/{useLoading-DOcoObCD.js → useLoading-C2UKuAxD.js} +1 -1
  65. package/dist/{useReportPermissions-c9KGuXQq.js → useReportPermissions-BiaXRc0p.js} +22 -22
  66. package/package.json +2 -2
  67. package/dist/ConditionBuilderForm.vue_vue_type_script_setup_true_lang-BjEJErcL.js +0 -459
  68. package/dist/EmployeeList-CBYU0R2j.js +0 -896
  69. package/dist/FormSection.vue_vue_type_script_setup_true_lang-DsPLbLwQ.js +0 -90
  70. package/dist/Main-D9MQo2l1.js +0 -101
  71. package/dist/MyPosProfile-IAPSqlBP.js +0 -360
  72. package/dist/PasscodePinField.vue_vue_type_script_setup_true_lang-TXPEqa46.js +0 -126
  73. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-CjQCbJRu.js +0 -4212
  74. package/dist/PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-DJnIFlKq.js +0 -1797
  75. package/dist/RoleForm.vue_vue_type_script_setup_true_lang-hE2OZwfO.js +0 -547
  76. package/dist/RoleList-zZHpt079.js +0 -274
  77. package/dist/TeamMemberList-C_4f5Djs.js +0 -2082
  78. package/dist/TimesheetList-B3Yx8cwt.js +0 -408
  79. package/dist/employee-n31b7QEp.js +0 -237
  80. package/dist/member-grant-B1V9g0Sb.js +0 -54
  81. package/dist/restaurant-BbSg6yOm.js +0 -49
  82. package/dist/role-iTqgtFqf.js +0 -91
  83. package/dist/rule-BJhti6BZ.js +0 -845
  84. package/dist/src/api/my-pos-profile/index.d.ts +0 -3
  85. package/dist/src/api/sso-provider/index.d.ts +0 -5
  86. package/dist/src/api/staff-invite/index.d.ts +0 -16
  87. package/dist/src/components/form/SegmentedTabs.vue.d.ts +0 -23
  88. package/dist/src/composables/useMenuAccess.d.ts +0 -56
  89. package/dist/src/composables/useSsoProviders.d.ts +0 -19
  90. package/dist/src/composables/useStaffInviteProviders.d.ts +0 -8
  91. package/dist/src/helpers/employee-merge.d.ts +0 -33
  92. package/dist/src/helpers/member-grant.d.ts +0 -36
  93. package/dist/src/helpers/my-pos-profile.d.ts +0 -37
  94. package/dist/src/helpers/pos-assignment-rows.d.ts +0 -28
  95. package/dist/src/helpers/restaurant-lookup.d.ts +0 -19
  96. package/dist/src/helpers/role-merge.d.ts +0 -11
  97. package/dist/src/helpers/staff-invite.d.ts +0 -54
  98. package/dist/src/router/menu-access-guard.d.ts +0 -17
  99. package/dist/src/types/my-pos-profile.d.ts +0 -24
  100. package/dist/src/types/sso-provider.d.ts +0 -10
  101. package/dist/src/types/staff-invite.d.ts +0 -100
  102. package/dist/src/views/hr/timesheet/timesheet-view.d.ts +0 -29
  103. package/dist/src/views/my-pos-profile/MyPosProfile.vue.d.ts +0 -2
  104. package/dist/src/views/my-pos-profile/components/PasscodeChangedDialog.vue.d.ts +0 -4
  105. package/dist/src/views/my-pos-profile/locales/index.d.ts +0 -236
  106. package/dist/src/views/team/components/MemberGrantFields.vue.d.ts +0 -51
  107. package/dist/src/views/team/components/PosAssignmentRows.vue.d.ts +0 -44
  108. package/dist/src/views/team/member/ExistingMemberNotice.vue.d.ts +0 -11
  109. package/dist/src/views/team/member/MemberDetailsCard.vue.d.ts +0 -35
  110. package/dist/src/views/team/member/MemberHeaderCard.vue.d.ts +0 -19
  111. package/dist/string-DZQ1uNjn.js +0 -22
  112. package/dist/useSsoProviders-CkhHtzRQ.js +0 -41
@@ -1,3 +0,0 @@
1
- import type { FdtoMyPosProfile, FdtoRegenerateMyPosPasscodeRes } from '@/types/my-pos-profile';
2
- export declare const readMyPosProfile: () => Promise<FdtoMyPosProfile>;
3
- export declare const regenerateMyPosPasscode: () => Promise<FdtoRegenerateMyPosPasscodeRes>;
@@ -1,5 +0,0 @@
1
- import type { IFdtoSsoProvider } from '@/types/sso-provider';
2
- declare const SsoProviderAPI: {
3
- readProviders(): Promise<IFdtoSsoProvider[]>;
4
- };
5
- export default SsoProviderAPI;
@@ -1,16 +0,0 @@
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,23 +0,0 @@
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
- } & {};
@@ -1,56 +0,0 @@
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 {};
@@ -1,19 +0,0 @@
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
- };
@@ -1,8 +0,0 @@
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
- };
@@ -1,33 +0,0 @@
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,36 +0,0 @@
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;
@@ -1,37 +0,0 @@
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,28 +0,0 @@
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,19 +0,0 @@
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;
@@ -1,11 +0,0 @@
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,54 +0,0 @@
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,17 +0,0 @@
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;
@@ -1,24 +0,0 @@
1
- /** GET /my-pos-profile response (shared contract with the HRM menu, KDI-5225). */
2
- export interface FdtoMyPosProfile {
3
- hasPosUser: boolean;
4
- profile: null | {
5
- name: string;
6
- /** The caller's own current passcode, shown on reveal (D50). */
7
- passcode: string;
8
- phoneNumber: string | null;
9
- email: string | null;
10
- assignments: {
11
- restaurantId: string;
12
- restaurantName: string;
13
- restaurantCode: string | null;
14
- roleId: string;
15
- roleName: string;
16
- }[];
17
- passcodeUpdatedAt: string | null;
18
- };
19
- }
20
- export type FdtoMyPosProfileAssignment = NonNullable<FdtoMyPosProfile['profile']>['assignments'][number];
21
- export interface FdtoRegenerateMyPosPasscodeRes {
22
- passcode: string;
23
- passcodeUpdatedAt: string;
24
- }
@@ -1,10 +0,0 @@
1
- import type { StaffInviteMatch } from '@/types/staff-invite';
2
- /** A business's SSO provider (GET /businesses/:businessId/sso-providers), on or off. */
3
- export interface IFdtoSsoProvider {
4
- slug: string;
5
- label: string;
6
- type: string;
7
- enabled: boolean;
8
- /** The key invites match people on; `none` turns invites off for this provider. */
9
- inviteMatch: StaffInviteMatch | 'none';
10
- }
@@ -1,100 +0,0 @@
1
- import type { FdoPermissionRule } from '@feedmepos/core/entity';
2
- import type { IFdtoPermissionPosUser } from '@/types/team';
3
- /** Wire contract: account-service-zus-lark-sso/part-b-contract.md §2.2. */
4
- export type StaffInviteMatch = 'mobile' | 'email';
5
- export type StaffInviteWarning = 'not_in_org' | 'dm_unavailable' | 'dm_failed';
6
- export declare const STAFF_INVITE_ERROR_CODES: readonly ["provider_unavailable", "key_mismatch", "key_required", "invalid_key", "invalid_contact", "already_member", "ambiguous_account", "invite_exists", "not_pending"];
7
- export type StaffInviteErrorCode = (typeof STAFF_INVITE_ERROR_CODES)[number];
8
- export type StaffInvitePosUser = IFdtoPermissionPosUser | null;
9
- export type StaffInviteDmStatus = 'sent' | 'not_in_org' | 'unsupported' | 'failed';
10
- export interface IFdtoStaffInviteProvider {
11
- slug: string;
12
- label: string;
13
- type: string;
14
- inviteMatch: StaffInviteMatch;
15
- }
16
- export interface IFdtoStaffInviteGrant {
17
- permissions: FdoPermissionRule[];
18
- customPermissions: FdoPermissionRule[];
19
- permissionSetIds: string[];
20
- posUser: StaffInvitePosUser;
21
- }
22
- export interface IFdtoStaffInvite {
23
- _id: string;
24
- businessId: string;
25
- provider: string;
26
- match: StaffInviteMatch;
27
- mobile?: string;
28
- email?: string;
29
- /** The other way to reach them; never matched on. */
30
- contact?: {
31
- mobile?: string;
32
- email?: string;
33
- };
34
- displayName?: string;
35
- employeeId?: string | null;
36
- grant: IFdtoStaffInviteGrant;
37
- status: 'pending' | 'claiming' | 'claimed' | 'revoked';
38
- createdBy: string;
39
- createdAt: string;
40
- updatedAt: string;
41
- claimedBy?: string;
42
- claimedAt?: string;
43
- claimOutcome?: 'granted' | 'already_member' | 'granted_without_pos';
44
- posConflict?: {
45
- restaurantId: string;
46
- reason: 'passcode_taken';
47
- }[];
48
- dm?: {
49
- status: StaffInviteDmStatus;
50
- at: string;
51
- };
52
- revokedBy?: string;
53
- revokedAt?: string;
54
- }
55
- export interface IFdtoCreateStaffInviteReq {
56
- provider: string;
57
- /** The sign-in key; the other of mobile/email is contact only. */
58
- match: StaffInviteMatch;
59
- mobile?: string;
60
- email?: string;
61
- displayName: string;
62
- employeeId?: string;
63
- permissions: FdoPermissionRule[];
64
- customPermissions: FdoPermissionRule[];
65
- permissionSetIds?: string[];
66
- posUser?: StaffInvitePosUser;
67
- }
68
- /** The key is fixed: only the mobile/email that isn't the key applies ('' clears it). */
69
- export type IFdtoUpdateStaffInviteReq = Omit<IFdtoCreateStaffInviteReq, 'provider' | 'match'>;
70
- /** Who already answers to a sign-in key: a member, or an open invite. */
71
- export type IFdtoStaffInviteLookup = {
72
- kind: 'member';
73
- id: string;
74
- name: string;
75
- restaurantCount: number;
76
- isOwner: boolean;
77
- } | {
78
- kind: 'invite';
79
- id: string;
80
- name: string;
81
- restaurantCount: number;
82
- invite: IFdtoStaffInvite;
83
- };
84
- export type IFdtoCreateStaffInviteRes = {
85
- result: 'added';
86
- uid: string;
87
- portalUserId: string;
88
- warnings: StaffInviteWarning[];
89
- } | {
90
- result: 'invited';
91
- invite: IFdtoStaffInvite;
92
- warnings: StaffInviteWarning[];
93
- };
94
- export interface IFdtoResendStaffInviteRes {
95
- dm: {
96
- status: StaffInviteDmStatus;
97
- at: string;
98
- };
99
- warnings: StaffInviteWarning[];
100
- }
@@ -1,29 +0,0 @@
1
- import type { Employee } from '@/types/employee';
2
- import type { HrmRestaurant } from '@/types/restaurant';
3
- import type { Timesheet } from '@/types/timesheet';
4
- /** A list-view row: the timesheet with its outlet code and the employee's code. */
5
- export type TimesheetRow = Timesheet & {
6
- restaurantCode?: string;
7
- user: Timesheet['user'] & {
8
- code?: string;
9
- };
10
- };
11
- /** A user-view row: one employee name with their timesheets and the total time. */
12
- export interface TimesheetGroup {
13
- key: string;
14
- user: string;
15
- code: string | undefined;
16
- timesheets: TimesheetRow[];
17
- total: string;
18
- }
19
- /**
20
- * Timesheets in the selected outlets (a falsy selection means all) with the outlet code and
21
- * the employee code attached. Both lookups are built once per call instead of scanning every
22
- * outlet and every employee per timesheet.
23
- */
24
- export declare function attachTimesheetCodes(timesheets: readonly Timesheet[], restaurants: readonly HrmRestaurant[], employees: readonly Employee[], selectedRestaurantIds: readonly string[] | null | undefined): TimesheetRow[];
25
- /**
26
- * Rows grouped by employee name and sorted by it. A group's code is its first timesheet's
27
- * employee code (or the row's own code when that employee is gone).
28
- */
29
- export declare function groupTimesheetsByUser(rows: readonly TimesheetRow[], employees: readonly Employee[]): TimesheetGroup[];
@@ -1,2 +0,0 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
- export default _default;
@@ -1,4 +0,0 @@
1
- declare const _default: import("vue").DefineComponent<{}, {
2
- open: (code: string, as?: "changed" | "generated") => void;
3
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
4
- export default _default;