From 0ac75669d4b31ffe97d81645380346490e89de8a Mon Sep 17 00:00:00 2001 From: fitse-yotor Date: Sat, 15 Aug 2026 11:51:14 +0300 Subject: [PATCH 01/16] feat: add ExamStageActions component for exam fee handling - Implemented ExamStageActions component to manage actions related to exam booking and payment based on application status. - Added mock-base-query for development, providing a partial mock backend for various API endpoints. - Introduced mock-data for simulating responses in the mock-base-query, covering profiles, vessels, applications, licenses, exams, and notifications. --- .../components/DesignerToolbar.tsx | 92 +++ .../components/NewVersionModal.tsx | 51 ++ .../components/TemplateActionBar.tsx | 101 +++ .../components/TemplateBackgroundPanel.tsx | 84 ++ .../components/TemplateEditor.tsx | 73 ++ .../components/TemplateVariableList.tsx | 46 ++ .../components/TemplateVersionList.tsx | 49 ++ .../certificate-designer/config/designer.ts | 17 + .../hooks/useDesignerActions.ts | 30 + .../hooks/useTemplateDraft.ts | 84 ++ .../hooks/useTemplatePreview.ts | 55 ++ .../pages/CertificateDesignerPage.tsx | 584 ++++---------- .../components/StcwMappingPanel.tsx | 159 ++++ .../components/ScheduleExamModal.tsx | 112 +++ .../features/license-review/config/actions.ts | 12 + .../pages/LicenseReviewPage/index.tsx | 33 + apps/backoffice/src/app/i18n/locales/am.ts | 2 + apps/backoffice/src/app/i18n/locales/en.ts | 2 + .../src/app/layouts/BackofficeLayout.tsx | 26 +- apps/backoffice/src/app/store/index.ts | 9 +- apps/backoffice/vite.config.mts | 4 + .../licensing/components/ExamStageActions.tsx | 82 ++ .../pages/MyApplicationsPage/actions.tsx | 35 +- .../pages/MyApplicationsPage/index.tsx | 32 + apps/portal/src/app/store/index.ts | 35 +- apps/portal/vite.config.mts | 4 + libs/api/src/lib/base-api/index.ts | 10 +- libs/api/src/lib/base-api/mock-base-query.ts | 385 +++++++++ libs/api/src/lib/base-api/mock-data.ts | 740 ++++++++++++++++++ .../lib/features/licensing/licensing-api.ts | 30 + .../features/licensing/licensing.helpers.ts | 26 + .../lib/features/licensing/licensing.types.ts | 71 +- libs/api/src/lib/session/index.ts | 32 +- .../src/lib/components/ProtectedRoute.tsx | 3 + 34 files changed, 2638 insertions(+), 472 deletions(-) create mode 100644 apps/backoffice/src/app/features/certificate-designer/components/DesignerToolbar.tsx create mode 100644 apps/backoffice/src/app/features/certificate-designer/components/NewVersionModal.tsx create mode 100644 apps/backoffice/src/app/features/certificate-designer/components/TemplateActionBar.tsx create mode 100644 apps/backoffice/src/app/features/certificate-designer/components/TemplateBackgroundPanel.tsx create mode 100644 apps/backoffice/src/app/features/certificate-designer/components/TemplateEditor.tsx create mode 100644 apps/backoffice/src/app/features/certificate-designer/components/TemplateVariableList.tsx create mode 100644 apps/backoffice/src/app/features/certificate-designer/components/TemplateVersionList.tsx create mode 100644 apps/backoffice/src/app/features/certificate-designer/config/designer.ts create mode 100644 apps/backoffice/src/app/features/certificate-designer/hooks/useDesignerActions.ts create mode 100644 apps/backoffice/src/app/features/certificate-designer/hooks/useTemplateDraft.ts create mode 100644 apps/backoffice/src/app/features/certificate-designer/hooks/useTemplatePreview.ts create mode 100644 apps/backoffice/src/app/features/configuration/components/StcwMappingPanel.tsx create mode 100644 apps/backoffice/src/app/features/license-review/components/ScheduleExamModal.tsx create mode 100644 apps/portal/src/app/features/licensing/components/ExamStageActions.tsx create mode 100644 libs/api/src/lib/base-api/mock-base-query.ts create mode 100644 libs/api/src/lib/base-api/mock-data.ts diff --git a/apps/backoffice/src/app/features/certificate-designer/components/DesignerToolbar.tsx b/apps/backoffice/src/app/features/certificate-designer/components/DesignerToolbar.tsx new file mode 100644 index 000000000..fc6dff825 --- /dev/null +++ b/apps/backoffice/src/app/features/certificate-designer/components/DesignerToolbar.tsx @@ -0,0 +1,92 @@ +import { Button, Group, NumberInput, Select, Tooltip } from '@mantine/core'; +import { IconPlus } from '@tabler/icons-react'; +import { useTranslation } from 'react-i18next'; +import { useLocalized, type LicenseType } from '@ema-platform/api'; + +interface Props { + licenseTypes: LicenseType[]; + typeId: string | null; + onTypeChange: (id: string | null) => void; + validityMonths: number; + onValidityChange: (months: number) => void; + currentValidityMonths?: number | null; + canEdit: boolean; + savingValidity: boolean; + onSaveValidity: () => void; + onNewVersion: () => void; +} + +/** Licence type, certificate validity, and the entry point for a new version. */ +export function DesignerToolbar({ + licenseTypes, + typeId, + onTypeChange, + validityMonths, + onValidityChange, + currentValidityMonths, + canEdit, + savingValidity, + onSaveValidity, + onNewVersion, +}: Props) { + const { t } = useTranslation(); + const localized = useLocalized(); + + return ( + +