From 339973771379092930542312e8426b300e612c82 Mon Sep 17 00:00:00 2001 From: cronn Bot <no-reply@cronn.de> Date: Mon, 27 Jan 2025 08:59:43 +0000 Subject: [PATCH] Update v1.6.2 --- admin-portal/eslint.config.js | 7 +- .../java/de/eshg/auditlog/AuditLogApi.java | 3 +- backend/auditlog/openApi.yaml | 1 + .../de/eshg/auditlog/AuditLogController.java | 58 +-- .../auditlog/crypto/SymmetricEncryption.java | 8 +- .../base/gdpr/GdprProcedureController.java | 6 +- .../repository/Icd10CodeRepository.java | 2 +- backend/dental/openApi.yaml | 184 ++++++++++ .../java/de/eshg/dental/ChildService.java | 76 ++-- .../dental/DentalGdprZipEditorProvider.java | 9 +- .../de/eshg/dental/ExaminationService.java | 23 +- .../dental/ProphylaxisSessionController.java | 12 + .../dental/ProphylaxisSessionService.java | 38 +- .../api/AbsenceExaminationResultDto.java | 21 ++ .../de/eshg/dental/api/ExaminationDto.java | 2 + .../eshg/dental/api/ExaminationResultDto.java | 10 +- .../de/eshg/dental/api/MainResultDto.java | 27 ++ .../eshg/dental/api/ReasonForAbsenceDto.java | 20 ++ .../api/ScreeningExaminationResultDto.java | 11 +- .../eshg/dental/api/SecondaryResultDto.java | 22 ++ .../de/eshg/dental/api/ToothDiagnosisDto.java | 16 + .../java/de/eshg/dental/api/ToothDto.java | 87 +++++ .../api/UpdateExaminationsInBulkRequest.java | 13 + ...ProphylaxisSessionExaminationsRequest.java | 13 + .../model/AbsenceExaminationResult.java | 32 ++ .../de/eshg/dental/domain/model/Child.java | 1 + .../domain/model/ExaminationResult.java | 10 - .../model/FluoridationExaminationResult.java | 13 +- .../eshg/dental/domain/model/MainResult.java | 39 +++ .../dental/domain/model/ReasonForAbsence.java | 17 + .../model/ScreeningExaminationResult.java | 31 ++ .../dental/domain/model/SecondaryResult.java | 29 ++ .../de/eshg/dental/domain/model/Tooth.java | 68 ++++ .../dental/domain/model/ToothDiagnosis.java | 21 ++ .../repository/ExaminationRepository.java | 5 + .../ProphylaxisSessionRepository.java | 8 + .../eshg/dental/mapper/ExaminationMapper.java | 267 +++++++++++++- .../ProphylaxisSessionsPopulator.java | 29 +- .../main/resources/gdpr-legal-basis-text.txt | 0 .../migrations/0026_add_tooth_diagnoses.xml | 30 ++ .../0027_add_absence_examination_result.xml | 37 ++ .../main/resources/migrations/changelog.xml | 2 + backend/docker-compose-common.yaml | 2 +- .../gdpr/InspectionGdprZipEditorProvider.java | 12 +- .../main/resources/gdpr-legal-basis-text.txt | 1 + backend/lib-appointmentblock/openApi.yaml | 6 + .../AppointmentBlockController.java | 10 +- .../AppointmentBlockService.java | 5 +- .../AppointmentBlockSlotUtil.java | 32 +- .../AppointmentBlockRepository.java | 2 + .../lib/procedure/domain/model/Procedure.java | 4 + .../gdpr/AbstractGdprZipEditorProvider.java | 25 +- .../gdpr/DefaultGdprZipEditorProvider.java | 11 +- .../gdpr/GdprValidationTaskService.java | 19 +- backend/measles-protection/openApi.yaml | 6 + .../measlesprotection/AppointmentService.java | 4 +- .../MeaslesGdprZipEditorProvider.java | 26 ++ .../main/resources/gdpr-legal-basis-text.txt | 1 + .../main/resources/gdpr-legal-basis-text.txt | 0 backend/official-medical-service/openApi.yaml | 41 +++ .../OmsGdprZipEditorProvider.java | 9 +- .../appointment/OmsAppointmentMapper.java | 8 + .../appointment/OmsAppointmentService.java | 19 +- .../appointment/api/OmsAppointmentDto.java | 1 + .../EmployeeOmsProcedureController.java | 5 +- .../EmployeeOmsProcedureService.java | 275 +++++++++++++-- .../EmployeeOmsProcedureSpecification.java | 68 ---- .../procedure/OmsProcedureOverviewMapper.java | 6 +- .../procedure/OmsProgressEntryType.java | 1 + .../procedure/ProgressEntryService.java | 15 +- .../api/EmployeeOmsProcedureOverviewDto.java | 4 +- .../api/EmployeeOmsProcedureSortKey.java | 7 + .../api/GetOmsProceduresFilterOptionsDto.java | 14 + .../persistence/entity/OmsProcedureView.java | 15 + .../user/UserClient.java | 4 + .../main/resources/gdpr-legal-basis-text.txt | 0 backend/school-entry/openApi.yaml | 6 + .../SchoolEntryCitizenService.java | 1 + .../schoolentry/SchoolEntryController.java | 19 +- .../SchoolEntryGdprZipEditorProvider.java | 8 +- .../eshg/schoolentry/SchoolEntryService.java | 32 +- .../business/model/ImportProcedureData.java | 4 - .../eshg/schoolentry/client/PersonClient.java | 4 +- .../SchoolInfoLetterValidator.java | 8 +- .../main/resources/gdpr-legal-basis-text.txt | 13 + .../data/postgres/docker-compose.yml | 2 +- .../config/AutoReportSeriesConfig.java | 13 - backend/sti-protection/openApi.yaml | 162 +++++++++ .../stiprotection/AppointmentService.java | 2 +- .../stiprotection/TextTemplateController.java | 89 +++++ .../stiprotection/TextTemplateService.java | 68 ++++ .../CreateTextTemplateRequest.java | 12 + .../CreateTextTemplateResponse.java | 11 + .../GetTextTemplatesFilterOptions.java | 21 ++ .../GetTextTemplatesResponse.java | 12 + .../texttemplate/TextTemplateContextDto.java | 18 + .../api/texttemplate/TextTemplateDto.java | 18 + .../TextTemplateContextMapper.java | 39 +++ .../texttemplate/TextTemplateMapper.java | 74 ++++ .../db/texttemplate/TextTemplate.java | 52 +++ .../db/texttemplate/TextTemplateContext.java | 15 + .../texttemplate/TextTemplateRepository.java | 17 + .../migrations/0043_add_text_templates.xml | 34 ++ .../main/resources/migrations/changelog.xml | 1 + backend/travel-medicine/openApi.yaml | 6 + .../TravelMedicineGdprZipEditorProvider.java | 8 +- .../CitizenPublicController.java | 6 +- .../util/TravelMedicineProgressEntryType.java | 1 + .../AppointmentService.java | 5 +- .../VaccinationConsultationService.java | 19 +- .../main/resources/gdpr-legal-basis-text.txt | 1 + buildSrc/src/main/groovy/api-package.gradle | 12 +- buildSrc/src/main/groovy/lib-package.gradle | 17 +- buildSrc/src/main/groovy/next-app.gradle | 3 +- buildSrc/src/main/groovy/node.gradle | 6 +- .../src/main/groovy/openapi-generator.gradle | 5 - buildSrc/src/main/groovy/source-checks.gradle | 6 +- buildSrc/src/main/groovy/typescript.gradle | 16 +- .../src/main/groovy/workspace-package.gradle | 2 +- citizen-portal-api/build.gradle | 3 - citizen-portal/gradleDependencies.json | 8 +- citizen-portal/package.json | 7 +- .../mein-bereich/profil/page.tsx | 2 +- .../src/app/[lang]/opendata/layout.tsx | 2 +- .../masernschutz/meldeformular/page.tsx | 2 +- .../unternehmen/mein-bereich/profil/page.tsx | 2 +- .../src/lib/baseModule/api/clients.ts | 2 +- .../src/lib/baseModule/api/mutations/gdpr.ts | 2 +- .../lib/baseModule/api/queries/bundIdLink.ts | 2 +- .../src/lib/baseModule/api/queries/feature.ts | 2 +- .../baseModule/api/queries/mukFacilityLink.ts | 2 +- .../form/ConfirmStartGdprProcedureDialog.tsx | 2 +- .../components/gdpr/form/GdprContactForm.tsx | 2 +- .../gdpr/form/GdprObjectionFormDialog.tsx | 2 +- .../gdpr/page/GdprRightsOverviewPage.tsx | 2 +- .../components/layout/AppLayout.tsx | 38 +- .../baseModule/components/layout/Footer.tsx | 2 +- .../navigationItemsResolver.tsx | 2 +- .../measlesProtection/api/clients.ts | 4 +- .../reportCase/ReportCaseOverview.tsx | 2 +- .../reportCase/ReportCaseOverviewCard.tsx | 6 +- .../components/reportCase/helpers.ts | 4 +- .../reportCase/subforms/AddressForm.tsx | 2 +- .../subforms/AffectedPersonForm.tsx | 2 +- .../reportCase/subforms/FacilityForm.tsx | 2 +- .../components/reportCase/types.ts | 4 +- .../shared/facility/helpers.ts | 4 +- .../measlesProtection/shared/translations.ts | 6 +- .../components/useOpenDataFilterValues.ts | 2 +- .../schoolEntry/api/clients.ts | 4 +- .../schoolEntry/api/models/Appointment.ts | 2 +- .../api/models/SchoolEntryChild.ts | 2 +- .../api/models/SchoolEntryProcedure.ts | 2 +- .../api/mutations/schoolEntryCitizenApi.ts | 6 +- .../api/queries/publicCitizenApi.ts | 2 +- .../api/queries/schoolEntryCitizenApi.ts | 2 +- .../citizenAnamnesis/CitizenAnamnesisForm.tsx | 8 +- .../CitizenAnamnesisSidePanel.tsx | 2 +- .../pages/citizenAnamnesis/translations.ts | 2 +- .../landingpage/LandingpageSidePanel.tsx | 2 +- .../SignDocumentModalContent.tsx | 8 +- .../shared/components/InfoIconButton.tsx | 4 +- .../shared/components/RadioButtonsField.tsx | 6 +- .../components/document/AnamnesisQuestion.tsx | 5 +- .../document/DocumentMultiSelectElement.tsx | 5 +- .../shared/contexts/DepartmentContext.tsx | 2 +- .../helpers/appointmentFormHelper.ts | 2 +- .../src/lib/i18n/useTranslateCountry.ts | 2 +- citizen-portal/src/lib/shared/api/clients.ts | 6 +- .../lib/shared/api/models/DepartmentInfo.ts | 2 +- .../src/lib/shared/api/queries/department.ts | 2 +- .../lib/shared/components/AddressSection.tsx | 2 +- .../lib/shared/components/ContactSection.tsx | 2 +- .../shared/components/card/ServiceCard.tsx | 4 +- .../components/card/ServiceCardContainer.tsx | 2 +- .../components/centralFile/AddressFields.tsx | 2 +- .../centralFile/BaseFacilityFields.tsx | 2 +- .../centralFile/BasePersonFields.tsx | 2 +- .../shared/components/form/file/FileField.tsx | 6 +- .../shared/components/icon/GradientIcon.tsx | 4 +- .../lib/shared/hooks/useHasBusinessModule.ts | 2 +- citizen-portal/src/lib/shared/types.ts | 2 +- config/eslint.next.js | 50 ++- docs/gradle.adoc | 14 +- docs/queries-and-mutations.adoc | 2 +- employee-portal-api/build.gradle | 3 - employee-portal/gradleDependencies.json | 5 +- employee-portal/package.json | 9 +- .../children/[childId]/details/page.tsx | 6 +- .../examinations/[examinationId]/page.tsx | 66 +++- .../children/[childId]/examinations/page.tsx | 6 +- .../[childId]/progress-entries/page.tsx | 48 +-- .../app/(businessModules)/dental/layout.tsx | 18 + .../[prophylaxisSessionId]/layout.tsx | 6 +- .../procedures/[id]/progress-entries/page.tsx | 51 +-- .../[id]/@tabs/progress-entries/page.tsx | 51 +-- .../procedures/[id]/progress-entries/page.tsx | 53 +-- .../procedures/[id]/progress-entries/page.tsx | 51 +-- .../procedures/page.tsx | 9 +- .../[procedureId]/anamnesis/page.tsx | 22 +- .../development-screening/page.tsx | 14 +- .../[procedureId]/examinations/ear/page.tsx | 8 +- .../[procedureId]/examinations/eye/page.tsx | 8 +- .../[procedureId]/examinations/layout.tsx | 2 +- .../examinations/sopess/page.tsx | 8 +- .../[procedureId]/progress-entries/page.tsx | 51 +-- .../[procedureId]/vaccination/page.tsx | 10 +- .../progress-entries/page.tsx | 51 +-- .../procedure/[id]/progress-entries/page.tsx | 51 +-- .../app/playground/designShowcase/page.tsx | 2 +- .../src/app/playground/personSidebar/page.tsx | 2 +- .../prototypes/dental-examination/page.tsx | 4 +- .../components/AuditLogDecryptSidebar.tsx | 4 +- .../components/calendar/EventForm.tsx | 2 +- .../resources/sidebar/AddServiceSidebar.tsx | 2 +- .../components/chatPanel/NewDirectChat.tsx | 2 +- .../components/chatPanel/NewGroupChat.tsx | 2 +- .../components/roomList/HighlightedText.tsx | 2 +- .../lib/businessModules/dental/api/clients.ts | 52 --- .../dental/api/downloads/files.ts | 14 - .../api/mutations/approvalRequestApi.ts | 18 - .../dental/api/mutations/fileApi.ts | 18 - .../dental/api/mutations/importApi.ts | 32 -- .../dental/api/mutations/progressEntryApi.ts | 31 -- .../dental/api/queries/fileApi.ts | 13 - .../dental/api/queries/progressEntryApi.ts | 54 --- .../children/ChildrenFilterSettings.tsx | 2 +- .../features/children/ChildrenTable.tsx | 4 +- .../children/CloseSchoolYearButton.tsx | 2 +- .../details/AdditionalInformation.tsx | 39 +++ .../details/AnnualInstitutionsTable.tsx | 2 +- .../children/details/ChildDetails.tsx | 2 +- .../children/details/ChildToolbar.tsx | 6 +- .../children/details/ExaminationDetails.tsx | 23 +- .../children/details/ExaminationsTable.tsx | 2 +- .../details/UpdateAnnualChildSidebar.tsx | 6 +- .../children/new/CreateChildSidebar.tsx | 10 +- .../dental/features/children/options.ts | 12 + .../dental/features/children/translations.ts | 13 + .../examinations/ExaminationStatusChip.tsx | 3 +- .../features/examinations/translations.ts | 2 +- .../AddChildToProphylaxisSessionSidebar.tsx | 8 +- .../CreateProphylaxisSessionSidebar.tsx | 10 +- .../ProphylaxisSessionExaminationToolbar.tsx | 2 +- .../ProphylaxisSessionParticipantsTable.tsx | 4 +- .../ProphylaxisSessionsTable.tsx | 4 +- .../prophylaxisSessions/SearchGroupField.tsx | 2 +- .../store/ProphylaxisSessionStoreProvider.tsx | 5 +- .../store/participantFilters.ts | 2 +- .../store/participantSorting.ts | 2 +- .../store/prophylaxisSessionStore.ts | 3 +- .../dental/import/ImportChildrenSidebar.tsx | 4 +- .../inspection/api/download/files.ts | 21 -- .../api/mutations/approvalRequests.ts | 18 - .../inspection/api/mutations/files.ts | 18 - .../api/mutations/progressEntries.ts | 31 -- .../inspection/api/queries/files.ts | 12 - .../inspection/api/queries/progressEntries.ts | 55 --- .../elements/ChecklistDefinitionElement.tsx | 8 +- .../ChecklistDefinitionElementsList.tsx | 10 +- .../ChecklistDefinitionElementMultiInner.tsx | 2 +- .../sections/ChecklistDefinitionSection.tsx | 6 +- .../ChecklistDefinitionSectionsList.tsx | 12 +- .../FinalizeInspectionModalContent.tsx | 15 +- .../form/ChecklistIncidentToggle.tsx | 2 +- .../inspection/new/AddInspectionTiles.tsx | 2 +- .../inspection/new/AdditionalInfoTile.tsx | 2 +- .../inspection/planning/packlist/Packlist.tsx | 12 +- .../elements/PacklistDefinitionElement.tsx | 20 +- .../PacklistDefinitionElementsList.tsx | 12 +- .../PacklistDefinitionRevisionTile.tsx | 10 +- .../measlesProtection/api/clients.ts | 4 +- .../measlesProtection/api/download/files.ts | 14 - .../api/models/AppointmentBlockGroup.ts | 10 +- .../api/mutations/appointmentBlockApi.ts | 2 +- .../api/mutations/appointmentBookingApi.ts | 2 +- .../api/mutations/approvalRequests.ts | 25 -- .../measlesProtection/api/mutations/files.ts | 25 -- .../api/mutations/measlesProtectionApi.ts | 2 +- .../api/mutations/procedures.ts | 12 +- .../api/mutations/progressEntries.ts | 45 --- .../api/queries/appointmentBlockApi.ts | 4 +- .../api/queries/featureTogglesApi.ts | 8 +- .../measlesProtection/api/queries/files.ts | 10 +- .../api/queries/procedures.ts | 2 +- .../api/queries/progressEntries.ts | 53 --- .../api/queries/proofRequestLetters.ts | 2 +- .../AppointmentBlockGroupsTable.tsx | 4 +- .../CreateAppointmentBlockGroupForm.tsx | 2 +- .../components/appointmentBlocks/options.ts | 2 +- .../components/procedures/constants.ts | 2 +- .../createProceduresForm/NewPersonButton.tsx | 2 +- .../AccessRestrictionLetterSidebar.tsx | 2 +- .../procedureDetails/AddCustodianSidebar.tsx | 2 +- .../AdditionalInfoSection.tsx | 6 +- .../AdditionalInfoUpdateSidebar.tsx | 2 +- .../procedureDetails/AddressDetails.tsx | 6 +- .../procedureDetails/AffectedPerson.tsx | 2 +- .../procedureDetails/AppointmentSidebar.tsx | 2 +- .../procedureDetails/CaseStatusSelect.tsx | 8 +- .../procedureDetails/Custodians.tsx | 2 +- .../EditAccessRestrictionSidebar.tsx | 8 +- .../EditAffectedPersonSidebar.tsx | 6 +- .../procedureDetails/EditCustodianButton.tsx | 2 +- .../procedureDetails/EditCustodianSidebar.tsx | 5 +- .../procedureDetails/EditFacilitySidebar.tsx | 2 +- .../procedures/procedureDetails/Facility.tsx | 4 +- .../procedureDetails/FacilityContact.tsx | 2 +- .../procedureDetails/FineSidebar.tsx | 2 +- .../procedureDetails/LetterRecipientField.tsx | 4 +- .../MeaslesFacilityTypeSelect.tsx | 2 +- .../MeaslesProtectionProcedureData.tsx | 2 +- ...slesProtectionProcedureDraftClientPage.tsx | 2 +- .../procedureDetails/NewCustodianButton.tsx | 2 +- .../procedureDetails/NewFacilitySidebar.tsx | 2 +- .../ProofRequestLetterSidebar.tsx | 6 +- .../procedureDetails/ProofSidebar.tsx | 8 +- .../procedures/procedureDetails/ProofTab.tsx | 8 +- .../UpdateProcedureSection.tsx | 10 +- .../procedures/procedureDetails/helpers.ts | 6 +- .../proof/AccessRestrictionCard.tsx | 4 +- .../proof/AppointmentCard.tsx | 4 +- .../proof/ProofTabFileCard.tsx | 14 +- .../proceduresTable/ProceduresTable.tsx | 2 +- .../ProceduresTableFilters.tsx | 4 +- .../shared/ProceduresContext.tsx | 2 +- .../measlesProtection/shared/constants.ts | 4 +- .../measlesProtection/shared/helpers.ts | 2 +- .../api/mutations/approvalRequests.ts | 18 - .../medicalRegistry/api/mutations/files.ts | 18 - .../api/mutations/progressEntries.ts | 31 -- .../medicalRegistry/api/queries/files.ts | 20 -- .../api/queries/progressEntries.ts | 53 --- .../officialMedicalService/api/clients.ts | 6 + .../api/download/files.ts | 14 - .../api/models/AppointmentBlockGroup.ts | 6 +- .../api/models/AppointmentTypeConfig.ts | 6 +- .../api/mutations/appointmentApi.ts | 37 ++ .../api/mutations/approvalRequests.ts | 18 - .../api/mutations/files.ts | 18 - .../api/mutations/progressEntries.ts | 31 -- .../api/queries/appointmentBlocksApi.ts | 22 +- .../api/queries/files.ts | 12 - .../api/queries/progressEntries.ts | 53 --- .../details/AdditionalInfoPanel.tsx | 5 +- .../procedures/details/AppointmentSidebar.tsx | 329 ++++++++++++++---- .../procedures/details/AppointmentsPanel.tsx | 25 +- .../procedures/details/AppointmentsTable.tsx | 56 +-- .../details/UpdateAffectedPersonSidebar.tsx | 2 +- .../overview/ProceduresOverviewTable.tsx | 139 +++++++- .../overview/procedureOverviewColumns.tsx | 50 ++- .../shared/constants.ts | 3 +- .../officialMedicalService/shared/enums.ts | 27 ++ .../officialMedicalService/shared/helpers.ts | 11 + .../schoolEntry/api/clients.ts | 4 +- .../schoolEntry/api/download/files.ts | 14 - .../schoolEntry/api/models/Anamnesis.ts | 8 +- .../schoolEntry/api/models/Appointment.ts | 2 +- .../api/models/AppointmentBlockGroup.ts | 10 +- .../api/models/AppointmentTypeConfig.ts | 8 +- .../schoolEntry/api/models/CountryCodes.ts | 2 +- .../schoolEntry/api/models/Label.ts | 8 +- .../schoolEntry/api/models/Person.ts | 6 +- .../schoolEntry/api/models/Procedure.ts | 10 +- .../api/models/ProcedureDetails.ts | 5 +- .../api/models/VaccinationStatus.ts | 8 +- .../schoolEntry/api/models/WaitingRoom.ts | 12 +- .../DevelopmentScreeningResult.ts | 8 +- .../models/examinations/ExaminationResult.ts | 2 +- .../examinations/EyeExaminationResult.ts | 7 +- .../models/examinations/HearingTestResult.ts | 7 +- .../api/models/examinations/Percentiles.ts | 2 +- .../examinations/SopessExaminationResult.ts | 8 +- .../api/mutations/appointmentBlockApi.ts | 2 +- .../api/mutations/approvalRequests.ts | 18 - .../schoolEntry/api/mutations/files.ts | 18 - .../schoolEntry/api/mutations/importApi.ts | 14 +- .../schoolEntry/api/mutations/labelsApi.ts | 5 +- .../api/mutations/progressEntries.ts | 31 -- .../api/mutations/schoolEntryApi.ts | 8 +- .../api/queries/appointmentBlockApi.ts | 6 +- .../api/queries/appointmentTypeApi.ts | 2 +- .../schoolEntry/api/queries/configApi.ts | 4 +- .../api/queries/countryCodesApi.ts | 2 +- .../api/queries/featureTogglesApi.ts | 8 +- .../schoolEntry/api/queries/files.ts | 12 - .../api/queries/progressEntries.ts | 53 --- .../schoolEntry/api/queries/schoolEntryApi.ts | 8 +- .../api/queries/valueEvaluatorApi.ts | 2 +- .../AppointmentBlockGroupForm.tsx | 2 +- .../CreateAppointmentBlockGroupForm.tsx | 10 +- .../AppointmentBlockGroupsTable.tsx | 4 +- .../features/labels/CreateLabelSidebar.tsx | 2 +- .../features/labels/UpdateLabelSidebar.tsx | 2 +- .../procedures/anamnesis/AnamnesisForm.tsx | 10 +- .../anamnesis/MigrationBackgroundForm.tsx | 2 +- .../DevelopmentScreeningForm.tsx | 6 +- .../developmentScreening/HandicapFields.tsx | 2 +- .../developmentScreening/Icd10Sidebar.tsx | 33 +- .../MeasurementFields.tsx | 2 +- .../PhysicalExaminationFields.tsx | 8 +- .../examinations/ExaminationResultFields.tsx | 8 +- .../ExaminationWithDiagnosisFields.tsx | 8 +- .../RequiredProcedureDataModal.tsx | 2 +- .../ResponseDoctorLetterField.tsx | 2 +- .../examinations/examinationResultHelpers.ts | 8 +- .../eyeExamination/EyeExaminationForm.tsx | 12 +- .../procedures/hearingTest/EarForm.tsx | 5 +- .../hearingTest/HearingTestForm.tsx | 6 +- .../importData/ImportDataFields.tsx | 2 +- .../procedures/new/CreateProcedureSidebar.tsx | 8 +- .../features/procedures/new/ProcedureCard.tsx | 2 +- .../features/procedures/options.ts | 4 +- .../procedureDetails/AddCustodianPanel.tsx | 2 +- .../procedureDetails/ProcedureDetails.tsx | 2 +- .../ProcedureDetailsSection.tsx | 2 +- .../UpdateProcedureSidebar.tsx | 12 +- .../procedureDetails/WaitingRoomPanel.tsx | 5 +- .../procedures/procedureDetails/options.ts | 2 +- .../ProcedureFilterSettings.tsx | 2 +- .../proceduresTable/ProceduresTable.tsx | 2 +- .../useBulkAppointmentCreationMessage.tsx | 2 +- .../useBulkDownloadInvitations.ts | 2 +- .../reports/SchoolInfoLetterSidebar.tsx | 2 +- .../sopessExamination/ArticulationForm.tsx | 2 +- .../BodyCoordinationForm.tsx | 8 +- .../sopessExamination/LanguageForm.tsx | 2 +- .../sopessExamination/PluralForm.tsx | 2 +- .../sopessExamination/PseudowordForm.tsx | 2 +- .../QuantityKnowledgeForm.tsx | 2 +- .../SelectiveAttentionForm.tsx | 8 +- .../SopessExaminationFields.tsx | 8 +- .../SopessExaminationForm.tsx | 8 +- .../VisualPerceptionForm.tsx | 8 +- .../VisuoMotorSkillsForm.tsx | 8 +- .../features/procedures/translations.ts | 4 +- .../vaccination/VaccinationForm.tsx | 10 +- .../features/waitingRoom/WaitingRoomTable.tsx | 2 +- .../schoolEntry/shared/constants.ts | 5 +- .../schoolEntry/shared/sideNavigationItem.tsx | 2 +- .../businessModules/statistics/api/clients.ts | 4 +- .../api/mapper/mapAttributeSelectionKey.ts | 2 +- .../api/mapper/mapAttributesToLabels.ts | 2 +- .../mapper/mapDateSpanFilterToApiDateSpan.ts | 2 +- .../api/models/anonymizationOptions.ts | 2 +- .../api/models/dataSourceSensitivity.ts | 4 +- .../api/models/evaluationDetailsTableData.ts | 2 +- .../api/models/evaluationDetailsTableView.ts | 2 +- .../api/models/evaluationDetailsViewTypes.ts | 2 +- .../api/models/evaluationFilterType.ts | 2 +- .../api/models/evaluationOverview.ts | 5 +- .../api/models/evaluationReports.ts | 2 +- .../statistics/api/models/flatAttribute.ts | 2 +- .../api/models/geoShapesTableView.ts | 2 +- .../api/mutations/useAddAnalysis.ts | 6 +- .../api/mutations/useAddAutoReportSeries.ts | 6 +- .../api/mutations/useAddEvaluation.ts | 2 +- .../api/mutations/useDuplicateEvaluation.ts | 2 +- .../statistics/api/queries/useGetAnalysis.ts | 2 +- .../api/queries/useGetAvailableDataSources.ts | 2 +- .../queries/useGetDetailPageInformation.ts | 2 +- .../api/queries/useGetEvaluation.ts | 5 +- .../api/queries/useGetEvaluationDetails.ts | 2 +- .../queries/useGetEvaluationDetailsPage.ts | 2 +- .../useGetEvaluationDetailsTablePage.ts | 2 +- .../api/queries/useGetEvaluationReports.ts | 2 +- .../useGetEvaluationTemplateDetails.ts | 2 +- .../useGetEvaluationTemplateFromRepository.ts | 2 +- .../api/queries/useGetEvaluationTemplates.ts | 2 +- ...useGetEvaluationTemplatesFromRepository.ts | 2 +- .../useGetEvaluationTemplatesOverview.ts | 2 +- .../api/queries/useGetEvaluations.ts | 2 +- .../api/queries/useGetFilterTemplates.ts | 2 +- .../statistics/api/queries/useGetGeoShapes.ts | 5 +- .../api/queries/useGetReportDetails.ts | 2 +- .../api/queries/useGetReportsOverview.ts | 2 +- .../api/queries/useStatisticsFeatureToggle.ts | 8 +- .../CreateEvaluationSidebar.tsx | 2 +- .../SummaryStep/SummaryStep.tsx | 1 - .../evaluations/EvaluationsTable.tsx | 6 +- .../components/evaluations/StateChip.tsx | 2 +- .../ConfigureBarChartStep.tsx | 4 +- .../ConfigureHistogramChartStep.tsx | 4 +- .../ConfigureLineChartStep.tsx | 4 +- .../ConfigurePieChartStep.tsx | 4 +- .../ConfigureScatterChartStep.tsx | 4 +- .../dataQuality/EvaluationDataQuality.tsx | 2 +- .../details/filter/enumFilterMappings.ts | 2 +- .../details/reports/EvaluationReports.tsx | 2 +- .../details/reports/ReportStateChip.tsx | 2 +- .../details/table/EvaluationDetailsTable.tsx | 45 ++- .../evaluations/details/table/columns.tsx | 65 +--- .../details/table/mapRawValueToTableCell.ts | 2 +- .../evaluations/filterDefinitions.ts | 2 +- .../evaluations/getAttributeLabel.ts | 2 +- .../templates/filterDefinitions.ts | 2 +- .../components/reports/filterDefinitions.ts | 5 +- .../components/shared/charts/EChart.tsx | 6 +- .../components/shared/charts/chartHelper.ts | 6 +- .../components/shared/charts/types.ts | 2 +- .../stiProtection/api/download/files.ts | 14 - .../api/models/AppointmentBlockGroup.ts | 6 +- .../api/models/AppointmentTypeConfig.ts | 6 +- .../api/mutations/approvalRequests.ts | 25 -- .../stiProtection/api/mutations/files.ts | 19 - .../api/mutations/progressEntries.ts | 45 --- .../api/queries/appointmentBlocks.ts | 2 +- .../stiProtection/api/queries/files.ts | 30 -- .../api/queries/progressEntries.ts | 53 --- .../procedures/details/CheckPinSection.tsx | 2 +- .../details/CreateAppointmentSidebar.tsx | 2 +- .../procedures/details/WaitingRoomSection.tsx | 2 +- .../procedures/diagnosis/DiagnosisForm.tsx | 2 +- .../LaboratoryTestExamination.tsx | 2 +- .../rapidTest/RapidTestExamination.tsx | 2 +- .../travelMedicine/api/download/files.ts | 24 +- .../api/models/AppointmentBlock.ts | 6 +- .../api/models/AppointmentTypeConfig.ts | 6 +- .../travelMedicine/api/models/Disease.ts | 6 +- .../models/InformationStatementTemplates.ts | 6 +- .../api/models/OtherServicesTemplates.ts | 6 +- .../travelMedicine/api/models/Vaccines.ts | 5 +- .../api/mutations/approvalRequests.ts | 18 - .../travelMedicine/api/mutations/files.ts | 18 - .../api/mutations/progressEntries.ts | 31 -- .../api/queries/appointmentBlocks.ts | 2 +- .../travelMedicine/api/queries/files.ts | 12 - .../api/queries/progressEntries.ts | 53 --- .../InformationStatementTemplateEditor.tsx | 2 +- .../MedicalHistoryTemplateEditor.tsx | 2 +- .../EditServiceAppointmentForm.tsx | 12 +- .../certificates/CertificatesTable.tsx | 9 +- .../InformationStatementsTable.tsx | 8 +- .../medicalHistory/MedicalHistory.tsx | 4 +- .../medicalHistory/MedicalHistoryContent.tsx | 9 +- .../MedicalHistoryMultiSelectElement.tsx | 4 +- .../medicalHistory/MedicalHistorySection.tsx | 2 +- .../MedicalHistorySectionElement.tsx | 4 +- .../travelMedicine/shared/constants.ts | 3 +- .../templateEditor/sections/SectionTitle.tsx | 2 +- .../sections/dataElements/DataElementBox.tsx | 4 +- .../src/lib/shared/api/download/files.ts | 18 - .../AppointmentBlockFormWithDays.tsx | 2 +- .../AppointmentCountWithDays.tsx | 2 +- .../validateAppointmentBlock.ts | 2 +- .../shared/components/drawer/SidebarScope.tsx | 29 ++ .../shared/components/drawer/SidebarSlot.tsx | 7 +- .../components/drawer/drawerContext.tsx | 4 + .../shared/components/drawer/useSidebar.tsx | 4 +- .../shared/components/drawer/useSidenav.ts | 4 +- .../shared/components/form/SidebarForm.tsx | 2 +- .../form/address/LegacyAddressForm.tsx | 2 +- .../components/import/ImportDataForm.tsx | 4 +- .../shared/components/import/ImportResult.tsx | 12 +- .../progress-entries/FileCardWithActions.tsx | 15 +- .../progress-entries/ProgressEntriesPage.tsx | 19 +- .../modals/EntryDeletionRequestModal.tsx | 6 +- .../modals/EntryDirectDeletionModal.tsx | 5 +- .../modals/FileDeletionRequestModal.tsx | 5 +- .../modals/FileDirectDeletionModal.tsx | 5 +- .../mutations/approvalRequestApi.ts} | 27 +- .../progress-entries/mutations/fileApi.ts} | 28 +- .../mutations/progressEntryApi.ts} | 67 +--- .../progress-entries/queries/fileApi.ts} | 23 +- .../queries/progressEntryApi.ts} | 33 +- .../sidebars/CreateProgressEntrySidebar.tsx | 6 +- .../ApprovalRequestCard.tsx | 5 +- .../ApprovalRequestsOverviewSidebar.tsx | 6 +- .../DetailsHistory.tsx | 15 +- .../ManualProgressEntryDetails.tsx | 5 +- .../ProgressEntryDetailsSidebar.tsx | 10 +- .../procedures/progress-entries/types.ts | 152 +++----- lib-portal/eslint.config.js | 7 +- lib-portal/src/components/form/FormPlus.tsx | 16 +- .../src/components/formFields/InputField.tsx | 1 + .../AppointmentListForDate.tsx | 5 +- .../AppointmentPickerField.tsx | 3 + .../formFields/appointmentPicker/labels.ts | 2 +- .../components/navigation/NavigationLink.tsx | 7 +- lib-portal/src/config/apiMiddlewares.ts | 14 + packages/base-api/buildscript-gradle.lockfile | 4 + .../dental-api/buildscript-gradle.lockfile | 4 + packages/dental/buildscript-gradle.lockfile | 4 + packages/dental/eslint.config.js | 7 +- packages/dental/package.json | 1 + packages/dental/src/api/createClients.ts | 34 ++ .../dental/src}/api/models/Child.ts | 15 +- .../dental/src}/api/models/ChildDetails.ts | 36 +- .../src}/api/models/ChildExamination.ts | 8 +- .../src}/api/models/ChildExaminationResult.ts | 19 +- .../src}/api/models/ChildSearchResult.ts | 0 .../dental/src}/api/models/Examination.ts | 19 +- .../src}/api/models/ExaminationStatus.ts | 0 .../dental/src}/api/models/Institution.ts | 6 +- .../src}/api/models/ProphylaxisSession.ts | 13 +- .../api/models/ProphylaxisSessionDetails.ts | 0 .../dental/src}/api/mutations/childApi.ts | 12 +- .../dental/src/api/mutations/importApi.ts | 20 ++ .../api/mutations/prophylaxisSessionApi.ts | 8 +- .../dental/src}/api/queries/apiQueryKeys.ts | 0 .../dental/src}/api/queries/childApi.ts | 18 +- .../src}/api/queries/prophylaxisSessionApi.ts | 10 +- .../dental/src/api/queries/staffApi.ts | 4 +- packages/dental/src/shared/DentalProvider.tsx | 37 ++ .../buildscript-gradle.lockfile | 4 + packages/lib-employee-portal/eslint.config.js | 7 +- packages/lib-employee-portal/package.json | 1 + .../src}/api/models/BaseEntity.ts | 4 + .../src}/api/models/PaginatedList.ts | 0 .../src}/api/models/Versioned.ts | 0 .../api/models/import/ImportStatistics.ts | 0 .../src}/api/models/utils.ts | 0 .../src}/helpers/import.ts | 0 packages/measles-protection-api/.gitignore | 2 + packages/measles-protection-api/build.gradle | 9 + .../buildscript-gradle.lockfile | 4 + packages/measles-protection-api/package.json | 10 + packages/measles-protection-api/tsconfig.json | 3 + .../measles-protection-api/tsup.config.ts | 8 + packages/school-entry-api/.gitignore | 2 + packages/school-entry-api/build.gradle | 9 + .../buildscript-gradle.lockfile | 4 + packages/school-entry-api/package.json | 10 + packages/school-entry-api/tsconfig.json | 3 + packages/school-entry-api/tsup.config.ts | 8 + packages/statistics-api/.gitignore | 2 + packages/statistics-api/build.gradle | 9 + .../buildscript-gradle.lockfile | 4 + packages/statistics-api/package.json | 10 + packages/statistics-api/tsconfig.json | 3 + packages/statistics-api/tsup.config.ts | 8 + pnpm-lock.yaml | 201 ++++++++++- pnpm-workspace.yaml | 1 + 633 files changed, 5045 insertions(+), 3304 deletions(-) create mode 100644 backend/dental/src/main/java/de/eshg/dental/api/AbsenceExaminationResultDto.java create mode 100644 backend/dental/src/main/java/de/eshg/dental/api/MainResultDto.java create mode 100644 backend/dental/src/main/java/de/eshg/dental/api/ReasonForAbsenceDto.java create mode 100644 backend/dental/src/main/java/de/eshg/dental/api/SecondaryResultDto.java create mode 100644 backend/dental/src/main/java/de/eshg/dental/api/ToothDiagnosisDto.java create mode 100644 backend/dental/src/main/java/de/eshg/dental/api/ToothDto.java create mode 100644 backend/dental/src/main/java/de/eshg/dental/api/UpdateExaminationsInBulkRequest.java create mode 100644 backend/dental/src/main/java/de/eshg/dental/api/UpdateProphylaxisSessionExaminationsRequest.java create mode 100644 backend/dental/src/main/java/de/eshg/dental/domain/model/AbsenceExaminationResult.java create mode 100644 backend/dental/src/main/java/de/eshg/dental/domain/model/MainResult.java create mode 100644 backend/dental/src/main/java/de/eshg/dental/domain/model/ReasonForAbsence.java create mode 100644 backend/dental/src/main/java/de/eshg/dental/domain/model/SecondaryResult.java create mode 100644 backend/dental/src/main/java/de/eshg/dental/domain/model/Tooth.java create mode 100644 backend/dental/src/main/java/de/eshg/dental/domain/model/ToothDiagnosis.java create mode 100644 backend/dental/src/main/resources/gdpr-legal-basis-text.txt create mode 100644 backend/dental/src/main/resources/migrations/0026_add_tooth_diagnoses.xml create mode 100644 backend/dental/src/main/resources/migrations/0027_add_absence_examination_result.xml create mode 100644 backend/inspection/src/main/resources/gdpr-legal-basis-text.txt create mode 100644 backend/measles-protection/src/main/java/de/eshg/measlesprotection/MeaslesGdprZipEditorProvider.java create mode 100644 backend/measles-protection/src/main/resources/gdpr-legal-basis-text.txt create mode 100644 backend/medical-registry/src/main/resources/gdpr-legal-basis-text.txt delete mode 100644 backend/official-medical-service/src/main/java/de/eshg/officialmedicalservice/procedure/EmployeeOmsProcedureSpecification.java create mode 100644 backend/official-medical-service/src/main/java/de/eshg/officialmedicalservice/procedure/api/GetOmsProceduresFilterOptionsDto.java create mode 100644 backend/official-medical-service/src/main/java/de/eshg/officialmedicalservice/procedure/persistence/entity/OmsProcedureView.java create mode 100644 backend/official-medical-service/src/main/resources/gdpr-legal-basis-text.txt create mode 100644 backend/school-entry/src/main/resources/gdpr-legal-basis-text.txt delete mode 100644 backend/statistics/src/main/java/de/eshg/statistics/config/AutoReportSeriesConfig.java create mode 100644 backend/sti-protection/src/main/java/de/eshg/stiprotection/TextTemplateController.java create mode 100644 backend/sti-protection/src/main/java/de/eshg/stiprotection/TextTemplateService.java create mode 100644 backend/sti-protection/src/main/java/de/eshg/stiprotection/api/texttemplate/CreateTextTemplateRequest.java create mode 100644 backend/sti-protection/src/main/java/de/eshg/stiprotection/api/texttemplate/CreateTextTemplateResponse.java create mode 100644 backend/sti-protection/src/main/java/de/eshg/stiprotection/api/texttemplate/GetTextTemplatesFilterOptions.java create mode 100644 backend/sti-protection/src/main/java/de/eshg/stiprotection/api/texttemplate/GetTextTemplatesResponse.java create mode 100644 backend/sti-protection/src/main/java/de/eshg/stiprotection/api/texttemplate/TextTemplateContextDto.java create mode 100644 backend/sti-protection/src/main/java/de/eshg/stiprotection/api/texttemplate/TextTemplateDto.java create mode 100644 backend/sti-protection/src/main/java/de/eshg/stiprotection/mapper/texttemplate/TextTemplateContextMapper.java create mode 100644 backend/sti-protection/src/main/java/de/eshg/stiprotection/mapper/texttemplate/TextTemplateMapper.java create mode 100644 backend/sti-protection/src/main/java/de/eshg/stiprotection/persistence/db/texttemplate/TextTemplate.java create mode 100644 backend/sti-protection/src/main/java/de/eshg/stiprotection/persistence/db/texttemplate/TextTemplateContext.java create mode 100644 backend/sti-protection/src/main/java/de/eshg/stiprotection/persistence/db/texttemplate/TextTemplateRepository.java create mode 100644 backend/sti-protection/src/main/resources/migrations/0043_add_text_templates.xml create mode 100644 backend/travel-medicine/src/main/resources/gdpr-legal-basis-text.txt create mode 100644 employee-portal/src/app/(businessModules)/dental/layout.tsx delete mode 100644 employee-portal/src/lib/businessModules/dental/api/clients.ts delete mode 100644 employee-portal/src/lib/businessModules/dental/api/downloads/files.ts delete mode 100644 employee-portal/src/lib/businessModules/dental/api/mutations/approvalRequestApi.ts delete mode 100644 employee-portal/src/lib/businessModules/dental/api/mutations/fileApi.ts delete mode 100644 employee-portal/src/lib/businessModules/dental/api/mutations/importApi.ts delete mode 100644 employee-portal/src/lib/businessModules/dental/api/mutations/progressEntryApi.ts delete mode 100644 employee-portal/src/lib/businessModules/dental/api/queries/fileApi.ts delete mode 100644 employee-portal/src/lib/businessModules/dental/api/queries/progressEntryApi.ts create mode 100644 employee-portal/src/lib/businessModules/dental/features/children/details/AdditionalInformation.tsx create mode 100644 employee-portal/src/lib/businessModules/dental/features/children/options.ts create mode 100644 employee-portal/src/lib/businessModules/dental/features/children/translations.ts delete mode 100644 employee-portal/src/lib/businessModules/inspection/api/download/files.ts delete mode 100644 employee-portal/src/lib/businessModules/inspection/api/mutations/approvalRequests.ts delete mode 100644 employee-portal/src/lib/businessModules/inspection/api/mutations/files.ts delete mode 100644 employee-portal/src/lib/businessModules/inspection/api/mutations/progressEntries.ts delete mode 100644 employee-portal/src/lib/businessModules/inspection/api/queries/files.ts delete mode 100644 employee-portal/src/lib/businessModules/inspection/api/queries/progressEntries.ts delete mode 100644 employee-portal/src/lib/businessModules/measlesProtection/api/download/files.ts delete mode 100644 employee-portal/src/lib/businessModules/measlesProtection/api/mutations/approvalRequests.ts delete mode 100644 employee-portal/src/lib/businessModules/measlesProtection/api/mutations/files.ts delete mode 100644 employee-portal/src/lib/businessModules/measlesProtection/api/mutations/progressEntries.ts delete mode 100644 employee-portal/src/lib/businessModules/measlesProtection/api/queries/progressEntries.ts delete mode 100644 employee-portal/src/lib/businessModules/medicalRegistry/api/mutations/approvalRequests.ts delete mode 100644 employee-portal/src/lib/businessModules/medicalRegistry/api/mutations/files.ts delete mode 100644 employee-portal/src/lib/businessModules/medicalRegistry/api/mutations/progressEntries.ts delete mode 100644 employee-portal/src/lib/businessModules/medicalRegistry/api/queries/files.ts delete mode 100644 employee-portal/src/lib/businessModules/medicalRegistry/api/queries/progressEntries.ts delete mode 100644 employee-portal/src/lib/businessModules/officialMedicalService/api/download/files.ts create mode 100644 employee-portal/src/lib/businessModules/officialMedicalService/api/mutations/appointmentApi.ts delete mode 100644 employee-portal/src/lib/businessModules/officialMedicalService/api/mutations/approvalRequests.ts delete mode 100644 employee-portal/src/lib/businessModules/officialMedicalService/api/mutations/files.ts delete mode 100644 employee-portal/src/lib/businessModules/officialMedicalService/api/mutations/progressEntries.ts delete mode 100644 employee-portal/src/lib/businessModules/officialMedicalService/api/queries/files.ts delete mode 100644 employee-portal/src/lib/businessModules/officialMedicalService/api/queries/progressEntries.ts create mode 100644 employee-portal/src/lib/businessModules/officialMedicalService/shared/enums.ts delete mode 100644 employee-portal/src/lib/businessModules/schoolEntry/api/download/files.ts delete mode 100644 employee-portal/src/lib/businessModules/schoolEntry/api/mutations/approvalRequests.ts delete mode 100644 employee-portal/src/lib/businessModules/schoolEntry/api/mutations/files.ts delete mode 100644 employee-portal/src/lib/businessModules/schoolEntry/api/mutations/progressEntries.ts delete mode 100644 employee-portal/src/lib/businessModules/schoolEntry/api/queries/files.ts delete mode 100644 employee-portal/src/lib/businessModules/schoolEntry/api/queries/progressEntries.ts delete mode 100644 employee-portal/src/lib/businessModules/stiProtection/api/download/files.ts delete mode 100644 employee-portal/src/lib/businessModules/stiProtection/api/mutations/approvalRequests.ts delete mode 100644 employee-portal/src/lib/businessModules/stiProtection/api/mutations/files.ts delete mode 100644 employee-portal/src/lib/businessModules/stiProtection/api/mutations/progressEntries.ts delete mode 100644 employee-portal/src/lib/businessModules/stiProtection/api/queries/files.ts delete mode 100644 employee-portal/src/lib/businessModules/stiProtection/api/queries/progressEntries.ts delete mode 100644 employee-portal/src/lib/businessModules/travelMedicine/api/mutations/approvalRequests.ts delete mode 100644 employee-portal/src/lib/businessModules/travelMedicine/api/mutations/files.ts delete mode 100644 employee-portal/src/lib/businessModules/travelMedicine/api/mutations/progressEntries.ts delete mode 100644 employee-portal/src/lib/businessModules/travelMedicine/api/queries/files.ts delete mode 100644 employee-portal/src/lib/businessModules/travelMedicine/api/queries/progressEntries.ts delete mode 100644 employee-portal/src/lib/shared/api/download/files.ts create mode 100644 employee-portal/src/lib/shared/components/drawer/SidebarScope.tsx rename employee-portal/src/lib/shared/{api/mutations/approvalRequests.ts => components/procedures/progress-entries/mutations/approvalRequestApi.ts} (67%) rename employee-portal/src/lib/shared/{api/mutations/files.ts => components/procedures/progress-entries/mutations/fileApi.ts} (58%) rename employee-portal/src/lib/shared/{api/mutations/progressEntries.ts => components/procedures/progress-entries/mutations/progressEntryApi.ts} (63%) rename employee-portal/src/lib/shared/{api/queries/files.ts => components/procedures/progress-entries/queries/fileApi.ts} (64%) rename employee-portal/src/lib/shared/{api/queries/progressEntries.ts => components/procedures/progress-entries/queries/progressEntryApi.ts} (83%) create mode 100644 lib-portal/src/config/apiMiddlewares.ts create mode 100644 packages/base-api/buildscript-gradle.lockfile create mode 100644 packages/dental-api/buildscript-gradle.lockfile create mode 100644 packages/dental/buildscript-gradle.lockfile create mode 100644 packages/dental/src/api/createClients.ts rename {employee-portal/src/lib/businessModules/dental => packages/dental/src}/api/models/Child.ts (74%) rename {employee-portal/src/lib/businessModules/dental => packages/dental/src}/api/models/ChildDetails.ts (61%) rename {employee-portal/src/lib/businessModules/dental => packages/dental/src}/api/models/ChildExamination.ts (83%) rename {employee-portal/src/lib/businessModules/dental => packages/dental/src}/api/models/ChildExaminationResult.ts (73%) rename {employee-portal/src/lib/businessModules/dental => packages/dental/src}/api/models/ChildSearchResult.ts (100%) rename {employee-portal/src/lib/businessModules/dental => packages/dental/src}/api/models/Examination.ts (55%) rename {employee-portal/src/lib/businessModules/dental => packages/dental/src}/api/models/ExaminationStatus.ts (100%) rename {employee-portal/src/lib/businessModules/dental => packages/dental/src}/api/models/Institution.ts (89%) rename {employee-portal/src/lib/businessModules/dental => packages/dental/src}/api/models/ProphylaxisSession.ts (67%) rename {employee-portal/src/lib/businessModules/dental => packages/dental/src}/api/models/ProphylaxisSessionDetails.ts (100%) rename {employee-portal/src/lib/businessModules/dental => packages/dental/src}/api/mutations/childApi.ts (89%) create mode 100644 packages/dental/src/api/mutations/importApi.ts rename {employee-portal/src/lib/businessModules/dental => packages/dental/src}/api/mutations/prophylaxisSessionApi.ts (82%) rename {employee-portal/src/lib/businessModules/dental => packages/dental/src}/api/queries/apiQueryKeys.ts (100%) rename {employee-portal/src/lib/businessModules/dental => packages/dental/src}/api/queries/childApi.ts (81%) rename {employee-portal/src/lib/businessModules/dental => packages/dental/src}/api/queries/prophylaxisSessionApi.ts (74%) rename employee-portal/src/lib/businessModules/dental/api/queries/staff.ts => packages/dental/src/api/queries/staffApi.ts (80%) create mode 100644 packages/dental/src/shared/DentalProvider.tsx create mode 100644 packages/lib-employee-portal/buildscript-gradle.lockfile rename {employee-portal/src/lib/shared => packages/lib-employee-portal/src}/api/models/BaseEntity.ts (78%) rename {employee-portal/src/lib/shared => packages/lib-employee-portal/src}/api/models/PaginatedList.ts (100%) rename {employee-portal/src/lib/shared => packages/lib-employee-portal/src}/api/models/Versioned.ts (100%) rename {employee-portal/src/lib/shared => packages/lib-employee-portal/src}/api/models/import/ImportStatistics.ts (100%) rename {employee-portal/src/lib/shared => packages/lib-employee-portal/src}/api/models/utils.ts (100%) rename {employee-portal/src/lib/shared => packages/lib-employee-portal/src}/helpers/import.ts (100%) create mode 100644 packages/measles-protection-api/.gitignore create mode 100644 packages/measles-protection-api/build.gradle create mode 100644 packages/measles-protection-api/buildscript-gradle.lockfile create mode 100644 packages/measles-protection-api/package.json create mode 100644 packages/measles-protection-api/tsconfig.json create mode 100644 packages/measles-protection-api/tsup.config.ts create mode 100644 packages/school-entry-api/.gitignore create mode 100644 packages/school-entry-api/build.gradle create mode 100644 packages/school-entry-api/buildscript-gradle.lockfile create mode 100644 packages/school-entry-api/package.json create mode 100644 packages/school-entry-api/tsconfig.json create mode 100644 packages/school-entry-api/tsup.config.ts create mode 100644 packages/statistics-api/.gitignore create mode 100644 packages/statistics-api/build.gradle create mode 100644 packages/statistics-api/buildscript-gradle.lockfile create mode 100644 packages/statistics-api/package.json create mode 100644 packages/statistics-api/tsconfig.json create mode 100644 packages/statistics-api/tsup.config.ts diff --git a/admin-portal/eslint.config.js b/admin-portal/eslint.config.js index 47a6d0e3f..86f0b25e4 100644 --- a/admin-portal/eslint.config.js +++ b/admin-portal/eslint.config.js @@ -3,11 +3,6 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import tseslint from "typescript-eslint"; - import { eslintNextConfigs } from "../config/eslint.next.js"; -export default tseslint.config( - ...eslintNextConfigs.app, - ...eslintNextConfigs.forbidStyleProp, -); +export default eslintNextConfigs.app; diff --git a/backend/auditlog-api/src/main/java/de/eshg/auditlog/AuditLogApi.java b/backend/auditlog-api/src/main/java/de/eshg/auditlog/AuditLogApi.java index 65ddb80cc..248f7ed89 100644 --- a/backend/auditlog-api/src/main/java/de/eshg/auditlog/AuditLogApi.java +++ b/backend/auditlog-api/src/main/java/de/eshg/auditlog/AuditLogApi.java @@ -15,6 +15,7 @@ import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotNull; import java.io.IOException; import org.springdoc.core.annotations.ParameterObject; +import org.springframework.core.io.Resource; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestHeader; @@ -41,7 +42,7 @@ public interface AuditLogApi { @GetExchange @Operation(summary = "Decrypt and read an auditlog file for a service of a certain date.") - ResponseEntity<String> readAuditLogFile( + ResponseEntity<Resource> readAuditLogFile( @RequestHeader(name = DECRYPTION_KEY_HEADER_NAME) @NotNull @NotBlank String key, @InlineParameterObject @ParameterObject @Valid ReadAuditLogFileRequest readAuditLogFileRequest) diff --git a/backend/auditlog/openApi.yaml b/backend/auditlog/openApi.yaml index 7cbd1a889..a464235cf 100644 --- a/backend/auditlog/openApi.yaml +++ b/backend/auditlog/openApi.yaml @@ -35,6 +35,7 @@ paths: '*/*': schema: type: string + format: binary description: OK summary: Decrypt and read an auditlog file for a service of a certain date. tags: diff --git a/backend/auditlog/src/main/java/de/eshg/auditlog/AuditLogController.java b/backend/auditlog/src/main/java/de/eshg/auditlog/AuditLogController.java index 83c6ed52f..b51269e5c 100644 --- a/backend/auditlog/src/main/java/de/eshg/auditlog/AuditLogController.java +++ b/backend/auditlog/src/main/java/de/eshg/auditlog/AuditLogController.java @@ -30,10 +30,13 @@ import de.eshg.base.user.api.UserFilterParameters; import de.eshg.lib.auditlog.AuditLogger; import de.eshg.rest.service.error.BadRequestException; import de.eshg.rest.service.error.ErrorCode; +import de.eshg.rest.service.error.ErrorResponse; import de.eshg.rest.service.error.NotFoundException; import de.eshg.rest.service.security.CurrentUserHelper; import jakarta.servlet.ServletRequest; import java.io.ByteArrayInputStream; +import java.io.FileInputStream; +import java.io.FileNotFoundException; import java.io.IOException; import java.io.UncheckedIOException; import java.nio.channels.Channels; @@ -66,13 +69,20 @@ import java.util.Optional; import java.util.Set; import java.util.UUID; import java.util.stream.Stream; +import javax.crypto.AEADBadTagException; +import javax.crypto.Cipher; import org.apache.commons.lang3.ArrayUtils; +import org.bouncycastle.jcajce.io.CipherInputStream; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.core.io.InputStreamResource; +import org.springframework.core.io.Resource; import org.springframework.http.ContentDisposition; import org.springframework.http.HttpHeaders; +import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.client.HttpClientErrorException; import org.springframework.web.context.request.RequestAttributes; @@ -136,7 +146,7 @@ public class AuditLogController implements AuditLogApi, AuditLogArchivingApi { } @Override - public ResponseEntity<String> readAuditLogFile( + public ResponseEntity<Resource> readAuditLogFile( String key, ReadAuditLogFileRequest readAuditLogFileRequest) { UserDto selfUser = userApi.getSelfUser(); @@ -160,25 +170,40 @@ public class AuditLogController implements AuditLogApi, AuditLogArchivingApi { validateAccessWasGranted( readAuditLogFileRequest.source(), readAuditLogFileRequest.date(), selfUser); + Cipher cipher = createDecryptionCipher(key, ivFilePath); + return ResponseEntity.ok() + .contentType(TEXT_PLAIN_UTF_8) + .header(HttpHeaders.CONTENT_DISPOSITION, ContentDisposition.inline().build().toString()) + .body(new InputStreamResource(() -> createInputStreamForFile(auditLogFilePath, cipher))); + } + + private static CipherInputStream createInputStreamForFile(Path file, Cipher cipher) + throws FileNotFoundException { + return new CipherInputStream(new FileInputStream(file.toFile()), cipher); + } + + private static Cipher createDecryptionCipher(String key, Path ivFilePath) { try { - ContentDisposition contentDisposition = ContentDisposition.inline().build(); - - return ResponseEntity.ok() - .contentType(TEXT_PLAIN_UTF_8) - .header(HttpHeaders.CONTENT_DISPOSITION, contentDisposition.toString()) - .body( - new String( - decryptAuditLogFile(key, auditLogFilePath, ivFilePath), StandardCharsets.UTF_8)); + return SymmetricEncryption.createDecryptionCipher( + Base64.getDecoder().decode(key), Files.readAllBytes(ivFilePath)); } catch (IOException e) { throw new UncheckedIOException("Unable to read audit log files", e); - } catch (InvalidKeyException | javax.crypto.AEADBadTagException e) { - log.error("Invalid decryption key", e); + } catch (InvalidKeyException e) { + log.error("Invalid encryption key was given", e); throw new BadRequestException("Invalid decryption key"); } catch (GeneralSecurityException e) { throw new AuditLogDecryptionException("Unable to decrypt audit log", e); } } + @ExceptionHandler + public ResponseEntity<ErrorResponse> handleInvalidKey(AEADBadTagException e) { + log.error("Wrong decryption key was given", e); + return ResponseEntity.badRequest() + .contentType(MediaType.APPLICATION_JSON) + .body(new ErrorResponse(ErrorCode.BAD_REQUEST, "Wrong decryption key")); + } + @Override public GetUsersResponse getAuditLogGranteesCandidates( GetAuditLogDataRequest getAuditLogDataRequest) { @@ -513,17 +538,6 @@ public class AuditLogController implements AuditLogApi, AuditLogArchivingApi { } } - private byte[] decryptAuditLogFile(String key, Path auditLogFilePath, Path ivFilePath) - throws GeneralSecurityException, IOException { - log.info("Decrypting audit log"); - EncryptedPayload encryptedPayload = - new EncryptedPayload( - Files.readAllBytes(auditLogFilePath), - Base64.getDecoder().decode(key), - Files.readAllBytes(ivFilePath)); - return SymmetricEncryption.decrypt(encryptedPayload); - } - private Path getIvFilePathOrThrow( ReadAuditLogFileRequest readAuditLogFileRequest, Path auditLogFilePath) { Path ivFilePath = getPathOfCorrespondingIvFile(auditLogFilePath); diff --git a/backend/auditlog/src/main/java/de/eshg/auditlog/crypto/SymmetricEncryption.java b/backend/auditlog/src/main/java/de/eshg/auditlog/crypto/SymmetricEncryption.java index f3643b8e3..cf0948442 100644 --- a/backend/auditlog/src/main/java/de/eshg/auditlog/crypto/SymmetricEncryption.java +++ b/backend/auditlog/src/main/java/de/eshg/auditlog/crypto/SymmetricEncryption.java @@ -54,13 +54,13 @@ public final class SymmetricEncryption { return cipher.doFinal(inputBytes); } - public static byte[] decrypt(EncryptedPayload encryptedPayload) throws GeneralSecurityException { + public static Cipher createDecryptionCipher(byte[] key, byte[] iv) + throws GeneralSecurityException { Cipher cipher = Cipher.getInstance(AES_GCM_ALGORITHM); - byte[] key = encryptedPayload.key; SecretKey secretKey = new SecretKeySpec(key, KEY_ALGORITHM); - GCMParameterSpec gcmParameterSpec = createGcmParameterSpecFromIv(encryptedPayload.iv); + GCMParameterSpec gcmParameterSpec = createGcmParameterSpecFromIv(iv); cipher.init(Cipher.DECRYPT_MODE, secretKey, gcmParameterSpec); - return cipher.doFinal(encryptedPayload.cipherText); + return cipher; } public record EncryptedPayload(byte[] cipherText, byte[] key, byte[] iv) {} diff --git a/backend/base/src/main/java/de/eshg/base/gdpr/GdprProcedureController.java b/backend/base/src/main/java/de/eshg/base/gdpr/GdprProcedureController.java index 88720543e..8bf5f1cf9 100644 --- a/backend/base/src/main/java/de/eshg/base/gdpr/GdprProcedureController.java +++ b/backend/base/src/main/java/de/eshg/base/gdpr/GdprProcedureController.java @@ -325,16 +325,14 @@ public class GdprProcedureController implements GdprProcedureApi { @Transactional(readOnly = true) public ResponseEntity<Resource> getCentralFileDownloadPackage(UUID id) { baseFeatureToggle.assertNewFeatureIsEnabled(BaseFeature.GDPR); - GdprProcedure procedure = service.getGdprProcedureFromDb(id); - byte[] content = service.getCentralFileDownloadPackage(procedure.getExternalId()); + byte[] content = service.getCentralFileDownloadPackage(id); return ResponseEntity.ok() .header( HttpHeaders.CONTENT_DISPOSITION, ContentDisposition.attachment() - .filename( - downloadPackageFilename(procedure.getExternalId()), StandardCharsets.UTF_8) + .filename(downloadPackageFilename(id), StandardCharsets.UTF_8) .build() .toString()) .header(HttpHeaders.CONTENT_TYPE, CustomMediaTypes.ZIP_VALUE) diff --git a/backend/base/src/main/java/de/eshg/base/icd10/persistence/repository/Icd10CodeRepository.java b/backend/base/src/main/java/de/eshg/base/icd10/persistence/repository/Icd10CodeRepository.java index d1e51cfdf..7d7f61894 100644 --- a/backend/base/src/main/java/de/eshg/base/icd10/persistence/repository/Icd10CodeRepository.java +++ b/backend/base/src/main/java/de/eshg/base/icd10/persistence/repository/Icd10CodeRepository.java @@ -46,7 +46,7 @@ public interface Icd10CodeRepository extends JpaRepository<Icd10Code, String> { select g.group_start || '-' || g.group_end as code, true as "group", g.title as title from icd10group g where (g.group_start || '-' || g.group_end) in :codesWithoutDot - ) + ) as codes order by code asc, "group" asc """) Stream<Icd10SearchResult> findAllCodes(@Param("codesWithoutDot") List<String> codesWithoutDot); diff --git a/backend/dental/openApi.yaml b/backend/dental/openApi.yaml index 53d8db35b..7c2374251 100644 --- a/backend/dental/openApi.yaml +++ b/backend/dental/openApi.yaml @@ -1749,6 +1749,31 @@ paths: description: OK tags: - ProphylaxisSession + /prophylaxis-sessions/{prophylaxisSessionId}/examinations: + patch: + operationId: updateProphylaxisSessionExaminations + parameters: + - in: path + name: prophylaxisSessionId + required: true + schema: + type: string + format: uuid + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/UpdateProphylaxisSessionExaminationsRequest" + required: true + responses: + "200": + content: + '*/*': + schema: + $ref: "#/components/schemas/ProphylaxisSessionDetails" + description: OK + tags: + - ProphylaxisSession /prophylaxis-sessions/{prophylaxisSessionId}/participants: put: operationId: updateProphylaxisSessionParticipants @@ -2138,6 +2163,16 @@ paths: - TestHelper components: schemas: + AbsenceExaminationResult: + type: object + allOf: + - $ref: "#/components/schemas/DentalExaminationResult" + - type: object + properties: + reasonForAbsence: + $ref: "#/components/schemas/ReasonForAbsence" + required: + - reasonForAbsence AbstractFile: type: object allOf: @@ -3195,6 +3230,8 @@ components: dateAndTime: type: string format: date-time + fluoridation: + type: boolean id: type: string format: uuid @@ -3204,15 +3241,20 @@ components: $ref: "#/components/schemas/ProphylaxisType" result: oneOf: + - $ref: "#/components/schemas/AbsenceExaminationResult" - $ref: "#/components/schemas/FluoridationExaminationResult" - $ref: "#/components/schemas/ScreeningExaminationResult" + screening: + type: boolean version: type: integer format: int64 required: - dateAndTime + - fluoridation - id - prophylaxisType + - screening - version ExistingUser: type: object @@ -4401,6 +4443,24 @@ components: $ref: "#/components/schemas/MailMetaData" required: - changedAt + MainResult: + type: string + enum: + - S + - I + - D + - F + - E + - "Y" + - X + - Z + - T + - H + - O + - V + - "N" + - P + - K ManualProgressEntry: type: object allOf: @@ -4856,6 +4916,7 @@ components: format: date examinationResult: oneOf: + - $ref: "#/components/schemas/AbsenceExaminationResult" - $ref: "#/components/schemas/FluoridationExaminationResult" - $ref: "#/components/schemas/ScreeningExaminationResult" firstName: @@ -4956,6 +5017,13 @@ components: - P5 - P6 - P7 + ReasonForAbsence: + type: string + enum: + - NOT_APPEARED + - SHIFTED + - MOVED + - REFUSED Salutation: type: string enum: @@ -4973,8 +5041,13 @@ components: type: boolean oralHygieneStatus: $ref: "#/components/schemas/OralHygieneStatus" + toothDiagnoses: + type: array + items: + $ref: "#/components/schemas/ToothDiagnosis" required: - fluorideVarnishApplied + - toothDiagnoses SearchChildrenResponse: type: object properties: @@ -4984,6 +5057,19 @@ components: $ref: "#/components/schemas/ChildSearchResult" required: - children + SecondaryResult: + type: string + enum: + - DA + - FA + - FIS + - ID + - INS + - LUE + - RET + - TR + - WR + - ZA SelfAssignTaskRequest: type: object properties: @@ -5208,6 +5294,75 @@ components: - DR - PROF - PROF_DR + Tooth: + type: string + enum: + - T11 + - T12 + - T13 + - T14 + - T15 + - T16 + - T17 + - T18 + - T21 + - T22 + - T23 + - T24 + - T25 + - T26 + - T27 + - T28 + - T31 + - T32 + - T33 + - T34 + - T35 + - T36 + - T37 + - T38 + - T41 + - T42 + - T43 + - T44 + - T45 + - T46 + - T47 + - T48 + - T51 + - T52 + - T53 + - T54 + - T55 + - T61 + - T62 + - T63 + - T64 + - T65 + - T71 + - T72 + - T73 + - T74 + - T75 + - T81 + - T82 + - T83 + - T84 + - T85 + ToothDiagnosis: + type: object + properties: + mainResult: + $ref: "#/components/schemas/MainResult" + secondaryResult1: + $ref: "#/components/schemas/SecondaryResult" + secondaryResult2: + $ref: "#/components/schemas/SecondaryResult" + tooth: + $ref: "#/components/schemas/Tooth" + required: + - mainResult + - tooth TriggerType: type: string enum: @@ -5238,6 +5393,7 @@ components: type: string result: oneOf: + - $ref: "#/components/schemas/AbsenceExaminationResult" - $ref: "#/components/schemas/FluoridationExaminationResult" - $ref: "#/components/schemas/ScreeningExaminationResult" version: @@ -5245,6 +5401,34 @@ components: format: int64 required: - version + UpdateExaminationsInBulkRequest: + type: object + properties: + id: + type: string + format: uuid + note: + type: string + result: + oneOf: + - $ref: "#/components/schemas/AbsenceExaminationResult" + - $ref: "#/components/schemas/FluoridationExaminationResult" + - $ref: "#/components/schemas/ScreeningExaminationResult" + version: + type: integer + format: int64 + required: + - id + - version + UpdateProphylaxisSessionExaminationsRequest: + type: object + properties: + examinationUpdates: + type: array + items: + $ref: "#/components/schemas/UpdateExaminationsInBulkRequest" + required: + - examinationUpdates UpdateProphylaxisSessionParticipantsRequest: type: object properties: diff --git a/backend/dental/src/main/java/de/eshg/dental/ChildService.java b/backend/dental/src/main/java/de/eshg/dental/ChildService.java index f50eb6039..079fdffea 100644 --- a/backend/dental/src/main/java/de/eshg/dental/ChildService.java +++ b/backend/dental/src/main/java/de/eshg/dental/ChildService.java @@ -11,6 +11,7 @@ import de.eshg.base.centralfile.PersonApi; import de.eshg.base.centralfile.api.DataOriginDto; import de.eshg.base.centralfile.api.GetFileStateIdsResponse; import de.eshg.base.centralfile.api.person.AddPersonFileStateRequest; +import de.eshg.base.centralfile.api.person.AddPersonFileStateResponse; import de.eshg.base.centralfile.api.person.AddPersonFileStatesRequest; import de.eshg.base.centralfile.api.person.AddPersonFileStatesResponse; import de.eshg.base.centralfile.api.person.GetPersonFileStateResponse; @@ -124,10 +125,26 @@ public class ChildService { this.procedureQuery = procedureQuery; } - public Child createChild(CreateChildRequest request) { - Map<CreateChildRequest, Child> children = - createChildren(List.of(request), DataOriginDto.MANUAL); - return Iterables.getOnlyElement(children.values()); + Child createChild(CreateChildRequest request) { + AddPersonFileStateRequest addPersonRequest = + mapToAddPersonFileStateRequest(DataOriginDto.MANUAL, request); + AddPersonFileStateResponse response = personApi.addPersonFileState(addPersonRequest); + + Child createdChild = createChild(request, response.id()); + childRepository.save(createdChild); + return createdChild; + } + + private Child createChild(CreateChildRequest request, UUID personId) { + Child createdChild = new Child(); + createdChild.setProcedureType(ProcedureType.DENTAL_CHILD); + createdChild.updateProcedureStatus(ProcedureStatus.OPEN, clock, auditLogger); + Person person = new Person(); + person.setPersonType(Person.PERSON_TYPE_USED_FOR_CHILDREN); + person.setCentralFileStateId(personId); + createdChild.addRelatedPerson(person); + ChildMapper.mapToChild(request, createdChild); + return createdChild; } public Map<CreateChildRequest, Child> createChildren( @@ -140,13 +157,7 @@ public class ChildService { Map<CreateChildRequest, Child> createdChildren = new LinkedHashMap<>(); for (int i = 0; i < requests.size(); i++) { - Child child = new Child(); - child.setProcedureType(ProcedureType.DENTAL_CHILD); - child.updateProcedureStatus(ProcedureStatus.OPEN, clock, auditLogger); - Person person = new Person(); - person.setPersonType(Person.PERSON_TYPE_USED_FOR_CHILDREN); - person.setCentralFileStateId(childFileStateIds.get(i)); - child.addRelatedPerson(person); + Child child = createChild(requests.get(i), childFileStateIds.get(i)); CreateChildRequest request = requests.get(i); ChildMapper.mapToChild(request, child); childRepository.save(child); @@ -282,25 +293,7 @@ public class ChildService { Collection<CreateChildRequest> requests, DataOriginDto dataOrigin) { List<AddPersonFileStateRequest> personsToAdd = requests.stream() - .map( - request -> - new AddPersonFileStateRequest( - request.referenceId(), - new PersonDetailsDto( - request.title(), - request.salutation(), - request.gender(), - request.firstName(), - request.lastName(), - request.dateOfBirth(), - request.nameAtBirth(), - request.placeOfBirth(), - request.countryOfBirth(), - request.emailAddresses(), - request.phoneNumbers(), - request.contactAddress(), - request.differentBillingAddress()), - dataOrigin)) + .map(request -> mapToAddPersonFileStateRequest(dataOrigin, request)) .toList(); AddPersonFileStatesResponse response = @@ -309,6 +302,27 @@ public class ChildService { return response.personFileStateIds(); } + private static AddPersonFileStateRequest mapToAddPersonFileStateRequest( + DataOriginDto dataOrigin, CreateChildRequest request) { + return new AddPersonFileStateRequest( + request.referenceId(), + new PersonDetailsDto( + request.title(), + request.salutation(), + request.gender(), + request.firstName(), + request.lastName(), + request.dateOfBirth(), + request.nameAtBirth(), + request.placeOfBirth(), + request.countryOfBirth(), + request.emailAddresses(), + request.phoneNumbers(), + request.contactAddress(), + request.differentBillingAddress()), + dataOrigin); + } + public Child findByExternalIdOrThrow(UUID childId) { return childRepository .findByExternalId(childId) @@ -570,7 +584,7 @@ public class ChildService { .map(this::augmentWithDetails); } - private static NotFoundException childNotFoundException() { + static NotFoundException childNotFoundException() { return ExceptionUtil.notFoundException(Child.class); } } diff --git a/backend/dental/src/main/java/de/eshg/dental/DentalGdprZipEditorProvider.java b/backend/dental/src/main/java/de/eshg/dental/DentalGdprZipEditorProvider.java index ccd501a02..961c57740 100644 --- a/backend/dental/src/main/java/de/eshg/dental/DentalGdprZipEditorProvider.java +++ b/backend/dental/src/main/java/de/eshg/dental/DentalGdprZipEditorProvider.java @@ -9,14 +9,17 @@ import de.eshg.dental.domain.model.Child_; import de.eshg.dental.domain.model.Examination_; import de.eshg.domain.model.serialization.ZipEditor; import de.eshg.lib.procedure.gdpr.AbstractGdprZipEditorProvider; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.core.io.Resource; import org.springframework.stereotype.Component; @Component public class DentalGdprZipEditorProvider extends AbstractGdprZipEditorProvider { - @Override - protected String getLegalBasisAppendix() { - return "Hier könnte Ihr Rechtsgrundlagen-Anhang stehen!"; + // TODO (ISSUE-7442): Replace text for legal basis in the file below + public DentalGdprZipEditorProvider( + @Value("classpath:/gdpr-legal-basis-text.txt") Resource resource) { + super(resource); } @Override diff --git a/backend/dental/src/main/java/de/eshg/dental/ExaminationService.java b/backend/dental/src/main/java/de/eshg/dental/ExaminationService.java index 9834a8532..0a7cdb0aa 100644 --- a/backend/dental/src/main/java/de/eshg/dental/ExaminationService.java +++ b/backend/dental/src/main/java/de/eshg/dental/ExaminationService.java @@ -6,10 +6,12 @@ package de.eshg.dental; import de.cronn.reflection.util.ClassUtils; +import de.eshg.dental.api.AbsenceExaminationResultDto; import de.eshg.dental.api.ExaminationResultDto; import de.eshg.dental.api.FluoridationExaminationResultDto; import de.eshg.dental.api.ScreeningExaminationResultDto; import de.eshg.dental.api.UpdateExaminationRequest; +import de.eshg.dental.domain.model.AbsenceExaminationResult; import de.eshg.dental.domain.model.Examination; import de.eshg.dental.domain.model.ExaminationResult; import de.eshg.dental.domain.model.FluoridationExaminationResult; @@ -69,6 +71,8 @@ public class ExaminationService { mapResult(examination, fluoridationExaminationResult); case ScreeningExaminationResultDto screeningExaminationResult -> mapResult(examination, screeningExaminationResult); + case AbsenceExaminationResultDto absenceExaminationResult -> + mapResult(examination, absenceExaminationResult); } } @@ -76,12 +80,13 @@ public class ExaminationService { mapResult( examination, FluoridationExaminationResult.class, - existingResult -> mapResultCommon(existingResult, newResult)); + existingResult -> + existingResult.setFluorideVarnishApplied(newResult.fluorideVarnishApplied())); } private static void validateExaminationResult( Examination examination, ExaminationResultDto newResult) { - if (newResult == null) { + if (newResult == null || newResult instanceof AbsenceExaminationResultDto) { return; } @@ -123,15 +128,21 @@ public class ExaminationService { examination, ScreeningExaminationResult.class, existingResult -> { - mapResultCommon(existingResult, newResult); + existingResult.setFluorideVarnishApplied(newResult.fluorideVarnishApplied()); existingResult.setOralHygieneStatus( ExaminationMapper.mapToDomain(newResult.oralHygieneStatus())); + existingResult.setToothDiagnoses( + ExaminationMapper.mapToDomain(newResult.toothDiagnoses())); }); } - private static void mapResultCommon( - ExaminationResult existingResult, ExaminationResultDto newResult) { - existingResult.setFluorideVarnishApplied(newResult.fluorideVarnishApplied()); + private void mapResult(Examination examination, AbsenceExaminationResultDto newResult) { + mapResult( + examination, + AbsenceExaminationResult.class, + existingResult -> + existingResult.setReasonForAbsence( + ExaminationMapper.mapToDomain(newResult.reasonForAbsence()))); } private <R extends ExaminationResult> void mapResult( diff --git a/backend/dental/src/main/java/de/eshg/dental/ProphylaxisSessionController.java b/backend/dental/src/main/java/de/eshg/dental/ProphylaxisSessionController.java index 46397b7d7..eb95cdd86 100644 --- a/backend/dental/src/main/java/de/eshg/dental/ProphylaxisSessionController.java +++ b/backend/dental/src/main/java/de/eshg/dental/ProphylaxisSessionController.java @@ -11,6 +11,7 @@ import de.eshg.dental.api.CreateProphylaxisSessionResponse; import de.eshg.dental.api.GetProphylaxisSessionResponse; import de.eshg.dental.api.ProphylaxisSessionDetailsDto; import de.eshg.dental.api.ProphylaxisSessionPaginationAndSortParameters; +import de.eshg.dental.api.UpdateProphylaxisSessionExaminationsRequest; import de.eshg.dental.api.UpdateProphylaxisSessionParticipantsRequest; import de.eshg.dental.api.UpdateProphylaxisSessionRequest; import de.eshg.dental.business.model.ProphylaxisSessionWithAugmentedInstitution; @@ -24,6 +25,7 @@ import org.springdoc.core.annotations.ParameterObject; import org.springframework.data.domain.Page; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PatchMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; @@ -103,4 +105,14 @@ public class ProphylaxisSessionController { prophylaxisSessionService.updateProphylaxisSessionParticipants( prophylaxisSessionId, request)); } + + @PatchMapping("/{prophylaxisSessionId}/examinations") + @Transactional + public ProphylaxisSessionDetailsDto updateProphylaxisSessionExaminations( + @PathVariable("prophylaxisSessionId") UUID prophylaxisSessionId, + @Valid @RequestBody UpdateProphylaxisSessionExaminationsRequest request) { + return ProphylaxisSessionMapper.mapProphylaxisSessionToDetailsDto( + prophylaxisSessionService.updateProphylaxisSessionExaminations( + prophylaxisSessionId, request)); + } } diff --git a/backend/dental/src/main/java/de/eshg/dental/ProphylaxisSessionService.java b/backend/dental/src/main/java/de/eshg/dental/ProphylaxisSessionService.java index d6009b159..03d32f7d2 100644 --- a/backend/dental/src/main/java/de/eshg/dental/ProphylaxisSessionService.java +++ b/backend/dental/src/main/java/de/eshg/dental/ProphylaxisSessionService.java @@ -15,6 +15,9 @@ import de.eshg.base.user.api.UserDto; import de.eshg.dental.api.CreateProphylaxisSessionRequest; import de.eshg.dental.api.ProphylaxisSessionPaginationAndSortParameters; import de.eshg.dental.api.ProphylaxisSessionRequest; +import de.eshg.dental.api.UpdateExaminationRequest; +import de.eshg.dental.api.UpdateExaminationsInBulkRequest; +import de.eshg.dental.api.UpdateProphylaxisSessionExaminationsRequest; import de.eshg.dental.api.UpdateProphylaxisSessionParticipantsRequest; import de.eshg.dental.api.UpdateProphylaxisSessionRequest; import de.eshg.dental.business.model.ProphylaxisSessionWithAugmentedData; @@ -24,8 +27,10 @@ import de.eshg.dental.domain.model.Child; import de.eshg.dental.domain.model.Examination; import de.eshg.dental.domain.model.ProphylaxisSession; import de.eshg.dental.domain.repository.ChildRepository; +import de.eshg.dental.domain.repository.ExaminationRepository; import de.eshg.dental.domain.repository.ProphylaxisSessionRepository; import de.eshg.dental.mapper.ProphylaxisSessionMapper; +import de.eshg.domain.model.BaseEntityWithExternalId; import de.eshg.lib.contact.ContactClient; import de.eshg.lib.procedure.domain.model.ProcedureStatus; import de.eshg.rest.service.error.BadRequestException; @@ -39,6 +44,7 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; import java.util.function.Function; +import java.util.stream.Collectors; import java.util.stream.Stream; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -59,6 +65,8 @@ public class ProphylaxisSessionService { private final Clock clock; private final Validator validator; private final UserApi userApi; + private final ExaminationService examinationService; + private final ExaminationRepository examinationRepository; public ProphylaxisSessionService( ProphylaxisSessionRepository prophylaxisSessionRepository, @@ -67,7 +75,9 @@ public class ProphylaxisSessionService { PersonClient personClient, Clock clock, Validator validator, - UserApi userApi) { + UserApi userApi, + ExaminationService examinationService, + ExaminationRepository examinationRepository) { this.prophylaxisSessionRepository = prophylaxisSessionRepository; this.contactClient = contactClient; this.childRepository = childRepository; @@ -75,6 +85,8 @@ public class ProphylaxisSessionService { this.clock = clock; this.validator = validator; this.userApi = userApi; + this.examinationService = examinationService; + this.examinationRepository = examinationRepository; } public ProphylaxisSession createProphylaxisSession(CreateProphylaxisSessionRequest request) { @@ -269,6 +281,30 @@ public class ProphylaxisSessionService { return getProphylaxisSessionWithDetails(persistedProphylaxisSession.getExternalId()); } + public ProphylaxisSessionWithAugmentedData updateProphylaxisSessionExaminations( + UUID prophylaxisSessionId, UpdateProphylaxisSessionExaminationsRequest updateRequest) { + List<UUID> examinationIds = + updateRequest.examinationUpdates().stream() + .map(UpdateExaminationsInBulkRequest::id) + .toList(); + + Map<UUID, Examination> persistedExaminations = + examinationRepository.findAllByExternalIdsForUpdate(examinationIds).stream() + .collect( + Collectors.toMap(BaseEntityWithExternalId::getExternalId, Function.identity())); + + for (UpdateExaminationsInBulkRequest examinationUpdate : updateRequest.examinationUpdates()) { + Examination persistedExamination = persistedExaminations.get(examinationUpdate.id()); + + examinationService.updateExamination( + persistedExamination, + new UpdateExaminationRequest( + examinationUpdate.version(), examinationUpdate.note(), examinationUpdate.result())); + } + + return getProphylaxisSessionWithDetails(prophylaxisSessionId); + } + private void mapProphylaxisSessionRequest( ProphylaxisSession session, ProphylaxisSessionRequest request) { session.setDateAndTime(request.dateAndTime()); diff --git a/backend/dental/src/main/java/de/eshg/dental/api/AbsenceExaminationResultDto.java b/backend/dental/src/main/java/de/eshg/dental/api/AbsenceExaminationResultDto.java new file mode 100644 index 000000000..ade926ddb --- /dev/null +++ b/backend/dental/src/main/java/de/eshg/dental/api/AbsenceExaminationResultDto.java @@ -0,0 +1,21 @@ +/* + * Copyright 2025 cronn GmbH + * SPDX-License-Identifier: Apache-2.0 + */ + +package de.eshg.dental.api; + +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotNull; + +@Schema(name = AbsenceExaminationResultDto.SCHEMA_NAME) +public record AbsenceExaminationResultDto(@NotNull ReasonForAbsenceDto reasonForAbsence) + implements ExaminationResultDto { + + static final String SCHEMA_NAME = "AbsenceExaminationResult"; + + @Override + public String type() { + return SCHEMA_NAME; + } +} diff --git a/backend/dental/src/main/java/de/eshg/dental/api/ExaminationDto.java b/backend/dental/src/main/java/de/eshg/dental/api/ExaminationDto.java index 980c91abe..66a5d1d8b 100644 --- a/backend/dental/src/main/java/de/eshg/dental/api/ExaminationDto.java +++ b/backend/dental/src/main/java/de/eshg/dental/api/ExaminationDto.java @@ -17,5 +17,7 @@ public record ExaminationDto( @NotNull long version, @NotNull Instant dateAndTime, @NotNull ProphylaxisTypeDto prophylaxisType, + @NotNull boolean screening, + @NotNull boolean fluoridation, String note, @Valid ExaminationResultDto result) {} diff --git a/backend/dental/src/main/java/de/eshg/dental/api/ExaminationResultDto.java b/backend/dental/src/main/java/de/eshg/dental/api/ExaminationResultDto.java index cc2c5b9e7..f6839ba17 100644 --- a/backend/dental/src/main/java/de/eshg/dental/api/ExaminationResultDto.java +++ b/backend/dental/src/main/java/de/eshg/dental/api/ExaminationResultDto.java @@ -23,9 +23,11 @@ import io.swagger.v3.oas.annotations.media.Schema; @JsonSubTypes.Type( value = ScreeningExaminationResultDto.class, name = ScreeningExaminationResultDto.SCHEMA_NAME), + @JsonSubTypes.Type( + value = AbsenceExaminationResultDto.class, + name = AbsenceExaminationResultDto.SCHEMA_NAME) }) public sealed interface ExaminationResultDto extends HasTypeDiscriminator - permits FluoridationExaminationResultDto, ScreeningExaminationResultDto { - - boolean fluorideVarnishApplied(); -} + permits FluoridationExaminationResultDto, + ScreeningExaminationResultDto, + AbsenceExaminationResultDto {} diff --git a/backend/dental/src/main/java/de/eshg/dental/api/MainResultDto.java b/backend/dental/src/main/java/de/eshg/dental/api/MainResultDto.java new file mode 100644 index 000000000..5708d305a --- /dev/null +++ b/backend/dental/src/main/java/de/eshg/dental/api/MainResultDto.java @@ -0,0 +1,27 @@ +/* + * Copyright 2025 cronn GmbH + * SPDX-License-Identifier: Apache-2.0 + */ + +package de.eshg.dental.api; + +import io.swagger.v3.oas.annotations.media.Schema; + +@Schema(name = "MainResult") +public enum MainResultDto { + S, + I, + D, + F, + E, + Y, + X, + Z, + T, + H, + O, + V, + N, + P, + K +} diff --git a/backend/dental/src/main/java/de/eshg/dental/api/ReasonForAbsenceDto.java b/backend/dental/src/main/java/de/eshg/dental/api/ReasonForAbsenceDto.java new file mode 100644 index 000000000..a89871253 --- /dev/null +++ b/backend/dental/src/main/java/de/eshg/dental/api/ReasonForAbsenceDto.java @@ -0,0 +1,20 @@ +/* + * Copyright 2025 cronn GmbH + * SPDX-License-Identifier: Apache-2.0 + */ + +package de.eshg.dental.api; + +import io.swagger.v3.oas.annotations.media.Schema; + +@Schema(name = "ReasonForAbsence") +public enum ReasonForAbsenceDto { + /** nicht erschienen */ + NOT_APPEARED, + /** versetzt */ + SHIFTED, + /** umgezogen */ + MOVED, + /** verweigert */ + REFUSED +} diff --git a/backend/dental/src/main/java/de/eshg/dental/api/ScreeningExaminationResultDto.java b/backend/dental/src/main/java/de/eshg/dental/api/ScreeningExaminationResultDto.java index 2eef6bb5d..133290147 100644 --- a/backend/dental/src/main/java/de/eshg/dental/api/ScreeningExaminationResultDto.java +++ b/backend/dental/src/main/java/de/eshg/dental/api/ScreeningExaminationResultDto.java @@ -6,15 +6,24 @@ package de.eshg.dental.api; import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.Valid; import jakarta.validation.constraints.NotNull; +import java.util.List; @Schema(name = ScreeningExaminationResultDto.SCHEMA_NAME) public record ScreeningExaminationResultDto( - @NotNull boolean fluorideVarnishApplied, OralHygieneStatusDto oralHygieneStatus) + @NotNull boolean fluorideVarnishApplied, + OralHygieneStatusDto oralHygieneStatus, + @NotNull @Valid List<ToothDiagnosisDto> toothDiagnoses) implements ExaminationResultDto { static final String SCHEMA_NAME = "ScreeningExaminationResult"; + public ScreeningExaminationResultDto( + boolean fluorideVarnishApplied, OralHygieneStatusDto oralHygieneStatus) { + this(fluorideVarnishApplied, oralHygieneStatus, List.of()); + } + @Override public String type() { return SCHEMA_NAME; diff --git a/backend/dental/src/main/java/de/eshg/dental/api/SecondaryResultDto.java b/backend/dental/src/main/java/de/eshg/dental/api/SecondaryResultDto.java new file mode 100644 index 000000000..8f69cf32a --- /dev/null +++ b/backend/dental/src/main/java/de/eshg/dental/api/SecondaryResultDto.java @@ -0,0 +1,22 @@ +/* + * Copyright 2025 cronn GmbH + * SPDX-License-Identifier: Apache-2.0 + */ + +package de.eshg.dental.api; + +import io.swagger.v3.oas.annotations.media.Schema; + +@Schema(name = "SecondaryResult") +public enum SecondaryResultDto { + DA, + FA, + FIS, + ID, + INS, + LUE, + RET, + TR, + WR, + ZA +} diff --git a/backend/dental/src/main/java/de/eshg/dental/api/ToothDiagnosisDto.java b/backend/dental/src/main/java/de/eshg/dental/api/ToothDiagnosisDto.java new file mode 100644 index 000000000..4f297e7e1 --- /dev/null +++ b/backend/dental/src/main/java/de/eshg/dental/api/ToothDiagnosisDto.java @@ -0,0 +1,16 @@ +/* + * Copyright 2025 cronn GmbH + * SPDX-License-Identifier: Apache-2.0 + */ + +package de.eshg.dental.api; + +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotNull; + +@Schema(name = "ToothDiagnosis") +public record ToothDiagnosisDto( + @NotNull ToothDto tooth, + @NotNull MainResultDto mainResult, + SecondaryResultDto secondaryResult1, + SecondaryResultDto secondaryResult2) {} diff --git a/backend/dental/src/main/java/de/eshg/dental/api/ToothDto.java b/backend/dental/src/main/java/de/eshg/dental/api/ToothDto.java new file mode 100644 index 000000000..ddc88b842 --- /dev/null +++ b/backend/dental/src/main/java/de/eshg/dental/api/ToothDto.java @@ -0,0 +1,87 @@ +/* + * Copyright 2025 cronn GmbH + * SPDX-License-Identifier: Apache-2.0 + */ + +package de.eshg.dental.api; + +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.Arrays; +import java.util.List; + +@Schema(name = "Tooth") +public enum ToothDto { + T11(false), + T12(false), + T13(false), + T14(false), + T15(false), + T16(false), + T17(false), + T18(false), + + T21(false), + T22(false), + T23(false), + T24(false), + T25(false), + T26(false), + T27(false), + T28(false), + + T31(false), + T32(false), + T33(false), + T34(false), + T35(false), + T36(false), + T37(false), + T38(false), + + T41(false), + T42(false), + T43(false), + T44(false), + T45(false), + T46(false), + T47(false), + T48(false), + + T51(true), + T52(true), + T53(true), + T54(true), + T55(true), + + T61(true), + T62(true), + T63(true), + T64(true), + T65(true), + + T71(true), + T72(true), + T73(true), + T74(true), + T75(true), + + T81(true), + T82(true), + T83(true), + T84(true), + T85(true); + + private final boolean milkTooth; + + ToothDto(boolean milkTooth) { + this.milkTooth = milkTooth; + } + + public static List<ToothDto> allMilkTeeth() { + return Arrays.stream(ToothDto.values()).filter(t -> t.milkTooth).toList(); + } + + public static List<ToothDto> allPermanentTeeth() { + return Arrays.stream(ToothDto.values()).filter(t -> !t.milkTooth).toList(); + } +} diff --git a/backend/dental/src/main/java/de/eshg/dental/api/UpdateExaminationsInBulkRequest.java b/backend/dental/src/main/java/de/eshg/dental/api/UpdateExaminationsInBulkRequest.java new file mode 100644 index 000000000..3a6ad8b0d --- /dev/null +++ b/backend/dental/src/main/java/de/eshg/dental/api/UpdateExaminationsInBulkRequest.java @@ -0,0 +1,13 @@ +/* + * Copyright 2025 cronn GmbH + * SPDX-License-Identifier: Apache-2.0 + */ + +package de.eshg.dental.api; + +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import java.util.UUID; + +public record UpdateExaminationsInBulkRequest( + @NotNull UUID id, @NotNull long version, String note, @Valid ExaminationResultDto result) {} diff --git a/backend/dental/src/main/java/de/eshg/dental/api/UpdateProphylaxisSessionExaminationsRequest.java b/backend/dental/src/main/java/de/eshg/dental/api/UpdateProphylaxisSessionExaminationsRequest.java new file mode 100644 index 000000000..ebc130750 --- /dev/null +++ b/backend/dental/src/main/java/de/eshg/dental/api/UpdateProphylaxisSessionExaminationsRequest.java @@ -0,0 +1,13 @@ +/* + * Copyright 2025 cronn GmbH + * SPDX-License-Identifier: Apache-2.0 + */ + +package de.eshg.dental.api; + +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotEmpty; +import java.util.List; + +public record UpdateProphylaxisSessionExaminationsRequest( + @NotEmpty @Valid List<UpdateExaminationsInBulkRequest> examinationUpdates) {} diff --git a/backend/dental/src/main/java/de/eshg/dental/domain/model/AbsenceExaminationResult.java b/backend/dental/src/main/java/de/eshg/dental/domain/model/AbsenceExaminationResult.java new file mode 100644 index 000000000..71bf91bda --- /dev/null +++ b/backend/dental/src/main/java/de/eshg/dental/domain/model/AbsenceExaminationResult.java @@ -0,0 +1,32 @@ +/* + * Copyright 2025 cronn GmbH + * SPDX-License-Identifier: Apache-2.0 + */ + +package de.eshg.dental.domain.model; + +import de.eshg.lib.common.DataSensitivity; +import de.eshg.lib.common.SensitivityLevel; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; +import org.hibernate.annotations.JdbcType; +import org.hibernate.dialect.PostgreSQLEnumJdbcType; + +@Entity +@DataSensitivity(SensitivityLevel.SENSITIVE) +@DiscriminatorValue("ABSENCE") +public class AbsenceExaminationResult extends ExaminationResult { + + @Column(nullable = false) + @JdbcType(PostgreSQLEnumJdbcType.class) + private ReasonForAbsence reasonForAbsence; + + public ReasonForAbsence getReasonForAbsence() { + return reasonForAbsence; + } + + public void setReasonForAbsence(ReasonForAbsence reasonForAbsence) { + this.reasonForAbsence = reasonForAbsence; + } +} diff --git a/backend/dental/src/main/java/de/eshg/dental/domain/model/Child.java b/backend/dental/src/main/java/de/eshg/dental/domain/model/Child.java index e7d7c9752..eac0a7e5f 100644 --- a/backend/dental/src/main/java/de/eshg/dental/domain/model/Child.java +++ b/backend/dental/src/main/java/de/eshg/dental/domain/model/Child.java @@ -53,6 +53,7 @@ public class Child extends Procedure<Child, ChildTask, Person, Facility> { @DataSensitivity(SENSITIVE) @ElementCollection @OrderColumn + @BatchSize(size = 100) private final List<FluoridationConsent> fluoridationConsents = new ArrayList<>(); public UUID getChildIdFromCentralFile() { diff --git a/backend/dental/src/main/java/de/eshg/dental/domain/model/ExaminationResult.java b/backend/dental/src/main/java/de/eshg/dental/domain/model/ExaminationResult.java index 9744cbd81..6b0aff7be 100644 --- a/backend/dental/src/main/java/de/eshg/dental/domain/model/ExaminationResult.java +++ b/backend/dental/src/main/java/de/eshg/dental/domain/model/ExaminationResult.java @@ -24,8 +24,6 @@ public abstract class ExaminationResult extends BaseEntity { @OneToOne(optional = false, mappedBy = Examination_.RESULT) private Examination examination; - private boolean fluorideVarnishApplied; - public Examination getExamination() { return examination; } @@ -33,12 +31,4 @@ public abstract class ExaminationResult extends BaseEntity { public void setExamination(Examination examination) { this.examination = examination; } - - public boolean isFluorideVarnishApplied() { - return fluorideVarnishApplied; - } - - public void setFluorideVarnishApplied(boolean fluorideVarnishApplied) { - this.fluorideVarnishApplied = fluorideVarnishApplied; - } } diff --git a/backend/dental/src/main/java/de/eshg/dental/domain/model/FluoridationExaminationResult.java b/backend/dental/src/main/java/de/eshg/dental/domain/model/FluoridationExaminationResult.java index ea6f1ac21..b539cedc7 100644 --- a/backend/dental/src/main/java/de/eshg/dental/domain/model/FluoridationExaminationResult.java +++ b/backend/dental/src/main/java/de/eshg/dental/domain/model/FluoridationExaminationResult.java @@ -13,4 +13,15 @@ import jakarta.persistence.Entity; @Entity @DataSensitivity(SensitivityLevel.SENSITIVE) @DiscriminatorValue("FLUORIDATION") -public class FluoridationExaminationResult extends ExaminationResult {} +public class FluoridationExaminationResult extends ExaminationResult { + + private boolean fluorideVarnishApplied; + + public boolean isFluorideVarnishApplied() { + return fluorideVarnishApplied; + } + + public void setFluorideVarnishApplied(boolean fluorideVarnishApplied) { + this.fluorideVarnishApplied = fluorideVarnishApplied; + } +} diff --git a/backend/dental/src/main/java/de/eshg/dental/domain/model/MainResult.java b/backend/dental/src/main/java/de/eshg/dental/domain/model/MainResult.java new file mode 100644 index 000000000..ce6ab795a --- /dev/null +++ b/backend/dental/src/main/java/de/eshg/dental/domain/model/MainResult.java @@ -0,0 +1,39 @@ +/* + * Copyright 2025 cronn GmbH + * SPDX-License-Identifier: Apache-2.0 + */ + +package de.eshg.dental.domain.model; + +public enum MainResult { + /** Kariesfrei */ + S, + /** Initialkaries */ + I, + /** Kariös */ + D, + /** Gefüllt */ + F, + /** Extrahiert */ + E, + /** KFO-Extr. */ + Y, + /** Nichtanlage */ + X, + /** Zerstört */ + Z, + /** Trauma */ + T, + /** Hypoplasie */ + H, + /** Trep/Fistel */ + O, + /** Versiegelt */ + V, + /** Nicht beurteilbar */ + N, + /** Platzhalter */ + P, + /** Krone */ + K +} diff --git a/backend/dental/src/main/java/de/eshg/dental/domain/model/ReasonForAbsence.java b/backend/dental/src/main/java/de/eshg/dental/domain/model/ReasonForAbsence.java new file mode 100644 index 000000000..daf29f394 --- /dev/null +++ b/backend/dental/src/main/java/de/eshg/dental/domain/model/ReasonForAbsence.java @@ -0,0 +1,17 @@ +/* + * Copyright 2025 cronn GmbH + * SPDX-License-Identifier: Apache-2.0 + */ + +package de.eshg.dental.domain.model; + +public enum ReasonForAbsence { + /** nicht erschienen */ + NOT_APPEARED, + /** versetzt */ + SHIFTED, + /** umgezogen */ + MOVED, + /** verweigert */ + REFUSED +} diff --git a/backend/dental/src/main/java/de/eshg/dental/domain/model/ScreeningExaminationResult.java b/backend/dental/src/main/java/de/eshg/dental/domain/model/ScreeningExaminationResult.java index 6492b42f0..e696b6723 100644 --- a/backend/dental/src/main/java/de/eshg/dental/domain/model/ScreeningExaminationResult.java +++ b/backend/dental/src/main/java/de/eshg/dental/domain/model/ScreeningExaminationResult.java @@ -8,8 +8,14 @@ package de.eshg.dental.domain.model; import de.eshg.lib.common.DataSensitivity; import de.eshg.lib.common.SensitivityLevel; import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.ElementCollection; import jakarta.persistence.Entity; +import jakarta.persistence.MapKeyColumn; +import jakarta.persistence.OrderBy; +import java.util.Map; +import org.hibernate.annotations.BatchSize; import org.hibernate.annotations.JdbcType; +import org.hibernate.annotations.MapKeyJdbcType; import org.hibernate.dialect.PostgreSQLEnumJdbcType; @Entity @@ -17,9 +23,18 @@ import org.hibernate.dialect.PostgreSQLEnumJdbcType; @DiscriminatorValue("SCREENING") public class ScreeningExaminationResult extends ExaminationResult { + private boolean fluorideVarnishApplied; + @JdbcType(PostgreSQLEnumJdbcType.class) private OralHygieneStatus oralHygieneStatus; + @ElementCollection + @MapKeyJdbcType(PostgreSQLEnumJdbcType.class) + @MapKeyColumn(name = "tooth") + @OrderBy("tooth") + @BatchSize(size = 100) + private Map<Tooth, ToothDiagnosis> toothDiagnoses; + public OralHygieneStatus getOralHygieneStatus() { return oralHygieneStatus; } @@ -27,4 +42,20 @@ public class ScreeningExaminationResult extends ExaminationResult { public void setOralHygieneStatus(OralHygieneStatus oralHygieneStatus) { this.oralHygieneStatus = oralHygieneStatus; } + + public Map<Tooth, ToothDiagnosis> getToothDiagnoses() { + return toothDiagnoses; + } + + public void setToothDiagnoses(Map<Tooth, ToothDiagnosis> toothDiagnoses) { + this.toothDiagnoses = toothDiagnoses; + } + + public boolean isFluorideVarnishApplied() { + return fluorideVarnishApplied; + } + + public void setFluorideVarnishApplied(boolean fluorideVarnishApplied) { + this.fluorideVarnishApplied = fluorideVarnishApplied; + } } diff --git a/backend/dental/src/main/java/de/eshg/dental/domain/model/SecondaryResult.java b/backend/dental/src/main/java/de/eshg/dental/domain/model/SecondaryResult.java new file mode 100644 index 000000000..d3e381940 --- /dev/null +++ b/backend/dental/src/main/java/de/eshg/dental/domain/model/SecondaryResult.java @@ -0,0 +1,29 @@ +/* + * Copyright 2025 cronn GmbH + * SPDX-License-Identifier: Apache-2.0 + */ + +package de.eshg.dental.domain.model; + +public enum SecondaryResult { + /** Doppelte Anlage */ + DA, + /** Formanomalie */ + FA, + /** Fistel */ + FIS, + /** Im Durchbruch */ + ID, + /** Insuffizienz */ + INS, + /** Lückenschluss */ + LUE, + /** Retinierter Zahn */ + RET, + /** Trepaniert */ + TR, + /** Wurzelrest */ + WR, + /** Zapfenzahn */ + ZA +} diff --git a/backend/dental/src/main/java/de/eshg/dental/domain/model/Tooth.java b/backend/dental/src/main/java/de/eshg/dental/domain/model/Tooth.java new file mode 100644 index 000000000..cd21b86b4 --- /dev/null +++ b/backend/dental/src/main/java/de/eshg/dental/domain/model/Tooth.java @@ -0,0 +1,68 @@ +/* + * Copyright 2025 cronn GmbH + * SPDX-License-Identifier: Apache-2.0 + */ + +package de.eshg.dental.domain.model; + +public enum Tooth { + T11, + T12, + T13, + T14, + T15, + T16, + T17, + T18, + + T21, + T22, + T23, + T24, + T25, + T26, + T27, + T28, + + T31, + T32, + T33, + T34, + T35, + T36, + T37, + T38, + + T41, + T42, + T43, + T44, + T45, + T46, + T47, + T48, + + T51, + T52, + T53, + T54, + T55, + + T61, + T62, + T63, + T64, + T65, + + T71, + T72, + T73, + T74, + T75, + + T81, + T82, + T83, + T84, + T85, +} diff --git a/backend/dental/src/main/java/de/eshg/dental/domain/model/ToothDiagnosis.java b/backend/dental/src/main/java/de/eshg/dental/domain/model/ToothDiagnosis.java new file mode 100644 index 000000000..ee51292b7 --- /dev/null +++ b/backend/dental/src/main/java/de/eshg/dental/domain/model/ToothDiagnosis.java @@ -0,0 +1,21 @@ +/* + * Copyright 2025 cronn GmbH + * SPDX-License-Identifier: Apache-2.0 + */ + +package de.eshg.dental.domain.model; + +import static de.eshg.lib.common.SensitivityLevel.SENSITIVE; + +import de.eshg.lib.common.DataSensitivity; +import jakarta.persistence.Column; +import jakarta.persistence.Embeddable; +import org.hibernate.annotations.JdbcType; +import org.hibernate.dialect.PostgreSQLEnumJdbcType; + +@Embeddable +@DataSensitivity(SENSITIVE) +public record ToothDiagnosis( + @Column(nullable = false) @JdbcType(PostgreSQLEnumJdbcType.class) MainResult mainResult, + @JdbcType(PostgreSQLEnumJdbcType.class) SecondaryResult secondaryResult1, + @JdbcType(PostgreSQLEnumJdbcType.class) SecondaryResult secondaryResult2) {} diff --git a/backend/dental/src/main/java/de/eshg/dental/domain/repository/ExaminationRepository.java b/backend/dental/src/main/java/de/eshg/dental/domain/repository/ExaminationRepository.java index 5e2a006ff..068ea5e24 100644 --- a/backend/dental/src/main/java/de/eshg/dental/domain/repository/ExaminationRepository.java +++ b/backend/dental/src/main/java/de/eshg/dental/domain/repository/ExaminationRepository.java @@ -24,6 +24,11 @@ public interface ExaminationRepository @Query("select e from Examination e where e.externalId = :examinationId") Optional<Examination> findOneByExternalIdForUpdate(@Param("examinationId") UUID examinationId); + @Lock(LockModeType.PESSIMISTIC_WRITE) + @Query("select e from Examination e where e.externalId in :examinationIds order by e.id") + List<Examination> findAllByExternalIdsForUpdate( + @Param("examinationIds") List<UUID> examinationIds); + @Query( """ select e from Examination e diff --git a/backend/dental/src/main/java/de/eshg/dental/domain/repository/ProphylaxisSessionRepository.java b/backend/dental/src/main/java/de/eshg/dental/domain/repository/ProphylaxisSessionRepository.java index 74df6d2bb..96e327b49 100644 --- a/backend/dental/src/main/java/de/eshg/dental/domain/repository/ProphylaxisSessionRepository.java +++ b/backend/dental/src/main/java/de/eshg/dental/domain/repository/ProphylaxisSessionRepository.java @@ -5,10 +5,13 @@ package de.eshg.dental.domain.repository; +import de.eshg.dental.domain.model.Examination_; import de.eshg.dental.domain.model.ProphylaxisSession; +import de.eshg.dental.domain.model.ProphylaxisSession_; import jakarta.persistence.LockModeType; import java.util.Optional; import java.util.UUID; +import org.springframework.data.jpa.repository.EntityGraph; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaSpecificationExecutor; import org.springframework.data.jpa.repository.Lock; @@ -26,6 +29,11 @@ public interface ProphylaxisSessionRepository @Param("oldInstitutionId") UUID oldInstitutionId, @Param("newInstitutionId") UUID newInstitutionId); + @EntityGraph( + attributePaths = { + ProphylaxisSession_.EXAMINATIONS + "." + Examination_.CHILD, + ProphylaxisSession_.EXAMINATIONS + "." + Examination_.RESULT + }) Optional<ProphylaxisSession> findByExternalId(UUID externalId); @Lock(LockModeType.PESSIMISTIC_WRITE) diff --git a/backend/dental/src/main/java/de/eshg/dental/mapper/ExaminationMapper.java b/backend/dental/src/main/java/de/eshg/dental/mapper/ExaminationMapper.java index 641d55ef5..4ee2c73a8 100644 --- a/backend/dental/src/main/java/de/eshg/dental/mapper/ExaminationMapper.java +++ b/backend/dental/src/main/java/de/eshg/dental/mapper/ExaminationMapper.java @@ -5,17 +5,32 @@ package de.eshg.dental.mapper; +import de.cronn.commons.lang.StreamUtil; +import de.eshg.dental.api.AbsenceExaminationResultDto; import de.eshg.dental.api.ExaminationDto; import de.eshg.dental.api.ExaminationResultDto; import de.eshg.dental.api.FluoridationExaminationResultDto; +import de.eshg.dental.api.MainResultDto; import de.eshg.dental.api.OralHygieneStatusDto; +import de.eshg.dental.api.ReasonForAbsenceDto; import de.eshg.dental.api.ScreeningExaminationResultDto; +import de.eshg.dental.api.SecondaryResultDto; +import de.eshg.dental.api.ToothDiagnosisDto; +import de.eshg.dental.api.ToothDto; +import de.eshg.dental.domain.model.AbsenceExaminationResult; import de.eshg.dental.domain.model.Examination; import de.eshg.dental.domain.model.ExaminationResult; import de.eshg.dental.domain.model.FluoridationExaminationResult; +import de.eshg.dental.domain.model.MainResult; import de.eshg.dental.domain.model.OralHygieneStatus; import de.eshg.dental.domain.model.ProphylaxisSession; +import de.eshg.dental.domain.model.ReasonForAbsence; import de.eshg.dental.domain.model.ScreeningExaminationResult; +import de.eshg.dental.domain.model.SecondaryResult; +import de.eshg.dental.domain.model.Tooth; +import de.eshg.dental.domain.model.ToothDiagnosis; +import java.util.List; +import java.util.Map; public final class ExaminationMapper { private ExaminationMapper() {} @@ -30,6 +45,8 @@ public final class ExaminationMapper { examination.getVersion(), prophylaxisSession.getDateAndTime(), ProphylaxisSessionMapper.mapToDto(prophylaxisSession.getType()), + prophylaxisSession.isScreening(), + prophylaxisSession.hasFluoridationVarnish(), examination.getNote(), mapToDto(examination.getResult())); } @@ -43,7 +60,10 @@ public final class ExaminationMapper { case ScreeningExaminationResult screeningExaminationResult -> new ScreeningExaminationResultDto( screeningExaminationResult.isFluorideVarnishApplied(), - mapToDto(screeningExaminationResult.getOralHygieneStatus())); + mapToDto(screeningExaminationResult.getOralHygieneStatus()), + mapToDto(screeningExaminationResult.getToothDiagnoses())); + case AbsenceExaminationResult absenceExaminationResult -> + new AbsenceExaminationResultDto(mapToDto(absenceExaminationResult.getReasonForAbsence())); default -> throw new IllegalArgumentException("Unexpected examination result: " + result); }; } @@ -65,4 +85,249 @@ public final class ExaminationMapper { case POOR -> OralHygieneStatus.POOR; }; } + + public static Map<Tooth, ToothDiagnosis> mapToDomain(List<ToothDiagnosisDto> toothDiagnoses) { + return toothDiagnoses.stream() + .collect( + StreamUtil.toLinkedHashMap( + toothDiagnosis -> mapToDomain(toothDiagnosis.tooth()), + ExaminationMapper::mapResultsToDomain)); + } + + public static List<ToothDiagnosisDto> mapToDto(Map<Tooth, ToothDiagnosis> toothDiagnoses) { + return toothDiagnoses.entrySet().stream() + .map(tooth -> mapToDto(tooth.getKey(), tooth.getValue())) + .toList(); + } + + private static ToothDiagnosis mapResultsToDomain(ToothDiagnosisDto toothDiagnosis) { + if (toothDiagnosis == null) { + return null; + } + return new ToothDiagnosis( + mapToDomain(toothDiagnosis.mainResult()), + mapToDomain(toothDiagnosis.secondaryResult1()), + mapToDomain(toothDiagnosis.secondaryResult2())); + } + + private static ToothDiagnosisDto mapToDto(Tooth tooth, ToothDiagnosis toothDiagnosis) { + if (toothDiagnosis == null) { + return null; + } + return new ToothDiagnosisDto( + mapToDto(tooth), + mapToDto(toothDiagnosis.mainResult()), + mapToDto(toothDiagnosis.secondaryResult1()), + mapToDto(toothDiagnosis.secondaryResult2())); + } + + private static MainResultDto mapToDto(MainResult mainResult) { + return switch (mainResult) { + case null -> null; + case S -> MainResultDto.S; + case I -> MainResultDto.I; + case D -> MainResultDto.D; + case F -> MainResultDto.F; + case E -> MainResultDto.E; + case Y -> MainResultDto.Y; + case X -> MainResultDto.X; + case Z -> MainResultDto.Z; + case T -> MainResultDto.T; + case H -> MainResultDto.H; + case O -> MainResultDto.O; + case V -> MainResultDto.V; + case N -> MainResultDto.N; + case P -> MainResultDto.P; + case K -> MainResultDto.K; + }; + } + + private static SecondaryResultDto mapToDto(SecondaryResult secondaryResult) { + return switch (secondaryResult) { + case null -> null; + case DA -> SecondaryResultDto.DA; + case FA -> SecondaryResultDto.FA; + case FIS -> SecondaryResultDto.FIS; + case ID -> SecondaryResultDto.ID; + case INS -> SecondaryResultDto.INS; + case LUE -> SecondaryResultDto.LUE; + case RET -> SecondaryResultDto.RET; + case TR -> SecondaryResultDto.TR; + case WR -> SecondaryResultDto.WR; + case ZA -> SecondaryResultDto.ZA; + }; + } + + private static MainResult mapToDomain(MainResultDto dto) { + return switch (dto) { + case null -> null; + case S -> MainResult.S; + case I -> MainResult.I; + case D -> MainResult.D; + case F -> MainResult.F; + case E -> MainResult.E; + case Y -> MainResult.Y; + case X -> MainResult.X; + case Z -> MainResult.Z; + case T -> MainResult.T; + case H -> MainResult.H; + case O -> MainResult.O; + case V -> MainResult.V; + case N -> MainResult.N; + case P -> MainResult.P; + case K -> MainResult.K; + }; + } + + private static SecondaryResult mapToDomain(SecondaryResultDto dto) { + return switch (dto) { + case null -> null; + case DA -> SecondaryResult.DA; + case FA -> SecondaryResult.FA; + case FIS -> SecondaryResult.FIS; + case ID -> SecondaryResult.ID; + case INS -> SecondaryResult.INS; + case LUE -> SecondaryResult.LUE; + case RET -> SecondaryResult.RET; + case TR -> SecondaryResult.TR; + case WR -> SecondaryResult.WR; + case ZA -> SecondaryResult.ZA; + }; + } + + private static Tooth mapToDomain(ToothDto dto) { + return switch (dto) { + case null -> null; + case T11 -> Tooth.T11; + case T12 -> Tooth.T12; + case T13 -> Tooth.T13; + case T14 -> Tooth.T14; + case T15 -> Tooth.T15; + case T16 -> Tooth.T16; + case T17 -> Tooth.T17; + case T18 -> Tooth.T18; + case T21 -> Tooth.T21; + case T22 -> Tooth.T22; + case T23 -> Tooth.T23; + case T24 -> Tooth.T24; + case T25 -> Tooth.T25; + case T26 -> Tooth.T26; + case T27 -> Tooth.T27; + case T28 -> Tooth.T28; + case T31 -> Tooth.T31; + case T32 -> Tooth.T32; + case T33 -> Tooth.T33; + case T34 -> Tooth.T34; + case T35 -> Tooth.T35; + case T36 -> Tooth.T36; + case T37 -> Tooth.T37; + case T38 -> Tooth.T38; + case T41 -> Tooth.T41; + case T42 -> Tooth.T42; + case T43 -> Tooth.T43; + case T44 -> Tooth.T44; + case T45 -> Tooth.T45; + case T46 -> Tooth.T46; + case T47 -> Tooth.T47; + case T48 -> Tooth.T48; + case T51 -> Tooth.T51; + case T52 -> Tooth.T52; + case T53 -> Tooth.T53; + case T54 -> Tooth.T54; + case T55 -> Tooth.T55; + case T61 -> Tooth.T61; + case T62 -> Tooth.T62; + case T63 -> Tooth.T63; + case T64 -> Tooth.T64; + case T65 -> Tooth.T65; + case T71 -> Tooth.T71; + case T72 -> Tooth.T72; + case T73 -> Tooth.T73; + case T74 -> Tooth.T74; + case T75 -> Tooth.T75; + case T81 -> Tooth.T81; + case T82 -> Tooth.T82; + case T83 -> Tooth.T83; + case T84 -> Tooth.T84; + case T85 -> Tooth.T85; + }; + } + + private static ToothDto mapToDto(Tooth tooth) { + return switch (tooth) { + case null -> null; + case T11 -> ToothDto.T11; + case T12 -> ToothDto.T12; + case T13 -> ToothDto.T13; + case T14 -> ToothDto.T14; + case T15 -> ToothDto.T15; + case T16 -> ToothDto.T16; + case T17 -> ToothDto.T17; + case T18 -> ToothDto.T18; + case T21 -> ToothDto.T21; + case T22 -> ToothDto.T22; + case T23 -> ToothDto.T23; + case T24 -> ToothDto.T24; + case T25 -> ToothDto.T25; + case T26 -> ToothDto.T26; + case T27 -> ToothDto.T27; + case T28 -> ToothDto.T28; + case T31 -> ToothDto.T31; + case T32 -> ToothDto.T32; + case T33 -> ToothDto.T33; + case T34 -> ToothDto.T34; + case T35 -> ToothDto.T35; + case T36 -> ToothDto.T36; + case T37 -> ToothDto.T37; + case T38 -> ToothDto.T38; + case T41 -> ToothDto.T41; + case T42 -> ToothDto.T42; + case T43 -> ToothDto.T43; + case T44 -> ToothDto.T44; + case T45 -> ToothDto.T45; + case T46 -> ToothDto.T46; + case T47 -> ToothDto.T47; + case T48 -> ToothDto.T48; + case T51 -> ToothDto.T51; + case T52 -> ToothDto.T52; + case T53 -> ToothDto.T53; + case T54 -> ToothDto.T54; + case T55 -> ToothDto.T55; + case T61 -> ToothDto.T61; + case T62 -> ToothDto.T62; + case T63 -> ToothDto.T63; + case T64 -> ToothDto.T64; + case T65 -> ToothDto.T65; + case T71 -> ToothDto.T71; + case T72 -> ToothDto.T72; + case T73 -> ToothDto.T73; + case T74 -> ToothDto.T74; + case T75 -> ToothDto.T75; + case T81 -> ToothDto.T81; + case T82 -> ToothDto.T82; + case T83 -> ToothDto.T83; + case T84 -> ToothDto.T84; + case T85 -> ToothDto.T85; + }; + } + + private static ReasonForAbsenceDto mapToDto(ReasonForAbsence reasonForAbsence) { + return switch (reasonForAbsence) { + case null -> null; + case NOT_APPEARED -> ReasonForAbsenceDto.NOT_APPEARED; + case MOVED -> ReasonForAbsenceDto.MOVED; + case SHIFTED -> ReasonForAbsenceDto.SHIFTED; + case REFUSED -> ReasonForAbsenceDto.REFUSED; + }; + } + + public static ReasonForAbsence mapToDomain(ReasonForAbsenceDto reasonForAbsenceDto) { + return switch (reasonForAbsenceDto) { + case null -> null; + case NOT_APPEARED -> ReasonForAbsence.NOT_APPEARED; + case MOVED -> ReasonForAbsence.MOVED; + case SHIFTED -> ReasonForAbsence.SHIFTED; + case REFUSED -> ReasonForAbsence.REFUSED; + }; + } } diff --git a/backend/dental/src/main/java/de/eshg/dental/testhelper/ProphylaxisSessionsPopulator.java b/backend/dental/src/main/java/de/eshg/dental/testhelper/ProphylaxisSessionsPopulator.java index 29210610f..74feca52c 100644 --- a/backend/dental/src/main/java/de/eshg/dental/testhelper/ProphylaxisSessionsPopulator.java +++ b/backend/dental/src/main/java/de/eshg/dental/testhelper/ProphylaxisSessionsPopulator.java @@ -13,14 +13,20 @@ import de.eshg.base.user.UserApi; import de.eshg.base.user.api.UserDto; import de.eshg.dental.ChildController; import de.eshg.dental.ProphylaxisSessionController; +import de.eshg.dental.api.AbsenceExaminationResultDto; import de.eshg.dental.api.CreateProphylaxisSessionRequest; import de.eshg.dental.api.CreateProphylaxisSessionResponse; import de.eshg.dental.api.ExaminationResultDto; import de.eshg.dental.api.FluoridationExaminationResultDto; import de.eshg.dental.api.FluoridationVarnishDto; +import de.eshg.dental.api.MainResultDto; import de.eshg.dental.api.OralHygieneStatusDto; import de.eshg.dental.api.ProphylaxisTypeDto; +import de.eshg.dental.api.ReasonForAbsenceDto; import de.eshg.dental.api.ScreeningExaminationResultDto; +import de.eshg.dental.api.SecondaryResultDto; +import de.eshg.dental.api.ToothDiagnosisDto; +import de.eshg.dental.api.ToothDto; import de.eshg.dental.api.UpdateExaminationRequest; import de.eshg.dental.domain.model.Child; import de.eshg.dental.domain.model.Examination; @@ -39,6 +45,7 @@ import java.io.Serial; import java.time.Clock; import java.time.Duration; import java.time.Instant; +import java.util.ArrayList; import java.util.List; import java.util.UUID; import net.datafaker.Faker; @@ -173,14 +180,34 @@ public class ProphylaxisSessionsPopulator if (prophylaxisSession.isScreening()) { return new ScreeningExaminationResultDto( hasFluoridationVarnish && faker.bool().bool(), - optional(faker, randomElement(faker, OralHygieneStatusDto.values()))); + optional(faker, randomElement(faker, OralHygieneStatusDto.values())), + randomToothDiagnoses(faker)); } else if (hasFluoridationVarnish) { return new FluoridationExaminationResultDto(faker.bool().bool()); } else { + if (faker.random().nextDouble() <= 0.5) { + return new AbsenceExaminationResultDto(randomElement(faker, ReasonForAbsenceDto.values())); + } return null; } } + private static List<ToothDiagnosisDto> randomToothDiagnoses(Faker faker) { + List<ToothDiagnosisDto> toothDiagnoses = new ArrayList<>(); + boolean milkTeeth = faker.bool().bool(); + List<ToothDto> teeth = milkTeeth ? ToothDto.allMilkTeeth() : ToothDto.allPermanentTeeth(); + for (ToothDto tooth : teeth) { + MainResultDto mainResult = randomElement(faker, MainResultDto.values()); + SecondaryResultDto secondaryResult1 = + optional(faker, randomElement(faker, SecondaryResultDto.values())); + SecondaryResultDto secondaryResult2 = + optional(faker, randomElement(faker, SecondaryResultDto.values())); + toothDiagnoses.add( + new ToothDiagnosisDto(tooth, mainResult, secondaryResult1, secondaryResult2)); + } + return toothDiagnoses; + } + static class EmptySchoolException extends RuntimeException { @Serial private static final long serialVersionUID = 1L; diff --git a/backend/dental/src/main/resources/gdpr-legal-basis-text.txt b/backend/dental/src/main/resources/gdpr-legal-basis-text.txt new file mode 100644 index 000000000..e69de29bb diff --git a/backend/dental/src/main/resources/migrations/0026_add_tooth_diagnoses.xml b/backend/dental/src/main/resources/migrations/0026_add_tooth_diagnoses.xml new file mode 100644 index 000000000..d28dad39e --- /dev/null +++ b/backend/dental/src/main/resources/migrations/0026_add_tooth_diagnoses.xml @@ -0,0 +1,30 @@ +<?xml version="1.1" encoding="UTF-8" standalone="no"?> +<!-- + Copyright 2025 cronn GmbH + SPDX-License-Identifier: Apache-2.0 +--> + +<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd"> + <changeSet author="GA-Lotse" id="1737446348651-1"> + <ext:createPostgresEnumType name="tooth" values="T11, T12, T13, T14, T15, T16, T17, T18, T21, T22, T23, T24, T25, T26, T27, T28, T31, T32, T33, T34, T35, T36, T37, T38, T41, T42, T43, T44, T45, T46, T47, T48, T51, T52, T53, T54, T55, T61, T62, T63, T64, T65, T71, T72, T73, T74, T75, T81, T82, T83, T84, T85"/> + <ext:createPostgresEnumType name="mainresult" values="D, E, F, H, I, K, N, O, P, S, T, V, X, Y, Z"/> + <ext:createPostgresEnumType name="secondaryresult" values="DA, FA, FIS, ID, INS, LUE, RET, TR, WR, ZA"/> + + <createTable tableName="screening_examination_result_tooth_diagnoses"> + <column name="screening_examination_result_id" type="BIGINT"> + <constraints nullable="false" primaryKey="true" primaryKeyName="pk_screening_examination_result_tooth_diagnoses"/> + </column> + <column name="tooth" type="TOOTH"> + <constraints nullable="false" primaryKey="true" primaryKeyName="pk_screening_examination_result_tooth_diagnoses"/> + </column> + <column name="main_result" type="MAINRESULT"> + <constraints nullable="false"/> + </column> + <column name="secondary_result1" type="SECONDARYRESULT"/> + <column name="secondary_result2" type="SECONDARYRESULT"/> + </createTable> + <addForeignKeyConstraint baseTableName="screening_examination_result_tooth_diagnoses" baseColumnNames="screening_examination_result_id" + constraintName="fk_screening_examination_result_tooth_diagnoses_screening_examination_result" + referencedColumnNames="id" referencedTableName="screening_examination_result"/> + </changeSet> +</databaseChangeLog> diff --git a/backend/dental/src/main/resources/migrations/0027_add_absence_examination_result.xml b/backend/dental/src/main/resources/migrations/0027_add_absence_examination_result.xml new file mode 100644 index 000000000..d285d0d29 --- /dev/null +++ b/backend/dental/src/main/resources/migrations/0027_add_absence_examination_result.xml @@ -0,0 +1,37 @@ +<?xml version="1.1" encoding="UTF-8" standalone="no"?> +<!-- + Copyright 2025 cronn GmbH + SPDX-License-Identifier: Apache-2.0 +--> + +<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd"> + <changeSet author="GA-Lotse" id="1737451987470-1"> + <ext:createPostgresEnumType name="reasonforabsence" values="MOVED, NOT_APPEARED, REFUSED, SHIFTED"/> + + <createTable tableName="absence_examination_result"> + <column name="id" type="BIGINT"> + <constraints nullable="false" primaryKey="true" primaryKeyName="pk_absence_examination_result"/> + </column> + <column name="reason_for_absence" type="REASONFORABSENCE"> + <constraints nullable="false"/> + </column> + </createTable> + <addForeignKeyConstraint baseTableName="absence_examination_result" baseColumnNames="id" constraintName="fk_absence_examination_result_examination_result" referencedColumnNames="id" referencedTableName="examination_result"/> + + <addColumn tableName="fluoridation_examination_result"> + <column name="fluoride_varnish_applied" type="BOOLEAN"/> + </addColumn> + + <addColumn tableName="screening_examination_result"> + <column name="fluoride_varnish_applied" type="BOOLEAN"/> + </addColumn> + + <sql>update fluoridation_examination_result fer set fluoride_varnish_applied = (select fluoride_varnish_applied from examination_result er where er.id = fer.id)</sql> + <sql>update screening_examination_result ser set fluoride_varnish_applied = (select fluoride_varnish_applied from examination_result er where er.id = ser.id)</sql> + + <addNotNullConstraint tableName="fluoridation_examination_result" columnName="fluoride_varnish_applied" columnDataType="boolean"/> + <addNotNullConstraint tableName="screening_examination_result" columnName="fluoride_varnish_applied" columnDataType="boolean"/> + + <dropColumn columnName="fluoride_varnish_applied" tableName="examination_result"/> + </changeSet> +</databaseChangeLog> diff --git a/backend/dental/src/main/resources/migrations/changelog.xml b/backend/dental/src/main/resources/migrations/changelog.xml index 4f38168cd..d5edebd10 100644 --- a/backend/dental/src/main/resources/migrations/changelog.xml +++ b/backend/dental/src/main/resources/migrations/changelog.xml @@ -33,5 +33,7 @@ <include file="migrations/0023_add_cemetery_delete_at.xml"/> <include file="migrations/0024_add_allergy_to_fluoridation_consent.xml"/> <include file="migrations/0025_add_previous_file_state_id_to_system_progress_entry.xml"/> + <include file="migrations/0026_add_tooth_diagnoses.xml"/> + <include file="migrations/0027_add_absence_examination_result.xml"/> </databaseChangeLog> diff --git a/backend/docker-compose-common.yaml b/backend/docker-compose-common.yaml index 6a58af353..860286606 100644 --- a/backend/docker-compose-common.yaml +++ b/backend/docker-compose-common.yaml @@ -15,7 +15,7 @@ services: memory: 1G eshg-postgres-base: - image: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX:-docker.io}/postgres:16.3@sha256:d0f363f8366fbc3f52d172c6e76bc27151c3d643b870e1062b4e8bfe65baf609 + image: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX:-docker.io}/postgres:15.8@sha256:eb3747f5d0a92195ca486d2f15d9a4ee5e9461b0332fe87fbc59069490a5c659 restart: unless-stopped tmpfs: - /var/lib/postgresql/data diff --git a/backend/inspection/src/main/java/de/eshg/inspection/gdpr/InspectionGdprZipEditorProvider.java b/backend/inspection/src/main/java/de/eshg/inspection/gdpr/InspectionGdprZipEditorProvider.java index bcc5eb6a9..77b7a10b3 100644 --- a/backend/inspection/src/main/java/de/eshg/inspection/gdpr/InspectionGdprZipEditorProvider.java +++ b/backend/inspection/src/main/java/de/eshg/inspection/gdpr/InspectionGdprZipEditorProvider.java @@ -10,22 +10,24 @@ import de.eshg.domain.model.serialization.ZipFileWrapper; import de.eshg.lib.procedure.gdpr.AbstractGdprZipEditorProvider; import java.util.Set; import java.util.function.Predicate; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.core.io.Resource; import org.springframework.stereotype.Component; @Component public class InspectionGdprZipEditorProvider extends AbstractGdprZipEditorProvider { + public InspectionGdprZipEditorProvider( + @Value("classpath:/gdpr-legal-basis-text.txt") Resource resource) { + super(resource); + } + @Override public ZipEditor createSpecificFilter() { return (jsonNode, zipFile) -> filterFiles(zipFile, InspectionGdprZipEditorProvider::isNotReportPdf); } - @Override - protected String getLegalBasisAppendix() { - return "Hier könnte Ihr Rechtsgrundlagen-Anhang stehen!"; - } - private static void filterFiles(ZipFileWrapper zipFile, Predicate<String> predicate) { Set<String> fileNames = Set.copyOf(zipFile.getFileNames()); for (String fileName : fileNames) { diff --git a/backend/inspection/src/main/resources/gdpr-legal-basis-text.txt b/backend/inspection/src/main/resources/gdpr-legal-basis-text.txt new file mode 100644 index 000000000..1ff2e42a3 --- /dev/null +++ b/backend/inspection/src/main/resources/gdpr-legal-basis-text.txt @@ -0,0 +1 @@ +Die Akten und Vorgänge sind in der Regel während der Aufbewahrungsfristen bei den Stellen aufzubewahren, die sie bestimmungsgemäß zu verwalten oder zu führen haben. Die Aufbewahrung kann durch Dienstleister erfolgen, sofern die Verfügungsgewalt der Dienststelle sichergestellt ist. Zudem ist gem. § 4 Abs. 3 Hessisches Datenschutzgesetz (HDSG) ein Vertrag abzuschließen (Datenverarbeitung im Auftrage), in dem Rechte und Pflichten von Auftraggeber und Auftragnehmer geregelt, sowie die Kontrollrechte des behördlichen Datenschutzbeauftragten, sowie des Hessischen Datenschutzbeauftragten enthalten sind. Handelt es sich um personenbezogene Daten, sind notwendige Datensicherungsmaßnahmen nach § 10 HDSG zu treffen. diff --git a/backend/lib-appointmentblock/openApi.yaml b/backend/lib-appointmentblock/openApi.yaml index 4b6469029..d8de40986 100644 --- a/backend/lib-appointmentblock/openApi.yaml +++ b/backend/lib-appointmentblock/openApi.yaml @@ -100,6 +100,12 @@ paths: schema: type: string format: date-time + - in: query + name: physicianId + required: false + schema: + type: string + format: uuid responses: "200": content: diff --git a/backend/lib-appointmentblock/src/main/java/de/eshg/lib/appointmentblock/AppointmentBlockController.java b/backend/lib-appointmentblock/src/main/java/de/eshg/lib/appointmentblock/AppointmentBlockController.java index e6b1e01ff..874993d70 100644 --- a/backend/lib-appointmentblock/src/main/java/de/eshg/lib/appointmentblock/AppointmentBlockController.java +++ b/backend/lib-appointmentblock/src/main/java/de/eshg/lib/appointmentblock/AppointmentBlockController.java @@ -14,6 +14,7 @@ import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; import java.time.Instant; import java.util.List; +import java.util.UUID; import org.springdoc.core.annotations.ParameterObject; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.GetMapping; @@ -77,10 +78,15 @@ public class AppointmentBlockController { @Transactional(readOnly = true) public GetFreeAppointmentsResponse getFreeAppointments( @RequestParam(name = "appointmentType") AppointmentTypeDto appointmentType, - @RequestParam(name = "earliestDate", required = false) Instant earliestDate) { + @RequestParam(name = "earliestDate", required = false) Instant earliestDate, + @RequestParam(name = "physicianId", required = false) UUID physicianId) { List<AppointmentDto> appointments = appointmentBlockService.getFreeAppointments( - earliestDate, null, MappingUtil.mapEnum(AppointmentType.class, appointmentType), null); + earliestDate, + null, + MappingUtil.mapEnum(AppointmentType.class, appointmentType), + null, + physicianId); return new GetFreeAppointmentsResponse(appointments); } diff --git a/backend/lib-appointmentblock/src/main/java/de/eshg/lib/appointmentblock/AppointmentBlockService.java b/backend/lib-appointmentblock/src/main/java/de/eshg/lib/appointmentblock/AppointmentBlockService.java index 5c842738c..3a950e6ab 100644 --- a/backend/lib-appointmentblock/src/main/java/de/eshg/lib/appointmentblock/AppointmentBlockService.java +++ b/backend/lib-appointmentblock/src/main/java/de/eshg/lib/appointmentblock/AppointmentBlockService.java @@ -132,13 +132,14 @@ public class AppointmentBlockService { Instant earliestStart, Instant latestStart, AppointmentType appointmentType, - UUID locationId) { + UUID locationId, + UUID physicianId) { Instant start = earliestStart == null ? Instant.now(clock) : earliestStart; List<AppointmentBlock> appointmentBlocks = appointmentBlockRepository .findBlockByAppointmentTypeAndLocationAndAppointmentBlockEndGreaterThan( - appointmentType, locationId, start); + appointmentType, locationId, physicianId, start); return appointmentBlockSlotUtil .calculateFreeAppointmentBlockSlots(appointmentBlocks) diff --git a/backend/lib-appointmentblock/src/main/java/de/eshg/lib/appointmentblock/AppointmentBlockSlotUtil.java b/backend/lib-appointmentblock/src/main/java/de/eshg/lib/appointmentblock/AppointmentBlockSlotUtil.java index 80153a92a..feda11e73 100644 --- a/backend/lib-appointmentblock/src/main/java/de/eshg/lib/appointmentblock/AppointmentBlockSlotUtil.java +++ b/backend/lib-appointmentblock/src/main/java/de/eshg/lib/appointmentblock/AppointmentBlockSlotUtil.java @@ -18,11 +18,14 @@ import java.time.Duration; import java.time.Instant; import java.time.temporal.ChronoUnit; import java.util.ArrayList; +import java.util.Comparator; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import java.util.Map.Entry; import java.util.UUID; import java.util.stream.Collectors; +import java.util.stream.Stream; import org.springframework.stereotype.Component; import org.springframework.util.Assert; @@ -92,11 +95,13 @@ public class AppointmentBlockSlotUtil { public void updateAppointment( AppointmentType appointmentType, UUID locationId, + UUID physicianId, EntityWithAppointment entityWithAppointment, Instant appointmentStart, Instant appointmentEnd) { AppointmentBlock newAppointmentBlock = - findSuitableAppointmentBlock(appointmentType, locationId, appointmentStart, appointmentEnd); + findSuitableAppointmentBlock( + appointmentType, locationId, physicianId, appointmentStart, appointmentEnd); Appointment newAppointment = new Appointment(); newAppointment.setAppointmentStart(appointmentStart); @@ -123,7 +128,11 @@ public class AppointmentBlockSlotUtil { } private AppointmentBlock findSuitableAppointmentBlock( - AppointmentType appointmentType, UUID locationId, Instant start, Instant end) { + AppointmentType appointmentType, + UUID locationId, + UUID physicianId, + Instant start, + Instant end) { AppointmentBlockSlot requestedSlot = new AppointmentBlockSlot(start, end); List<AppointmentBlock> appointmentBlocks = @@ -134,9 +143,22 @@ public class AppointmentBlockSlotUtil { Map<AppointmentBlock, List<AppointmentBlockSlot>> freeAppointmentBlockSlots = calculateFreeAppointmentBlockSlots(appointmentBlocks); - return freeAppointmentBlockSlots.entrySet().stream() - .filter(entry -> entry.getValue().contains(requestedSlot)) - .map(Map.Entry::getKey) + Stream<AppointmentBlock> appointmentBlock = + freeAppointmentBlockSlots.entrySet().stream() + .filter(entry -> entry.getValue().contains(requestedSlot)) + .map(Entry::getKey); + + if (physicianId != null) { + appointmentBlock = + appointmentBlock.sorted( + Comparator.comparing( + block -> { + List<UUID> physicians = block.getAppointmentBlockGroup().getPhysicians(); + return physicians.contains(physicianId) ? physicians.size() : Integer.MAX_VALUE; + })); + } + + return appointmentBlock .findFirst() .orElseThrow( () -> diff --git a/backend/lib-appointmentblock/src/main/java/de/eshg/lib/appointmentblock/persistence/AppointmentBlockRepository.java b/backend/lib-appointmentblock/src/main/java/de/eshg/lib/appointmentblock/persistence/AppointmentBlockRepository.java index 23f61ff5e..7ce24bf29 100644 --- a/backend/lib-appointmentblock/src/main/java/de/eshg/lib/appointmentblock/persistence/AppointmentBlockRepository.java +++ b/backend/lib-appointmentblock/src/main/java/de/eshg/lib/appointmentblock/persistence/AppointmentBlockRepository.java @@ -23,10 +23,12 @@ public interface AppointmentBlockRepository extends JpaRepository<AppointmentBlo @Query( "select a from AppointmentBlock a left join fetch a.appointments where a.appointmentBlockGroup.type = :appointmentType " + "and (:locationId is null or a.appointmentBlockGroup.locationId = :locationId) " + + "and (:physicianId is null or :physicianId member of a.appointmentBlockGroup.physicians) " + "and a.appointmentBlockEnd >= :appointmentBlockEnd order by a.id") List<AppointmentBlock> findBlockByAppointmentTypeAndLocationAndAppointmentBlockEndGreaterThan( @Param("appointmentType") AppointmentType appointmentType, @Param("locationId") UUID locationId, + @Param("physicianId") UUID physicianId, @Param("appointmentBlockEnd") Instant appointmentBlockEnd); @Lock(LockModeType.PESSIMISTIC_WRITE) diff --git a/backend/lib-procedures/src/main/java/de/eshg/lib/procedure/domain/model/Procedure.java b/backend/lib-procedures/src/main/java/de/eshg/lib/procedure/domain/model/Procedure.java index e78f9facf..a15c59780 100644 --- a/backend/lib-procedures/src/main/java/de/eshg/lib/procedure/domain/model/Procedure.java +++ b/backend/lib-procedures/src/main/java/de/eshg/lib/procedure/domain/model/Procedure.java @@ -162,6 +162,10 @@ public abstract class Procedure< this.procedureStatus = procedureStatus; } + public boolean isFinalized() { + return List.of(ProcedureStatus.CLOSED, ProcedureStatus.ABORTED).contains(this.procedureStatus); + } + private void validateStatusTransition(ProcedureStatus procedureStatus) { if (this.procedureStatus != null && this.procedureStatus != ProcedureStatus.DRAFT diff --git a/backend/lib-procedures/src/main/java/de/eshg/lib/procedure/gdpr/AbstractGdprZipEditorProvider.java b/backend/lib-procedures/src/main/java/de/eshg/lib/procedure/gdpr/AbstractGdprZipEditorProvider.java index a63745c3c..829f41147 100644 --- a/backend/lib-procedures/src/main/java/de/eshg/lib/procedure/gdpr/AbstractGdprZipEditorProvider.java +++ b/backend/lib-procedures/src/main/java/de/eshg/lib/procedure/gdpr/AbstractGdprZipEditorProvider.java @@ -22,6 +22,9 @@ import de.eshg.lib.procedure.domain.model.RelatedFacility_; import de.eshg.lib.procedure.domain.model.RelatedPerson_; import de.eshg.lib.procedure.domain.model.SystemProgressEntry_; import de.eshg.lib.procedure.domain.model.Task_; +import java.io.IOException; +import java.io.UncheckedIOException; +import java.nio.file.Files; import java.util.Collections; import java.util.Iterator; import java.util.List; @@ -30,17 +33,27 @@ import java.util.UUID; import java.util.stream.Stream; import java.util.stream.Stream.Builder; import org.apache.commons.lang3.StringUtils; +import org.springframework.core.io.Resource; public abstract class AbstractGdprZipEditorProvider { + private final Resource resource; + public static final String FILE_META_DATA = "metaData"; - public static final String COMMON_LEGAL_BASIS_TEXT = - "Die Rechtsgrundlage für die Datenverarbeitung ist Art. 6 Abs. 1 S. 1 lit. f DS-GVO."; + protected AbstractGdprZipEditorProvider(Resource resource) { + this.resource = resource; + } protected abstract ZipEditor createSpecificFilter(); - protected abstract String getLegalBasisAppendix(); + protected String getLegalBasis() { + try { + return Files.readString(resource.getFile().toPath()); + } catch (IOException e) { + throw new UncheckedIOException("Could not read resource file " + resource.getFilename(), e); + } + } public ZipEditor create(List<UUID> fileStateIds) { return createCommonFilter(fileStateIds) @@ -51,15 +64,11 @@ public abstract class AbstractGdprZipEditorProvider { private ZipEditor createLegalBasisEnricher() { return (jsonNode, zipFileWrapper) -> { if (!zipFileWrapper.getFileNames().contains("Rechtsgrundlage.txt")) { - zipFileWrapper.addEntry("Rechtsgrundlage.txt", buildLegalBasisFileContent()); + zipFileWrapper.addEntry("Rechtsgrundlage.txt", getLegalBasis().getBytes()); } }; } - private byte[] buildLegalBasisFileContent() { - return (COMMON_LEGAL_BASIS_TEXT + System.lineSeparator() + getLegalBasisAppendix()).getBytes(); - } - private static ZipEditor createCommonFilter(List<UUID> fileStateIds) { List<String> fileStateIdStrings = fileStateIds.stream().map(UUID::toString).toList(); return removeManualAndProcessedInboxProgressEntries() diff --git a/backend/lib-procedures/src/main/java/de/eshg/lib/procedure/gdpr/DefaultGdprZipEditorProvider.java b/backend/lib-procedures/src/main/java/de/eshg/lib/procedure/gdpr/DefaultGdprZipEditorProvider.java index 9de0821b8..8518d927a 100644 --- a/backend/lib-procedures/src/main/java/de/eshg/lib/procedure/gdpr/DefaultGdprZipEditorProvider.java +++ b/backend/lib-procedures/src/main/java/de/eshg/lib/procedure/gdpr/DefaultGdprZipEditorProvider.java @@ -6,18 +6,21 @@ package de.eshg.lib.procedure.gdpr; import de.eshg.domain.model.serialization.ZipEditor; +import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.core.io.Resource; import org.springframework.stereotype.Component; @Component @ConditionalOnMissingBean(AbstractGdprZipEditorProvider.class) public class DefaultGdprZipEditorProvider extends AbstractGdprZipEditorProvider { - protected ZipEditor createSpecificFilter() { - return (jsonNode, zipFileWrapper) -> {}; + public DefaultGdprZipEditorProvider( + @Value("classpath:/gdpr-legal-basis-text.txt") Resource resource) { + super(resource); } - protected String getLegalBasisAppendix() { - return ""; + protected ZipEditor createSpecificFilter() { + return (jsonNode, zipFileWrapper) -> {}; } } diff --git a/backend/lib-procedures/src/main/java/de/eshg/lib/procedure/gdpr/GdprValidationTaskService.java b/backend/lib-procedures/src/main/java/de/eshg/lib/procedure/gdpr/GdprValidationTaskService.java index 412b5a473..260a91b92 100644 --- a/backend/lib-procedures/src/main/java/de/eshg/lib/procedure/gdpr/GdprValidationTaskService.java +++ b/backend/lib-procedures/src/main/java/de/eshg/lib/procedure/gdpr/GdprValidationTaskService.java @@ -107,13 +107,22 @@ public class GdprValidationTaskService< } public GdprDownloadPackage getDownloadPackage(UUID gdprId, UUID downloadId) { - validatePermissionToAccessGdprProcedure(gdprId, false); + validatePermissionToAccessGdprProcedure(gdprId); + validateDownloadIdBelongsToGdprProcedure(gdprId, downloadId); log.info("Fetching download package from database by downloadId: {}", downloadId); return downloadPackageRepository .findByExternalId(downloadId) .orElseThrow(() -> new NotFoundException("GdprDownloadPackage not found.")); } + private void validateDownloadIdBelongsToGdprProcedure(UUID gdprId, UUID downloadId) { + Set<UUID> knownDownloadIds = fetchDownloadIdsFromBase(gdprId).downloadIds(); + if (!knownDownloadIds.contains(downloadId)) { + throw new BadRequestException( + "The requested gdpr procedure does not contain the requested download package"); + } + } + public Procedure<?, ?, ?, ?> getBusinessProcedureFromDb(UUID id) { return procedureRepository .findByExternalId(id) @@ -188,7 +197,7 @@ public class GdprValidationTaskService< } public List<GdprDownloadPackageInfo> getDownloadPackagesInfo(UUID gdprProcedureId) { - validatePermissionToAccessGdprProcedure(gdprProcedureId, false); + validatePermissionToAccessGdprProcedure(gdprProcedureId); Set<UUID> downloadIdsFromBase = fetchDownloadIdsFromBase(gdprProcedureId).downloadIds(); if (downloadIdsFromBase.isEmpty()) { return List.of(); @@ -349,11 +358,7 @@ public class GdprValidationTaskService< downloadPackageRepository.deleteAllByExternalIdIn(downloadIds); } - private void validatePermissionToAccessGdprProcedure( - UUID gdprProcedureId, boolean allowEmployeeFullAccess) { - if (allowEmployeeFullAccess && CurrentUserHelper.isEmployee()) { - return; - } + private void validatePermissionToAccessGdprProcedure(UUID gdprProcedureId) { GdprIdentificationDataDto identificationData; try { identificationData = diff --git a/backend/measles-protection/openApi.yaml b/backend/measles-protection/openApi.yaml index a4e5c307b..2c5bf99ff 100644 --- a/backend/measles-protection/openApi.yaml +++ b/backend/measles-protection/openApi.yaml @@ -100,6 +100,12 @@ paths: schema: type: string format: date-time + - in: query + name: physicianId + required: false + schema: + type: string + format: uuid responses: "200": content: diff --git a/backend/measles-protection/src/main/java/de/eshg/measlesprotection/AppointmentService.java b/backend/measles-protection/src/main/java/de/eshg/measlesprotection/AppointmentService.java index 86f57c5be..f879ecfdd 100644 --- a/backend/measles-protection/src/main/java/de/eshg/measlesprotection/AppointmentService.java +++ b/backend/measles-protection/src/main/java/de/eshg/measlesprotection/AppointmentService.java @@ -80,7 +80,7 @@ public class AppointmentService { List<AppointmentBlock> appointmentBlocks = appointmentBlockRepository .findBlockByAppointmentTypeAndLocationAndAppointmentBlockEndGreaterThan( - PROOF_SUBMISSION, null, start); + PROOF_SUBMISSION, null, null, start); Set<UUID> currentUserEvents = currentUserEvents(start, end); List<AppointmentBlock> currentUserBlocks = @@ -136,7 +136,7 @@ public class AppointmentService { } private void bookAppointment(MeaslesProtectionProcedure procedure, Instant start, Instant end) { - appointmentBlockSlotUtil.updateAppointment(PROOF_SUBMISSION, null, procedure, start, end); + appointmentBlockSlotUtil.updateAppointment(PROOF_SUBMISSION, null, null, procedure, start, end); UserCalendar currentUserCalendar = calendarApi.getCurrentUserCalendar(); calendarEventApi.addBusinessCaseEvent( diff --git a/backend/measles-protection/src/main/java/de/eshg/measlesprotection/MeaslesGdprZipEditorProvider.java b/backend/measles-protection/src/main/java/de/eshg/measlesprotection/MeaslesGdprZipEditorProvider.java new file mode 100644 index 000000000..04f8d098d --- /dev/null +++ b/backend/measles-protection/src/main/java/de/eshg/measlesprotection/MeaslesGdprZipEditorProvider.java @@ -0,0 +1,26 @@ +/* + * Copyright 2025 cronn GmbH + * SPDX-License-Identifier: AGPL-3.0-only + */ + +package de.eshg.measlesprotection; + +import de.eshg.domain.model.serialization.ZipEditor; +import de.eshg.lib.procedure.gdpr.AbstractGdprZipEditorProvider; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.core.io.Resource; +import org.springframework.stereotype.Component; + +@Component +public class MeaslesGdprZipEditorProvider extends AbstractGdprZipEditorProvider { + + public MeaslesGdprZipEditorProvider( + @Value("classpath:/gdpr-legal-basis-text.txt") Resource resource) { + super(resource); + } + + @Override + protected ZipEditor createSpecificFilter() { + return (jsonNode, zipFileWrapper) -> {}; + } +} diff --git a/backend/measles-protection/src/main/resources/gdpr-legal-basis-text.txt b/backend/measles-protection/src/main/resources/gdpr-legal-basis-text.txt new file mode 100644 index 000000000..2fe1a2855 --- /dev/null +++ b/backend/measles-protection/src/main/resources/gdpr-legal-basis-text.txt @@ -0,0 +1 @@ +Die Datenerhebung basiert auf Grundlage des Art. 6 Abs. 1, S. 1 lit. c, lit. d, lit. e und Art. 9 Abs. 2 c und 2 i DSGVO in Verbindung mit § 20 (IfSG). diff --git a/backend/medical-registry/src/main/resources/gdpr-legal-basis-text.txt b/backend/medical-registry/src/main/resources/gdpr-legal-basis-text.txt new file mode 100644 index 000000000..e69de29bb diff --git a/backend/official-medical-service/openApi.yaml b/backend/official-medical-service/openApi.yaml index 23755e816..de7a2ecb3 100644 --- a/backend/official-medical-service/openApi.yaml +++ b/backend/official-medical-service/openApi.yaml @@ -100,6 +100,12 @@ paths: schema: type: string format: date-time + - in: query + name: physicianId + required: false + schema: + type: string + format: uuid responses: "200": content: @@ -492,6 +498,29 @@ paths: get: operationId: getAllEmployeeProcedures parameters: + - in: query + name: assigned + required: false + schema: + type: boolean + - in: query + name: status + required: false + schema: + type: array + items: + $ref: "#/components/schemas/ProcedureStatus" + uniqueItems: true + - in: query + name: highPriority + required: false + schema: + type: boolean + - in: query + name: today + required: false + schema: + type: boolean - in: query name: sortKey required: false @@ -3394,6 +3423,9 @@ components: format: uuid lastName: type: string + nextAppointment: + type: string + format: date-time physicianName: type: string status: @@ -3405,6 +3437,13 @@ components: type: string enum: - ID + - FIRSTNAME + - LASTNAME + - DATEOFBIRTH + - FACILITYNAME + - PHYSICIANNAME + - STATUS + - NEXTAPPOINTMENT ExportArchivingRelevantProceduresRequest: type: object properties: @@ -4771,6 +4810,8 @@ components: $ref: "#/components/schemas/AppointmentType" bookingState: $ref: "#/components/schemas/BookingState" + bookingType: + $ref: "#/components/schemas/BookingType" duration: type: integer format: int32 diff --git a/backend/official-medical-service/src/main/java/de/eshg/officialmedicalservice/OmsGdprZipEditorProvider.java b/backend/official-medical-service/src/main/java/de/eshg/officialmedicalservice/OmsGdprZipEditorProvider.java index fda6be432..430a90660 100644 --- a/backend/official-medical-service/src/main/java/de/eshg/officialmedicalservice/OmsGdprZipEditorProvider.java +++ b/backend/official-medical-service/src/main/java/de/eshg/officialmedicalservice/OmsGdprZipEditorProvider.java @@ -8,14 +8,17 @@ package de.eshg.officialmedicalservice; import de.eshg.domain.model.serialization.ZipEditor; import de.eshg.lib.procedure.gdpr.AbstractGdprZipEditorProvider; import de.eshg.officialmedicalservice.procedure.persistence.entity.OmsProcedure_; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.core.io.Resource; import org.springframework.stereotype.Component; @Component public class OmsGdprZipEditorProvider extends AbstractGdprZipEditorProvider { - @Override - protected String getLegalBasisAppendix() { - return "Hier könnte Ihr Rechtsgrundlagen-Anhang stehen!"; + // TODO (ISSUE-7443): Replace text for legal basis in the file below + public OmsGdprZipEditorProvider( + @Value("classpath:/gdpr-legal-basis-text.txt") Resource resource) { + super(resource); } @Override diff --git a/backend/official-medical-service/src/main/java/de/eshg/officialmedicalservice/appointment/OmsAppointmentMapper.java b/backend/official-medical-service/src/main/java/de/eshg/officialmedicalservice/appointment/OmsAppointmentMapper.java index 5230583a4..703fa6a18 100644 --- a/backend/official-medical-service/src/main/java/de/eshg/officialmedicalservice/appointment/OmsAppointmentMapper.java +++ b/backend/official-medical-service/src/main/java/de/eshg/officialmedicalservice/appointment/OmsAppointmentMapper.java @@ -43,6 +43,7 @@ public class OmsAppointmentMapper { toInterfaceType(omsAppointment.getAppointmentType()), toInterfaceType(omsAppointment.getAppointmentState()), toInterfaceType(omsAppointment.getBookingState()), + toInterfaceType(omsAppointment.getBookingType()), omsAppointment.getStart(), omsAppointment.getDuration()); } @@ -75,6 +76,13 @@ public class OmsAppointmentMapper { return BookingStateDto.valueOf(bookingState.name()); } + public BookingTypeDto toInterfaceType(BookingType bookingType) { + if (bookingType == null) { + return null; + } + return BookingTypeDto.valueOf(bookingType.name()); + } + public BookingType toDomainType(BookingTypeDto bookingTypeDto) { if (bookingTypeDto == null) { return null; diff --git a/backend/official-medical-service/src/main/java/de/eshg/officialmedicalservice/appointment/OmsAppointmentService.java b/backend/official-medical-service/src/main/java/de/eshg/officialmedicalservice/appointment/OmsAppointmentService.java index a302d95bc..077284c69 100644 --- a/backend/official-medical-service/src/main/java/de/eshg/officialmedicalservice/appointment/OmsAppointmentService.java +++ b/backend/official-medical-service/src/main/java/de/eshg/officialmedicalservice/appointment/OmsAppointmentService.java @@ -8,7 +8,6 @@ package de.eshg.officialmedicalservice.appointment; import de.eshg.lib.appointmentblock.AppointmentBlockSlotUtil; import de.eshg.lib.appointmentblock.api.AppointmentTypeDto; import de.eshg.lib.appointmentblock.persistence.AppointmentType; -import de.eshg.lib.procedure.domain.model.ProcedureStatus; import de.eshg.officialmedicalservice.appointment.api.BookingInfoDto; import de.eshg.officialmedicalservice.appointment.api.BookingTypeDto; import de.eshg.officialmedicalservice.appointment.api.PostOmsAppointmentRequest; @@ -53,7 +52,7 @@ public class OmsAppointmentService { OmsProcedure procedure = loadOmsProcedure(externalId); // validate - if (procedure.getProcedureStatus() == ProcedureStatus.CLOSED) { + if (procedure.isFinalized()) { throw new BadRequestException("Procedure already closed"); } if (!supportedAppointmentTypes.contains(request.appointmentType())) { @@ -64,6 +63,8 @@ public class OmsAppointmentService { // create bookable appointment OmsAppointment appointment = new OmsAppointment(appointmentType); + appointment.setProcedure(procedure); + procedure.getAppointments().add(appointment); // and book it BookingInfoDto bookingInfo = request.bookingInfo(); @@ -71,9 +72,6 @@ public class OmsAppointmentService { processBooking(bookingInfo, appointment); } - // relate procedure and appointment entities - appointment.setProcedure(procedure); - procedure.getAppointments().add(appointment); omsAppointmentRepository.save(appointment); return appointment.getExternalId(); @@ -82,7 +80,7 @@ public class OmsAppointmentService { @Transactional public void bookAppointmentEmployee(UUID appointmentId, BookingInfoDto request) { OmsAppointment appointment = loadAppointment(appointmentId); - if (ProcedureStatus.CLOSED == appointment.getProcedure().getProcedureStatus()) { + if (appointment.getProcedure().isFinalized()) { throw new BadRequestException("Procedure is already closed."); } if (AppointmentState.CLOSED == appointment.getAppointmentState()) { @@ -99,7 +97,7 @@ public class OmsAppointmentService { public void cancelAppointmentEmployee(UUID appointmentId) { OmsAppointment appointment = loadAppointment(appointmentId); - if (ProcedureStatus.CLOSED == appointment.getProcedure().getProcedureStatus()) { + if (appointment.getProcedure().isFinalized()) { throw new BadRequestException("Procedure is already closed."); } if (AppointmentState.CLOSED == appointment.getAppointmentState()) { @@ -128,7 +126,12 @@ public class OmsAppointmentService { if (BookingTypeDto.APPOINTMENT_BLOCK.equals(bookingTypeDto)) { Instant end = start.plus(Duration.ofMinutes(duration)); appointmentBlockSlotUtil.updateAppointment( - appointment.getAppointmentType(), null, appointment, start, end); + appointment.getAppointmentType(), + null, + appointment.getProcedure().getPhysicianId(), + appointment, + start, + end); } else { // in case we rebook from appointment block to user defined... // ...we need to unlock the used appointment slot diff --git a/backend/official-medical-service/src/main/java/de/eshg/officialmedicalservice/appointment/api/OmsAppointmentDto.java b/backend/official-medical-service/src/main/java/de/eshg/officialmedicalservice/appointment/api/OmsAppointmentDto.java index 6b371d834..9e31c71c3 100644 --- a/backend/official-medical-service/src/main/java/de/eshg/officialmedicalservice/appointment/api/OmsAppointmentDto.java +++ b/backend/official-medical-service/src/main/java/de/eshg/officialmedicalservice/appointment/api/OmsAppointmentDto.java @@ -17,5 +17,6 @@ public record OmsAppointmentDto( @NotNull AppointmentTypeDto appointmentType, @NotNull AppointmentStateDto appointmentState, @NotNull BookingStateDto bookingState, + BookingTypeDto bookingType, Instant start, Integer duration) {} diff --git a/backend/official-medical-service/src/main/java/de/eshg/officialmedicalservice/procedure/EmployeeOmsProcedureController.java b/backend/official-medical-service/src/main/java/de/eshg/officialmedicalservice/procedure/EmployeeOmsProcedureController.java index 3153c27c6..ff7653764 100644 --- a/backend/official-medical-service/src/main/java/de/eshg/officialmedicalservice/procedure/EmployeeOmsProcedureController.java +++ b/backend/official-medical-service/src/main/java/de/eshg/officialmedicalservice/procedure/EmployeeOmsProcedureController.java @@ -13,6 +13,7 @@ import de.eshg.officialmedicalservice.procedure.api.EmployeeOmsProcedureHeaderDt import de.eshg.officialmedicalservice.procedure.api.EmployeeOmsProcedurePaginationAndSortParameters; import de.eshg.officialmedicalservice.procedure.api.EmployeePagedOmsProcedures; import de.eshg.officialmedicalservice.procedure.api.GetEmployeeOmsProcedureOverviewResponse; +import de.eshg.officialmedicalservice.procedure.api.GetOmsProceduresFilterOptionsDto; import de.eshg.officialmedicalservice.procedure.api.PatchAffectedPersonRequest; import de.eshg.officialmedicalservice.procedure.api.PatchConcernRequest; import de.eshg.officialmedicalservice.procedure.api.PatchEmployeeOmsProcedureFacilityRequest; @@ -88,10 +89,12 @@ public class EmployeeOmsProcedureController { @GetMapping(path = PROCEDURES_URL) @Operation(summary = "Get all oms procedures") public GetEmployeeOmsProcedureOverviewResponse getAllEmployeeProcedures( + @InlineParameterObject @ParameterObject @Valid GetOmsProceduresFilterOptionsDto filters, @InlineParameterObject @ParameterObject @Valid EmployeeOmsProcedurePaginationAndSortParameters paginationAndSortParameters) { EmployeePagedOmsProcedures pagedOmsProcedures = - employeeOmsProcedureService.getEmployeeProceduresOverview(paginationAndSortParameters); + employeeOmsProcedureService.getEmployeeProceduresOverview( + filters, paginationAndSortParameters); return new GetEmployeeOmsProcedureOverviewResponse( pagedOmsProcedures.proceduresPage(), pagedOmsProcedures.totalNumberOfProcedures()); } diff --git a/backend/official-medical-service/src/main/java/de/eshg/officialmedicalservice/procedure/EmployeeOmsProcedureService.java b/backend/official-medical-service/src/main/java/de/eshg/officialmedicalservice/procedure/EmployeeOmsProcedureService.java index 2877f130e..5d35d7a74 100644 --- a/backend/official-medical-service/src/main/java/de/eshg/officialmedicalservice/procedure/EmployeeOmsProcedureService.java +++ b/backend/official-medical-service/src/main/java/de/eshg/officialmedicalservice/procedure/EmployeeOmsProcedureService.java @@ -8,7 +8,12 @@ package de.eshg.officialmedicalservice.procedure; import static de.eshg.lib.procedure.domain.factory.SystemProgressEntryFactory.createSystemProgressEntry; import static de.eshg.officialmedicalservice.concern.ConcernMapper.mapToConcernDto; import static de.eshg.officialmedicalservice.concern.ConcernMapper.mapToEntity; +import static java.util.Comparator.comparing; +import static java.util.Comparator.naturalOrder; +import static java.util.Comparator.nullsLast; +import static org.springframework.util.CollectionUtils.isEmpty; +import de.eshg.base.SortDirection; import de.eshg.base.centralfile.api.facility.AddFacilityFileStateResponse; import de.eshg.base.centralfile.api.facility.GetFacilityFileStateResponse; import de.eshg.base.centralfile.api.facility.GetFacilityFileStatesRequest; @@ -24,7 +29,11 @@ import de.eshg.lib.procedure.domain.model.ProcedureStatus; import de.eshg.lib.procedure.domain.model.RelatedPerson; import de.eshg.lib.procedure.domain.model.TriggerType; import de.eshg.lib.procedure.mapping.ProcedureMapper; +import de.eshg.lib.procedure.model.ProcedureStatusDto; import de.eshg.officialmedicalservice.appointment.OmsAppointmentMapper; +import de.eshg.officialmedicalservice.appointment.persistence.entity.AppointmentState; +import de.eshg.officialmedicalservice.appointment.persistence.entity.OmsAppointment; +import de.eshg.officialmedicalservice.appointment.persistence.entity.OmsAppointment_; import de.eshg.officialmedicalservice.concern.ConcernMapper; import de.eshg.officialmedicalservice.facility.FacilityClient; import de.eshg.officialmedicalservice.facility.FacilityMapper; @@ -35,8 +44,10 @@ import de.eshg.officialmedicalservice.procedure.api.EmployeeOmsProcedureDetailsD import de.eshg.officialmedicalservice.procedure.api.EmployeeOmsProcedureHeaderDto; import de.eshg.officialmedicalservice.procedure.api.EmployeeOmsProcedureOverviewDto; import de.eshg.officialmedicalservice.procedure.api.EmployeeOmsProcedurePaginationAndSortParameters; +import de.eshg.officialmedicalservice.procedure.api.EmployeeOmsProcedureSortKey; import de.eshg.officialmedicalservice.procedure.api.EmployeePagedOmsProcedures; import de.eshg.officialmedicalservice.procedure.api.FacilityDto; +import de.eshg.officialmedicalservice.procedure.api.GetOmsProceduresFilterOptionsDto; import de.eshg.officialmedicalservice.procedure.api.PatchAffectedPersonRequest; import de.eshg.officialmedicalservice.procedure.api.PatchConcernRequest; import de.eshg.officialmedicalservice.procedure.api.PatchEmployeeOmsProcedureFacilityRequest; @@ -46,24 +57,45 @@ import de.eshg.officialmedicalservice.procedure.api.PostEmployeeOmsProcedureRequ import de.eshg.officialmedicalservice.procedure.api.SyncAffectedPersonRequest; import de.eshg.officialmedicalservice.procedure.api.SyncFacilityRequest; import de.eshg.officialmedicalservice.procedure.persistence.entity.Concern; +import de.eshg.officialmedicalservice.procedure.persistence.entity.Concern_; import de.eshg.officialmedicalservice.procedure.persistence.entity.Facility; import de.eshg.officialmedicalservice.procedure.persistence.entity.OmsProcedure; import de.eshg.officialmedicalservice.procedure.persistence.entity.OmsProcedureRepository; +import de.eshg.officialmedicalservice.procedure.persistence.entity.OmsProcedureView; +import de.eshg.officialmedicalservice.procedure.persistence.entity.OmsProcedure_; import de.eshg.officialmedicalservice.procedure.persistence.entity.Person; import de.eshg.officialmedicalservice.user.UserClient; import de.eshg.rest.service.error.BadRequestException; import de.eshg.rest.service.error.NotFoundException; import de.eshg.rest.service.security.CurrentUserHelper; import de.eshg.validation.ValidationUtil; +import jakarta.annotation.Nullable; +import jakarta.persistence.EntityManager; +import jakarta.persistence.criteria.CriteriaBuilder; +import jakarta.persistence.criteria.CriteriaQuery; +import jakarta.persistence.criteria.Join; +import jakarta.persistence.criteria.JoinType; +import jakarta.persistence.criteria.Predicate; +import jakarta.persistence.criteria.Root; import java.time.Clock; +import java.time.Instant; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.Collection; import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; +import java.util.Set; import java.util.UUID; import java.util.stream.Collectors; -import org.springframework.data.domain.Page; +import java.util.stream.Stream; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -78,6 +110,7 @@ public class EmployeeOmsProcedureService { private final Clock clock; private final AuditLogger auditLogger; private final ProgressEntryService progressEntryService; + private final EntityManager entityManager; public EmployeeOmsProcedureService( OmsProcedureRepository omsProcedureRepository, @@ -88,7 +121,8 @@ public class EmployeeOmsProcedureService { Clock clock, AuditLogger auditLogger, UserClient userClient, - ProgressEntryService progressEntryService) { + ProgressEntryService progressEntryService, + EntityManager entityManager) { this.omsProcedureRepository = omsProcedureRepository; this.omsProcedureOverviewMapper = omsProcedureOverviewMapper; this.omsAppointmentMapper = omsAppointmentMapper; @@ -98,6 +132,7 @@ public class EmployeeOmsProcedureService { this.auditLogger = auditLogger; this.userClient = userClient; this.progressEntryService = progressEntryService; + this.entityManager = entityManager; } @Transactional @@ -161,31 +196,198 @@ public class EmployeeOmsProcedureService { @Transactional(readOnly = true) public EmployeePagedOmsProcedures getEmployeeProceduresOverview( + GetOmsProceduresFilterOptionsDto filters, EmployeeOmsProcedurePaginationAndSortParameters paginationAndSortParameters) { - Page<OmsProcedure> omsProcedures = - omsProcedureRepository.findAll( - new EmployeeOmsProcedureSpecification(paginationAndSortParameters), - EmployeeOmsProcedureSpecification.toPageSpec(paginationAndSortParameters)); + Instant isBefore = null; + Instant isAfter = null; - Map<UUID, GetPersonFileStateResponse> personMap = getPersonMap(omsProcedures.getContent()); - Map<UUID, GetFacilityFileStateResponse> facilityMap = - getFacilityMap(omsProcedures.getContent()); + if (Boolean.TRUE.equals(filters.today())) { + LocalDate today = LocalDate.ofInstant(clock.instant(), clock.getZone()); + LocalDateTime startOfDay = today.atStartOfDay(); + isAfter = startOfDay.atZone(clock.getZone()).toInstant(); + isBefore = isAfter.plus(1, ChronoUnit.DAYS); + } + + UserDto selfUser = userClient.getSelfUser(); + UUID physicianId = Boolean.TRUE.equals(filters.assigned()) ? selfUser.userId() : null; + + List<OmsProcedureView> candidates = + findOmsProcedures(physicianId, filters.status(), isBefore, isAfter, filters.highPriority()); + + List<OmsProcedure> candidateProcedures = + candidates.stream().map(OmsProcedureView::procedure).toList(); + + Map<UUID, GetPersonFileStateResponse> personMap = getPersonMap(candidateProcedures); + Map<UUID, GetFacilityFileStateResponse> facilityMap = getFacilityMap(candidateProcedures); Map<UUID, UserDto> physicianMap = userClient.getPhysiciansMap(); + Map<UUID, Long> idMap = getIdMap(candidateProcedures); List<EmployeeOmsProcedureOverviewDto> omsProcedureOverviewDtos = - omsProcedures.getContent().stream() - .map( - omsProcedure -> - omsProcedureOverviewMapper.toInterfaceType( - omsProcedure, - getPersonForOmsProcedure(omsProcedure, personMap), - getFacilityForOmsProcedure(omsProcedure, facilityMap), - getPhysicianForOmsProcedure(omsProcedure, physicianMap))) - .toList(); + chooseNextAppointmentAndMapCandidates(candidates, personMap, facilityMap, physicianMap); + + List<EmployeeOmsProcedureOverviewDto> result = + sortAndPageEntries(omsProcedureOverviewDtos, paginationAndSortParameters, idMap); - return new EmployeePagedOmsProcedures( - omsProcedureOverviewDtos, omsProcedures.getTotalElements()); + return new EmployeePagedOmsProcedures(result, omsProcedureOverviewDtos.size()); + } + + private List<OmsProcedureView> findOmsProcedures( + @Nullable UUID physicianId, + @Nullable Set<ProcedureStatusDto> status, + @Nullable Instant isBefore, + @Nullable Instant isAfter, + @Nullable Boolean highPriority) { + Set<ProcedureStatus> procedureStatus = + Stream.ofNullable(status) + .flatMap(Collection::stream) + .map(ProcedureMapper::toDomainType) + .collect(Collectors.toSet()); + + CriteriaBuilder cb = entityManager.getCriteriaBuilder(); + CriteriaQuery<OmsProcedureView> cq = cb.createQuery(OmsProcedureView.class); + + // Root from OmsProcedure, LEFT JOIN other OmsProcedure members + Root<OmsProcedure> procedureRoot = cq.from(OmsProcedure.class); + Join<OmsProcedure, Concern> concernJoin = + procedureRoot.join(OmsProcedure_.CONCERN, JoinType.LEFT); + Join<OmsProcedure, OmsAppointment> appointmentJoin = + procedureRoot.join(OmsProcedure_.appointments, JoinType.LEFT); + + List<Predicate> predicates = new ArrayList<>(); + + if (physicianId != null) { + predicates.add( + cb.equal(procedureRoot.get(OmsProcedure_.physicianId), cb.literal(physicianId))); + } + if (!isEmpty(procedureStatus)) { + predicates.add(procedureRoot.get(OmsProcedure_.procedureStatus).in(procedureStatus)); + } + + if (isBefore != null || isAfter != null) { + predicates.add( + cb.and( + cb.isNotNull(appointmentJoin), + cb.notEqual( + appointmentJoin.get(OmsAppointment_.appointmentState), + cb.literal(AppointmentState.CLOSED)))); + + if (isBefore != null) { + predicates.add(cb.lessThanOrEqualTo(appointmentJoin.get(OmsAppointment_.start), isBefore)); + } + if (isAfter != null) { + predicates.add( + cb.greaterThanOrEqualTo(appointmentJoin.get(OmsAppointment_.start), isAfter)); + } + } + + if (Boolean.TRUE.equals(highPriority)) { + predicates.add(cb.isTrue(concernJoin.get(Concern_.HIGH_PRIORITY))); + } + + cq.select(cb.construct(OmsProcedureView.class, procedureRoot, concernJoin, appointmentJoin)); + cq.where(cb.and(predicates.toArray(Predicate[]::new))); + + return entityManager.createQuery(cq).getResultList(); + } + + private List<EmployeeOmsProcedureOverviewDto> chooseNextAppointmentAndMapCandidates( + List<OmsProcedureView> candidates, + Map<UUID, GetPersonFileStateResponse> personMap, + Map<UUID, GetFacilityFileStateResponse> facilityMap, + Map<UUID, UserDto> physicianMap) { + Instant now = clock.instant(); + + Map<Long, Instant> appointmentMap = new HashMap<>(); + for (OmsProcedureView candidate : candidates) { + Instant appointmentFromMap = appointmentMap.get(candidate.procedure().getId()); + Instant appointmentFromCandidate = + Optional.ofNullable(candidate.appointment()) + .filter(appointment -> appointment.getAppointmentState() != AppointmentState.CLOSED) + .map(OmsAppointment::getStart) + .orElse(null); + if (appointmentFromCandidate != null + && (appointmentFromMap == null + || (appointmentFromCandidate.isBefore(appointmentFromMap) + && appointmentFromCandidate.isAfter(now)))) { + appointmentMap.put(candidate.procedure().getId(), appointmentFromCandidate); + } + } + + Set<Long> idsAlreadyInResult = new HashSet<>(); + + return candidates.stream() + .filter(c -> !idsAlreadyInResult.contains(c.procedure().getId())) + .map( + c -> { + idsAlreadyInResult.add(c.procedure().getId()); + return omsProcedureOverviewMapper.toInterfaceType( + c.procedure(), + getPersonForOmsProcedure(c.procedure(), personMap), + getFacilityForOmsProcedure(c.procedure(), facilityMap), + getPhysicianForOmsProcedure(c.procedure(), physicianMap), + appointmentMap.get(c.procedure().getId())); + }) + .toList(); + } + + private List<EmployeeOmsProcedureOverviewDto> sortAndPageEntries( + List<EmployeeOmsProcedureOverviewDto> entries, + EmployeeOmsProcedurePaginationAndSortParameters paginationAndSortParameters, + Map<UUID, Long> idMap) { + return entries.stream() + .sorted(createComparator(paginationAndSortParameters, idMap)) + .skip( + (long) paginationAndSortParameters.pageNumberOrFallback(0) + * (long) paginationAndSortParameters.pageSizeOrFallback(10)) + .limit(paginationAndSortParameters.pageSizeOrFallback(10)) + .toList(); + } + + public static Comparator<EmployeeOmsProcedureOverviewDto> createComparator( + EmployeeOmsProcedurePaginationAndSortParameters paginationAndSortParameters, + Map<UUID, Long> idMap) { + EmployeeOmsProcedureSortKey sortKey = + Optional.ofNullable(paginationAndSortParameters.sortKey()) + .orElse(EmployeeOmsProcedureSortKey.ID); + + Comparator<EmployeeOmsProcedureOverviewDto> comparator = + switch (sortKey) { + case ID -> + comparing( + e -> Optional.ofNullable(e.id()).map(idMap::get).orElse(null), + nullsLast(naturalOrder())); + case FIRSTNAME -> + comparing( + e -> e.firstName() == null ? null : e.firstName(), nullsLast(naturalOrder())); + case LASTNAME -> + comparing(e -> e.lastName() == null ? null : e.lastName(), nullsLast(naturalOrder())); + case DATEOFBIRTH -> + comparing( + e -> e.dateOfBirth() == null ? null : e.dateOfBirth(), nullsLast(naturalOrder())); + case FACILITYNAME -> + comparing( + e -> e.facilityName() == null ? null : e.facilityName(), + nullsLast(naturalOrder())); + case PHYSICIANNAME -> + comparing( + e -> e.physicianName() == null ? null : e.physicianName(), + nullsLast(naturalOrder())); + case STATUS -> + comparing( + e -> e.status() == null ? null : e.status().name(), nullsLast(naturalOrder())); + case NEXTAPPOINTMENT -> + comparing( + e -> e.nextAppointment() == null ? null : e.nextAppointment(), + nullsLast(naturalOrder())); + default -> throw new BadRequestException("invalid sort param: " + sortKey); + // TODO Implement sorting for medical opinion state when the attribute is created + }; + if (paginationAndSortParameters.sortDirection() == SortDirection.DESC) { + comparator = comparator.reversed(); + } + + return comparator; } @Transactional @@ -219,7 +421,7 @@ public class EmployeeOmsProcedureService { public void closeOpenProcedure(UUID externalID) { OmsProcedure omsProcedure = loadOmsProcedureForUpdate(externalID); - if (omsProcedure.getProcedureStatus() == ProcedureStatus.CLOSED) { + if (omsProcedure.isFinalized()) { throw new BadRequestException("Procedure is already in CLOSED status"); } if (omsProcedure.getProcedureStatus() != ProcedureStatus.OPEN) { @@ -236,19 +438,20 @@ public class EmployeeOmsProcedureService { UUID externalId, PatchAffectedPersonRequest patchAffectedPersonRequest) { OmsProcedure omsProcedure = loadOmsProcedureForUpdate(externalId); - if (omsProcedure.getProcedureStatus() == ProcedureStatus.CLOSED) { + if (omsProcedure.isFinalized()) { throw new BadRequestException("Affected person can not be edited in CLOSED status"); } Person person = omsProcedure.findAffectedPerson(); ValidationUtil.validateVersion(patchAffectedPersonRequest.affectedPerson().version(), person); + UUID previousFileStateId = person.getCentralFileStateId(); AddPersonFileStateResponse baseResponse; try { baseResponse = personClient.updatePersonFileStateAndReference( - person.getCentralFileStateId(), + previousFileStateId, PersonMapper.mapToUpdatePersonRequest(patchAffectedPersonRequest.affectedPerson())); } catch (BadRequestException e) { if (!"Matching reference Person already exists".equals(e.getMessage())) { @@ -261,22 +464,26 @@ public class EmployeeOmsProcedureService { } person.setCentralFileStateId(baseResponse.id()); + + progressEntryService.createProgressEntryForUpdateAffectedPerson( + omsProcedure, previousFileStateId); } @Transactional public void syncAffectedPerson(UUID externalId, SyncAffectedPersonRequest request) { OmsProcedure procedure = loadOmsProcedureForUpdate(externalId); - if (procedure.getProcedureStatus() == ProcedureStatus.CLOSED) { + if (procedure.isFinalized()) { throw new BadRequestException("Affected person can not be synced in CLOSED status"); } Person person = procedure.getRelatedPersons().getFirst(); + UUID currentFileStateId = person.getCentralFileStateId(); UUID updateFileStateId = - personClient.syncAffectedPerson(person.getCentralFileStateId(), request.referenceVersion()); + personClient.syncAffectedPerson(currentFileStateId, request.referenceVersion()); person.setCentralFileStateId(updateFileStateId); - progressEntryService.createProgressEntryForSyncAffectedPerson(procedure); + progressEntryService.createProgressEntryForSyncAffectedPerson(procedure, currentFileStateId); } @Transactional @@ -305,7 +512,7 @@ public class EmployeeOmsProcedureService { public void updateFacility(UUID externalId, PatchEmployeeOmsProcedureFacilityRequest request) { OmsProcedure procedure = loadOmsProcedureForUpdate(externalId); - if (procedure.getProcedureStatus() == ProcedureStatus.CLOSED) { + if (procedure.isFinalized()) { throw new BadRequestException("Facility can not be edited in CLOSED status"); } if (procedure.getProcedureStatus() != ProcedureStatus.DRAFT) { @@ -341,7 +548,7 @@ public class EmployeeOmsProcedureService { public void syncFacilityData(UUID externalId, SyncFacilityRequest request) { OmsProcedure procedure = loadOmsProcedureForUpdate(externalId); - if (procedure.getProcedureStatus() == ProcedureStatus.CLOSED) { + if (procedure.isFinalized()) { throw new BadRequestException("Facility can not be synced in CLOSED status"); } if (procedure.getProcedureStatus() != ProcedureStatus.DRAFT) { @@ -365,7 +572,7 @@ public class EmployeeOmsProcedureService { public UUID modifyPhysician(UUID externalId, PatchEmployeeOmsProcedurePhysicianRequest request) { OmsProcedure procedure = loadOmsProcedure(externalId); - if (procedure.getProcedureStatus() == ProcedureStatus.CLOSED) { + if (procedure.isFinalized()) { throw new BadRequestException("A physician can not be set in CLOSED status"); } @@ -382,7 +589,7 @@ public class EmployeeOmsProcedureService { public void updateOmsProcedureConcern(UUID externalId, PatchConcernRequest request) { OmsProcedure omsProcedure = loadOmsProcedureForUpdate(externalId); - if (omsProcedure.getProcedureStatus() == ProcedureStatus.CLOSED) { + if (omsProcedure.isFinalized()) { throw new BadRequestException("Concern can not be edited in CLOSED status"); } if (omsProcedure.getProcedureStatus() != ProcedureStatus.DRAFT) { @@ -470,6 +677,14 @@ public class EmployeeOmsProcedureService { .collect(Collectors.toMap(GetFacilityFileStateResponse::id, facility -> facility)); } + private Map<UUID, Long> getIdMap(List<OmsProcedure> omsProcedures) { + Map<UUID, Long> map = new HashMap<>(); + for (OmsProcedure omsProcedure : omsProcedures) { + map.put(omsProcedure.getExternalId(), omsProcedure.getId()); + } + return map; + } + private GetPersonFileStateResponse getPersonForOmsProcedure( OmsProcedure omsProcedure, Map<UUID, GetPersonFileStateResponse> personMap) { if (omsProcedure.findAffectedPerson() == null) { diff --git a/backend/official-medical-service/src/main/java/de/eshg/officialmedicalservice/procedure/EmployeeOmsProcedureSpecification.java b/backend/official-medical-service/src/main/java/de/eshg/officialmedicalservice/procedure/EmployeeOmsProcedureSpecification.java deleted file mode 100644 index cfcba8749..000000000 --- a/backend/official-medical-service/src/main/java/de/eshg/officialmedicalservice/procedure/EmployeeOmsProcedureSpecification.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright 2025 cronn GmbH - * SPDX-License-Identifier: Apache-2.0 - */ - -package de.eshg.officialmedicalservice.procedure; - -import de.eshg.base.PaginationParameters; -import de.eshg.base.SortDirection; -import de.eshg.officialmedicalservice.procedure.api.EmployeeOmsProcedurePaginationAndSortParameters; -import de.eshg.officialmedicalservice.procedure.api.EmployeeOmsProcedureSortKey; -import de.eshg.officialmedicalservice.procedure.persistence.entity.OmsProcedure; -import de.eshg.officialmedicalservice.procedure.persistence.entity.OmsProcedure_; -import jakarta.persistence.criteria.CriteriaBuilder; -import jakarta.persistence.criteria.CriteriaQuery; -import jakarta.persistence.criteria.Order; -import jakarta.persistence.criteria.Path; -import jakarta.persistence.criteria.Predicate; -import jakarta.persistence.criteria.Root; -import java.io.Serial; -import java.util.stream.Stream; -import org.springframework.data.domain.PageRequest; -import org.springframework.data.domain.Pageable; -import org.springframework.data.jpa.domain.Specification; - -public class EmployeeOmsProcedureSpecification implements Specification<OmsProcedure> { - - @Serial private static final long serialVersionUID = 1L; - - private final SortDirection sortDirection; - private final EmployeeOmsProcedureSortKey sortKey; - - public EmployeeOmsProcedureSpecification( - EmployeeOmsProcedurePaginationAndSortParameters paginationAndSortParameters) { - sortKey = paginationAndSortParameters.sortKeyOrFallback(EmployeeOmsProcedureSortKey.ID); - sortDirection = paginationAndSortParameters.sortDirectionOrFallback(SortDirection.ASC); - } - - static Pageable toPageSpec(PaginationParameters paginationParameters) { - return PageRequest.of( - paginationParameters.pageNumberOrFallback(0), paginationParameters.pageSizeOrFallback(10)); - } - - @Override - public Predicate toPredicate( - Root<OmsProcedure> root, CriteriaQuery<?> query, CriteriaBuilder cb) { - query.orderBy( - Stream.of(getPrimarySortOrder(cb, root), cb.asc(root.get(OmsProcedure_.id))) - .distinct() - .toList()); - - return cb.and(); - } - - private Order getPrimarySortOrder(CriteriaBuilder cb, Root<OmsProcedure> root) { - Path<?> sortPath = mapToSortPath(root); - return switch (sortDirection) { - case ASC -> cb.asc(sortPath); - case DESC -> cb.desc(sortPath); - }; - } - - private Path<?> mapToSortPath(Root<OmsProcedure> root) { - return switch (sortKey) { - case ID -> root.get(OmsProcedure_.id); - }; - } -} diff --git a/backend/official-medical-service/src/main/java/de/eshg/officialmedicalservice/procedure/OmsProcedureOverviewMapper.java b/backend/official-medical-service/src/main/java/de/eshg/officialmedicalservice/procedure/OmsProcedureOverviewMapper.java index 359ce68f3..d4f915c27 100644 --- a/backend/official-medical-service/src/main/java/de/eshg/officialmedicalservice/procedure/OmsProcedureOverviewMapper.java +++ b/backend/official-medical-service/src/main/java/de/eshg/officialmedicalservice/procedure/OmsProcedureOverviewMapper.java @@ -73,7 +73,8 @@ public class OmsProcedureOverviewMapper { OmsProcedure procedure, GetPersonFileStateResponse affectedPerson, GetFacilityFileStateResponse facility, - UserDto physician) { + UserDto physician, + Instant nextAppointment) { String firstName = null; String lastName = null; LocalDate dateOfBirth = null; @@ -98,6 +99,7 @@ public class OmsProcedureOverviewMapper { dateOfBirth, facilityName, ConcernMapper.mapToConcernDto(procedure.getConcern()), - physicianName); + physicianName, + nextAppointment); } } diff --git a/backend/official-medical-service/src/main/java/de/eshg/officialmedicalservice/procedure/OmsProgressEntryType.java b/backend/official-medical-service/src/main/java/de/eshg/officialmedicalservice/procedure/OmsProgressEntryType.java index 6e06ee101..c947331e2 100644 --- a/backend/official-medical-service/src/main/java/de/eshg/officialmedicalservice/procedure/OmsProgressEntryType.java +++ b/backend/official-medical-service/src/main/java/de/eshg/officialmedicalservice/procedure/OmsProgressEntryType.java @@ -6,6 +6,7 @@ package de.eshg.officialmedicalservice.procedure; public enum OmsProgressEntryType { + UPDATE_AFFECTED_PERSON, SYNC_AFFECTED_PERSON, SYNC_FACILITY, PHYSICIAN_CHANGED, diff --git a/backend/official-medical-service/src/main/java/de/eshg/officialmedicalservice/procedure/ProgressEntryService.java b/backend/official-medical-service/src/main/java/de/eshg/officialmedicalservice/procedure/ProgressEntryService.java index b89589f67..6d85cca93 100644 --- a/backend/official-medical-service/src/main/java/de/eshg/officialmedicalservice/procedure/ProgressEntryService.java +++ b/backend/official-medical-service/src/main/java/de/eshg/officialmedicalservice/procedure/ProgressEntryService.java @@ -13,6 +13,7 @@ import de.eshg.lib.procedure.domain.model.TriggerType; import de.eshg.officialmedicalservice.procedure.persistence.entity.OmsProcedure; import java.time.Clock; import java.time.format.DateTimeFormatter; +import java.util.UUID; import org.springframework.stereotype.Service; @Service @@ -29,11 +30,23 @@ public class ProgressEntryService { this.userApi = userApi; } - public void createProgressEntryForSyncAffectedPerson(OmsProcedure procedure) { + public void createProgressEntryForUpdateAffectedPerson( + OmsProcedure procedure, UUID previousFileStateId) { + SystemProgressEntry progressEntry = + SystemProgressEntryFactory.createSystemProgressEntry( + OmsProgressEntryType.UPDATE_AFFECTED_PERSON.name(), TriggerType.SYSTEM_AUTOMATIC); + progressEntry.setProcedureId(procedure.getId()); + progressEntry.setPreviousFileStateId(previousFileStateId); + procedure.addProgressEntry(progressEntry); + } + + public void createProgressEntryForSyncAffectedPerson( + OmsProcedure procedure, UUID previousFileStateId) { SystemProgressEntry progressEntry = SystemProgressEntryFactory.createSystemProgressEntry( OmsProgressEntryType.SYNC_AFFECTED_PERSON.name(), TriggerType.SYSTEM_AUTOMATIC); progressEntry.setProcedureId(procedure.getId()); + progressEntry.setPreviousFileStateId(previousFileStateId); procedure.addProgressEntry(progressEntry); } diff --git a/backend/official-medical-service/src/main/java/de/eshg/officialmedicalservice/procedure/api/EmployeeOmsProcedureOverviewDto.java b/backend/official-medical-service/src/main/java/de/eshg/officialmedicalservice/procedure/api/EmployeeOmsProcedureOverviewDto.java index 367c37367..b2e1824d7 100644 --- a/backend/official-medical-service/src/main/java/de/eshg/officialmedicalservice/procedure/api/EmployeeOmsProcedureOverviewDto.java +++ b/backend/official-medical-service/src/main/java/de/eshg/officialmedicalservice/procedure/api/EmployeeOmsProcedureOverviewDto.java @@ -9,6 +9,7 @@ import de.eshg.lib.procedure.model.ProcedureStatusDto; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.Valid; import jakarta.validation.constraints.NotNull; +import java.time.Instant; import java.time.LocalDate; import java.util.UUID; @@ -21,4 +22,5 @@ public record EmployeeOmsProcedureOverviewDto( LocalDate dateOfBirth, String facilityName, @Valid ConcernDto concern, - String physicianName) {} + String physicianName, + Instant nextAppointment) {} diff --git a/backend/official-medical-service/src/main/java/de/eshg/officialmedicalservice/procedure/api/EmployeeOmsProcedureSortKey.java b/backend/official-medical-service/src/main/java/de/eshg/officialmedicalservice/procedure/api/EmployeeOmsProcedureSortKey.java index d78e01663..a99cd9847 100644 --- a/backend/official-medical-service/src/main/java/de/eshg/officialmedicalservice/procedure/api/EmployeeOmsProcedureSortKey.java +++ b/backend/official-medical-service/src/main/java/de/eshg/officialmedicalservice/procedure/api/EmployeeOmsProcedureSortKey.java @@ -7,4 +7,11 @@ package de.eshg.officialmedicalservice.procedure.api; public enum EmployeeOmsProcedureSortKey { ID, + FIRSTNAME, + LASTNAME, + DATEOFBIRTH, + FACILITYNAME, + PHYSICIANNAME, + STATUS, + NEXTAPPOINTMENT, } diff --git a/backend/official-medical-service/src/main/java/de/eshg/officialmedicalservice/procedure/api/GetOmsProceduresFilterOptionsDto.java b/backend/official-medical-service/src/main/java/de/eshg/officialmedicalservice/procedure/api/GetOmsProceduresFilterOptionsDto.java new file mode 100644 index 000000000..5735965de --- /dev/null +++ b/backend/official-medical-service/src/main/java/de/eshg/officialmedicalservice/procedure/api/GetOmsProceduresFilterOptionsDto.java @@ -0,0 +1,14 @@ +/* + * Copyright 2025 cronn GmbH + * SPDX-License-Identifier: Apache-2.0 + */ + +package de.eshg.officialmedicalservice.procedure.api; + +import de.eshg.lib.procedure.model.ProcedureStatusDto; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.Set; + +@Schema(name = "GetOmsProceduresFilterOptions") +public record GetOmsProceduresFilterOptionsDto( + Boolean assigned, Set<ProcedureStatusDto> status, Boolean highPriority, Boolean today) {} diff --git a/backend/official-medical-service/src/main/java/de/eshg/officialmedicalservice/procedure/persistence/entity/OmsProcedureView.java b/backend/official-medical-service/src/main/java/de/eshg/officialmedicalservice/procedure/persistence/entity/OmsProcedureView.java new file mode 100644 index 000000000..8ee300552 --- /dev/null +++ b/backend/official-medical-service/src/main/java/de/eshg/officialmedicalservice/procedure/persistence/entity/OmsProcedureView.java @@ -0,0 +1,15 @@ +/* + * Copyright 2025 cronn GmbH + * SPDX-License-Identifier: Apache-2.0 + */ + +package de.eshg.officialmedicalservice.procedure.persistence.entity; + +import de.eshg.officialmedicalservice.appointment.persistence.entity.OmsAppointment; +import jakarta.annotation.Nullable; +import jakarta.validation.constraints.NotNull; + +public record OmsProcedureView( + @NotNull OmsProcedure procedure, + @Nullable Concern concern, + @Nullable OmsAppointment appointment) {} diff --git a/backend/official-medical-service/src/main/java/de/eshg/officialmedicalservice/user/UserClient.java b/backend/official-medical-service/src/main/java/de/eshg/officialmedicalservice/user/UserClient.java index 8e4f46934..a72d897a5 100644 --- a/backend/official-medical-service/src/main/java/de/eshg/officialmedicalservice/user/UserClient.java +++ b/backend/official-medical-service/src/main/java/de/eshg/officialmedicalservice/user/UserClient.java @@ -79,4 +79,8 @@ public class UserClient { Collectors.toMap( UserDto::userId, valueMapper, (key, conflictingKey) -> key, LinkedHashMap::new)); } + + public UserDto getSelfUser() { + return userApi.getSelfUser(); + } } diff --git a/backend/official-medical-service/src/main/resources/gdpr-legal-basis-text.txt b/backend/official-medical-service/src/main/resources/gdpr-legal-basis-text.txt new file mode 100644 index 000000000..e69de29bb diff --git a/backend/school-entry/openApi.yaml b/backend/school-entry/openApi.yaml index 025ddd5fc..002372142 100644 --- a/backend/school-entry/openApi.yaml +++ b/backend/school-entry/openApi.yaml @@ -100,6 +100,12 @@ paths: schema: type: string format: date-time + - in: query + name: physicianId + required: false + schema: + type: string + format: uuid responses: "200": content: diff --git a/backend/school-entry/src/main/java/de/eshg/schoolentry/SchoolEntryCitizenService.java b/backend/school-entry/src/main/java/de/eshg/schoolentry/SchoolEntryCitizenService.java index 33a3817ee..2c6412013 100644 --- a/backend/school-entry/src/main/java/de/eshg/schoolentry/SchoolEntryCitizenService.java +++ b/backend/school-entry/src/main/java/de/eshg/schoolentry/SchoolEntryCitizenService.java @@ -128,6 +128,7 @@ public class SchoolEntryCitizenService { appointmentBlockSlotUtil.updateAppointment( appointmentType, schoolEntryService.getAppointmentLocation(schoolEntryProcedure), + null, schoolEntryProcedure, start, end); diff --git a/backend/school-entry/src/main/java/de/eshg/schoolentry/SchoolEntryController.java b/backend/school-entry/src/main/java/de/eshg/schoolentry/SchoolEntryController.java index ca16c9c4b..39fca257b 100644 --- a/backend/school-entry/src/main/java/de/eshg/schoolentry/SchoolEntryController.java +++ b/backend/school-entry/src/main/java/de/eshg/schoolentry/SchoolEntryController.java @@ -19,6 +19,7 @@ import de.eshg.lib.procedure.api.ProcedureSearchParameters; import de.eshg.lib.procedure.domain.model.Pdf; import de.eshg.lib.procedure.domain.model.TaskType; import de.eshg.lib.procedure.util.ProcedureValidator; +import de.eshg.rest.service.error.BadRequestException; import de.eshg.rest.service.security.CurrentUserHelper; import de.eshg.rest.service.security.config.BaseUrls; import de.eshg.schoolentry.api.*; @@ -507,6 +508,13 @@ public class SchoolEntryController { SchoolEntryProcedure procedure = schoolEntryService.findProcedureByExternalId(procedureId); ProcedureValidator.validateProcedureStatusNotClosed(procedure); + List<RequiredProcedureData> validationResult = + SchoolInfoLetterValidator.validateSchoolEntryProcedure(procedure); + if (!validationResult.isEmpty()) { + throw new BadRequestException( + "School entry procedure is not complete.", + "Incomplete areas: %s".formatted(validationResult)); + } ProcedureDetailsData procedureDetailsData = schoolEntryService.augmentWithDetails(procedure); Pdf pdf = @@ -554,17 +562,10 @@ public class SchoolEntryController { @PathVariable("procedureId") UUID procedureId) { SchoolEntryProcedure procedure = schoolEntryService.findProcedureByExternalId(procedureId); - Map<RequiredProcedureData, Boolean> validationResult = + List<RequiredProcedureData> validationResult = SchoolInfoLetterValidator.validateSchoolEntryProcedure(procedure); - List<RequiredProcedureData> incompleteAreas = - validationResult.entrySet().stream() - .filter(entry -> !entry.getValue()) - .map(Map.Entry::getKey) - .sorted() - .toList(); - - return ResponseEntity.ok(new ValidateRequiredProcedureDataResponse(incompleteAreas)); + return ResponseEntity.ok(new ValidateRequiredProcedureDataResponse(validationResult)); } @GetMapping("/waiting-room-procedures") diff --git a/backend/school-entry/src/main/java/de/eshg/schoolentry/SchoolEntryGdprZipEditorProvider.java b/backend/school-entry/src/main/java/de/eshg/schoolentry/SchoolEntryGdprZipEditorProvider.java index 15d235e53..f899cbdcc 100644 --- a/backend/school-entry/src/main/java/de/eshg/schoolentry/SchoolEntryGdprZipEditorProvider.java +++ b/backend/school-entry/src/main/java/de/eshg/schoolentry/SchoolEntryGdprZipEditorProvider.java @@ -19,14 +19,16 @@ import de.eshg.schoolentry.domain.model.SchoolEntryProcedure_; import de.eshg.schoolentry.domain.model.SopessExaminationResult_; import de.eshg.schoolentry.domain.model.WaitingRoom_; import java.util.List; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.core.io.Resource; import org.springframework.stereotype.Component; @Component public class SchoolEntryGdprZipEditorProvider extends AbstractGdprZipEditorProvider { - @Override - protected String getLegalBasisAppendix() { - return "Hier könnte Ihr Rechtsgrundlagen-Anhang stehen!"; + public SchoolEntryGdprZipEditorProvider( + @Value("classpath:/gdpr-legal-basis-text.txt") Resource resource) { + super(resource); } @Override diff --git a/backend/school-entry/src/main/java/de/eshg/schoolentry/SchoolEntryService.java b/backend/school-entry/src/main/java/de/eshg/schoolentry/SchoolEntryService.java index 38c32a7ef..7864ab03a 100644 --- a/backend/school-entry/src/main/java/de/eshg/schoolentry/SchoolEntryService.java +++ b/backend/school-entry/src/main/java/de/eshg/schoolentry/SchoolEntryService.java @@ -9,7 +9,6 @@ import static de.eshg.schoolentry.population.CreateLabelsTask.SPECIAL_NEEDS_LABE import static de.eshg.schoolentry.util.SchoolEntrySystemProgressEntryType.*; import static java.util.Comparator.comparing; -import de.cronn.commons.lang.StreamUtil; import de.eshg.base.citizenuser.CitizenAccessCodeUserApi; import de.eshg.base.citizenuser.api.AddCitizenAccessCodeUserWithDateOfBirthCredentialRequest; import de.eshg.base.citizenuser.api.CitizenAccessCodeUserDto; @@ -113,16 +112,28 @@ public class SchoolEntryService { } public SchoolEntryProcedure createProcedure(CreateProcedureRequest request) { - return createProceduresWithBookAppointmentTask( - List.of( - new ImportProcedureData( - request.child(), ProcedureMapper.mapToDomain(request.type()))), + UUID createdId = personClient.createPersonInCentralFile(request.child()); + + SchoolEntryProcedure createdProcedure = + saveSchoolEntryProcedure( + createdId, + List.of(), + ProcedureMapper.mapToDomain(request.type()), null, null, null, - DataOrigin.MANUAL_CREATION) - .stream() - .collect(StreamUtil.toSingleElement()); + false, + null, + ProcedureStatus.OPEN, + new Anamnesis(), + new VaccinationStatus(), + new EyeExaminationResult(), + new HearingTestResult(), + new SopessExaminationResult(), + new DevelopmentScreening()); + + taskUtil.addOpenTaskOfType(createdProcedure, TaskType.BOOK_APPOINTMENT); + return createdProcedure; } public List<SchoolEntryProcedure> createProceduresWithBookAppointmentTask( @@ -453,7 +464,7 @@ public class SchoolEntryService { List<AppointmentDto> freeAppointments = appointmentBlockService.getFreeAppointments( - earliestStart, latestStart, appointmentType, appointmentLocationId); + earliestStart, latestStart, appointmentType, appointmentLocationId, null); Appointment persistedAppointment = procedure.getAppointment(); if (persistedAppointment != null && returnCurrentAppointment) { @@ -535,7 +546,8 @@ public class SchoolEntryService { && locationId == null) { throw new BadRequestException("Appointment location is missing at procedure."); } - appointmentBlockSlotUtil.updateAppointment(appointmentType, locationId, procedure, start, end); + appointmentBlockSlotUtil.updateAppointment( + appointmentType, locationId, null, procedure, start, end); CitizenAccessCodeUserDto citizenAccessCodeUser = createOrGetCitizenAccessCodeUser(procedure); String accessCode = citizenAccessCodeUser.accessCode(); diff --git a/backend/school-entry/src/main/java/de/eshg/schoolentry/business/model/ImportProcedureData.java b/backend/school-entry/src/main/java/de/eshg/schoolentry/business/model/ImportProcedureData.java index 4b2252033..65b0be813 100644 --- a/backend/school-entry/src/main/java/de/eshg/schoolentry/business/model/ImportProcedureData.java +++ b/backend/school-entry/src/main/java/de/eshg/schoolentry/business/model/ImportProcedureData.java @@ -19,10 +19,6 @@ public record ImportProcedureData( boolean isEarlyExamination, boolean hasInformationBlock) { - public ImportProcedureData(CreatePersonDto child, ProcedureType procedureType) { - this(child, procedureType, null, false, false, false); - } - public ImportProcedureData( CreatePersonDto child, ProcedureType procedureType, diff --git a/backend/school-entry/src/main/java/de/eshg/schoolentry/client/PersonClient.java b/backend/school-entry/src/main/java/de/eshg/schoolentry/client/PersonClient.java index 6561b60d3..6346fcf51 100644 --- a/backend/school-entry/src/main/java/de/eshg/schoolentry/client/PersonClient.java +++ b/backend/school-entry/src/main/java/de/eshg/schoolentry/client/PersonClient.java @@ -105,7 +105,9 @@ public class PersonClient { public UUID createPersonInCentralFile(CreatePersonDto personDetailsData) { AddPersonFileStateRequest request = new AddPersonFileStateRequest( - PersonMapper.mapToPersonDetailsDto(personDetailsData), DataOriginDto.MANUAL); + personDetailsData.referenceId(), + PersonMapper.mapToPersonDetailsDto(personDetailsData), + DataOriginDto.MANUAL); log.info("Creating person in the central file"); diff --git a/backend/school-entry/src/main/java/de/eshg/schoolentry/pdf/schoolinfoletter/SchoolInfoLetterValidator.java b/backend/school-entry/src/main/java/de/eshg/schoolentry/pdf/schoolinfoletter/SchoolInfoLetterValidator.java index 8b719fcfd..6f69e6de3 100644 --- a/backend/school-entry/src/main/java/de/eshg/schoolentry/pdf/schoolinfoletter/SchoolInfoLetterValidator.java +++ b/backend/school-entry/src/main/java/de/eshg/schoolentry/pdf/schoolinfoletter/SchoolInfoLetterValidator.java @@ -23,7 +23,7 @@ public class SchoolInfoLetterValidator { private SchoolInfoLetterValidator() {} - public static Map<RequiredProcedureData, Boolean> validateSchoolEntryProcedure( + public static List<RequiredProcedureData> validateSchoolEntryProcedure( SchoolEntryProcedure procedure) { Map<RequiredProcedureData, Boolean> result = new HashMap<>(); @@ -93,7 +93,11 @@ public class SchoolInfoLetterValidator { || type != null, Stream.of(DevelopmentScreening::getDisabilityType))); - return result; + return result.entrySet().stream() + .filter(entry -> !entry.getValue()) + .map(Map.Entry::getKey) + .sorted() + .toList(); } private static <T extends ValidatableEntity> boolean validate(T validatableEntity) { diff --git a/backend/school-entry/src/main/resources/gdpr-legal-basis-text.txt b/backend/school-entry/src/main/resources/gdpr-legal-basis-text.txt new file mode 100644 index 000000000..1a963874a --- /dev/null +++ b/backend/school-entry/src/main/resources/gdpr-legal-basis-text.txt @@ -0,0 +1,13 @@ +Die Datenverarbeitung basiert auf Grundlage des Art. 6 Abs. 1c und 1e DSGVO und Art. 9 Abs. 2h DSGVO in Verbindung mit + +Hessisches Gesetz über den öffentlichen Gesundheitsdienst (HGöGD) § 10 + +Hessisches Schulgesetz (HSchulG) §§ 71, § 83 insbesondere Abs. 7, § 149 + +Infektionsschutzgesetz (IfSG) § 34 Abs. 11 + +Hessische Verordnung über die Zulassung und die Ausgestaltung von Untersuchungen und Maßnahmen der Schulgesundheitspflege (Schulgesundheitspflege-Verordnung, SchulGesPflV HE) § 1. Nr. 9, § 2 + +Hessisches Kindergesundheitsschutz-Gesetz (KiGesSchG HE) § 2 + +Die Bereitstellung der personenbezogenen Daten ist für Einschulungsuntersuchungen gesetzlich vorgeschrieben und die betroffene Person ist verpflichtet personenbezogene Daten bereitzustellen. Sollten uns die Daten nicht zur Verfügung gestellt werden, kann keine kinder- und jugendmedizinische Untersuchung durchgeführt werden. Mit ihrer Einwilligung (Art. 6 Abs. 1a und Art. 9 Abs. 2a DSGVO) werden personenbezogene Daten/Befunde bei niedergelassenen Kinderärzten, Kliniken, Therapeuten oder Sozialpädiatrischen Zentren eingeholt. diff --git a/backend/service-directory/data/postgres/docker-compose.yml b/backend/service-directory/data/postgres/docker-compose.yml index b5c2483e3..a272e3245 100644 --- a/backend/service-directory/data/postgres/docker-compose.yml +++ b/backend/service-directory/data/postgres/docker-compose.yml @@ -4,7 +4,7 @@ services: postgres: container_name: servicedirectory_db - image: 'postgres:16.3@sha256:d0f363f8366fbc3f52d172c6e76bc27151c3d643b870e1062b4e8bfe65baf609' + image: 'postgres:15.8@sha256:eb3747f5d0a92195ca486d2f15d9a4ee5e9461b0332fe87fbc59069490a5c659' ports: - 5437:5432 environment: diff --git a/backend/statistics/src/main/java/de/eshg/statistics/config/AutoReportSeriesConfig.java b/backend/statistics/src/main/java/de/eshg/statistics/config/AutoReportSeriesConfig.java deleted file mode 100644 index c6dcab82f..000000000 --- a/backend/statistics/src/main/java/de/eshg/statistics/config/AutoReportSeriesConfig.java +++ /dev/null @@ -1,13 +0,0 @@ -/* - * Copyright 2025 cronn GmbH - * SPDX-License-Identifier: AGPL-3.0-only - */ - -package de.eshg.statistics.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.scheduling.annotation.EnableScheduling; - -@Configuration -@EnableScheduling -public class AutoReportSeriesConfig {} diff --git a/backend/sti-protection/openApi.yaml b/backend/sti-protection/openApi.yaml index 6da07aabf..1640dd223 100644 --- a/backend/sti-protection/openApi.yaml +++ b/backend/sti-protection/openApi.yaml @@ -100,6 +100,12 @@ paths: schema: type: string format: date-time + - in: query + name: physicianId + required: false + schema: + type: string + format: uuid responses: "200": content: @@ -1634,6 +1640,106 @@ paths: summary: Get the printable document for sexwork in EN locale. tags: - MedicalHistoryDocument + /sti-procedures/text-templates: + get: + operationId: getTextTemplates + parameters: + - description: | + Filter logic: + - If 'context' is submitted, only text templates are returned which belong to one of the provided contexts. + - If no 'context' is submitted, no filtering takes place. + in: query + name: context + required: false + schema: + type: array + items: + $ref: "#/components/schemas/TextTemplateContext" + uniqueItems: true + responses: + "200": + content: + '*/*': + schema: + $ref: "#/components/schemas/GetTextTemplatesResponse" + description: OK + summary: Get a list of text templates + tags: + - TextTemplate + post: + operationId: createTextTemplate + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/CreateTextTemplateRequest" + required: true + responses: + "200": + content: + '*/*': + schema: + $ref: "#/components/schemas/CreateTextTemplateResponse" + description: OK + summary: Create a new text template + tags: + - TextTemplate + /sti-procedures/text-templates/{textTemplateId}: + delete: + operationId: deleteTextTemplate + parameters: + - in: path + name: textTemplateId + required: true + schema: + type: string + format: uuid + responses: + "200": + description: OK + summary: Delete an existing text template + tags: + - TextTemplate + get: + operationId: getTextTemplate + parameters: + - in: path + name: textTemplateId + required: true + schema: + type: string + format: uuid + responses: + "200": + content: + '*/*': + schema: + $ref: "#/components/schemas/TextTemplate" + description: OK + summary: Get an existing text template + tags: + - TextTemplate + put: + operationId: updateTextTemplate + parameters: + - in: path + name: textTemplateId + required: true + schema: + type: string + format: uuid + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/TextTemplate" + required: true + responses: + "200": + description: OK + summary: Update an existing text template + tags: + - TextTemplate /sti-procedures/waiting-room-procedures: get: operationId: getWaitingRoomProcedures @@ -3387,6 +3493,27 @@ components: required: - pin - procedureId + CreateTextTemplateRequest: + type: object + properties: + content: + type: string + context: + $ref: "#/components/schemas/TextTemplateContext" + name: + type: string + required: + - content + - context + - name + CreateTextTemplateResponse: + type: object + properties: + textTemplateId: + type: string + format: uuid + required: + - textTemplateId DataOrigin: type: string description: "A list of possible origins of Persons and Facility in the Central\ @@ -4528,6 +4655,15 @@ components: enum: - ASC - DESC + GetTextTemplatesResponse: + type: object + properties: + textTemplates: + type: array + items: + $ref: "#/components/schemas/TextTemplate" + required: + - textTemplates GetWaitingRoomProceduresResponse: type: object properties: @@ -6092,6 +6228,32 @@ components: - P24 - PCR - OTHER + TextTemplate: + type: object + properties: + content: + type: string + context: + $ref: "#/components/schemas/TextTemplateContext" + externalId: + type: string + format: uuid + name: + type: string + required: + - content + - context + - externalId + - name + TextTemplateContext: + type: string + enum: + - CONSULTATION_REASON + - CONSULTATION_REMARK + - RAPID_TESTS_REMARK + - LABORATORY_TESTS_REMARK + - DIAGNOSIS_RESULT + - DIAGNOSIS_REMARK Title: type: string enum: diff --git a/backend/sti-protection/src/main/java/de/eshg/stiprotection/AppointmentService.java b/backend/sti-protection/src/main/java/de/eshg/stiprotection/AppointmentService.java index 6037315bf..219b9ff11 100644 --- a/backend/sti-protection/src/main/java/de/eshg/stiprotection/AppointmentService.java +++ b/backend/sti-protection/src/main/java/de/eshg/stiprotection/AppointmentService.java @@ -92,7 +92,7 @@ public class AppointmentService { private void bookBlockAppointment( StiProtectionProcedure procedure, AppointmentType type, Instant start, Instant end) { procedure.setUserDefinedAppointment(null); - appointmentBlockSlotUtil.updateAppointment(type, null, procedure, start, end); + appointmentBlockSlotUtil.updateAppointment(type, null, null, procedure, start, end); createAppointmentCalendarEvent(procedure, start, end); } diff --git a/backend/sti-protection/src/main/java/de/eshg/stiprotection/TextTemplateController.java b/backend/sti-protection/src/main/java/de/eshg/stiprotection/TextTemplateController.java new file mode 100644 index 000000000..b839ff0e5 --- /dev/null +++ b/backend/sti-protection/src/main/java/de/eshg/stiprotection/TextTemplateController.java @@ -0,0 +1,89 @@ +/* + * Copyright 2025 cronn GmbH + * SPDX-License-Identifier: AGPL-3.0-only + */ + +package de.eshg.stiprotection; + +import static de.eshg.lib.procedure.MapperHelper.mapEnumSet; + +import de.eshg.api.commons.InlineParameterObject; +import de.eshg.rest.service.security.config.BaseUrls; +import de.eshg.stiprotection.api.texttemplate.CreateTextTemplateRequest; +import de.eshg.stiprotection.api.texttemplate.CreateTextTemplateResponse; +import de.eshg.stiprotection.api.texttemplate.GetTextTemplatesFilterOptions; +import de.eshg.stiprotection.api.texttemplate.GetTextTemplatesResponse; +import de.eshg.stiprotection.api.texttemplate.TextTemplateDto; +import de.eshg.stiprotection.mapper.texttemplate.TextTemplateContextMapper; +import de.eshg.stiprotection.mapper.texttemplate.TextTemplateMapper; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; +import java.util.UUID; +import org.springdoc.core.annotations.ParameterObject; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping(value = TextTemplateController.BASE_URL) +@Tag(name = "TextTemplate") +public class TextTemplateController { + public static final String BASE_URL = + BaseUrls.StiProtection.PROCEDURE_CONTROLLER + "/text-templates"; + + private final TextTemplateService textTemplateService; + + public TextTemplateController(TextTemplateService textTemplateService) { + this.textTemplateService = textTemplateService; + } + + @PostMapping + @Operation(summary = "Create a new text template") + @Transactional + public CreateTextTemplateResponse createTextTemplate( + @Valid @RequestBody CreateTextTemplateRequest request) { + return TextTemplateMapper.toInterface( + textTemplateService.createTextTemplate(TextTemplateMapper.toDatabase(request))); + } + + @GetMapping("/{textTemplateId}") + @Operation(summary = "Get an existing text template") + @Transactional(readOnly = true) + public TextTemplateDto getTextTemplate(@PathVariable("textTemplateId") UUID textTemplateId) { + return TextTemplateMapper.toInterfaceType(textTemplateService.getTextTemplate(textTemplateId)); + } + + @GetMapping + @Operation(summary = "Get a list of text templates") + @Transactional(readOnly = true) + public GetTextTemplatesResponse getTextTemplates( + @Valid @ParameterObject @InlineParameterObject GetTextTemplatesFilterOptions filterOptions) { + return TextTemplateMapper.toInterfaceType( + textTemplateService.getTextTemplates( + mapEnumSet(filterOptions.context(), TextTemplateContextMapper::toDatabaseType))); + } + + @PutMapping("/{textTemplateId}") + @Operation(summary = "Update an existing text template") + @Transactional + public void updateTextTemplate( + @PathVariable("textTemplateId") UUID textTemplateId, + @Valid @RequestBody TextTemplateDto textTemplateDto) { + textTemplateService.updateTextTemplate( + textTemplateId, TextTemplateMapper.toDatabaseType(textTemplateDto)); + } + + @DeleteMapping("/{textTemplateId}") + @Operation(summary = "Delete an existing text template") + @Transactional + public void deleteTextTemplate(@PathVariable("textTemplateId") UUID textTemplateId) { + textTemplateService.deleteTextTemplate(textTemplateId); + } +} diff --git a/backend/sti-protection/src/main/java/de/eshg/stiprotection/TextTemplateService.java b/backend/sti-protection/src/main/java/de/eshg/stiprotection/TextTemplateService.java new file mode 100644 index 000000000..0bc44e223 --- /dev/null +++ b/backend/sti-protection/src/main/java/de/eshg/stiprotection/TextTemplateService.java @@ -0,0 +1,68 @@ +/* + * Copyright 2025 cronn GmbH + * SPDX-License-Identifier: AGPL-3.0-only + */ + +package de.eshg.stiprotection; + +import de.eshg.rest.service.error.BadRequestException; +import de.eshg.stiprotection.persistence.db.texttemplate.TextTemplate; +import de.eshg.stiprotection.persistence.db.texttemplate.TextTemplateContext; +import de.eshg.stiprotection.persistence.db.texttemplate.TextTemplateRepository; +import de.eshg.stiprotection.persistence.db.texttemplate.TextTemplate_; +import java.util.List; +import java.util.Set; +import java.util.UUID; +import org.springframework.data.domain.Sort; +import org.springframework.data.jpa.domain.Specification; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +@Service +public class TextTemplateService { + + private final TextTemplateRepository textTemplateRepository; + + public TextTemplateService(TextTemplateRepository textTemplateRepository) { + this.textTemplateRepository = textTemplateRepository; + } + + public TextTemplate createTextTemplate(TextTemplate entity) { + return textTemplateRepository.save(entity); + } + + public TextTemplate getTextTemplate(UUID externalId) { + return textTemplateRepository + .findByExternalId(externalId) + .orElseThrow( + () -> + new BadRequestException( + "Text template with id: %s does not exist.".formatted(externalId))); + } + + public void updateTextTemplate(UUID externalId, TextTemplate newEntity) { + TextTemplate oldEntity = getTextTemplate(externalId); + oldEntity.setName(newEntity.getName()); + oldEntity.setContext(newEntity.getContext()); + oldEntity.setContent(newEntity.getContent()); + } + + public void deleteTextTemplate(UUID externalId) { + TextTemplate entity = getTextTemplate(externalId); + textTemplateRepository.delete(entity); + } + + public List<TextTemplate> getTextTemplates(Set<TextTemplateContext> contexts) { + Sort sortByNameAsc = Sort.by(Sort.Direction.ASC, TextTemplate_.NAME); + if (CollectionUtils.isEmpty(contexts)) { + return textTemplateRepository.findAll(sortByNameAsc); + } else { + return textTemplateRepository.findAll( + Specification.where(contextIsIn(contexts)), sortByNameAsc); + } + } + + private static Specification<TextTemplate> contextIsIn(Set<TextTemplateContext> contexts) { + return (root, query, criteriaBuilder) -> root.get(TextTemplate_.CONTEXT).in(contexts); + } +} diff --git a/backend/sti-protection/src/main/java/de/eshg/stiprotection/api/texttemplate/CreateTextTemplateRequest.java b/backend/sti-protection/src/main/java/de/eshg/stiprotection/api/texttemplate/CreateTextTemplateRequest.java new file mode 100644 index 000000000..f3fd681ad --- /dev/null +++ b/backend/sti-protection/src/main/java/de/eshg/stiprotection/api/texttemplate/CreateTextTemplateRequest.java @@ -0,0 +1,12 @@ +/* + * Copyright 2025 cronn GmbH + * SPDX-License-Identifier: AGPL-3.0-only + */ + +package de.eshg.stiprotection.api.texttemplate; + +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; + +public record CreateTextTemplateRequest( + @NotBlank String name, @NotNull TextTemplateContextDto context, @NotBlank String content) {} diff --git a/backend/sti-protection/src/main/java/de/eshg/stiprotection/api/texttemplate/CreateTextTemplateResponse.java b/backend/sti-protection/src/main/java/de/eshg/stiprotection/api/texttemplate/CreateTextTemplateResponse.java new file mode 100644 index 000000000..c2d25df25 --- /dev/null +++ b/backend/sti-protection/src/main/java/de/eshg/stiprotection/api/texttemplate/CreateTextTemplateResponse.java @@ -0,0 +1,11 @@ +/* + * Copyright 2025 cronn GmbH + * SPDX-License-Identifier: AGPL-3.0-only + */ + +package de.eshg.stiprotection.api.texttemplate; + +import jakarta.validation.constraints.NotNull; +import java.util.UUID; + +public record CreateTextTemplateResponse(@NotNull UUID textTemplateId) {} diff --git a/backend/sti-protection/src/main/java/de/eshg/stiprotection/api/texttemplate/GetTextTemplatesFilterOptions.java b/backend/sti-protection/src/main/java/de/eshg/stiprotection/api/texttemplate/GetTextTemplatesFilterOptions.java new file mode 100644 index 000000000..547e42ed4 --- /dev/null +++ b/backend/sti-protection/src/main/java/de/eshg/stiprotection/api/texttemplate/GetTextTemplatesFilterOptions.java @@ -0,0 +1,21 @@ +/* + * Copyright 2025 cronn GmbH + * SPDX-License-Identifier: AGPL-3.0-only + */ + +package de.eshg.stiprotection.api.texttemplate; + +import io.swagger.v3.oas.annotations.Parameter; +import java.util.Set; +import org.springframework.web.bind.annotation.BindParam; + +public record GetTextTemplatesFilterOptions( + @BindParam("context") + @Parameter( + description = + """ + Filter logic: + - If 'context' is submitted, only text templates are returned which belong to one of the provided contexts. + - If no 'context' is submitted, no filtering takes place. + """) + Set<TextTemplateContextDto> context) {} diff --git a/backend/sti-protection/src/main/java/de/eshg/stiprotection/api/texttemplate/GetTextTemplatesResponse.java b/backend/sti-protection/src/main/java/de/eshg/stiprotection/api/texttemplate/GetTextTemplatesResponse.java new file mode 100644 index 000000000..e73d6f725 --- /dev/null +++ b/backend/sti-protection/src/main/java/de/eshg/stiprotection/api/texttemplate/GetTextTemplatesResponse.java @@ -0,0 +1,12 @@ +/* + * Copyright 2025 cronn GmbH + * SPDX-License-Identifier: AGPL-3.0-only + */ + +package de.eshg.stiprotection.api.texttemplate; + +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import java.util.List; + +public record GetTextTemplatesResponse(@NotNull @Valid List<TextTemplateDto> textTemplates) {} diff --git a/backend/sti-protection/src/main/java/de/eshg/stiprotection/api/texttemplate/TextTemplateContextDto.java b/backend/sti-protection/src/main/java/de/eshg/stiprotection/api/texttemplate/TextTemplateContextDto.java new file mode 100644 index 000000000..1bbb08315 --- /dev/null +++ b/backend/sti-protection/src/main/java/de/eshg/stiprotection/api/texttemplate/TextTemplateContextDto.java @@ -0,0 +1,18 @@ +/* + * Copyright 2025 cronn GmbH + * SPDX-License-Identifier: AGPL-3.0-only + */ + +package de.eshg.stiprotection.api.texttemplate; + +import io.swagger.v3.oas.annotations.media.Schema; + +@Schema(name = "TextTemplateContext") +public enum TextTemplateContextDto { + CONSULTATION_REASON, + CONSULTATION_REMARK, + RAPID_TESTS_REMARK, + LABORATORY_TESTS_REMARK, + DIAGNOSIS_RESULT, + DIAGNOSIS_REMARK +} diff --git a/backend/sti-protection/src/main/java/de/eshg/stiprotection/api/texttemplate/TextTemplateDto.java b/backend/sti-protection/src/main/java/de/eshg/stiprotection/api/texttemplate/TextTemplateDto.java new file mode 100644 index 000000000..ce51225ca --- /dev/null +++ b/backend/sti-protection/src/main/java/de/eshg/stiprotection/api/texttemplate/TextTemplateDto.java @@ -0,0 +1,18 @@ +/* + * Copyright 2025 cronn GmbH + * SPDX-License-Identifier: AGPL-3.0-only + */ + +package de.eshg.stiprotection.api.texttemplate; + +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import java.util.UUID; + +@Schema(name = "TextTemplate") +public record TextTemplateDto( + @NotNull UUID externalId, + @NotBlank String name, + @NotNull TextTemplateContextDto context, + @NotBlank String content) {} diff --git a/backend/sti-protection/src/main/java/de/eshg/stiprotection/mapper/texttemplate/TextTemplateContextMapper.java b/backend/sti-protection/src/main/java/de/eshg/stiprotection/mapper/texttemplate/TextTemplateContextMapper.java new file mode 100644 index 000000000..a91c41a24 --- /dev/null +++ b/backend/sti-protection/src/main/java/de/eshg/stiprotection/mapper/texttemplate/TextTemplateContextMapper.java @@ -0,0 +1,39 @@ +/* + * Copyright 2025 cronn GmbH + * SPDX-License-Identifier: AGPL-3.0-only + */ + +package de.eshg.stiprotection.mapper.texttemplate; + +import de.eshg.stiprotection.api.texttemplate.TextTemplateContextDto; +import de.eshg.stiprotection.persistence.db.texttemplate.TextTemplateContext; + +public class TextTemplateContextMapper { + + private TextTemplateContextMapper() {} + + public static TextTemplateContext toDatabaseType(TextTemplateContextDto dto) { + return switch (dto) { + case null -> throw new IllegalArgumentException("The dto to be mapped should not be null."); + case CONSULTATION_REASON -> TextTemplateContext.CONSULTATION_REASON; + case CONSULTATION_REMARK -> TextTemplateContext.CONSULTATION_REMARK; + case RAPID_TESTS_REMARK -> TextTemplateContext.RAPID_TESTS_REMARK; + case LABORATORY_TESTS_REMARK -> TextTemplateContext.LABORATORY_TESTS_REMARK; + case DIAGNOSIS_RESULT -> TextTemplateContext.DIAGNOSIS_RESULT; + case DIAGNOSIS_REMARK -> TextTemplateContext.DIAGNOSIS_REMARK; + }; + } + + public static TextTemplateContextDto toInterfaceType(TextTemplateContext entity) { + return switch (entity) { + case null -> + throw new IllegalArgumentException("The entity to be mapped should not be null."); + case CONSULTATION_REASON -> TextTemplateContextDto.CONSULTATION_REASON; + case CONSULTATION_REMARK -> TextTemplateContextDto.CONSULTATION_REMARK; + case RAPID_TESTS_REMARK -> TextTemplateContextDto.RAPID_TESTS_REMARK; + case LABORATORY_TESTS_REMARK -> TextTemplateContextDto.LABORATORY_TESTS_REMARK; + case DIAGNOSIS_RESULT -> TextTemplateContextDto.DIAGNOSIS_RESULT; + case DIAGNOSIS_REMARK -> TextTemplateContextDto.DIAGNOSIS_REMARK; + }; + } +} diff --git a/backend/sti-protection/src/main/java/de/eshg/stiprotection/mapper/texttemplate/TextTemplateMapper.java b/backend/sti-protection/src/main/java/de/eshg/stiprotection/mapper/texttemplate/TextTemplateMapper.java new file mode 100644 index 000000000..a6b8b165e --- /dev/null +++ b/backend/sti-protection/src/main/java/de/eshg/stiprotection/mapper/texttemplate/TextTemplateMapper.java @@ -0,0 +1,74 @@ +/* + * Copyright 2025 cronn GmbH + * SPDX-License-Identifier: AGPL-3.0-only + */ + +package de.eshg.stiprotection.mapper.texttemplate; + +import de.eshg.stiprotection.api.texttemplate.CreateTextTemplateRequest; +import de.eshg.stiprotection.api.texttemplate.CreateTextTemplateResponse; +import de.eshg.stiprotection.api.texttemplate.GetTextTemplatesResponse; +import de.eshg.stiprotection.api.texttemplate.TextTemplateContextDto; +import de.eshg.stiprotection.api.texttemplate.TextTemplateDto; +import de.eshg.stiprotection.persistence.db.texttemplate.TextTemplate; +import java.util.List; +import org.springframework.util.CollectionUtils; + +public class TextTemplateMapper { + + private TextTemplateMapper() {} + + public static TextTemplate toDatabase(CreateTextTemplateRequest request) { + if (request == null) { + throw new IllegalArgumentException("The request to be mapped should not be null."); + } + + return createTextTemplate(request.name(), request.context(), request.content()); + } + + public static CreateTextTemplateResponse toInterface(TextTemplate entity) { + if (entity == null) { + throw new IllegalArgumentException("The entity to be mapped should not be null."); + } + + return new CreateTextTemplateResponse(entity.getExternalId()); + } + + public static TextTemplateDto toInterfaceType(TextTemplate entity) { + if (entity == null) { + throw new IllegalArgumentException("The entity to be mapped should not be null."); + } + + return new TextTemplateDto( + entity.getExternalId(), + entity.getName(), + TextTemplateContextMapper.toInterfaceType(entity.getContext()), + entity.getContent()); + } + + public static TextTemplate toDatabaseType(TextTemplateDto dto) { + if (dto == null) { + throw new IllegalArgumentException("The dto to be mapped should not be null."); + } + + return createTextTemplate(dto.name(), dto.context(), dto.content()); + } + + private static TextTemplate createTextTemplate( + String name, TextTemplateContextDto context, String content) { + TextTemplate textTemplate = new TextTemplate(); + textTemplate.setName(name); + textTemplate.setContext(TextTemplateContextMapper.toDatabaseType(context)); + textTemplate.setContent(content); + return textTemplate; + } + + public static GetTextTemplatesResponse toInterfaceType(List<TextTemplate> textTemplates) { + if (CollectionUtils.isEmpty(textTemplates)) { + return new GetTextTemplatesResponse(List.of()); + } + + return new GetTextTemplatesResponse( + textTemplates.stream().map(TextTemplateMapper::toInterfaceType).toList()); + } +} diff --git a/backend/sti-protection/src/main/java/de/eshg/stiprotection/persistence/db/texttemplate/TextTemplate.java b/backend/sti-protection/src/main/java/de/eshg/stiprotection/persistence/db/texttemplate/TextTemplate.java new file mode 100644 index 000000000..9caedb5b5 --- /dev/null +++ b/backend/sti-protection/src/main/java/de/eshg/stiprotection/persistence/db/texttemplate/TextTemplate.java @@ -0,0 +1,52 @@ +/* + * Copyright 2025 cronn GmbH + * SPDX-License-Identifier: AGPL-3.0-only + */ + +package de.eshg.stiprotection.persistence.db.texttemplate; + +import de.eshg.domain.model.BaseEntityWithExternalId; +import de.eshg.lib.common.DataSensitivity; +import de.eshg.lib.common.SensitivityLevel; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import org.hibernate.annotations.JdbcType; +import org.hibernate.dialect.PostgreSQLEnumJdbcType; + +@Entity +@DataSensitivity(SensitivityLevel.SENSITIVE) +public class TextTemplate extends BaseEntityWithExternalId { + + @Column(nullable = false) + private String name; + + @JdbcType(PostgreSQLEnumJdbcType.class) + @Column(nullable = false) + private TextTemplateContext context; + + private String content; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public TextTemplateContext getContext() { + return context; + } + + public void setContext(TextTemplateContext context) { + this.context = context; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } +} diff --git a/backend/sti-protection/src/main/java/de/eshg/stiprotection/persistence/db/texttemplate/TextTemplateContext.java b/backend/sti-protection/src/main/java/de/eshg/stiprotection/persistence/db/texttemplate/TextTemplateContext.java new file mode 100644 index 000000000..35979d917 --- /dev/null +++ b/backend/sti-protection/src/main/java/de/eshg/stiprotection/persistence/db/texttemplate/TextTemplateContext.java @@ -0,0 +1,15 @@ +/* + * Copyright 2025 cronn GmbH + * SPDX-License-Identifier: AGPL-3.0-only + */ + +package de.eshg.stiprotection.persistence.db.texttemplate; + +public enum TextTemplateContext { + CONSULTATION_REASON, + CONSULTATION_REMARK, + RAPID_TESTS_REMARK, + LABORATORY_TESTS_REMARK, + DIAGNOSIS_RESULT, + DIAGNOSIS_REMARK +} diff --git a/backend/sti-protection/src/main/java/de/eshg/stiprotection/persistence/db/texttemplate/TextTemplateRepository.java b/backend/sti-protection/src/main/java/de/eshg/stiprotection/persistence/db/texttemplate/TextTemplateRepository.java new file mode 100644 index 000000000..9c0e5ddd0 --- /dev/null +++ b/backend/sti-protection/src/main/java/de/eshg/stiprotection/persistence/db/texttemplate/TextTemplateRepository.java @@ -0,0 +1,17 @@ +/* + * Copyright 2025 cronn GmbH + * SPDX-License-Identifier: AGPL-3.0-only + */ + +package de.eshg.stiprotection.persistence.db.texttemplate; + +import java.util.Optional; +import java.util.UUID; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; + +public interface TextTemplateRepository + extends JpaRepository<TextTemplate, Long>, JpaSpecificationExecutor<TextTemplate> { + + Optional<TextTemplate> findByExternalId(UUID externalId); +} diff --git a/backend/sti-protection/src/main/resources/migrations/0043_add_text_templates.xml b/backend/sti-protection/src/main/resources/migrations/0043_add_text_templates.xml new file mode 100644 index 000000000..9959f5fb5 --- /dev/null +++ b/backend/sti-protection/src/main/resources/migrations/0043_add_text_templates.xml @@ -0,0 +1,34 @@ +<?xml version="1.1" encoding="UTF-8" standalone="no"?> +<!-- + Copyright 2025 cronn GmbH + SPDX-License-Identifier: AGPL-3.0-only +--> + +<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd"> + <changeSet author="GA-Lotse" id="1737383279977-1"> + <ext:createPostgresEnumType name="texttemplatecontext" values="CONSULTATION_REASON, CONSULTATION_REMARK, DIAGNOSIS_REMARK, DIAGNOSIS_RESULT, LABORATORY_TESTS_REMARK, RAPID_TESTS_REMARK"/> + </changeSet> + <changeSet author="GA-Lotse" id="1737383279977-2"> + <createTable tableName="text_template"> + <column autoIncrement="true" name="id" type="BIGINT"> + <constraints nullable="false" primaryKey="true" primaryKeyName="pk_text_template"/> + </column> + <column name="version" type="BIGINT"> + <constraints nullable="false"/> + </column> + <column name="external_id" type="UUID"> + <constraints nullable="false"/> + </column> + <column name="content" type="TEXT"/> + <column name="context" type="TEXTTEMPLATECONTEXT"> + <constraints nullable="false"/> + </column> + <column name="name" type="TEXT"> + <constraints nullable="false"/> + </column> + </createTable> + </changeSet> + <changeSet author="GA-Lotse" id="1737383279977-3"> + <addUniqueConstraint columnNames="external_id" constraintName="text_template_external_id_key" tableName="text_template"/> + </changeSet> +</databaseChangeLog> diff --git a/backend/sti-protection/src/main/resources/migrations/changelog.xml b/backend/sti-protection/src/main/resources/migrations/changelog.xml index 246ffe8ac..2407f4db3 100644 --- a/backend/sti-protection/src/main/resources/migrations/changelog.xml +++ b/backend/sti-protection/src/main/resources/migrations/changelog.xml @@ -50,5 +50,6 @@ <include file="migrations/0040_add_cemetery_delete_at.xml"/> <include file="migrations/0041_add_countrycodes.xml"/> <include file="migrations/0042_add_previous_file_state_id_to_system_progress_entry.xml"/> + <include file="migrations/0043_add_text_templates.xml"/> </databaseChangeLog> diff --git a/backend/travel-medicine/openApi.yaml b/backend/travel-medicine/openApi.yaml index 249858bde..c07efbda6 100644 --- a/backend/travel-medicine/openApi.yaml +++ b/backend/travel-medicine/openApi.yaml @@ -100,6 +100,12 @@ paths: schema: type: string format: date-time + - in: query + name: physicianId + required: false + schema: + type: string + format: uuid responses: "200": content: diff --git a/backend/travel-medicine/src/main/java/de/eshg/travelmedicine/TravelMedicineGdprZipEditorProvider.java b/backend/travel-medicine/src/main/java/de/eshg/travelmedicine/TravelMedicineGdprZipEditorProvider.java index 476e23038..977ab60c3 100644 --- a/backend/travel-medicine/src/main/java/de/eshg/travelmedicine/TravelMedicineGdprZipEditorProvider.java +++ b/backend/travel-medicine/src/main/java/de/eshg/travelmedicine/TravelMedicineGdprZipEditorProvider.java @@ -15,14 +15,16 @@ import de.eshg.travelmedicine.vaccinationconsultation.persistence.entity.Procedu import de.eshg.travelmedicine.vaccinationconsultation.persistence.entity.VaccinationConsultation_; import de.eshg.travelmedicine.vaccinationconsultation.persistence.entity.VcService_; import java.util.Iterator; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.core.io.Resource; import org.springframework.stereotype.Component; @Component public class TravelMedicineGdprZipEditorProvider extends AbstractGdprZipEditorProvider { - @Override - protected String getLegalBasisAppendix() { - return "Hier könnte Ihr Rechtsgrundlagen-Anhang stehen!"; + public TravelMedicineGdprZipEditorProvider( + @Value("classpath:/gdpr-legal-basis-text.txt") Resource resource) { + super(resource); } @Override diff --git a/backend/travel-medicine/src/main/java/de/eshg/travelmedicine/citizenpublic/CitizenPublicController.java b/backend/travel-medicine/src/main/java/de/eshg/travelmedicine/citizenpublic/CitizenPublicController.java index 7b3e53b87..56381573a 100644 --- a/backend/travel-medicine/src/main/java/de/eshg/travelmedicine/citizenpublic/CitizenPublicController.java +++ b/backend/travel-medicine/src/main/java/de/eshg/travelmedicine/citizenpublic/CitizenPublicController.java @@ -100,7 +100,11 @@ public class CitizenPublicController { } List<AppointmentDto> appointments = appointmentBlockService.getFreeAppointments( - earliestDate, null, MappingUtil.mapEnum(AppointmentType.class, appointmentType), null); + earliestDate, + null, + MappingUtil.mapEnum(AppointmentType.class, appointmentType), + null, + null); return new GetFreeAppointmentsResponse(appointments); } diff --git a/backend/travel-medicine/src/main/java/de/eshg/travelmedicine/util/TravelMedicineProgressEntryType.java b/backend/travel-medicine/src/main/java/de/eshg/travelmedicine/util/TravelMedicineProgressEntryType.java index 24250c9f8..d03336edf 100644 --- a/backend/travel-medicine/src/main/java/de/eshg/travelmedicine/util/TravelMedicineProgressEntryType.java +++ b/backend/travel-medicine/src/main/java/de/eshg/travelmedicine/util/TravelMedicineProgressEntryType.java @@ -9,6 +9,7 @@ public enum TravelMedicineProgressEntryType { CERTIFICATE_FOR_HEALTH_INSURANCE, VACCINATION_APPLIED, VACCINATION_EDIT, + PERSON_UPDATED, PERSON_SYNCHRONIZED, NEW_APPOINTMENT, FOLLOWUP_APPOINTMENT, diff --git a/backend/travel-medicine/src/main/java/de/eshg/travelmedicine/vaccinationconsultation/AppointmentService.java b/backend/travel-medicine/src/main/java/de/eshg/travelmedicine/vaccinationconsultation/AppointmentService.java index cede33e9b..ee28d69ff 100644 --- a/backend/travel-medicine/src/main/java/de/eshg/travelmedicine/vaccinationconsultation/AppointmentService.java +++ b/backend/travel-medicine/src/main/java/de/eshg/travelmedicine/vaccinationconsultation/AppointmentService.java @@ -51,7 +51,8 @@ public class AppointmentService { AppointmentType appointmentType = procedureStep.getAppointmentType(); Instant end = start.plus(Duration.ofMinutes(durationInMinutes)); - appointmentBlockSlotUtil.updateAppointment(appointmentType, null, procedureStep, start, end); + appointmentBlockSlotUtil.updateAppointment( + appointmentType, null, null, procedureStep, start, end); } public Appointment createBlockAppointment( @@ -59,7 +60,7 @@ public class AppointmentService { DummyEntityWithAppointment appointmentHolder = new DummyEntityWithAppointment(); Instant end = start.plus(Duration.ofMinutes(durationInMinutes)); appointmentBlockSlotUtil.updateAppointment( - appointmentType, null, appointmentHolder, start, end); + appointmentType, null, null, appointmentHolder, start, end); return appointmentHolder.getAppointment(); } diff --git a/backend/travel-medicine/src/main/java/de/eshg/travelmedicine/vaccinationconsultation/VaccinationConsultationService.java b/backend/travel-medicine/src/main/java/de/eshg/travelmedicine/vaccinationconsultation/VaccinationConsultationService.java index a05745c37..dd2315d70 100644 --- a/backend/travel-medicine/src/main/java/de/eshg/travelmedicine/vaccinationconsultation/VaccinationConsultationService.java +++ b/backend/travel-medicine/src/main/java/de/eshg/travelmedicine/vaccinationconsultation/VaccinationConsultationService.java @@ -7,6 +7,7 @@ package de.eshg.travelmedicine.vaccinationconsultation; import static de.eshg.travelmedicine.util.MappingUtil.mapEnum; import static de.eshg.travelmedicine.util.TravelMedicineProgressEntryType.PERSON_SYNCHRONIZED; +import static de.eshg.travelmedicine.util.TravelMedicineProgressEntryType.PERSON_UPDATED; import de.eshg.base.citizenuser.api.CitizenAccessCodeUserDto; import de.eshg.lib.appointmentblock.AppointmentTypeMapper; @@ -297,14 +298,16 @@ public class VaccinationConsultationService { procedureAccessor.accessProcedure(procedureId, ProcedureAccessor.checkNotClosed); Person person = vaccinationConsultation.getRelatedPersons().getFirst(); + UUID previousFileStateId = person.getCentralFileStateId(); UUID updatedFileStateId = - personClient.syncPerson(person.getCentralFileStateId(), request.referenceVersion()); + personClient.syncPerson(previousFileStateId, request.referenceVersion()); person.setCentralFileStateId(updatedFileStateId); SystemProgressEntry progressEntry = SystemProgressEntryFactory.createSystemProgressEntry( PERSON_SYNCHRONIZED.name(), TriggerType.SYSTEM_AUTOMATIC); progressEntry.setProcedureId(vaccinationConsultation.getId()); + progressEntry.setPreviousFileStateId(previousFileStateId); vaccinationConsultation.addProgressEntry(progressEntry); } @@ -315,16 +318,24 @@ public class VaccinationConsultationService { throw new BadRequestException("Can't update person in draft status."); } + Person person = vaccinationConsultation.getRelatedPersons().getFirst(); + UUID previousFileStateId = person.getCentralFileStateId(); + try { UUID patientIdFromCentralFile = - personClient.updatePersonInCentralFile( - vaccinationConsultation.getRelatedPersons().getFirst().getCentralFileStateId(), - request.patient()); + personClient.updatePersonInCentralFile(previousFileStateId, request.patient()); vaccinationConsultationMapper.toDomainTypePatchPerson( patientIdFromCentralFile, vaccinationConsultation); } catch (Exception e) { throw new BadRequestException(UPDATE_OUTDATED_PERSON); } + + SystemProgressEntry progressEntry = + SystemProgressEntryFactory.createSystemProgressEntry( + PERSON_UPDATED.name(), TriggerType.SYSTEM_AUTOMATIC); + progressEntry.setProcedureId(vaccinationConsultation.getId()); + progressEntry.setPreviousFileStateId(previousFileStateId); + vaccinationConsultation.addProgressEntry(progressEntry); } public void updateTravelDetails( diff --git a/backend/travel-medicine/src/main/resources/gdpr-legal-basis-text.txt b/backend/travel-medicine/src/main/resources/gdpr-legal-basis-text.txt new file mode 100644 index 000000000..b75017d32 --- /dev/null +++ b/backend/travel-medicine/src/main/resources/gdpr-legal-basis-text.txt @@ -0,0 +1 @@ +Die Datenverarbeitung erfolgt auf Grundlage von Art. 6 Abs. 1 lit. c DSGVO bzw. Art. 9 Abs. 2 lit. h, i DSGVO in Verbindung mit Hessisches Gesetz über den öffentlichen Gesundheitsdienst (HGöGD) insbesondere § 6 Abs. 3, Infektionsschutzgesetz (IfSG) § 20 Abs. 1 - 5, § 22, Bürgerliches Gesetzbuch (BGB) § 630 f. diff --git a/buildSrc/src/main/groovy/api-package.gradle b/buildSrc/src/main/groovy/api-package.gradle index 1eb6df645..7408456d2 100644 --- a/buildSrc/src/main/groovy/api-package.gradle +++ b/buildSrc/src/main/groovy/api-package.gradle @@ -76,16 +76,6 @@ def cleanTaskProvider = tasks.register('cleanGeneratedFiles', Delete) { delete srcDir } -tasks.named('compile') { - dependsOn generateTaskProvider - inputs.files("${rootDir}/config/tsconfig.lib-legacy.json") -} - -tasks.named('compileCheck') { - dependsOn generateTaskProvider - inputs.files("${rootDir}/config/tsconfig.lib-legacy.json") -} - // Fix/workaround for https://github.com/OpenAPITools/openapi-generator/issues/15637 private void fixDuplicateImports(Directory outputDir) { fileTree("${outputDir}/models").matching { @@ -125,7 +115,7 @@ tasks.named('compile').configure { } } -tasks.named('compileCheck').configure { +tasks.named('compile').configure { dependsOn generateTaskProvider inputs.file configDir.file('tsconfig.lib.json') } diff --git a/buildSrc/src/main/groovy/lib-package.gradle b/buildSrc/src/main/groovy/lib-package.gradle index 7cf2aa590..40afba5f5 100644 --- a/buildSrc/src/main/groovy/lib-package.gradle +++ b/buildSrc/src/main/groovy/lib-package.gradle @@ -1,3 +1,5 @@ +import com.github.gradle.node.pnpm.task.PnpmTask + plugins { id 'source-checks' id 'vitest' @@ -20,6 +22,15 @@ typescript { def typesDir = layout.buildDirectory.dir('types') def configDir = rootProject.layout.projectDirectory.dir('config') +tasks.register('resolveTsPaths', PnpmTask) { + group = 'package' + inputs.dir typesDir + outputs.dir typesDir + + args = ['resolve-tspaths', '--out', typesDir.get().asFile.absolutePath] +} + + tasks.register('assemble') { group = 'package' dependsOn 'compile' @@ -41,6 +52,7 @@ tasks.named('lintFix').configure { } tasks.named('compile').configure { + finalizedBy 'resolveTsPaths' inputs.file configDir.file('tsconfig.lib.json') outputs.dir typesDir @@ -49,11 +61,8 @@ tasks.named('compile').configure { } } -tasks.named('compileCheck').configure { - inputs.file configDir.file('tsconfig.lib.json') -} - tasks.named('bundle').configure { + mustRunAfter 'format', 'lintFix' inputs.file configDir.file('tsconfig.lib.json') } diff --git a/buildSrc/src/main/groovy/next-app.gradle b/buildSrc/src/main/groovy/next-app.gradle index 3a6af4f34..ed3392ba2 100644 --- a/buildSrc/src/main/groovy/next-app.gradle +++ b/buildSrc/src/main/groovy/next-app.gradle @@ -183,7 +183,8 @@ tasks.register('run', NodeTask) { tasks.register('runDev', PnpmTask) { dependsOn 'prepareEnvironment' - args = ['next', 'dev', '--turbo', '--port', nextExtension.port.get()] + def bundlerArgs = project.hasProperty('webpack') ? [] : ['--turbo'] + args = ['next', 'dev', '--port', nextExtension.port.get()] + bundlerArgs } tasks.named('clean').configure { diff --git a/buildSrc/src/main/groovy/node.gradle b/buildSrc/src/main/groovy/node.gradle index a6fea3b83..776d575db 100644 --- a/buildSrc/src/main/groovy/node.gradle +++ b/buildSrc/src/main/groovy/node.gradle @@ -3,15 +3,15 @@ plugins { } node { - version = '22.13.0' - pnpmVersion = '9.15.3' + version = '22.13.1' + pnpmVersion = '9.15.4' download = true workDir = file("${rootProject.projectDir}/.gradle/nodejs") pnpmWorkDir = file("${rootProject.projectDir}/.gradle/pnpm") } ext { - nodeDockerImage = "node:${node.version.get()}-alpine@sha256:f2dc6eea95f787e25f173ba9904c9d0647ab2506178c7b5b7c5a3d02bc4af145" + nodeDockerImage = "node:${node.version.get()}-alpine@sha256:e2b39f7b64281324929257d0f8004fb6cb4bf0fdfb9aa8cedb235a766aec31da" } tasks.register('cleanDependencies', Delete) { diff --git a/buildSrc/src/main/groovy/openapi-generator.gradle b/buildSrc/src/main/groovy/openapi-generator.gradle index 8e6290dfa..11be10e5a 100644 --- a/buildSrc/src/main/groovy/openapi-generator.gradle +++ b/buildSrc/src/main/groovy/openapi-generator.gradle @@ -23,11 +23,6 @@ tasks.named('compile') { inputs.files("${rootDir}/config/tsconfig.lib-legacy.json") } -tasks.named('compileCheck') { - dependsOn generateMetaTaskProvider - inputs.files("${rootDir}/config/tsconfig.lib-legacy.json") -} - static String emulateSymlinkIfNecessary(java.nio.file.Path path) { if (Files.isSymbolicLink(path)) { return path.toString() diff --git a/buildSrc/src/main/groovy/source-checks.gradle b/buildSrc/src/main/groovy/source-checks.gradle index dcad4d701..7d9d44d2e 100644 --- a/buildSrc/src/main/groovy/source-checks.gradle +++ b/buildSrc/src/main/groovy/source-checks.gradle @@ -44,7 +44,7 @@ def defaultPrettierArgs = ['--no-error-on-unmatched-pattern'] tasks.register('format', PnpmTask) { group = 'verification' dependsOn rootProject.tasks.installDependencies - mustRunAfter 'lintFix' + mustRunAfter 'compile', 'lintFix' inputs.file "${rootDir}/.editorconfig" inputs.file "${rootDir}/.prettierrc" if (file("${projectDir}/.prettierignore").exists()) { @@ -80,7 +80,7 @@ def defaultEslintArgs = ['--max-warnings=0', '--no-error-on-unmatched-pattern'] tasks.register('lint', PnpmTask) { group = 'verification' dependsOn 'prepareEnvironment' - dependsOn 'compileCheck' + dependsOn 'compile' inputs.files eslintConfigFiles def inputFiles = getEslintInputs() inputs.files inputFiles @@ -91,7 +91,7 @@ tasks.register('lint', PnpmTask) { tasks.register('lintFix', PnpmTask) { group = 'verification' dependsOn 'prepareEnvironment' - dependsOn 'compileCheck' + dependsOn 'compile' inputs.files eslintConfigFiles def inputFiles = getEslintInputs() inputs.files inputFiles diff --git a/buildSrc/src/main/groovy/typescript.gradle b/buildSrc/src/main/groovy/typescript.gradle index e0c0ff976..7438f97e4 100644 --- a/buildSrc/src/main/groovy/typescript.gradle +++ b/buildSrc/src/main/groovy/typescript.gradle @@ -15,7 +15,6 @@ def getTypescriptInputFiles = { tasks.register('compile', PnpmTask) { group = 'package' dependsOn 'prepareEnvironment' - mustRunAfter 'compileCheck' inputs.files "${rootDir}/config/tsconfig.base.json" inputs.files "${projectDir}/tsconfig.json" @@ -26,19 +25,6 @@ tasks.register('compile', PnpmTask) { args = ['tsc'] doFirst { - delete distDir // TODO: exclude *.tsbuildinfo from deletion to enable incremental builds + delete distDir } } - -tasks.register('compileCheck', PnpmTask) { - group = 'verification' - dependsOn 'prepareEnvironment' - - inputs.files "${rootDir}/config/tsconfig.base.json" - inputs.files "${projectDir}/tsconfig.json" - inputs.files getTypescriptInputFiles() - - outputs.dir distDir - - args = ['tsc', '--noEmit'] -} diff --git a/buildSrc/src/main/groovy/workspace-package.gradle b/buildSrc/src/main/groovy/workspace-package.gradle index d890870c3..64fc4f49d 100644 --- a/buildSrc/src/main/groovy/workspace-package.gradle +++ b/buildSrc/src/main/groovy/workspace-package.gradle @@ -18,7 +18,7 @@ tasks.register('prepareEnvironment') { tasks.register('check') { group = 'verification' - dependsOn 'compileCheck' + dependsOn 'compile' } tasks.register('clean', Delete) { diff --git a/citizen-portal-api/build.gradle b/citizen-portal-api/build.gradle index 0e2b5e481..bc4732aab 100644 --- a/citizen-portal-api/build.gradle +++ b/citizen-portal-api/build.gradle @@ -6,9 +6,6 @@ def backendDir = rootProject.layout.projectDirectory.dir('backend') openapiGenerator { inputSpecs = [ - 'base' : backendDir.file('base/openApi.yaml'), // TODO: use separate OpenAPI specification for citizen-portal - 'measlesProtection' : backendDir.file('measles-protection/openApi.yaml'), // TODO: use separate OpenAPI specification for citizen-portal - 'schoolEntry' : backendDir.file('school-entry/openApi.yaml'), // TODO: use separate OpenAPI specification for citizen-portal 'travelMedicine' : backendDir.file('travel-medicine/openApi.yaml'), // TODO: use separate OpenAPI specification for citizen-portal 'officialMedicalService' : backendDir.file('official-medical-service/openApi.yaml'), // TODO: use separate OpenAPI specification for citizen-portal 'medicalRegistry' : backendDir.file('medical-registry/openApi.yaml'), // TODO: use separate OpenAPI specification for citizen-portal diff --git a/citizen-portal/gradleDependencies.json b/citizen-portal/gradleDependencies.json index be9e063ad..7b3cdf760 100644 --- a/citizen-portal/gradleDependencies.json +++ b/citizen-portal/gradleDependencies.json @@ -1,3 +1,9 @@ { - "dependencies": [":citizen-portal-api", ":lib-portal"] + "dependencies": [ + ":base-api", + ":citizen-portal-api", + ":lib-portal", + ":measles-protection-api", + ":school-entry-api" + ] } diff --git a/citizen-portal/package.json b/citizen-portal/package.json index a4adc6e0b..f1de81c79 100644 --- a/citizen-portal/package.json +++ b/citizen-portal/package.json @@ -6,8 +6,11 @@ "dependencies": { "@emotion/react": "catalog:joy", "@emotion/styled": "catalog:joy", + "@eshg/base-api": "workspace:*", "@eshg/citizen-portal-api": "workspace:*", "@eshg/lib-portal": "workspace:*", + "@eshg/measles-protection-api": "workspace:*", + "@eshg/school-entry-api": "workspace:*", "@fontsource/poppins": "catalog:joy", "@fullcalendar/core": "catalog:fullcalendar", "@fullcalendar/daygrid": "catalog:fullcalendar", @@ -47,11 +50,11 @@ "@vitejs/plugin-react": "catalog:vitest", "@vitest/coverage-istanbul": "catalog:vitest", "eslint": "catalog:eslint", - "eslint-plugin-import": "catalog:eslint", "eslint-config-next": "catalog:next", "eslint-config-prettier": "catalog:eslint", - "eslint-plugin-unused-imports": "catalog:eslint", + "eslint-plugin-import": "catalog:eslint", "eslint-plugin-promise": "catalog:eslint", + "eslint-plugin-unused-imports": "catalog:eslint", "prettier": "catalog:prettier", "typescript": "catalog:common", "vite-tsconfig-paths": "catalog:vitest", diff --git a/citizen-portal/src/app/[lang]/(privatpersonen)/mein-bereich/profil/page.tsx b/citizen-portal/src/app/[lang]/(privatpersonen)/mein-bereich/profil/page.tsx index b553d6e4b..9a9b333e2 100644 --- a/citizen-portal/src/app/[lang]/(privatpersonen)/mein-bereich/profil/page.tsx +++ b/citizen-portal/src/app/[lang]/(privatpersonen)/mein-bereich/profil/page.tsx @@ -5,7 +5,7 @@ "use client"; -import { ApiGetReferencePersonResponse } from "@eshg/citizen-portal-api/base"; +import { ApiGetReferencePersonResponse } from "@eshg/base-api"; import { QueryBoundary } from "@eshg/lib-portal/components/boundaries/QueryBoundary"; import { Grid } from "@mui/joy"; import { isDefined } from "remeda"; diff --git a/citizen-portal/src/app/[lang]/opendata/layout.tsx b/citizen-portal/src/app/[lang]/opendata/layout.tsx index 97be27ea1..08b7b94c9 100644 --- a/citizen-portal/src/app/[lang]/opendata/layout.tsx +++ b/citizen-portal/src/app/[lang]/opendata/layout.tsx @@ -5,7 +5,7 @@ "use client"; -import { ApiBaseFeature } from "@eshg/citizen-portal-api/base"; +import { ApiBaseFeature } from "@eshg/base-api"; import { Alert } from "@eshg/lib-portal/components/Alert"; import { PropsWithChildren } from "react"; diff --git a/citizen-portal/src/app/[lang]/unternehmen/masernschutz/meldeformular/page.tsx b/citizen-portal/src/app/[lang]/unternehmen/masernschutz/meldeformular/page.tsx index a06cd89e3..d711c41af 100644 --- a/citizen-portal/src/app/[lang]/unternehmen/masernschutz/meldeformular/page.tsx +++ b/citizen-portal/src/app/[lang]/unternehmen/masernschutz/meldeformular/page.tsx @@ -5,8 +5,8 @@ "use client"; -import { ApiReportCaseRequest } from "@eshg/citizen-portal-api/measlesProtection"; import { useHandledMutation } from "@eshg/lib-portal/api/useHandledMutation"; +import { ApiReportCaseRequest } from "@eshg/measles-protection-api"; import { useOrganisationPortalApi } from "@/lib/businessModules/measlesProtection/api/clients"; import { ReportCaseForm } from "@/lib/businessModules/measlesProtection/components/reportCase/ReportCaseForm"; diff --git a/citizen-portal/src/app/[lang]/unternehmen/mein-bereich/profil/page.tsx b/citizen-portal/src/app/[lang]/unternehmen/mein-bereich/profil/page.tsx index 005e1f9dc..07c27c743 100644 --- a/citizen-portal/src/app/[lang]/unternehmen/mein-bereich/profil/page.tsx +++ b/citizen-portal/src/app/[lang]/unternehmen/mein-bereich/profil/page.tsx @@ -5,7 +5,7 @@ "use client"; -import { ApiGetReferenceFacilityResponse } from "@eshg/citizen-portal-api/base"; +import { ApiGetReferenceFacilityResponse } from "@eshg/base-api"; import { QueryBoundary } from "@eshg/lib-portal/components/boundaries/QueryBoundary"; import { formatPersonName } from "@eshg/lib-portal/formatters/person"; import { Grid } from "@mui/joy"; diff --git a/citizen-portal/src/lib/baseModule/api/clients.ts b/citizen-portal/src/lib/baseModule/api/clients.ts index d39fd6724..795ea856c 100644 --- a/citizen-portal/src/lib/baseModule/api/clients.ts +++ b/citizen-portal/src/lib/baseModule/api/clients.ts @@ -9,7 +9,7 @@ import { Configuration, GdprProcedureApi, MukFacilityLinkApi, -} from "@eshg/citizen-portal-api/base"; +} from "@eshg/base-api"; import { useApiConfiguration } from "@eshg/lib-portal/api/ApiProvider"; function useConfiguration() { diff --git a/citizen-portal/src/lib/baseModule/api/mutations/gdpr.ts b/citizen-portal/src/lib/baseModule/api/mutations/gdpr.ts index fa1ab250c..33a54d74e 100644 --- a/citizen-portal/src/lib/baseModule/api/mutations/gdpr.ts +++ b/citizen-portal/src/lib/baseModule/api/mutations/gdpr.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiAddGdprProcedureFromCitizenPortalRequest } from "@eshg/citizen-portal-api/base"; +import { ApiAddGdprProcedureFromCitizenPortalRequest } from "@eshg/base-api"; import { useHandledMutation } from "@eshg/lib-portal/api/useHandledMutation"; import { useSnackbar } from "@eshg/lib-portal/components/snackbar/SnackbarProvider"; diff --git a/citizen-portal/src/lib/baseModule/api/queries/bundIdLink.ts b/citizen-portal/src/lib/baseModule/api/queries/bundIdLink.ts index 35c1acb8a..e35556692 100644 --- a/citizen-portal/src/lib/baseModule/api/queries/bundIdLink.ts +++ b/citizen-portal/src/lib/baseModule/api/queries/bundIdLink.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiErrorCode } from "@eshg/citizen-portal-api/base"; +import { ApiErrorCode } from "@eshg/base-api"; import { resolveError } from "@eshg/lib-portal/errorHandling/errorResolvers"; import { useSuspenseQuery } from "@tanstack/react-query"; diff --git a/citizen-portal/src/lib/baseModule/api/queries/feature.ts b/citizen-portal/src/lib/baseModule/api/queries/feature.ts index 7c76965f3..37bb05f77 100644 --- a/citizen-portal/src/lib/baseModule/api/queries/feature.ts +++ b/citizen-portal/src/lib/baseModule/api/queries/feature.ts @@ -6,7 +6,7 @@ import { ApiBaseFeature, ApiGetBaseFeatureTogglesResponse, -} from "@eshg/citizen-portal-api/base"; +} from "@eshg/base-api"; import { selectDisabledOldFeature, selectEnabledNewFeature, diff --git a/citizen-portal/src/lib/baseModule/api/queries/mukFacilityLink.ts b/citizen-portal/src/lib/baseModule/api/queries/mukFacilityLink.ts index 111059b1d..28d89805d 100644 --- a/citizen-portal/src/lib/baseModule/api/queries/mukFacilityLink.ts +++ b/citizen-portal/src/lib/baseModule/api/queries/mukFacilityLink.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiErrorCode } from "@eshg/citizen-portal-api/base"; +import { ApiErrorCode } from "@eshg/base-api"; import { resolveError } from "@eshg/lib-portal/errorHandling/errorResolvers"; import { useSuspenseQuery } from "@tanstack/react-query"; diff --git a/citizen-portal/src/lib/baseModule/components/gdpr/form/ConfirmStartGdprProcedureDialog.tsx b/citizen-portal/src/lib/baseModule/components/gdpr/form/ConfirmStartGdprProcedureDialog.tsx index 52d5a9016..7c2efcd84 100644 --- a/citizen-portal/src/lib/baseModule/components/gdpr/form/ConfirmStartGdprProcedureDialog.tsx +++ b/citizen-portal/src/lib/baseModule/components/gdpr/form/ConfirmStartGdprProcedureDialog.tsx @@ -3,7 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiGdprProcedureType } from "@eshg/citizen-portal-api/base"; +import { ApiGdprProcedureType } from "@eshg/base-api"; import { BaseModal } from "@eshg/lib-portal/components/BaseModal"; import { useResetAlertContext } from "@eshg/lib-portal/errorHandling/AlertContext"; import { Button, Stack, Typography } from "@mui/joy"; diff --git a/citizen-portal/src/lib/baseModule/components/gdpr/form/GdprContactForm.tsx b/citizen-portal/src/lib/baseModule/components/gdpr/form/GdprContactForm.tsx index 869e3e43d..2ca84819c 100644 --- a/citizen-portal/src/lib/baseModule/components/gdpr/form/GdprContactForm.tsx +++ b/citizen-portal/src/lib/baseModule/components/gdpr/form/GdprContactForm.tsx @@ -3,7 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiGdprProcedureType } from "@eshg/citizen-portal-api/base"; +import { ApiGdprProcedureType } from "@eshg/base-api"; import { SubmitButton } from "@eshg/lib-portal/components/buttons/SubmitButton"; import { FormPlus } from "@eshg/lib-portal/components/form/FormPlus"; import { AlertSlot } from "@eshg/lib-portal/errorHandling/AlertContext"; diff --git a/citizen-portal/src/lib/baseModule/components/gdpr/form/GdprObjectionFormDialog.tsx b/citizen-portal/src/lib/baseModule/components/gdpr/form/GdprObjectionFormDialog.tsx index 26eee885a..50cfaa847 100644 --- a/citizen-portal/src/lib/baseModule/components/gdpr/form/GdprObjectionFormDialog.tsx +++ b/citizen-portal/src/lib/baseModule/components/gdpr/form/GdprObjectionFormDialog.tsx @@ -3,7 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiGdprProcedureType } from "@eshg/citizen-portal-api/base"; +import { ApiGdprProcedureType } from "@eshg/base-api"; import { BaseModal } from "@eshg/lib-portal/components/BaseModal"; import { SubmitButton } from "@eshg/lib-portal/components/buttons/SubmitButton"; import { FormPlus } from "@eshg/lib-portal/components/form/FormPlus"; diff --git a/citizen-portal/src/lib/baseModule/components/gdpr/page/GdprRightsOverviewPage.tsx b/citizen-portal/src/lib/baseModule/components/gdpr/page/GdprRightsOverviewPage.tsx index db1c8b162..e8c4a1fc9 100644 --- a/citizen-portal/src/lib/baseModule/components/gdpr/page/GdprRightsOverviewPage.tsx +++ b/citizen-portal/src/lib/baseModule/components/gdpr/page/GdprRightsOverviewPage.tsx @@ -3,7 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiGdprProcedureType } from "@eshg/citizen-portal-api/base"; +import { ApiGdprProcedureType } from "@eshg/base-api"; import { QueryBoundary } from "@eshg/lib-portal/components/boundaries/QueryBoundary"; import { Button, Sheet, Typography } from "@mui/joy"; import { useId, useState } from "react"; diff --git a/citizen-portal/src/lib/baseModule/components/layout/AppLayout.tsx b/citizen-portal/src/lib/baseModule/components/layout/AppLayout.tsx index b16f9afac..7dcb501c6 100644 --- a/citizen-portal/src/lib/baseModule/components/layout/AppLayout.tsx +++ b/citizen-portal/src/lib/baseModule/components/layout/AppLayout.tsx @@ -10,6 +10,7 @@ import { EnvironmentTypeProvider } from "@eshg/lib-portal/components/Environment import { QueryBoundary } from "@eshg/lib-portal/components/boundaries/QueryBoundary"; import { ConfirmationDialogProvider } from "@eshg/lib-portal/components/confirmationDialog/ConfirmationDialogProvider"; import { SnackbarProvider } from "@eshg/lib-portal/components/snackbar/SnackbarProvider"; +import { Box } from "@mui/joy"; import { PropsWithChildren } from "react"; import { env } from "@/env/server"; @@ -31,20 +32,21 @@ export function AppLayout({ }> >) { return ( - <html lang={lang} style={{ height: "100%" }}> - <body - style={{ - backgroundColor: "var(--joy-palette-neutral-100, #F0F4F8)", - minHeight: "100%", - display: "flex", - flexDirection: "column", - }} - > - <noscript> - Bitte aktivieren Sie JavaScript, um diese Anwendung zu nutzen. - </noscript> - <I18nProvider lang={lang}> - <ThemeProvider> + <I18nProvider lang={lang}> + <ThemeProvider> + <Box component="html" sx={{ height: "100%" }}> + <Box + component="body" + sx={{ + backgroundColor: "neutral.100", + minHeight: "100%", + display: "flex", + flexDirection: "column", + }} + > + <noscript> + Bitte aktivieren Sie JavaScript, um diese Anwendung zu nutzen. + </noscript> <EnvironmentTypeProvider environmentType={env.PUBLIC_ENVIRONMENT_TYPE} > @@ -65,9 +67,9 @@ export function AppLayout({ </EnvironmentTypeProvider> <HiddenDownloadContainer /> - </ThemeProvider> - </I18nProvider> - </body> - </html> + </Box> + </Box> + </ThemeProvider> + </I18nProvider> ); } diff --git a/citizen-portal/src/lib/baseModule/components/layout/Footer.tsx b/citizen-portal/src/lib/baseModule/components/layout/Footer.tsx index 742c30511..c92bd2d89 100644 --- a/citizen-portal/src/lib/baseModule/components/layout/Footer.tsx +++ b/citizen-portal/src/lib/baseModule/components/layout/Footer.tsx @@ -3,7 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiBaseFeature } from "@eshg/citizen-portal-api/base"; +import { ApiBaseFeature } from "@eshg/base-api"; import { InternalLink } from "@eshg/lib-portal/components/navigation/InternalLink"; import { RequiresChildren } from "@eshg/lib-portal/types/react"; import { Box, Stack, Typography, styled } from "@mui/joy"; diff --git a/citizen-portal/src/lib/baseModule/moduleRegister/navigationItemsResolver.tsx b/citizen-portal/src/lib/baseModule/moduleRegister/navigationItemsResolver.tsx index 308853711..0f3f3fdd0 100644 --- a/citizen-portal/src/lib/baseModule/moduleRegister/navigationItemsResolver.tsx +++ b/citizen-portal/src/lib/baseModule/moduleRegister/navigationItemsResolver.tsx @@ -3,7 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiBusinessModule } from "@eshg/citizen-portal-api/base"; +import { ApiBusinessModule } from "@eshg/base-api"; import { NavigationItem } from "@/lib/baseModule/components/layout/types"; import { diff --git a/citizen-portal/src/lib/businessModules/measlesProtection/api/clients.ts b/citizen-portal/src/lib/businessModules/measlesProtection/api/clients.ts index 7ba2d6d1f..2364dd8ea 100644 --- a/citizen-portal/src/lib/businessModules/measlesProtection/api/clients.ts +++ b/citizen-portal/src/lib/businessModules/measlesProtection/api/clients.ts @@ -3,12 +3,12 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +import { useApiConfiguration } from "@eshg/lib-portal/api/ApiProvider"; import { Configuration, FileApi, OrganisationPortalApi, -} from "@eshg/citizen-portal-api/measlesProtection"; -import { useApiConfiguration } from "@eshg/lib-portal/api/ApiProvider"; +} from "@eshg/measles-protection-api"; function useConfiguration() { const configurationParameters = useApiConfiguration( diff --git a/citizen-portal/src/lib/businessModules/measlesProtection/components/reportCase/ReportCaseOverview.tsx b/citizen-portal/src/lib/businessModules/measlesProtection/components/reportCase/ReportCaseOverview.tsx index b8ea9b2a2..21b5593ea 100644 --- a/citizen-portal/src/lib/businessModules/measlesProtection/components/reportCase/ReportCaseOverview.tsx +++ b/citizen-portal/src/lib/businessModules/measlesProtection/components/reportCase/ReportCaseOverview.tsx @@ -8,7 +8,7 @@ import { ApiReportingReason, ApiRoleStatus, -} from "@eshg/citizen-portal-api/measlesProtection"; +} from "@eshg/measles-protection-api"; import { DeleteOutline, EditOutlined } from "@mui/icons-material"; import { Accordion, diff --git a/citizen-portal/src/lib/businessModules/measlesProtection/components/reportCase/ReportCaseOverviewCard.tsx b/citizen-portal/src/lib/businessModules/measlesProtection/components/reportCase/ReportCaseOverviewCard.tsx index f1691f3d6..cd4695240 100644 --- a/citizen-portal/src/lib/businessModules/measlesProtection/components/reportCase/ReportCaseOverviewCard.tsx +++ b/citizen-portal/src/lib/businessModules/measlesProtection/components/reportCase/ReportCaseOverviewCard.tsx @@ -3,12 +3,12 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +import { ButtonLink } from "@eshg/lib-portal/components/buttons/ButtonLink"; +import { SubmitButton } from "@eshg/lib-portal/components/buttons/SubmitButton"; import { ApiReportingReason, ApiRoleStatus, -} from "@eshg/citizen-portal-api/measlesProtection"; -import { ButtonLink } from "@eshg/lib-portal/components/buttons/ButtonLink"; -import { SubmitButton } from "@eshg/lib-portal/components/buttons/SubmitButton"; +} from "@eshg/measles-protection-api"; import { Business, FmdGoodOutlined, diff --git a/citizen-portal/src/lib/businessModules/measlesProtection/components/reportCase/helpers.ts b/citizen-portal/src/lib/businessModules/measlesProtection/components/reportCase/helpers.ts index f098173df..57a593821 100644 --- a/citizen-portal/src/lib/businessModules/measlesProtection/components/reportCase/helpers.ts +++ b/citizen-portal/src/lib/businessModules/measlesProtection/components/reportCase/helpers.ts @@ -3,13 +3,13 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +import { mapOptionalValue } from "@eshg/lib-portal/helpers/form"; import { ApiAffectedPersonDetails, ApiAffectedPersonSupplementalData, ApiDomesticAddress, ApiReportPerson, -} from "@eshg/citizen-portal-api/measlesProtection"; -import { mapOptionalValue } from "@eshg/lib-portal/helpers/form"; +} from "@eshg/measles-protection-api"; import { AffectedPersonFormInputs, diff --git a/citizen-portal/src/lib/businessModules/measlesProtection/components/reportCase/subforms/AddressForm.tsx b/citizen-portal/src/lib/businessModules/measlesProtection/components/reportCase/subforms/AddressForm.tsx index e399f3ff4..30d568182 100644 --- a/citizen-portal/src/lib/businessModules/measlesProtection/components/reportCase/subforms/AddressForm.tsx +++ b/citizen-portal/src/lib/businessModules/measlesProtection/components/reportCase/subforms/AddressForm.tsx @@ -3,10 +3,10 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiDomesticAddress } from "@eshg/citizen-portal-api/measlesProtection"; import { InputField } from "@eshg/lib-portal/components/formFields/InputField"; import { createFieldNameMapper } from "@eshg/lib-portal/helpers/form"; import { validateLength } from "@eshg/lib-portal/helpers/validators"; +import { ApiDomesticAddress } from "@eshg/measles-protection-api"; import { Box, Checkbox, Grid, Typography } from "@mui/joy"; import { FormSectionLabel } from "@/lib/businessModules/measlesProtection/components/reportCase/ReportCaseForm"; diff --git a/citizen-portal/src/lib/businessModules/measlesProtection/components/reportCase/subforms/AffectedPersonForm.tsx b/citizen-portal/src/lib/businessModules/measlesProtection/components/reportCase/subforms/AffectedPersonForm.tsx index 3e9294a97..e70441f14 100644 --- a/citizen-portal/src/lib/businessModules/measlesProtection/components/reportCase/subforms/AffectedPersonForm.tsx +++ b/citizen-portal/src/lib/businessModules/measlesProtection/components/reportCase/subforms/AffectedPersonForm.tsx @@ -5,13 +5,13 @@ "use client"; -import { ApiReportingReason } from "@eshg/citizen-portal-api/measlesProtection"; import { Alert } from "@eshg/lib-portal/components/Alert"; import { DateField } from "@eshg/lib-portal/components/formFields/DateField"; import { InputField } from "@eshg/lib-portal/components/formFields/InputField"; import { SelectField } from "@eshg/lib-portal/components/formFields/SelectField"; import { createFieldNameMapper } from "@eshg/lib-portal/helpers/form"; import { validateLength } from "@eshg/lib-portal/helpers/validators"; +import { ApiReportingReason } from "@eshg/measles-protection-api"; import { Grid, Stack, Typography } from "@mui/joy"; import { SxProps } from "@mui/joy/styles/types"; import { useFormikContext } from "formik"; diff --git a/citizen-portal/src/lib/businessModules/measlesProtection/components/reportCase/subforms/FacilityForm.tsx b/citizen-portal/src/lib/businessModules/measlesProtection/components/reportCase/subforms/FacilityForm.tsx index 47cd0eb9e..3fd9fa633 100644 --- a/citizen-portal/src/lib/businessModules/measlesProtection/components/reportCase/subforms/FacilityForm.tsx +++ b/citizen-portal/src/lib/businessModules/measlesProtection/components/reportCase/subforms/FacilityForm.tsx @@ -5,11 +5,11 @@ "use client"; -import { ApiFacilityType } from "@eshg/citizen-portal-api/measlesProtection"; import { Alert } from "@eshg/lib-portal/components/Alert"; import { InputField } from "@eshg/lib-portal/components/formFields/InputField"; import { SelectField } from "@eshg/lib-portal/components/formFields/SelectField"; import { createFieldNameMapper } from "@eshg/lib-portal/helpers/form"; +import { ApiFacilityType } from "@eshg/measles-protection-api"; import { Grid, Stack, Typography } from "@mui/joy"; import { SxProps } from "@mui/joy/styles/types"; import { useFormikContext } from "formik"; diff --git a/citizen-portal/src/lib/businessModules/measlesProtection/components/reportCase/types.ts b/citizen-portal/src/lib/businessModules/measlesProtection/components/reportCase/types.ts index aafb9fa3d..c57404d49 100644 --- a/citizen-portal/src/lib/businessModules/measlesProtection/components/reportCase/types.ts +++ b/citizen-portal/src/lib/businessModules/measlesProtection/components/reportCase/types.ts @@ -3,6 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +import { OptionalFieldValue } from "@eshg/lib-portal/types/form"; import { ApiAddFacilityFileStateRequest, ApiAddFacilityFileStateRequestContactAddress, @@ -17,8 +18,7 @@ import { ApiReportData, ApiRoleStatus, ApiSalutation, -} from "@eshg/citizen-portal-api/measlesProtection"; -import { OptionalFieldValue } from "@eshg/lib-portal/types/form"; +} from "@eshg/measles-protection-api"; export interface AffectedPersonFormInputs extends Omit< diff --git a/citizen-portal/src/lib/businessModules/measlesProtection/shared/facility/helpers.ts b/citizen-portal/src/lib/businessModules/measlesProtection/shared/facility/helpers.ts index a77140806..ef86c1d3a 100644 --- a/citizen-portal/src/lib/businessModules/measlesProtection/shared/facility/helpers.ts +++ b/citizen-portal/src/lib/businessModules/measlesProtection/shared/facility/helpers.ts @@ -3,13 +3,13 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +import { mapOptionalValue } from "@eshg/lib-portal/helpers/form"; import { ApiAddFacilityFileStateRequest, ApiAddFacilityFileStateRequestContactAddress, ApiDataOrigin, ApiFacilityContactPerson, -} from "@eshg/citizen-portal-api/measlesProtection"; -import { mapOptionalValue } from "@eshg/lib-portal/helpers/form"; +} from "@eshg/measles-protection-api"; import { FacilityContactAddressFormInputs, diff --git a/citizen-portal/src/lib/businessModules/measlesProtection/shared/translations.ts b/citizen-portal/src/lib/businessModules/measlesProtection/shared/translations.ts index 65637126c..5d372e6a0 100644 --- a/citizen-portal/src/lib/businessModules/measlesProtection/shared/translations.ts +++ b/citizen-portal/src/lib/businessModules/measlesProtection/shared/translations.ts @@ -3,6 +3,8 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +import { buildEnumOptions } from "@eshg/lib-portal/helpers/form"; +import { EnumMap } from "@eshg/lib-portal/types/helpers"; import { ApiGender, ApiMPFacilityType, @@ -10,9 +12,7 @@ import { ApiRoleStatus, ApiSalutation, ApiTitle, -} from "@eshg/citizen-portal-api/measlesProtection"; -import { buildEnumOptions } from "@eshg/lib-portal/helpers/form"; -import { EnumMap } from "@eshg/lib-portal/types/helpers"; +} from "@eshg/measles-protection-api"; import { TranslateFn } from "@/lib/i18n/client"; diff --git a/citizen-portal/src/lib/businessModules/opendata/components/useOpenDataFilterValues.ts b/citizen-portal/src/lib/businessModules/opendata/components/useOpenDataFilterValues.ts index ff0eaf8eb..8fbb279d1 100644 --- a/citizen-portal/src/lib/businessModules/opendata/components/useOpenDataFilterValues.ts +++ b/citizen-portal/src/lib/businessModules/opendata/components/useOpenDataFilterValues.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiBusinessModule } from "@eshg/citizen-portal-api/base"; +import { ApiBusinessModule } from "@eshg/base-api"; import { ApiOpenDataFileType } from "@eshg/citizen-portal-api/openData"; import { parseOptionalEnum } from "@eshg/lib-portal/helpers/searchParams"; import { useSearchParams } from "next/navigation"; diff --git a/citizen-portal/src/lib/businessModules/schoolEntry/api/clients.ts b/citizen-portal/src/lib/businessModules/schoolEntry/api/clients.ts index ab6e6cbfa..2f69463fd 100644 --- a/citizen-portal/src/lib/businessModules/schoolEntry/api/clients.ts +++ b/citizen-portal/src/lib/businessModules/schoolEntry/api/clients.ts @@ -3,12 +3,12 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +import { useApiConfiguration } from "@eshg/lib-portal/api/ApiProvider"; import { Configuration, SchoolEntryCitizenApi, SchoolEntryPublicCitizenApi, -} from "@eshg/citizen-portal-api/schoolEntry"; -import { useApiConfiguration } from "@eshg/lib-portal/api/ApiProvider"; +} from "@eshg/school-entry-api"; function useConfiguration() { const configurationParameters = useApiConfiguration( diff --git a/citizen-portal/src/lib/businessModules/schoolEntry/api/models/Appointment.ts b/citizen-portal/src/lib/businessModules/schoolEntry/api/models/Appointment.ts index 985e2c4d0..942a8d5ce 100644 --- a/citizen-portal/src/lib/businessModules/schoolEntry/api/models/Appointment.ts +++ b/citizen-portal/src/lib/businessModules/schoolEntry/api/models/Appointment.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiAppointment } from "@eshg/citizen-portal-api/schoolEntry"; +import { ApiAppointment } from "@eshg/school-entry-api"; export interface Appointment { readonly start: Date; diff --git a/citizen-portal/src/lib/businessModules/schoolEntry/api/models/SchoolEntryChild.ts b/citizen-portal/src/lib/businessModules/schoolEntry/api/models/SchoolEntryChild.ts index cf9df939b..0ac0b0219 100644 --- a/citizen-portal/src/lib/businessModules/schoolEntry/api/models/SchoolEntryChild.ts +++ b/citizen-portal/src/lib/businessModules/schoolEntry/api/models/SchoolEntryChild.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiCitizenChild } from "@eshg/citizen-portal-api/schoolEntry"; +import { ApiCitizenChild } from "@eshg/school-entry-api"; export interface SchoolEntryChild { firstName: string; diff --git a/citizen-portal/src/lib/businessModules/schoolEntry/api/models/SchoolEntryProcedure.ts b/citizen-portal/src/lib/businessModules/schoolEntry/api/models/SchoolEntryProcedure.ts index 1ef9e27ef..f76d15644 100644 --- a/citizen-portal/src/lib/businessModules/schoolEntry/api/models/SchoolEntryProcedure.ts +++ b/citizen-portal/src/lib/businessModules/schoolEntry/api/models/SchoolEntryProcedure.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiGetCitizenProcedureResponse } from "@eshg/citizen-portal-api/schoolEntry"; +import { ApiGetCitizenProcedureResponse } from "@eshg/school-entry-api"; import { Duration, intervalToDuration } from "date-fns"; import { SchoolEntryChild, mapSchoolEntryChild } from "./SchoolEntryChild"; diff --git a/citizen-portal/src/lib/businessModules/schoolEntry/api/mutations/schoolEntryCitizenApi.ts b/citizen-portal/src/lib/businessModules/schoolEntry/api/mutations/schoolEntryCitizenApi.ts index 24d53ed81..188ab94aa 100644 --- a/citizen-portal/src/lib/businessModules/schoolEntry/api/mutations/schoolEntryCitizenApi.ts +++ b/citizen-portal/src/lib/businessModules/schoolEntry/api/mutations/schoolEntryCitizenApi.ts @@ -3,12 +3,12 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +import { useHandledMutation } from "@eshg/lib-portal/api/useHandledMutation"; +import { useSnackbar } from "@eshg/lib-portal/components/snackbar/SnackbarProvider"; import { ApiAddCitizenAnamnesisRequest, ApiUpdateCitizenAppointmentRequest, -} from "@eshg/citizen-portal-api/schoolEntry"; -import { useHandledMutation } from "@eshg/lib-portal/api/useHandledMutation"; -import { useSnackbar } from "@eshg/lib-portal/components/snackbar/SnackbarProvider"; +} from "@eshg/school-entry-api"; import { useSchoolEntryCitizenApi } from "@/lib/businessModules/schoolEntry/api/clients"; import { schoolEntryCitizenApiQueryKey } from "@/lib/businessModules/schoolEntry/api/queries/apiQueryKeys"; diff --git a/citizen-portal/src/lib/businessModules/schoolEntry/api/queries/publicCitizenApi.ts b/citizen-portal/src/lib/businessModules/schoolEntry/api/queries/publicCitizenApi.ts index 4ba98bc87..e40cdeccf 100644 --- a/citizen-portal/src/lib/businessModules/schoolEntry/api/queries/publicCitizenApi.ts +++ b/citizen-portal/src/lib/businessModules/schoolEntry/api/queries/publicCitizenApi.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { SchoolEntryPublicCitizenApi } from "@eshg/citizen-portal-api/schoolEntry"; +import { SchoolEntryPublicCitizenApi } from "@eshg/school-entry-api"; import { queryOptions } from "@tanstack/react-query"; import { schoolEntryPublicCitizenApiQueryKey } from "@/lib/businessModules/schoolEntry/api/queries/apiQueryKeys"; diff --git a/citizen-portal/src/lib/businessModules/schoolEntry/api/queries/schoolEntryCitizenApi.ts b/citizen-portal/src/lib/businessModules/schoolEntry/api/queries/schoolEntryCitizenApi.ts index 89c40b989..e3158f7c9 100644 --- a/citizen-portal/src/lib/businessModules/schoolEntry/api/queries/schoolEntryCitizenApi.ts +++ b/citizen-portal/src/lib/businessModules/schoolEntry/api/queries/schoolEntryCitizenApi.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { SchoolEntryCitizenApi } from "@eshg/citizen-portal-api/schoolEntry"; +import { SchoolEntryCitizenApi } from "@eshg/school-entry-api"; import { queryOptions } from "@tanstack/react-query"; import { mapAppointment } from "@/lib/businessModules/schoolEntry/api/models/Appointment"; diff --git a/citizen-portal/src/lib/businessModules/schoolEntry/pages/citizenAnamnesis/CitizenAnamnesisForm.tsx b/citizen-portal/src/lib/businessModules/schoolEntry/pages/citizenAnamnesis/CitizenAnamnesisForm.tsx index 922728e5c..901e863c9 100644 --- a/citizen-portal/src/lib/businessModules/schoolEntry/pages/citizenAnamnesis/CitizenAnamnesisForm.tsx +++ b/citizen-portal/src/lib/businessModules/schoolEntry/pages/citizenAnamnesis/CitizenAnamnesisForm.tsx @@ -3,10 +3,6 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { - ApiAddCitizenAnamnesisRequest, - ApiSchoolEntryCountryCode, -} from "@eshg/citizen-portal-api/schoolEntry"; import { FormPlus } from "@eshg/lib-portal/components/form/FormPlus"; import { MultiStepForm, @@ -23,6 +19,10 @@ import { mapOptionalValue, } from "@eshg/lib-portal/helpers/form"; import { OptionalFieldValue } from "@eshg/lib-portal/types/form"; +import { + ApiAddCitizenAnamnesisRequest, + ApiSchoolEntryCountryCode, +} from "@eshg/school-entry-api"; import { Typography } from "@mui/joy"; import { Formik } from "formik"; import { useRouter } from "next/navigation"; diff --git a/citizen-portal/src/lib/businessModules/schoolEntry/pages/citizenAnamnesis/CitizenAnamnesisSidePanel.tsx b/citizen-portal/src/lib/businessModules/schoolEntry/pages/citizenAnamnesis/CitizenAnamnesisSidePanel.tsx index 84e4b01ae..24e2d5d36 100644 --- a/citizen-portal/src/lib/businessModules/schoolEntry/pages/citizenAnamnesis/CitizenAnamnesisSidePanel.tsx +++ b/citizen-portal/src/lib/businessModules/schoolEntry/pages/citizenAnamnesis/CitizenAnamnesisSidePanel.tsx @@ -3,11 +3,11 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiCitizenChild } from "@eshg/citizen-portal-api/schoolEntry"; import { useMultiStepForm } from "@eshg/lib-portal/components/form/MultiStepForm"; import { InternalLinkButton } from "@eshg/lib-portal/components/navigation/InternalLinkButton"; import { formatDate } from "@eshg/lib-portal/formatters/dateTime"; import { formatPersonName } from "@eshg/lib-portal/formatters/person"; +import { ApiCitizenChild } from "@eshg/school-entry-api"; import { CakeOutlined, PersonOutlined } from "@mui/icons-material"; import { Button, Typography } from "@mui/joy"; import { useFormikContext } from "formik"; diff --git a/citizen-portal/src/lib/businessModules/schoolEntry/pages/citizenAnamnesis/translations.ts b/citizen-portal/src/lib/businessModules/schoolEntry/pages/citizenAnamnesis/translations.ts index e0676af43..925a8cefc 100644 --- a/citizen-portal/src/lib/businessModules/schoolEntry/pages/citizenAnamnesis/translations.ts +++ b/citizen-portal/src/lib/businessModules/schoolEntry/pages/citizenAnamnesis/translations.ts @@ -3,8 +3,8 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiSchoolEntryCountryCode } from "@eshg/citizen-portal-api/schoolEntry"; import { EnumMap } from "@eshg/lib-portal/types/helpers"; +import { ApiSchoolEntryCountryCode } from "@eshg/school-entry-api"; const CountryCodesWithoutGeneralGroups = Object.values( ApiSchoolEntryCountryCode, diff --git a/citizen-portal/src/lib/businessModules/schoolEntry/pages/landingpage/LandingpageSidePanel.tsx b/citizen-portal/src/lib/businessModules/schoolEntry/pages/landingpage/LandingpageSidePanel.tsx index fcb3a6673..bb2fa769e 100644 --- a/citizen-portal/src/lib/businessModules/schoolEntry/pages/landingpage/LandingpageSidePanel.tsx +++ b/citizen-portal/src/lib/businessModules/schoolEntry/pages/landingpage/LandingpageSidePanel.tsx @@ -64,7 +64,7 @@ function PrivacyPolicyConfirmationForm() { ); return ( - <FormPlus style={{ display: "contents" }}> + <FormPlus sx={{ display: "contents" }}> <Stack gap={1}> <ConfirmationCheckboxField name="confirmPrivacyNotice" diff --git a/citizen-portal/src/lib/businessModules/travelMedicine/components/informationStatement/SignDocumentModalContent.tsx b/citizen-portal/src/lib/businessModules/travelMedicine/components/informationStatement/SignDocumentModalContent.tsx index 2dd666c00..4659d7338 100644 --- a/citizen-portal/src/lib/businessModules/travelMedicine/components/informationStatement/SignDocumentModalContent.tsx +++ b/citizen-portal/src/lib/businessModules/travelMedicine/components/informationStatement/SignDocumentModalContent.tsx @@ -4,7 +4,7 @@ */ import { InfoOutlined } from "@mui/icons-material"; -import { Button, Sheet, Stack, Typography } from "@mui/joy"; +import { Box, Button, Sheet, Stack, Typography } from "@mui/joy"; import { type Drauu, createDrauu } from "drauu"; import { useFormikContext } from "formik"; import { useEffect, useRef, useState } from "react"; @@ -97,7 +97,11 @@ export function SignDocumentModalContent({ <Typography startDecorator={<InfoOutlined />}> {t("modal.sign")} </Typography> - <svg ref={svgRef} style={{ width: "100%", height: "100%" }} /> + <Box + component={"svg"} + ref={svgRef} + sx={{ width: "100%", height: "100%" }} + /> </Sheet> <Stack direction="row" diff --git a/citizen-portal/src/lib/businessModules/travelMedicine/components/shared/components/InfoIconButton.tsx b/citizen-portal/src/lib/businessModules/travelMedicine/components/shared/components/InfoIconButton.tsx index 2426d334b..ef2d46c7d 100644 --- a/citizen-portal/src/lib/businessModules/travelMedicine/components/shared/components/InfoIconButton.tsx +++ b/citizen-portal/src/lib/businessModules/travelMedicine/components/shared/components/InfoIconButton.tsx @@ -5,14 +5,13 @@ import { InfoOutlined } from "@mui/icons-material"; import { IconButton as JoyIconButton } from "@mui/joy"; -import { CSSProperties, PropsWithChildren } from "react"; +import { PropsWithChildren } from "react"; export function InfoIconButton( props: PropsWithChildren<{ disabled: boolean; label: string; onClick: () => void; - style?: CSSProperties; }>, ) { return ( @@ -22,7 +21,6 @@ export function InfoIconButton( color="primary" size="sm" onClick={props.onClick} - style={props.style} > <InfoOutlined sx={{ width: "24px", height: "24px" }} /> </JoyIconButton> diff --git a/citizen-portal/src/lib/businessModules/travelMedicine/components/shared/components/RadioButtonsField.tsx b/citizen-portal/src/lib/businessModules/travelMedicine/components/shared/components/RadioButtonsField.tsx index 5e9955d8c..8c6c95d52 100644 --- a/citizen-portal/src/lib/businessModules/travelMedicine/components/shared/components/RadioButtonsField.tsx +++ b/citizen-portal/src/lib/businessModules/travelMedicine/components/shared/components/RadioButtonsField.tsx @@ -67,13 +67,11 @@ export function RadioButtonsField<T extends SelectOption = SelectOption>( value={field.input.value ? String(field.input.value) : ""} onChange={onChange} onBlur={field.input.onBlur} - style={{ - flexDirection: props.direction ?? "row", - }} sx={{ gap: 2, - marginLeft: "20px", + marginLeft: 2.5, marginBottom: 0, + flexDirection: props.direction ?? "row", }} data-testid={props["data-testid"]} > diff --git a/citizen-portal/src/lib/businessModules/travelMedicine/components/shared/components/document/AnamnesisQuestion.tsx b/citizen-portal/src/lib/businessModules/travelMedicine/components/shared/components/document/AnamnesisQuestion.tsx index c9217ba54..7d459ba1d 100644 --- a/citizen-portal/src/lib/businessModules/travelMedicine/components/shared/components/document/AnamnesisQuestion.tsx +++ b/citizen-portal/src/lib/businessModules/travelMedicine/components/shared/components/document/AnamnesisQuestion.tsx @@ -51,9 +51,8 @@ export function AnamnesisQuestion(props: Readonly<AnamnesisQuestionProps>) { )} {props.anamnesisQuestion.subElementText && ( <Stack - style={{ - marginLeft: "20px", - marginRight: "20px", + sx={{ + marginX: 2.5, }} > <DocumentTextareaElement diff --git a/citizen-portal/src/lib/businessModules/travelMedicine/components/shared/components/document/DocumentMultiSelectElement.tsx b/citizen-portal/src/lib/businessModules/travelMedicine/components/shared/components/document/DocumentMultiSelectElement.tsx index ded8c29cb..7e41e13da 100644 --- a/citizen-portal/src/lib/businessModules/travelMedicine/components/shared/components/document/DocumentMultiSelectElement.tsx +++ b/citizen-portal/src/lib/businessModules/travelMedicine/components/shared/components/document/DocumentMultiSelectElement.tsx @@ -62,9 +62,8 @@ export function DocumentMultiSelectElement({ return ( <Stack - style={{ - marginLeft: "20px", - marginRight: "20px", + sx={{ + marginX: 2.5, }} gap={1} > diff --git a/citizen-portal/src/lib/businessModules/travelMedicine/components/shared/contexts/DepartmentContext.tsx b/citizen-portal/src/lib/businessModules/travelMedicine/components/shared/contexts/DepartmentContext.tsx index 2ab83b789..53f7c0a60 100644 --- a/citizen-portal/src/lib/businessModules/travelMedicine/components/shared/contexts/DepartmentContext.tsx +++ b/citizen-portal/src/lib/businessModules/travelMedicine/components/shared/contexts/DepartmentContext.tsx @@ -3,7 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiGetDepartmentInfoResponse } from "@eshg/citizen-portal-api/base"; +import { ApiGetDepartmentInfoResponse } from "@eshg/base-api"; import { RequiresChildren } from "@eshg/lib-portal/types/react"; import { Dispatch, diff --git a/citizen-portal/src/lib/businessModules/travelMedicine/helpers/appointmentFormHelper.ts b/citizen-portal/src/lib/businessModules/travelMedicine/helpers/appointmentFormHelper.ts index e9c7266c3..683618f40 100644 --- a/citizen-portal/src/lib/businessModules/travelMedicine/helpers/appointmentFormHelper.ts +++ b/citizen-portal/src/lib/businessModules/travelMedicine/helpers/appointmentFormHelper.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiGetDepartmentInfoResponse } from "@eshg/citizen-portal-api/base"; +import { ApiGetDepartmentInfoResponse } from "@eshg/base-api"; import { ApiAppointmentType, ApiCountryCode, diff --git a/citizen-portal/src/lib/i18n/useTranslateCountry.ts b/citizen-portal/src/lib/i18n/useTranslateCountry.ts index db573d4a1..ce7c1f3a6 100644 --- a/citizen-portal/src/lib/i18n/useTranslateCountry.ts +++ b/citizen-portal/src/lib/i18n/useTranslateCountry.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { ApiCountryCode } from "@eshg/citizen-portal-api/base"; +import { ApiCountryCode } from "@eshg/base-api"; import { countryOptions, translateCountry, diff --git a/citizen-portal/src/lib/shared/api/clients.ts b/citizen-portal/src/lib/shared/api/clients.ts index 59452c938..e82e1eb13 100644 --- a/citizen-portal/src/lib/shared/api/clients.ts +++ b/citizen-portal/src/lib/shared/api/clients.ts @@ -3,11 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { Configuration } from "@eshg/citizen-portal-api/base"; -import { - DepartmentApi, - PublicConfigApi, -} from "@eshg/citizen-portal-api/base/apis"; +import { Configuration, DepartmentApi, PublicConfigApi } from "@eshg/base-api"; import { useApiConfiguration } from "@eshg/lib-portal/api/ApiProvider"; function useConfiguration() { diff --git a/citizen-portal/src/lib/shared/api/models/DepartmentInfo.ts b/citizen-portal/src/lib/shared/api/models/DepartmentInfo.ts index e3460f99d..eee73973b 100644 --- a/citizen-portal/src/lib/shared/api/models/DepartmentInfo.ts +++ b/citizen-portal/src/lib/shared/api/models/DepartmentInfo.ts @@ -7,7 +7,7 @@ import { ApiCountryCode, ApiGetDepartmentInfoResponse, ApiLocation, -} from "@eshg/citizen-portal-api/base"; +} from "@eshg/base-api"; export interface DepartmentInfo { readonly name: string; diff --git a/citizen-portal/src/lib/shared/api/queries/department.ts b/citizen-portal/src/lib/shared/api/queries/department.ts index 05a6deac1..bec631d9f 100644 --- a/citizen-portal/src/lib/shared/api/queries/department.ts +++ b/citizen-portal/src/lib/shared/api/queries/department.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { DepartmentApi } from "@eshg/citizen-portal-api/base"; +import { DepartmentApi } from "@eshg/base-api"; import { queryOptions, useQuery, diff --git a/citizen-portal/src/lib/shared/components/AddressSection.tsx b/citizen-portal/src/lib/shared/components/AddressSection.tsx index dbe85cdcb..3597ac29f 100644 --- a/citizen-portal/src/lib/shared/components/AddressSection.tsx +++ b/citizen-portal/src/lib/shared/components/AddressSection.tsx @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { ApiGetDepartmentInfoResponse } from "@eshg/citizen-portal-api/base"; +import { ApiGetDepartmentInfoResponse } from "@eshg/base-api"; import { FmdGoodOutlined } from "@mui/icons-material"; import { Typography } from "@mui/joy"; diff --git a/citizen-portal/src/lib/shared/components/ContactSection.tsx b/citizen-portal/src/lib/shared/components/ContactSection.tsx index 1e14f8710..3911e6b72 100644 --- a/citizen-portal/src/lib/shared/components/ContactSection.tsx +++ b/citizen-portal/src/lib/shared/components/ContactSection.tsx @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { ApiGetDepartmentInfoResponse } from "@eshg/citizen-portal-api/base"; +import { ApiGetDepartmentInfoResponse } from "@eshg/base-api"; import { ExternalLink } from "@eshg/lib-portal/components/navigation/ExternalLink"; import { ChatBubbleOutlineOutlined } from "@mui/icons-material"; import { Typography } from "@mui/joy"; diff --git a/citizen-portal/src/lib/shared/components/card/ServiceCard.tsx b/citizen-portal/src/lib/shared/components/card/ServiceCard.tsx index a9b060f08..f0ebc6cb6 100644 --- a/citizen-portal/src/lib/shared/components/card/ServiceCard.tsx +++ b/citizen-portal/src/lib/shared/components/card/ServiceCard.tsx @@ -20,7 +20,7 @@ export function ServiceCard(props: ServiceCardProps) { <NavigationLink href={props.href} passHref - style={{ + sx={{ width: "100%", textDecoration: "none", }} @@ -44,7 +44,7 @@ export function ServiceCard(props: ServiceCardProps) { }} > <GradientIcon - style={{ width: "153px", height: "153px" }} + sx={{ width: "153px", height: "153px" }} iconClass={props.icon} /> </Box> diff --git a/citizen-portal/src/lib/shared/components/card/ServiceCardContainer.tsx b/citizen-portal/src/lib/shared/components/card/ServiceCardContainer.tsx index 2f494214c..dc2f85ca0 100644 --- a/citizen-portal/src/lib/shared/components/card/ServiceCardContainer.tsx +++ b/citizen-portal/src/lib/shared/components/card/ServiceCardContainer.tsx @@ -5,7 +5,7 @@ "use client"; -import { ApiBusinessModule } from "@eshg/citizen-portal-api/base"; +import { ApiBusinessModule } from "@eshg/base-api"; import { MedicalServicesOutlined, PhoneInTalkOutlined, diff --git a/citizen-portal/src/lib/shared/components/centralFile/AddressFields.tsx b/citizen-portal/src/lib/shared/components/centralFile/AddressFields.tsx index d7dacd4dd..74b998f7c 100644 --- a/citizen-portal/src/lib/shared/components/centralFile/AddressFields.tsx +++ b/citizen-portal/src/lib/shared/components/centralFile/AddressFields.tsx @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { ApiGetReferenceFacilityResponse } from "@eshg/citizen-portal-api/base"; +import { ApiGetReferenceFacilityResponse } from "@eshg/base-api"; import StreetIcon from "@mui/icons-material/BusinessOutlined"; import AddressAdditionIcon from "@mui/icons-material/InfoOutlined"; import PostalCodeIcon from "@mui/icons-material/MapOutlined"; diff --git a/citizen-portal/src/lib/shared/components/centralFile/BaseFacilityFields.tsx b/citizen-portal/src/lib/shared/components/centralFile/BaseFacilityFields.tsx index 40d7bb1d8..b8b4920e0 100644 --- a/citizen-portal/src/lib/shared/components/centralFile/BaseFacilityFields.tsx +++ b/citizen-portal/src/lib/shared/components/centralFile/BaseFacilityFields.tsx @@ -6,7 +6,7 @@ import { ApiFacilityContactPerson, ApiGetReferenceFacilityResponse, -} from "@eshg/citizen-portal-api/base"; +} from "@eshg/base-api"; import { ExternalLink } from "@eshg/lib-portal/components/navigation/ExternalLink"; import SalutationIcon from "@mui/icons-material/HowToRegOutlined"; import MailIcon from "@mui/icons-material/MailOutlined"; diff --git a/citizen-portal/src/lib/shared/components/centralFile/BasePersonFields.tsx b/citizen-portal/src/lib/shared/components/centralFile/BasePersonFields.tsx index fc2a15d4a..556ad7c7b 100644 --- a/citizen-portal/src/lib/shared/components/centralFile/BasePersonFields.tsx +++ b/citizen-portal/src/lib/shared/components/centralFile/BasePersonFields.tsx @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { ApiGetReferencePersonResponse } from "@eshg/citizen-portal-api/base"; +import { ApiGetReferencePersonResponse } from "@eshg/base-api"; import { ExternalLink } from "@eshg/lib-portal/components/navigation/ExternalLink"; import { formatDate } from "@eshg/lib-portal/formatters/dateTime"; import DateOfBirthIcon from "@mui/icons-material/CakeOutlined"; diff --git a/citizen-portal/src/lib/shared/components/form/file/FileField.tsx b/citizen-portal/src/lib/shared/components/form/file/FileField.tsx index da8a3e830..c9c8c9eff 100644 --- a/citizen-portal/src/lib/shared/components/form/file/FileField.tsx +++ b/citizen-portal/src/lib/shared/components/form/file/FileField.tsx @@ -21,6 +21,7 @@ import { FormLabelProps, Stack, Typography, + styled, } from "@mui/joy"; import { ChangeEvent, ReactNode, useId, useRef } from "react"; import { isDefined, isFunction, isString } from "remeda"; @@ -29,6 +30,8 @@ import { useTranslation } from "@/lib/i18n/client"; import { FileButton, StyledRemoveButton } from "./buttonVariants"; +const HiddenInput = styled("input")({ display: "none" }); + function resolveAcceptedFileTypes( accept: FileType | FileType[] | undefined, ): FileType[] { @@ -175,7 +178,7 @@ export function FileField(props: Readonly<FileFieldProps>) { > {isFileSelected ? props.placeholderSelected : props.placeholder} </FileButton> - <input + <HiddenInput ref={fileInputRef} id={fileInputId} type="file" @@ -185,7 +188,6 @@ export function FileField(props: Readonly<FileFieldProps>) { required={field.required} onChange={handleChange} tabIndex={-1} - style={{ display: "none" }} /> {isDefined(field.helperText) && ( <FormHelperText id={`${fileInputId}-helper-text`}> diff --git a/citizen-portal/src/lib/shared/components/icon/GradientIcon.tsx b/citizen-portal/src/lib/shared/components/icon/GradientIcon.tsx index 9133f18d1..edc9502b2 100644 --- a/citizen-portal/src/lib/shared/components/icon/GradientIcon.tsx +++ b/citizen-portal/src/lib/shared/components/icon/GradientIcon.tsx @@ -5,10 +5,12 @@ import { SvgIconComponent } from "@mui/icons-material"; import { SvgIconProps } from "@mui/joy"; +import { SxProps } from "@mui/joy/styles/types"; import { createElement } from "react"; -export interface GradientIconProps extends SvgIconProps { +export interface GradientIconProps extends Omit<SvgIconProps, "style"> { iconClass: SvgIconComponent; + sx?: SxProps; } export function GradientIcon({ iconClass, ...props }: GradientIconProps) { diff --git a/citizen-portal/src/lib/shared/hooks/useHasBusinessModule.ts b/citizen-portal/src/lib/shared/hooks/useHasBusinessModule.ts index 539aedbb0..62271c388 100644 --- a/citizen-portal/src/lib/shared/hooks/useHasBusinessModule.ts +++ b/citizen-portal/src/lib/shared/hooks/useHasBusinessModule.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { ApiBusinessModule } from "@eshg/citizen-portal-api/base"; +import { ApiBusinessModule } from "@eshg/base-api"; import { useCallback } from "react"; import { useGetConfig } from "@/lib/shared/api/queries/publicConfig"; diff --git a/citizen-portal/src/lib/shared/types.ts b/citizen-portal/src/lib/shared/types.ts index 8c53fd6f7..ce6291205 100644 --- a/citizen-portal/src/lib/shared/types.ts +++ b/citizen-portal/src/lib/shared/types.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { ApiGetDepartmentInfoResponse } from "@eshg/citizen-portal-api/base"; +import { ApiGetDepartmentInfoResponse } from "@eshg/base-api"; export interface DepartmentInfoProps { department: ApiGetDepartmentInfoResponse; diff --git a/config/eslint.next.js b/config/eslint.next.js index d4bab3541..33d2aa2b5 100644 --- a/config/eslint.next.js +++ b/config/eslint.next.js @@ -141,6 +141,29 @@ const nextBaseConfig = tseslint.config( ], }, ], + + "react/forbid-dom-props": [ + "error", + { + forbid: [ + { + propName: "style", + message: `Avoid using "style" prop. Prefer using Joy's Box or Stack components and the "sx" prop. Or create a styled-component using the "styled" function.`, + }, + ], + }, + ], + "react/forbid-component-props": [ + "error", + { + forbid: [ + { + propName: "style", + message: `Avoid using "style" prop. Prefer using the "sx" prop. Or create a styled-component using the "styled" function.`, + }, + ], + }, + ], }, }, { @@ -181,31 +204,4 @@ export const eslintNextConfigs = { "@next/next/no-html-link-for-pages": "off", // libs contain no pages }, }), - // These rules should be move into nextBaseConfig once all portal apps have removed all style attributes. - forbidStyleProp: tseslint.config({ - rules: { - "react/forbid-dom-props": [ - "error", - { - forbid: [ - { - propName: "style", - message: `Avoid using "style" prop. Prefer using Joy's Box or Stack components and the "sx" prop. Or create a styled-component using the "styled" function.`, - }, - ], - }, - ], - "react/forbid-component-props": [ - "error", - { - forbid: [ - { - propName: "style", - message: `Avoid using "style" prop. Prefer using the "sx" prop. Or create a styled-component using the "styled" function.`, - }, - ], - }, - ], - }, - }), }; diff --git a/docs/gradle.adoc b/docs/gradle.adoc index fe7d1e8da..5d082911f 100644 --- a/docs/gradle.adoc +++ b/docs/gradle.adoc @@ -34,13 +34,13 @@ These are also available within the subprojects. == Tasks for the subprojects [cols="1,1"] |=== -| *Command* | *Description* -| `./gradlew [project-name]:run` | Start the application in production mode -| `./gradlew [project-name]:runDev` | Start the application in development mode (hot-code reloading) -| `./gradlew [project-name]:build` | Run all checks and builds the {project-name} -| `./gradlew [project-name]:test` | Run all tests in a single run -| `./gradlew [project-name]:testWatch` | Run all tests in watch mode (reruns tests when they change) -| `./gradlew [project-name]:analyzeBundle` | Generates a visual report of the size of each module and their dependencies +| *Command* | *Description* +| `./gradlew [project-name]:run` | Start the application in production mode +| `./gradlew [project-name]:runDev [-Pwebpack]` | Start the application in development mode (hot-code reloading). Use `-Pwebpack` to use webpack instead of Turbopack (default). +| `./gradlew [project-name]:build` | Run all checks and builds the {project-name} +| `./gradlew [project-name]:test` | Run all tests in a single run +| `./gradlew [project-name]:testWatch` | Run all tests in watch mode (reruns tests when they change) +| `./gradlew [project-name]:analyzeBundle` | Generates a visual report of the size of each module and their dependencies |=== *Notice:* The `run` task is recommended over the `runDev` task for demos and reviews, because in development mode, pages will be built ad-hoc. This can significantly reduce the runtime performance, especially when using screen sharing. diff --git a/docs/queries-and-mutations.adoc b/docs/queries-and-mutations.adoc index 26204cd59..b9504133a 100644 --- a/docs/queries-and-mutations.adoc +++ b/docs/queries-and-mutations.adoc @@ -26,7 +26,7 @@ To properly configure the API clients for usage with TanStack Query, we define r .$PATH_TO_MODULE/api/clients.ts [,ts] ---- -import { AppointmentBlockApi, Configuration, SchoolEntryApi } from "@eshg/employee-portal-api/schoolEntry"; +import { AppointmentBlockApi, Configuration, SchoolEntryApi } from "@eshg/school-entry-api"; import { useApiConfiguration } from "@eshg/lib-portal/api/ApiProvider"; function useConfiguration() { diff --git a/employee-portal-api/build.gradle b/employee-portal-api/build.gradle index de79be5fe..760a3f8f8 100644 --- a/employee-portal-api/build.gradle +++ b/employee-portal-api/build.gradle @@ -11,11 +11,8 @@ openapiGenerator { 'libEditor' : backendDir.file('lib-editor/openApi.yaml'), 'libStatistics' : backendDir.file('lib-statistics/openApi.yaml'), 'inspection' : backendDir.file('inspection/openApi.yaml'), - 'measlesProtection' : backendDir.file('measles-protection/openApi.yaml'), 'opendata' : backendDir.file('opendata/openApi.yaml'), - 'schoolEntry' : backendDir.file('school-entry/openApi.yaml'), 'travelMedicine' : backendDir.file('travel-medicine/openApi.yaml'), - 'statistics' : backendDir.file('statistics/openApi.yaml'), 'chatManagement' : backendDir.file('chat-management/openApi.yaml'), 'stiProtection' : backendDir.file('sti-protection/openApi.yaml'), 'medicalRegistry' : backendDir.file('medical-registry/openApi.yaml'), diff --git a/employee-portal/gradleDependencies.json b/employee-portal/gradleDependencies.json index b45fa0665..6beec3bbf 100644 --- a/employee-portal/gradleDependencies.json +++ b/employee-portal/gradleDependencies.json @@ -5,6 +5,9 @@ ":dental-api", ":employee-portal-api", ":lib-employee-portal", - ":lib-portal" + ":lib-portal", + ":measles-protection-api", + ":school-entry-api", + ":statistics-api" ] } diff --git a/employee-portal/package.json b/employee-portal/package.json index 812a93e23..a7f773239 100644 --- a/employee-portal/package.json +++ b/employee-portal/package.json @@ -13,6 +13,9 @@ "@eshg/employee-portal-api": "workspace:*", "@eshg/lib-employee-portal": "workspace:*", "@eshg/lib-portal": "workspace:*", + "@eshg/measles-protection-api": "workspace:*", + "@eshg/school-entry-api": "workspace:*", + "@eshg/statistics-api": "workspace:*", "@fontsource/poppins": "catalog:joy", "@fontsource/source-code-pro": "catalog:joy", "@fullcalendar/core": "catalog:fullcalendar", @@ -29,8 +32,8 @@ "@tanstack/react-query": "catalog:common", "@tanstack/react-table": "catalog:common", "compressorjs": "1.2.1", - "drauu": "catalog:common", "date-fns": "catalog:common", + "drauu": "catalog:common", "echarts": "5.6.0", "echarts-for-react": "3.0.2", "formik": "catalog:common", @@ -66,11 +69,11 @@ "@vitejs/plugin-react": "catalog:vitest", "@vitest/coverage-istanbul": "catalog:vitest", "eslint": "catalog:eslint", - "eslint-plugin-import": "catalog:eslint", "eslint-config-next": "catalog:next", "eslint-config-prettier": "catalog:eslint", - "eslint-plugin-unused-imports": "catalog:eslint", + "eslint-plugin-import": "catalog:eslint", "eslint-plugin-promise": "catalog:eslint", + "eslint-plugin-unused-imports": "catalog:eslint", "prettier": "catalog:prettier", "typescript": "catalog:common", "vite-tsconfig-paths": "catalog:vitest", diff --git a/employee-portal/src/app/(businessModules)/dental/children/[childId]/details/page.tsx b/employee-portal/src/app/(businessModules)/dental/children/[childId]/details/page.tsx index acbd46992..c8b3bec65 100644 --- a/employee-portal/src/app/(businessModules)/dental/children/[childId]/details/page.tsx +++ b/employee-portal/src/app/(businessModules)/dental/children/[childId]/details/page.tsx @@ -5,16 +5,16 @@ "use client"; +import { getChildDetailsQuery } from "@eshg/dental/api/queries/childApi"; +import { useDentalApi } from "@eshg/dental/shared/DentalProvider"; import { DisabledFormProvider } from "@eshg/lib-portal/components/form/DisabledFormContext"; import { useSuspenseQuery } from "@tanstack/react-query"; import { DentalChildPageProps } from "@/app/(businessModules)/dental/children/[childId]/layout"; -import { useChildApi } from "@/lib/businessModules/dental/api/clients"; -import { getChildDetailsQuery } from "@/lib/businessModules/dental/api/queries/childApi"; import { ChildDetailsPage } from "@/lib/businessModules/dental/features/children/details/ChildDetails"; export default function DentalChildDetailsPage(props: DentalChildPageProps) { - const childApi = useChildApi(); + const { childApi } = useDentalApi(); const childResult = useSuspenseQuery( getChildDetailsQuery(childApi, props.params.childId), ); diff --git a/employee-portal/src/app/(businessModules)/dental/children/[childId]/examinations/[examinationId]/page.tsx b/employee-portal/src/app/(businessModules)/dental/children/[childId]/examinations/[examinationId]/page.tsx index fade961fd..6007f5c6d 100644 --- a/employee-portal/src/app/(businessModules)/dental/children/[childId]/examinations/[examinationId]/page.tsx +++ b/employee-portal/src/app/(businessModules)/dental/children/[childId]/examinations/[examinationId]/page.tsx @@ -6,24 +6,30 @@ "use client"; import { UpdateExaminationRequest } from "@eshg/dental-api"; +import { + ApiExaminationResult, + ApiFluoridationExaminationResult, + ApiScreeningExaminationResult, +} from "@eshg/dental-api"; +import { Examination } from "@eshg/dental/api/models/Examination"; +import { useUpdateExamination } from "@eshg/dental/api/mutations/childApi"; +import { getExaminationQuery } from "@eshg/dental/api/queries/childApi"; +import { useDentalApi } from "@eshg/dental/shared/DentalProvider"; import { mapOptionalValue, + mapRequiredValue, parseOptionalValue, } from "@eshg/lib-portal/helpers/form"; import { useSuspenseQuery } from "@tanstack/react-query"; import { DentalChildPageProps } from "@/app/(businessModules)/dental/children/[childId]/layout"; -import { useChildApi } from "@/lib/businessModules/dental/api/clients"; -import { Examination } from "@/lib/businessModules/dental/api/models/Examination"; -import { useUpdateExamination } from "@/lib/businessModules/dental/api/mutations/childApi"; -import { getExaminationQuery } from "@/lib/businessModules/dental/api/queries/childApi"; import { ExaminationDetails, ExaminationFormValues, } from "@/lib/businessModules/dental/features/children/details/ExaminationDetails"; export default function ExaminationDetailsPage(props: DentalChildPageProps) { - const childApi = useChildApi(); + const { childApi } = useDentalApi(); const examinationId = props.params.examinationId; const { data: examination } = useSuspenseQuery( getExaminationQuery(childApi, examinationId), @@ -44,7 +50,33 @@ export default function ExaminationDetailsPage(props: DentalChildPageProps) { } function mapToFormValues(apiExamination: Examination): ExaminationFormValues { - return { note: parseOptionalValue(apiExamination.note) }; + return { + screening: apiExamination.screening, + fluoridation: apiExamination.fluoridation, + note: parseOptionalValue(apiExamination.note), + ...mapExaminationResultFormValues(apiExamination), + }; +} + +function mapExaminationResultFormValues(apiExamination: Examination) { + if (apiExamination.screening) { + const screeningResult = + apiExamination.result as ApiScreeningExaminationResult; + return { + oralHygieneStatus: parseOptionalValue(screeningResult?.oralHygieneStatus), + fluorideVarnishApplied: parseOptionalValue( + screeningResult?.fluorideVarnishApplied, + ), + }; + } else { + const fluoridationResult = + apiExamination.result as ApiFluoridationExaminationResult; + return { + fluorideVarnishApplied: parseOptionalValue( + fluoridationResult?.fluorideVarnishApplied, + ), + }; + } } function mapToRequest( @@ -57,6 +89,28 @@ function mapToRequest( apiUpdateExaminationRequest: { version, note: mapOptionalValue(formValues.note), + result: mapExaminationResultRequest(formValues), }, }; } + +function mapExaminationResultRequest( + formValues: ExaminationFormValues, +): ApiExaminationResult | undefined { + if (formValues.screening) { + return { + type: "ScreeningExaminationResult", + oralHygieneStatus: mapOptionalValue(formValues.oralHygieneStatus), + fluorideVarnishApplied: + mapOptionalValue(formValues.fluorideVarnishApplied) ?? false, + toothDiagnoses: [], + }; + } else if (formValues.fluoridation) { + return { + type: "FluoridationExaminationResult", + fluorideVarnishApplied: mapRequiredValue( + formValues.fluorideVarnishApplied, + ), + }; + } +} diff --git a/employee-portal/src/app/(businessModules)/dental/children/[childId]/examinations/page.tsx b/employee-portal/src/app/(businessModules)/dental/children/[childId]/examinations/page.tsx index b7733263b..3f66985df 100644 --- a/employee-portal/src/app/(businessModules)/dental/children/[childId]/examinations/page.tsx +++ b/employee-portal/src/app/(businessModules)/dental/children/[childId]/examinations/page.tsx @@ -5,18 +5,18 @@ "use client"; +import { getChildDetailsQuery } from "@eshg/dental/api/queries/childApi"; +import { useDentalApi } from "@eshg/dental/shared/DentalProvider"; import { useSuspenseQuery } from "@tanstack/react-query"; import { DentalChildPageProps } from "@/app/(businessModules)/dental/children/[childId]/layout"; -import { useChildApi } from "@/lib/businessModules/dental/api/clients"; -import { getChildDetailsQuery } from "@/lib/businessModules/dental/api/queries/childApi"; import { ExaminationsTable } from "@/lib/businessModules/dental/features/children/details/ExaminationsTable"; export default function DentalChildExaminationsPage( props: DentalChildPageProps, ) { const childId = props.params.childId; - const childApi = useChildApi(); + const { childApi } = useDentalApi(); const { data: child } = useSuspenseQuery( getChildDetailsQuery(childApi, childId), ); diff --git a/employee-portal/src/app/(businessModules)/dental/children/[childId]/progress-entries/page.tsx b/employee-portal/src/app/(businessModules)/dental/children/[childId]/progress-entries/page.tsx index 6755a24fd..a04b8e75b 100644 --- a/employee-portal/src/app/(businessModules)/dental/children/[childId]/progress-entries/page.tsx +++ b/employee-portal/src/app/(businessModules)/dental/children/[childId]/progress-entries/page.tsx @@ -6,6 +6,11 @@ "use client"; import { ApiUserRole } from "@eshg/base-api"; +import { + fileApiQueryKey, + progressEntryApiQueryKey, +} from "@eshg/dental/api/queries/apiQueryKeys"; +import { useDentalApi } from "@eshg/dental/shared/DentalProvider"; import { moduleUserGroup } from "@eshg/dental/shared/moduleUserGroup"; import { keyDocumentTypes, @@ -13,27 +18,6 @@ import { } from "@eshg/dental/shared/progressEntries"; import { DentalChildPageParams } from "@/app/(businessModules)/dental/children/[childId]/layout"; -import { useDownloadDentalFile } from "@/lib/businessModules/dental/api/downloads/files"; -import { - useDecideApprovalRequest, - useGrantDeletionForAllRequests, -} from "@/lib/businessModules/dental/api/mutations/approvalRequestApi"; -import { - useDeleteFile, - useRequestFileDeletion, -} from "@/lib/businessModules/dental/api/mutations/fileApi"; -import { - useCreateProgressEntry, - useDeleteProgressEntry, - usePatchProgressEntry, - useRequestProgressEntryDeletion, -} from "@/lib/businessModules/dental/api/mutations/progressEntryApi"; -import { useGetMetaDataHistory } from "@/lib/businessModules/dental/api/queries/fileApi"; -import { - useFetchProgressEntries, - useFetchProgressEntryDetails, - useGetManualProgressEntryHistory, -} from "@/lib/businessModules/dental/api/queries/progressEntryApi"; import { ProgressEntriesPage } from "@/lib/shared/components/procedures/progress-entries/ProgressEntriesPage"; import { ProgressEntriesUrlParams } from "@/lib/shared/components/procedures/progress-entries/types"; @@ -41,27 +25,23 @@ export default function DentalProgressEntriesPage( props: ProgressEntriesUrlParams<DentalChildPageParams>, ) { const { params, searchParams } = props; + const { progressEntryApi, procedureApi, fileApi, approvalRequestApi } = + useDentalApi(); + return ( <ProgressEntriesPage - useCreateProgressEntry={useCreateProgressEntry} - useDeleteFile={useDeleteFile} - useDeleteProgressEntry={useDeleteProgressEntry} - usePatchProgressEntry={usePatchProgressEntry} - useFetchProgressEntries={useFetchProgressEntries} - useFetchProgressEntryDetails={useFetchProgressEntryDetails} procedureId={params.childId} searchParams={searchParams} leaderRole={ApiUserRole.DentalLeader} - useRequestProgressEntryDeletion={useRequestProgressEntryDeletion} - useRequestFileDeletion={useRequestFileDeletion} - useDecideApprovalRequest={useDecideApprovalRequest} - useGrantDeletionForAllRequests={useGrantDeletionForAllRequests} - useDownloadFile={useDownloadDentalFile} - useGetManualProgressEntryHistory={useGetManualProgressEntryHistory} - useGetMetaDataHistory={useGetMetaDataHistory} systemProgressEntryTypes={systemProgressEntryTypeTitles} additionalKeyDocumentTypes={keyDocumentTypes} groupName={moduleUserGroup.group} + progressEntryApiQueryKey={progressEntryApiQueryKey} + progressEntryApi={progressEntryApi} + procedureApi={procedureApi} + fileApiQueryKey={fileApiQueryKey} + fileApi={fileApi} + approvalRequestApi={approvalRequestApi} /> ); } diff --git a/employee-portal/src/app/(businessModules)/dental/layout.tsx b/employee-portal/src/app/(businessModules)/dental/layout.tsx new file mode 100644 index 000000000..500b02bed --- /dev/null +++ b/employee-portal/src/app/(businessModules)/dental/layout.tsx @@ -0,0 +1,18 @@ +/** + * Copyright 2025 cronn GmbH + * SPDX-License-Identifier: AGPL-3.0-only + */ + +import { DentalProvider } from "@eshg/dental/shared/DentalProvider"; +import { RequiresChildren } from "@eshg/lib-portal/types/react"; + +import { env } from "@/env/server"; +import { SidebarScope } from "@/lib/shared/components/drawer/SidebarScope"; + +export default function DentalLayout(props: RequiresChildren) { + return ( + <DentalProvider baseUrl={env.PUBLIC_DENTAL_BACKEND_URL}> + <SidebarScope>{props.children}</SidebarScope> + </DentalProvider> + ); +} diff --git a/employee-portal/src/app/(businessModules)/dental/prophylaxis-sessions/[prophylaxisSessionId]/layout.tsx b/employee-portal/src/app/(businessModules)/dental/prophylaxis-sessions/[prophylaxisSessionId]/layout.tsx index cf448a187..806458a00 100644 --- a/employee-portal/src/app/(businessModules)/dental/prophylaxis-sessions/[prophylaxisSessionId]/layout.tsx +++ b/employee-portal/src/app/(businessModules)/dental/prophylaxis-sessions/[prophylaxisSessionId]/layout.tsx @@ -5,11 +5,11 @@ "use client"; +import { getProphylaxisSessionQuery } from "@eshg/dental/api/queries/prophylaxisSessionApi"; +import { useDentalApi } from "@eshg/dental/shared/DentalProvider"; import { useSuspenseQuery } from "@tanstack/react-query"; import { PropsWithChildren } from "react"; -import { useProphylaxisSessionApi } from "@/lib/businessModules/dental/api/clients"; -import { getProphylaxisSessionQuery } from "@/lib/businessModules/dental/api/queries/prophylaxisSessionApi"; import { ProphylaxisSessionStoreProvider } from "@/lib/businessModules/dental/features/prophylaxisSessions/store/ProphylaxisSessionStoreProvider"; export type ProphylaxisSessionPageProps = Readonly<{ @@ -23,7 +23,7 @@ interface ProphylaxisSessionPageParams { export default function ProphylaxisSessionPageLayout( props: PropsWithChildren<ProphylaxisSessionPageProps>, ) { - const prophylaxisSessionApi = useProphylaxisSessionApi(); + const { prophylaxisSessionApi } = useDentalApi(); const { data: prophylaxisSession } = useSuspenseQuery( getProphylaxisSessionQuery(prophylaxisSessionApi, { prophylaxisSessionId: props.params.prophylaxisSessionId, diff --git a/employee-portal/src/app/(businessModules)/inspection/procedures/[id]/progress-entries/page.tsx b/employee-portal/src/app/(businessModules)/inspection/procedures/[id]/progress-entries/page.tsx index 8b9b408ab..02cabcff9 100644 --- a/employee-portal/src/app/(businessModules)/inspection/procedures/[id]/progress-entries/page.tsx +++ b/employee-portal/src/app/(businessModules)/inspection/procedures/[id]/progress-entries/page.tsx @@ -8,27 +8,16 @@ import { ApiUserRole } from "@eshg/base-api"; import { EditInspectionPageParams } from "@/app/(businessModules)/inspection/procedures/[id]/layout"; -import { useDownloadInspectionFile } from "@/lib/businessModules/inspection/api/download/files"; import { - useDecideApprovalRequest, - useGrantDeletionForAllRequests, -} from "@/lib/businessModules/inspection/api/mutations/approvalRequests"; + useApprovalRequestApi, + useFileApi, + useProcedureApi, + useProgressEntryApi, +} from "@/lib/businessModules/inspection/api/clients"; import { - useDeleteFile, - useRequestFileDeletion, -} from "@/lib/businessModules/inspection/api/mutations/files"; -import { - useCreateProgressEntry, - useDeleteProgressEntry, - usePatchProgressEntry, - useRequestProgressEntryDeletion, -} from "@/lib/businessModules/inspection/api/mutations/progressEntries"; -import { useGetMetaDataHistory } from "@/lib/businessModules/inspection/api/queries/files"; -import { - useFetchProgressEntries, - useFetchProgressEntryDetails, - useGetManualProgressEntryHistory, -} from "@/lib/businessModules/inspection/api/queries/progressEntries"; + fileApiQueryKey, + progressEntryApiQueryKey, +} from "@/lib/businessModules/inspection/api/queries/apiQueryKeys"; import { systemProgressEntryTypeTitles } from "@/lib/businessModules/inspection/shared/constants"; import { moduleUserGroup } from "@/lib/businessModules/inspection/shared/moduleUserGroup"; import { getHeadersForOfflineCaching } from "@/lib/businessModules/inspection/shared/offline/getHeadersForOfflineCaching"; @@ -39,27 +28,25 @@ export default function InspectionProgressEntriesPage( props: ProgressEntriesUrlParams<EditInspectionPageParams>, ) { const { params, searchParams } = props; + const progressEntryApi = useProgressEntryApi(); + const procedureApi = useProcedureApi(); + const fileApi = useFileApi(); + const approvalRequestApi = useApprovalRequestApi(); + return ( <ProgressEntriesPage - useCreateProgressEntry={useCreateProgressEntry} - useDeleteFile={useDeleteFile} - useDeleteProgressEntry={useDeleteProgressEntry} - usePatchProgressEntry={usePatchProgressEntry} - useFetchProgressEntries={useFetchProgressEntries} - useFetchProgressEntryDetails={useFetchProgressEntryDetails} procedureId={params.id} searchParams={searchParams} leaderRole={ApiUserRole.InspectionLeader} - useRequestProgressEntryDeletion={useRequestProgressEntryDeletion} - useRequestFileDeletion={useRequestFileDeletion} - useDecideApprovalRequest={useDecideApprovalRequest} - useGrantDeletionForAllRequests={useGrantDeletionForAllRequests} - useDownloadFile={useDownloadInspectionFile} - useGetManualProgressEntryHistory={useGetManualProgressEntryHistory} - useGetMetaDataHistory={useGetMetaDataHistory} systemProgressEntryTypes={systemProgressEntryTypeTitles} groupName={moduleUserGroup.group} getInitOverrides={getHeadersForOfflineCaching} + progressEntryApiQueryKey={progressEntryApiQueryKey} + progressEntryApi={progressEntryApi} + procedureApi={procedureApi} + fileApiQueryKey={fileApiQueryKey} + fileApi={fileApi} + approvalRequestApi={approvalRequestApi} /> ); } diff --git a/employee-portal/src/app/(businessModules)/measles-protection/procedures/[id]/@tabs/progress-entries/page.tsx b/employee-portal/src/app/(businessModules)/measles-protection/procedures/[id]/@tabs/progress-entries/page.tsx index 5c56d5a4e..62f2ed31f 100644 --- a/employee-portal/src/app/(businessModules)/measles-protection/procedures/[id]/@tabs/progress-entries/page.tsx +++ b/employee-portal/src/app/(businessModules)/measles-protection/procedures/[id]/@tabs/progress-entries/page.tsx @@ -7,27 +7,16 @@ import { ApiUserRole } from "@eshg/base-api"; -import { useDownloadMeaslesProtectionFile } from "@/lib/businessModules/measlesProtection/api/download/files"; import { - useDecideApprovalRequest, - useGrantDeletionForAllRequests, -} from "@/lib/businessModules/measlesProtection/api/mutations/approvalRequests"; + useApprovalRequestApi, + useFileApi, + useProcedureApi, + useProgressEntryApi, +} from "@/lib/businessModules/measlesProtection/api/clients"; import { - useDeleteFile, - useRequestFileDeletion, -} from "@/lib/businessModules/measlesProtection/api/mutations/files"; -import { - useCreateProgressEntry, - useDeleteProgressEntry, - usePatchProgressEntry, - useRequestProgressEntryDeletion, -} from "@/lib/businessModules/measlesProtection/api/mutations/progressEntries"; -import { useGetMetaDataHistory } from "@/lib/businessModules/measlesProtection/api/queries/files"; -import { - useFetchProgressEntries, - useFetchProgressEntryDetails, - useGetManualProgressEntryHistory, -} from "@/lib/businessModules/measlesProtection/api/queries/progressEntries"; + fileApiQueryKey, + progressEntryApiQueryKey, +} from "@/lib/businessModules/measlesProtection/api/queries/apiQueryKeys"; import { systemProgressEntryTypeTitles } from "@/lib/businessModules/measlesProtection/shared/constants"; import { moduleUserGroup } from "@/lib/businessModules/measlesProtection/shared/moduleUserGroup"; import { ProgressEntriesPage } from "@/lib/shared/components/procedures/progress-entries/ProgressEntriesPage"; @@ -41,26 +30,24 @@ export default function MeaslesProtectionProcedureDataProgressEntriesTab( props: ProgressEntriesUrlParams<MeaslesProtectionProcedureProgressEntriesPageParams>, ) { const { params, searchParams } = props; + const progressEntryApi = useProgressEntryApi(); + const procedureApi = useProcedureApi(); + const fileApi = useFileApi(); + const approvalRequestApi = useApprovalRequestApi(); + return ( <ProgressEntriesPage - useCreateProgressEntry={useCreateProgressEntry} - useDeleteFile={useDeleteFile} - useDeleteProgressEntry={useDeleteProgressEntry} - usePatchProgressEntry={usePatchProgressEntry} - useFetchProgressEntries={useFetchProgressEntries} - useFetchProgressEntryDetails={useFetchProgressEntryDetails} procedureId={params.id} searchParams={searchParams} leaderRole={ApiUserRole.MeaslesProtectionLeader} - useRequestProgressEntryDeletion={useRequestProgressEntryDeletion} - useRequestFileDeletion={useRequestFileDeletion} - useDecideApprovalRequest={useDecideApprovalRequest} - useGrantDeletionForAllRequests={useGrantDeletionForAllRequests} - useDownloadFile={useDownloadMeaslesProtectionFile} - useGetManualProgressEntryHistory={useGetManualProgressEntryHistory} - useGetMetaDataHistory={useGetMetaDataHistory} systemProgressEntryTypes={systemProgressEntryTypeTitles} groupName={moduleUserGroup.group} + progressEntryApiQueryKey={progressEntryApiQueryKey} + progressEntryApi={progressEntryApi} + procedureApi={procedureApi} + fileApiQueryKey={fileApiQueryKey} + fileApi={fileApi} + approvalRequestApi={approvalRequestApi} /> ); } diff --git a/employee-portal/src/app/(businessModules)/medical-registry/procedures/[id]/progress-entries/page.tsx b/employee-portal/src/app/(businessModules)/medical-registry/procedures/[id]/progress-entries/page.tsx index 08eda983a..26bedab88 100644 --- a/employee-portal/src/app/(businessModules)/medical-registry/procedures/[id]/progress-entries/page.tsx +++ b/employee-portal/src/app/(businessModules)/medical-registry/procedures/[id]/progress-entries/page.tsx @@ -9,28 +9,15 @@ import { ApiUserRole } from "@eshg/base-api"; import { MedicalRegistryProcedurePageParams } from "@/app/(businessModules)/medical-registry/procedures/[id]/page"; import { - useDecideApprovalRequest, - useGrantDeletionForAllRequests, -} from "@/lib/businessModules/medicalRegistry/api/mutations/approvalRequests"; + useApprovalRequestApi, + useFileApi, + useProcedureApi, + useProgressEntryApi, +} from "@/lib/businessModules/medicalRegistry/api/clients"; import { - useDeleteFile, - useRequestFileDeletion, -} from "@/lib/businessModules/medicalRegistry/api/mutations/files"; -import { - useCreateProgressEntry, - useDeleteProgressEntry, - usePatchProgressEntry, - useRequestProgressEntryDeletion, -} from "@/lib/businessModules/medicalRegistry/api/mutations/progressEntries"; -import { - useDownloadMedicalRegistryFile, - useGetMetaDataHistory, -} from "@/lib/businessModules/medicalRegistry/api/queries/files"; -import { - useFetchProgressEntries, - useFetchProgressEntryDetails, - useGetManualProgressEntryHistory, -} from "@/lib/businessModules/medicalRegistry/api/queries/progressEntries"; + fileApiQueryKey, + progressEntryApiQueryKey, +} from "@/lib/businessModules/medicalRegistry/api/queries/apiQueryKeys"; import { keyDocumentTypes, systemProgressEntryTypeTitles, @@ -43,27 +30,25 @@ export default function MedicalRegistryProgressEntriesPage( props: Readonly<ProgressEntriesUrlParams<MedicalRegistryProcedurePageParams>>, ) { const { params, searchParams } = props; + const progressEntryApi = useProgressEntryApi(); + const procedureApi = useProcedureApi(); + const fileApi = useFileApi(); + const approvalRequestApi = useApprovalRequestApi(); + return ( <ProgressEntriesPage - useCreateProgressEntry={useCreateProgressEntry} - useDeleteFile={useDeleteFile} - useDeleteProgressEntry={useDeleteProgressEntry} - usePatchProgressEntry={usePatchProgressEntry} - useFetchProgressEntries={useFetchProgressEntries} - useFetchProgressEntryDetails={useFetchProgressEntryDetails} procedureId={params.id} searchParams={searchParams} leaderRole={ApiUserRole.MedicalRegistryLeader} - useRequestProgressEntryDeletion={useRequestProgressEntryDeletion} - useRequestFileDeletion={useRequestFileDeletion} - useDecideApprovalRequest={useDecideApprovalRequest} - useGrantDeletionForAllRequests={useGrantDeletionForAllRequests} - useDownloadFile={useDownloadMedicalRegistryFile} - useGetManualProgressEntryHistory={useGetManualProgressEntryHistory} - useGetMetaDataHistory={useGetMetaDataHistory} systemProgressEntryTypes={systemProgressEntryTypeTitles} additionalKeyDocumentTypes={keyDocumentTypes} groupName={moduleUserGroup.group} + progressEntryApiQueryKey={progressEntryApiQueryKey} + progressEntryApi={progressEntryApi} + procedureApi={procedureApi} + fileApiQueryKey={fileApiQueryKey} + fileApi={fileApi} + approvalRequestApi={approvalRequestApi} /> ); } diff --git a/employee-portal/src/app/(businessModules)/official-medical-service/procedures/[id]/progress-entries/page.tsx b/employee-portal/src/app/(businessModules)/official-medical-service/procedures/[id]/progress-entries/page.tsx index 1d5ca788b..4ce607b6e 100644 --- a/employee-portal/src/app/(businessModules)/official-medical-service/procedures/[id]/progress-entries/page.tsx +++ b/employee-portal/src/app/(businessModules)/official-medical-service/procedures/[id]/progress-entries/page.tsx @@ -8,27 +8,16 @@ import { ApiUserRole } from "@eshg/base-api"; import { OfficialMedicalServiceDetailsPageParams } from "@/app/(businessModules)/official-medical-service/procedures/[id]/layout"; -import { useDownloadOfficialMedicalFileFile } from "@/lib/businessModules/officialMedicalService/api/download/files"; import { - useDecideApprovalRequest, - useGrantDeletionForAllRequests, -} from "@/lib/businessModules/officialMedicalService/api/mutations/approvalRequests"; + useApprovalRequestApi, + useFileApi, + useProcedureApi, + useProgressEntryApi, +} from "@/lib/businessModules/officialMedicalService/api/clients"; import { - useDeleteFile, - useRequestFileDeletion, -} from "@/lib/businessModules/officialMedicalService/api/mutations/files"; -import { - useCreateProgressEntry, - useDeleteProgressEntry, - usePatchProgressEntry, - useRequestProgressEntryDeletion, -} from "@/lib/businessModules/officialMedicalService/api/mutations/progressEntries"; -import { useGetMetaDataHistory } from "@/lib/businessModules/officialMedicalService/api/queries/files"; -import { - useFetchProgressEntries, - useFetchProgressEntryDetails, - useGetManualProgressEntryHistory, -} from "@/lib/businessModules/officialMedicalService/api/queries/progressEntries"; + fileApiQueryKey, + progressEntryApiQueryKey, +} from "@/lib/businessModules/officialMedicalService/api/queries/apiQueryKeys"; import { systemProgressEntryTypeTitles } from "@/lib/businessModules/officialMedicalService/shared/constants"; import { moduleUserGroup } from "@/lib/businessModules/officialMedicalService/shared/moduleUserGroup"; import { ProgressEntriesPage } from "@/lib/shared/components/procedures/progress-entries/ProgressEntriesPage"; @@ -38,26 +27,24 @@ export default function OfficialMedicalServiceProgressEntries( props: ProgressEntriesUrlParams<OfficialMedicalServiceDetailsPageParams>, ) { const { params, searchParams } = props; + const progressEntryApi = useProgressEntryApi(); + const procedureApi = useProcedureApi(); + const fileApi = useFileApi(); + const approvalRequestApi = useApprovalRequestApi(); + return ( <ProgressEntriesPage - useCreateProgressEntry={useCreateProgressEntry} - useDeleteFile={useDeleteFile} - useDeleteProgressEntry={useDeleteProgressEntry} - usePatchProgressEntry={usePatchProgressEntry} - useFetchProgressEntries={useFetchProgressEntries} - useFetchProgressEntryDetails={useFetchProgressEntryDetails} procedureId={params.id} searchParams={searchParams} leaderRole={ApiUserRole.OfficialMedicalServiceLeader} - useRequestProgressEntryDeletion={useRequestProgressEntryDeletion} - useRequestFileDeletion={useRequestFileDeletion} - useDecideApprovalRequest={useDecideApprovalRequest} - useGrantDeletionForAllRequests={useGrantDeletionForAllRequests} - useDownloadFile={useDownloadOfficialMedicalFileFile} - useGetManualProgressEntryHistory={useGetManualProgressEntryHistory} - useGetMetaDataHistory={useGetMetaDataHistory} systemProgressEntryTypes={systemProgressEntryTypeTitles} groupName={moduleUserGroup.group} + progressEntryApiQueryKey={progressEntryApiQueryKey} + progressEntryApi={progressEntryApi} + procedureApi={procedureApi} + fileApiQueryKey={fileApiQueryKey} + fileApi={fileApi} + approvalRequestApi={approvalRequestApi} /> ); } diff --git a/employee-portal/src/app/(businessModules)/official-medical-service/procedures/page.tsx b/employee-portal/src/app/(businessModules)/official-medical-service/procedures/page.tsx index 471cbe810..20044971d 100644 --- a/employee-portal/src/app/(businessModules)/official-medical-service/procedures/page.tsx +++ b/employee-portal/src/app/(businessModules)/official-medical-service/procedures/page.tsx @@ -3,6 +3,8 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +import { SearchParams } from "@eshg/lib-portal/helpers/searchParams"; + import { CreateProcedure } from "@/lib/businessModules/officialMedicalService/components/procedures/overview/CreateProcedure"; import { ProceduresOverviewTable } from "@/lib/businessModules/officialMedicalService/components/procedures/overview/ProceduresOverviewTable"; import { OverlayBoundary } from "@/lib/shared/components/boundaries/OverlayBoundary"; @@ -18,12 +20,17 @@ function CreateProcedureButton() { ); } -export default function OfficialMedicalServiceProceduresPage() { +export default function OfficialMedicalServiceProceduresPage( + props: Readonly<{ + searchParams: SearchParams; + }>, +) { return ( <StickyToolbarLayout toolbar={<Toolbar title="Amtsärztlicher Dienst" />}> <MainContentLayout fullViewportHeight> <ProceduresOverviewTable buttons={[<CreateProcedureButton key="createProcedure" />]} + filter={props.searchParams} /> </MainContentLayout> </StickyToolbarLayout> diff --git a/employee-portal/src/app/(businessModules)/school-entry/procedures/[procedureId]/anamnesis/page.tsx b/employee-portal/src/app/(businessModules)/school-entry/procedures/[procedureId]/anamnesis/page.tsx index 10b041b8c..6758d0f81 100644 --- a/employee-portal/src/app/(businessModules)/school-entry/procedures/[procedureId]/anamnesis/page.tsx +++ b/employee-portal/src/app/(businessModules)/school-entry/procedures/[procedureId]/anamnesis/page.tsx @@ -5,6 +5,16 @@ "use client"; +import { useHandledMutation } from "@eshg/lib-portal/api/useHandledMutation"; +import { DisabledFormProvider } from "@eshg/lib-portal/components/form/DisabledFormContext"; +import { mapMonthAndYear } from "@eshg/lib-portal/components/formFields/MonthAndYearFields"; +import { + mapOptionalDate, + mapOptionalValue, + parseOptionalDate, + parseOptionalValue, +} from "@eshg/lib-portal/helpers/form"; +import { isEmptyString } from "@eshg/lib-portal/helpers/guards"; import { ApiAdditionalChildInfo, ApiCheckUps, @@ -17,17 +27,7 @@ import { ApiPromotionBeforeSchoolEntry, ApiPromotionTherapyAndAidInfo, UpdateAnamnesisRequest, -} from "@eshg/employee-portal-api/schoolEntry"; -import { useHandledMutation } from "@eshg/lib-portal/api/useHandledMutation"; -import { DisabledFormProvider } from "@eshg/lib-portal/components/form/DisabledFormContext"; -import { mapMonthAndYear } from "@eshg/lib-portal/components/formFields/MonthAndYearFields"; -import { - mapOptionalDate, - mapOptionalValue, - parseOptionalDate, - parseOptionalValue, -} from "@eshg/lib-portal/helpers/form"; -import { isEmptyString } from "@eshg/lib-portal/helpers/guards"; +} from "@eshg/school-entry-api"; import { useSuspenseQueries } from "@tanstack/react-query"; import { isDefined } from "remeda"; diff --git a/employee-portal/src/app/(businessModules)/school-entry/procedures/[procedureId]/examinations/development-screening/page.tsx b/employee-portal/src/app/(businessModules)/school-entry/procedures/[procedureId]/examinations/development-screening/page.tsx index 5eca2c3ab..952b685b9 100644 --- a/employee-portal/src/app/(businessModules)/school-entry/procedures/[procedureId]/examinations/development-screening/page.tsx +++ b/employee-portal/src/app/(businessModules)/school-entry/procedures/[procedureId]/examinations/development-screening/page.tsx @@ -5,6 +5,12 @@ "use client"; +import { useHandledMutation } from "@eshg/lib-portal/api/useHandledMutation"; +import { DisabledFormProvider } from "@eshg/lib-portal/components/form/DisabledFormContext"; +import { + mapOptionalValue, + parseOptionalValue, +} from "@eshg/lib-portal/helpers/form"; import { type ApiExaminationWithDiagnosis, ApiHandicap, @@ -14,13 +20,7 @@ import { ApiPsychoSocialRisk, ApiSocioEducationalPerformance, UpdateDevelopmentScreeningResultRequest, -} from "@eshg/employee-portal-api/schoolEntry"; -import { useHandledMutation } from "@eshg/lib-portal/api/useHandledMutation"; -import { DisabledFormProvider } from "@eshg/lib-portal/components/form/DisabledFormContext"; -import { - mapOptionalValue, - parseOptionalValue, -} from "@eshg/lib-portal/helpers/form"; +} from "@eshg/school-entry-api"; import { useSuspenseQueries } from "@tanstack/react-query"; import { SchoolEntryProcedurePageProps } from "@/app/(businessModules)/school-entry/procedures/[procedureId]/layout"; diff --git a/employee-portal/src/app/(businessModules)/school-entry/procedures/[procedureId]/examinations/ear/page.tsx b/employee-portal/src/app/(businessModules)/school-entry/procedures/[procedureId]/examinations/ear/page.tsx index e1adbe78c..680bd627f 100644 --- a/employee-portal/src/app/(businessModules)/school-entry/procedures/[procedureId]/examinations/ear/page.tsx +++ b/employee-portal/src/app/(businessModules)/school-entry/procedures/[procedureId]/examinations/ear/page.tsx @@ -5,13 +5,13 @@ "use client"; -import { - ApiHertzValue, - UpdateHearingTestResultRequest, -} from "@eshg/employee-portal-api/schoolEntry"; import { useHandledMutation } from "@eshg/lib-portal/api/useHandledMutation"; import { DisabledFormProvider } from "@eshg/lib-portal/components/form/DisabledFormContext"; import { addMissingKeys, dropEmptyKeys } from "@eshg/lib-portal/helpers/form"; +import { + ApiHertzValue, + UpdateHearingTestResultRequest, +} from "@eshg/school-entry-api"; import { useSuspenseQueries } from "@tanstack/react-query"; import { SchoolEntryProcedurePageProps } from "@/app/(businessModules)/school-entry/procedures/[procedureId]/layout"; diff --git a/employee-portal/src/app/(businessModules)/school-entry/procedures/[procedureId]/examinations/eye/page.tsx b/employee-portal/src/app/(businessModules)/school-entry/procedures/[procedureId]/examinations/eye/page.tsx index d23a05604..a1d925663 100644 --- a/employee-portal/src/app/(businessModules)/school-entry/procedures/[procedureId]/examinations/eye/page.tsx +++ b/employee-portal/src/app/(businessModules)/school-entry/procedures/[procedureId]/examinations/eye/page.tsx @@ -5,13 +5,13 @@ "use client"; -import { - ApiEyeExaminationType, - UpdateEyeExaminationResultRequest, -} from "@eshg/employee-portal-api/schoolEntry"; import { useHandledMutation } from "@eshg/lib-portal/api/useHandledMutation"; import { DisabledFormProvider } from "@eshg/lib-portal/components/form/DisabledFormContext"; import { addMissingKeys, dropEmptyKeys } from "@eshg/lib-portal/helpers/form"; +import { + ApiEyeExaminationType, + UpdateEyeExaminationResultRequest, +} from "@eshg/school-entry-api"; import { useSuspenseQueries } from "@tanstack/react-query"; import { SchoolEntryProcedurePageProps } from "@/app/(businessModules)/school-entry/procedures/[procedureId]/layout"; diff --git a/employee-portal/src/app/(businessModules)/school-entry/procedures/[procedureId]/examinations/layout.tsx b/employee-portal/src/app/(businessModules)/school-entry/procedures/[procedureId]/examinations/layout.tsx index 577ec8a67..272e86904 100644 --- a/employee-portal/src/app/(businessModules)/school-entry/procedures/[procedureId]/examinations/layout.tsx +++ b/employee-portal/src/app/(businessModules)/school-entry/procedures/[procedureId]/examinations/layout.tsx @@ -5,7 +5,7 @@ "use client"; -import { ApiRequiredProcedureData } from "@eshg/employee-portal-api/schoolEntry"; +import { ApiRequiredProcedureData } from "@eshg/school-entry-api"; import { Button, Grid, Stack } from "@mui/joy"; import { PropsWithChildren, useState } from "react"; diff --git a/employee-portal/src/app/(businessModules)/school-entry/procedures/[procedureId]/examinations/sopess/page.tsx b/employee-portal/src/app/(businessModules)/school-entry/procedures/[procedureId]/examinations/sopess/page.tsx index 2e6d60877..b41e089d2 100644 --- a/employee-portal/src/app/(businessModules)/school-entry/procedures/[procedureId]/examinations/sopess/page.tsx +++ b/employee-portal/src/app/(businessModules)/school-entry/procedures/[procedureId]/examinations/sopess/page.tsx @@ -5,16 +5,16 @@ "use client"; -import { - ApiScoredEvaluationExamination, - UpdateSopessExaminationResultRequest, -} from "@eshg/employee-portal-api/schoolEntry"; import { useHandledMutation } from "@eshg/lib-portal/api/useHandledMutation"; import { DisabledFormProvider } from "@eshg/lib-portal/components/form/DisabledFormContext"; import { mapOptionalValue, parseOptionalValue, } from "@eshg/lib-portal/helpers/form"; +import { + ApiScoredEvaluationExamination, + UpdateSopessExaminationResultRequest, +} from "@eshg/school-entry-api"; import { useSuspenseQueries } from "@tanstack/react-query"; import { SchoolEntryProcedurePageProps } from "@/app/(businessModules)/school-entry/procedures/[procedureId]/layout"; diff --git a/employee-portal/src/app/(businessModules)/school-entry/procedures/[procedureId]/progress-entries/page.tsx b/employee-portal/src/app/(businessModules)/school-entry/procedures/[procedureId]/progress-entries/page.tsx index 4e14b174e..ed86ef3b5 100644 --- a/employee-portal/src/app/(businessModules)/school-entry/procedures/[procedureId]/progress-entries/page.tsx +++ b/employee-portal/src/app/(businessModules)/school-entry/procedures/[procedureId]/progress-entries/page.tsx @@ -8,27 +8,16 @@ import { ApiUserRole } from "@eshg/base-api"; import { SchoolEntryProcedurePageParams } from "@/app/(businessModules)/school-entry/procedures/[procedureId]/layout"; -import { useDownloadSchoolEntryFile } from "@/lib/businessModules/schoolEntry/api/download/files"; import { - useDecideApprovalRequest, - useGrantDeletionForAllRequests, -} from "@/lib/businessModules/schoolEntry/api/mutations/approvalRequests"; + useApprovalRequestApi, + useFileApi, + useProcedureApi, + useProgressEntryApi, +} from "@/lib/businessModules/schoolEntry/api/clients"; import { - useDeleteFile, - useRequestFileDeletion, -} from "@/lib/businessModules/schoolEntry/api/mutations/files"; -import { - useCreateProgressEntry, - useDeleteProgressEntry, - usePatchProgressEntry, - useRequestProgressEntryDeletion, -} from "@/lib/businessModules/schoolEntry/api/mutations/progressEntries"; -import { useGetMetaDataHistory } from "@/lib/businessModules/schoolEntry/api/queries/files"; -import { - useFetchProgressEntries, - useFetchProgressEntryDetails, - useGetManualProgressEntryHistory, -} from "@/lib/businessModules/schoolEntry/api/queries/progressEntries"; + fileApiQueryKey, + progressEntryApiQueryKey, +} from "@/lib/businessModules/schoolEntry/api/queries/apiQueryKeys"; import { keyDocumentTypes, systemProgressEntryTypeTitles, @@ -41,27 +30,25 @@ export default function SchoolEntryProgressEntriesPage( props: ProgressEntriesUrlParams<SchoolEntryProcedurePageParams>, ) { const { params, searchParams } = props; + const progressEntryApi = useProgressEntryApi(); + const procedureApi = useProcedureApi(); + const fileApi = useFileApi(); + const approvalRequestApi = useApprovalRequestApi(); + return ( <ProgressEntriesPage - useCreateProgressEntry={useCreateProgressEntry} - useDeleteFile={useDeleteFile} - useDeleteProgressEntry={useDeleteProgressEntry} - usePatchProgressEntry={usePatchProgressEntry} - useFetchProgressEntries={useFetchProgressEntries} - useFetchProgressEntryDetails={useFetchProgressEntryDetails} procedureId={params.procedureId} searchParams={searchParams} leaderRole={ApiUserRole.SchoolEntryLeader} - useRequestProgressEntryDeletion={useRequestProgressEntryDeletion} - useRequestFileDeletion={useRequestFileDeletion} - useDecideApprovalRequest={useDecideApprovalRequest} - useGrantDeletionForAllRequests={useGrantDeletionForAllRequests} - useDownloadFile={useDownloadSchoolEntryFile} - useGetManualProgressEntryHistory={useGetManualProgressEntryHistory} - useGetMetaDataHistory={useGetMetaDataHistory} systemProgressEntryTypes={systemProgressEntryTypeTitles} additionalKeyDocumentTypes={keyDocumentTypes} groupName={moduleUserGroup.group} + progressEntryApiQueryKey={progressEntryApiQueryKey} + progressEntryApi={progressEntryApi} + procedureApi={procedureApi} + fileApiQueryKey={fileApiQueryKey} + fileApi={fileApi} + approvalRequestApi={approvalRequestApi} /> ); } diff --git a/employee-portal/src/app/(businessModules)/school-entry/procedures/[procedureId]/vaccination/page.tsx b/employee-portal/src/app/(businessModules)/school-entry/procedures/[procedureId]/vaccination/page.tsx index aeff9a9f6..61226ccc8 100644 --- a/employee-portal/src/app/(businessModules)/school-entry/procedures/[procedureId]/vaccination/page.tsx +++ b/employee-portal/src/app/(businessModules)/school-entry/procedures/[procedureId]/vaccination/page.tsx @@ -5,11 +5,6 @@ "use client"; -import { - ApiOtherVaccination, - ApiVaccinationStatus, - UpdateVaccinationStatusRequest, -} from "@eshg/employee-portal-api/schoolEntry"; import { useHandledMutation } from "@eshg/lib-portal/api/useHandledMutation"; import { DisabledFormProvider } from "@eshg/lib-portal/components/form/DisabledFormContext"; import { @@ -20,6 +15,11 @@ import { parseOptionalValue, } from "@eshg/lib-portal/helpers/form"; import { isNonEmptyString } from "@eshg/lib-portal/helpers/guards"; +import { + ApiOtherVaccination, + ApiVaccinationStatus, + UpdateVaccinationStatusRequest, +} from "@eshg/school-entry-api"; import { useSuspenseQueries } from "@tanstack/react-query"; import { isEmpty } from "remeda"; diff --git a/employee-portal/src/app/(businessModules)/sti-protection/procedures/[id]/(framedPageLayout)/progress-entries/page.tsx b/employee-portal/src/app/(businessModules)/sti-protection/procedures/[id]/(framedPageLayout)/progress-entries/page.tsx index d6dedb6d5..373852921 100644 --- a/employee-portal/src/app/(businessModules)/sti-protection/procedures/[id]/(framedPageLayout)/progress-entries/page.tsx +++ b/employee-portal/src/app/(businessModules)/sti-protection/procedures/[id]/(framedPageLayout)/progress-entries/page.tsx @@ -8,27 +8,16 @@ import { ApiUserRole } from "@eshg/base-api"; import { StiProtectionProcedurePageParams } from "@/app/(businessModules)/sti-protection/procedures/[id]/(framedPageLayout)/layout"; -import { useDownloadStiProtectionFile } from "@/lib/businessModules/stiProtection/api/download/files"; import { - useDecideApprovalRequest, - useGrantDeletionForAllRequests, -} from "@/lib/businessModules/stiProtection/api/mutations/approvalRequests"; + useApprovalRequestApi, + useFileApi, + useProcedureApi, + useProgressEntryApi, +} from "@/lib/businessModules/stiProtection/api/clients"; import { - useDeleteFile, - useRequestFileDeletion, -} from "@/lib/businessModules/stiProtection/api/mutations/files"; -import { - useCreateProgressEntry, - useDeleteProgressEntry, - usePatchProgressEntry, - useRequestProgressEntryDeletion, -} from "@/lib/businessModules/stiProtection/api/mutations/progressEntries"; -import { useGetMetaDataHistory } from "@/lib/businessModules/stiProtection/api/queries/files"; -import { - useFetchProgressEntries, - useFetchProgressEntryDetails, - useGetManualProgressEntryHistory, -} from "@/lib/businessModules/stiProtection/api/queries/progressEntries"; + fileApiQueryKey, + progressEntryApiQueryKey, +} from "@/lib/businessModules/stiProtection/api/queries/apiQueryKeys"; import { systemProgressEntryTypeTitles } from "@/lib/businessModules/stiProtection/shared/constants"; import { moduleUserGroup } from "@/lib/businessModules/stiProtection/shared/moduleUserGroup"; import { ProgressEntriesPage } from "@/lib/shared/components/procedures/progress-entries/ProgressEntriesPage"; @@ -38,26 +27,24 @@ export default function StiProtectionProcedureProgressEntriesTab( props: Readonly<ProgressEntriesUrlParams<StiProtectionProcedurePageParams>>, ) { const { params, searchParams } = props; + const progressEntryApi = useProgressEntryApi(); + const procedureApi = useProcedureApi(); + const fileApi = useFileApi(); + const approvalRequestApi = useApprovalRequestApi(); + return ( <ProgressEntriesPage - useCreateProgressEntry={useCreateProgressEntry} - useDeleteFile={useDeleteFile} - useDeleteProgressEntry={useDeleteProgressEntry} - usePatchProgressEntry={usePatchProgressEntry} - useFetchProgressEntries={useFetchProgressEntries} - useFetchProgressEntryDetails={useFetchProgressEntryDetails} procedureId={params.id} searchParams={searchParams} leaderRole={ApiUserRole.StiProtectionLeader} - useRequestProgressEntryDeletion={useRequestProgressEntryDeletion} - useRequestFileDeletion={useRequestFileDeletion} - useDecideApprovalRequest={useDecideApprovalRequest} - useGrantDeletionForAllRequests={useGrantDeletionForAllRequests} - useDownloadFile={useDownloadStiProtectionFile} - useGetManualProgressEntryHistory={useGetManualProgressEntryHistory} - useGetMetaDataHistory={useGetMetaDataHistory} systemProgressEntryTypes={systemProgressEntryTypeTitles} groupName={moduleUserGroup.group} + progressEntryApiQueryKey={progressEntryApiQueryKey} + progressEntryApi={progressEntryApi} + procedureApi={procedureApi} + fileApiQueryKey={fileApiQueryKey} + fileApi={fileApi} + approvalRequestApi={approvalRequestApi} /> ); } diff --git a/employee-portal/src/app/(businessModules)/travel-medicine/procedure/[id]/progress-entries/page.tsx b/employee-portal/src/app/(businessModules)/travel-medicine/procedure/[id]/progress-entries/page.tsx index 9f5f9b622..c9a346bbf 100644 --- a/employee-portal/src/app/(businessModules)/travel-medicine/procedure/[id]/progress-entries/page.tsx +++ b/employee-portal/src/app/(businessModules)/travel-medicine/procedure/[id]/progress-entries/page.tsx @@ -8,27 +8,16 @@ import { ApiUserRole } from "@eshg/base-api"; import { EditInspectionPageParams } from "@/app/(businessModules)/inspection/procedures/[id]/layout"; -import { useDownloadTravelMedicineFile } from "@/lib/businessModules/travelMedicine/api/download/files"; import { - useDecideApprovalRequest, - useGrantDeletionForAllRequests, -} from "@/lib/businessModules/travelMedicine/api/mutations/approvalRequests"; + useApprovalRequestApi, + useFileApi, + useProcedureApi, + useProgressEntryApi, +} from "@/lib/businessModules/travelMedicine/api/clients"; import { - useDeleteFile, - useRequestFileDeletion, -} from "@/lib/businessModules/travelMedicine/api/mutations/files"; -import { - useCreateProgressEntry, - useDeleteProgressEntry, - usePatchProgressEntry, - useRequestProgressEntryDeletion, -} from "@/lib/businessModules/travelMedicine/api/mutations/progressEntries"; -import { useGetMetaDataHistory } from "@/lib/businessModules/travelMedicine/api/queries/files"; -import { - useFetchProgressEntries, - useFetchProgressEntryDetails, - useGetManualProgressEntryHistory, -} from "@/lib/businessModules/travelMedicine/api/queries/progressEntries"; + fileApiQueryKey, + progressEntryApiQueryKey, +} from "@/lib/businessModules/travelMedicine/api/queries/queryKeys"; import { systemProgressEntryTypeTitles } from "@/lib/businessModules/travelMedicine/shared/constants"; import { moduleUserGroup } from "@/lib/businessModules/travelMedicine/shared/moduleUserGroup"; import { ProgressEntriesPage } from "@/lib/shared/components/procedures/progress-entries/ProgressEntriesPage"; @@ -38,26 +27,24 @@ export default function TravelMedicineProgressEntries( props: ProgressEntriesUrlParams<EditInspectionPageParams>, ) { const { params, searchParams } = props; + const progressEntryApi = useProgressEntryApi(); + const procedureApi = useProcedureApi(); + const fileApi = useFileApi(); + const approvalRequestApi = useApprovalRequestApi(); + return ( <ProgressEntriesPage - useCreateProgressEntry={useCreateProgressEntry} - useDeleteFile={useDeleteFile} - useDeleteProgressEntry={useDeleteProgressEntry} - usePatchProgressEntry={usePatchProgressEntry} - useFetchProgressEntries={useFetchProgressEntries} - useFetchProgressEntryDetails={useFetchProgressEntryDetails} procedureId={params.id} searchParams={searchParams} leaderRole={ApiUserRole.TravelMedicineLeader} - useRequestProgressEntryDeletion={useRequestProgressEntryDeletion} - useRequestFileDeletion={useRequestFileDeletion} - useDecideApprovalRequest={useDecideApprovalRequest} - useGrantDeletionForAllRequests={useGrantDeletionForAllRequests} - useDownloadFile={useDownloadTravelMedicineFile} - useGetManualProgressEntryHistory={useGetManualProgressEntryHistory} - useGetMetaDataHistory={useGetMetaDataHistory} systemProgressEntryTypes={systemProgressEntryTypeTitles} groupName={moduleUserGroup.group} + progressEntryApiQueryKey={progressEntryApiQueryKey} + progressEntryApi={progressEntryApi} + procedureApi={procedureApi} + fileApiQueryKey={fileApiQueryKey} + fileApi={fileApi} + approvalRequestApi={approvalRequestApi} /> ); } diff --git a/employee-portal/src/app/playground/designShowcase/page.tsx b/employee-portal/src/app/playground/designShowcase/page.tsx index 06997813c..c5fa28bd0 100644 --- a/employee-portal/src/app/playground/designShowcase/page.tsx +++ b/employee-portal/src/app/playground/designShowcase/page.tsx @@ -23,7 +23,7 @@ export default function DesignShowcasePage() { initialValues={{ name: "Value", error: "" }} onSubmit={() => Promise.resolve()} > - <FormPlus style={{ display: "contents" }}> + <FormPlus sx={{ display: "contents" }}> <Sheet sx={{ width: "fit-content" }}> <Stack gap={8} diff --git a/employee-portal/src/app/playground/personSidebar/page.tsx b/employee-portal/src/app/playground/personSidebar/page.tsx index 5f278b524..9682e1f78 100644 --- a/employee-portal/src/app/playground/personSidebar/page.tsx +++ b/employee-portal/src/app/playground/personSidebar/page.tsx @@ -5,10 +5,10 @@ "use client"; -import { ApiSchoolEntryProcedureType } from "@eshg/employee-portal-api/schoolEntry"; import { SelectField } from "@eshg/lib-portal/components/formFields/SelectField"; import { useSnackbar } from "@eshg/lib-portal/components/snackbar/SnackbarProvider"; import { OptionalFieldValue } from "@eshg/lib-portal/types/form"; +import { ApiSchoolEntryProcedureType } from "@eshg/school-entry-api"; import { Button, Stack } from "@mui/joy"; import { useRef, useState } from "react"; diff --git a/employee-portal/src/app/playground/prototypes/dental-examination/page.tsx b/employee-portal/src/app/playground/prototypes/dental-examination/page.tsx index bf4598145..b4a1a88d5 100644 --- a/employee-portal/src/app/playground/prototypes/dental-examination/page.tsx +++ b/employee-portal/src/app/playground/prototypes/dental-examination/page.tsx @@ -1125,7 +1125,9 @@ function FindingsLegendSidebar(props: DrawerProps) { <table> {Object.entries(FINDINGS).map(([abbreviation, description]) => ( <tr key={abbreviation}> - <th style={{ textAlign: "left" }}>{abbreviation}</th> + <Box component={"th"} sx={{ textAlign: "left" }}> + {abbreviation} + </Box> <td>= {description}</td> </tr> ))} diff --git a/employee-portal/src/lib/auditlog/components/AuditLogDecryptSidebar.tsx b/employee-portal/src/lib/auditlog/components/AuditLogDecryptSidebar.tsx index 26ab85300..02e0cd2a1 100644 --- a/employee-portal/src/lib/auditlog/components/AuditLogDecryptSidebar.tsx +++ b/employee-portal/src/lib/auditlog/components/AuditLogDecryptSidebar.tsx @@ -97,9 +97,11 @@ export function AuditLogDecryptSidebar({ date, ); + const auditLogFileContent = await auditLogFile.text(); + const newAuditLogTab = window.open("about:blank", "_blank")!; newAuditLogTab.document.write( - `<pre>${encodeReservedHtmlCharacters(auditLogFile)}</pre>`, + `<pre>${encodeReservedHtmlCharacters(auditLogFileContent)}</pre>`, ); newAuditLogTab.document.title = `${formatDate(date)} | ${auditLogSourceNames[source]} | Auditlog`; newAuditLogTab.document.close(); diff --git a/employee-portal/src/lib/baseModule/components/calendar/EventForm.tsx b/employee-portal/src/lib/baseModule/components/calendar/EventForm.tsx index b1616846e..7db557742 100644 --- a/employee-portal/src/lib/baseModule/components/calendar/EventForm.tsx +++ b/employee-portal/src/lib/baseModule/components/calendar/EventForm.tsx @@ -81,7 +81,7 @@ export function EventForm({ onSubmit={onSubmit} validate={validateEndAfterStart} > - <FormPlus style={{ display: "contents" }}>{children}</FormPlus> + <FormPlus sx={{ display: "contents" }}>{children}</FormPlus> </Formik> ); } diff --git a/employee-portal/src/lib/baseModule/components/resources/sidebar/AddServiceSidebar.tsx b/employee-portal/src/lib/baseModule/components/resources/sidebar/AddServiceSidebar.tsx index 1b35d3a22..8dac72e30 100644 --- a/employee-portal/src/lib/baseModule/components/resources/sidebar/AddServiceSidebar.tsx +++ b/employee-portal/src/lib/baseModule/components/resources/sidebar/AddServiceSidebar.tsx @@ -107,7 +107,7 @@ export function AddServiceForm({ validate={validateEndAfterStart} enableReinitialize > - <FormPlus style={{ display: "contents" }}>{children}</FormPlus> + <FormPlus sx={{ display: "contents" }}>{children}</FormPlus> </Formik> ); } diff --git a/employee-portal/src/lib/businessModules/chat/components/chatPanel/NewDirectChat.tsx b/employee-portal/src/lib/businessModules/chat/components/chatPanel/NewDirectChat.tsx index 54e1ae2cc..45dadf3e4 100644 --- a/employee-portal/src/lib/businessModules/chat/components/chatPanel/NewDirectChat.tsx +++ b/employee-portal/src/lib/businessModules/chat/components/chatPanel/NewDirectChat.tsx @@ -86,7 +86,7 @@ export function NewDirectChat({ validate={validateDMForm} > <FormPlus - style={{ + sx={{ height: "100%", display: "flex", flexDirection: "column", diff --git a/employee-portal/src/lib/businessModules/chat/components/chatPanel/NewGroupChat.tsx b/employee-portal/src/lib/businessModules/chat/components/chatPanel/NewGroupChat.tsx index f6f1ca458..3acb2b660 100644 --- a/employee-portal/src/lib/businessModules/chat/components/chatPanel/NewGroupChat.tsx +++ b/employee-portal/src/lib/businessModules/chat/components/chatPanel/NewGroupChat.tsx @@ -86,7 +86,7 @@ export function NewGroupChat({ > {({ values }) => ( <FormPlus - style={{ + sx={{ height: "100%", display: "flex", flexDirection: "column", diff --git a/employee-portal/src/lib/businessModules/chat/components/roomList/HighlightedText.tsx b/employee-portal/src/lib/businessModules/chat/components/roomList/HighlightedText.tsx index 2dc502ce5..9ce971af2 100644 --- a/employee-portal/src/lib/businessModules/chat/components/roomList/HighlightedText.tsx +++ b/employee-portal/src/lib/businessModules/chat/components/roomList/HighlightedText.tsx @@ -39,7 +39,7 @@ export function HighlightedText({ {index > 0 && ( <Box component="mark" - style={{ backgroundColor: theme.palette.success[100] }} + sx={{ backgroundColor: theme.palette.success[100] }} > {match[0]} </Box> diff --git a/employee-portal/src/lib/businessModules/dental/api/clients.ts b/employee-portal/src/lib/businessModules/dental/api/clients.ts deleted file mode 100644 index 28666fd19..000000000 --- a/employee-portal/src/lib/businessModules/dental/api/clients.ts +++ /dev/null @@ -1,52 +0,0 @@ -/** - * Copyright 2025 cronn GmbH - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { - ApprovalRequestApi, - ChildApi, - Configuration, - FileApi, - ProcedureApi, - ProgressEntryApi, - ProphylaxisSessionApi, -} from "@eshg/dental-api"; -import { useApiConfiguration } from "@eshg/lib-portal/api/ApiProvider"; - -function useConfiguration() { - const configurationParameters = useApiConfiguration( - "PUBLIC_DENTAL_BACKEND_URL", - ); - return new Configuration(configurationParameters); -} - -export function useChildApi() { - const configuration = useConfiguration(); - return new ChildApi(configuration); -} - -export function useProphylaxisSessionApi() { - const configuration = useConfiguration(); - return new ProphylaxisSessionApi(configuration); -} - -export function useProcedureApi() { - const configuration = useConfiguration(); - return new ProcedureApi(configuration); -} - -export function useProgressEntryApi() { - const configuration = useConfiguration(); - return new ProgressEntryApi(configuration); -} - -export function useFileApi() { - const configuration = useConfiguration(); - return new FileApi(configuration); -} - -export function useApprovalRequestApi() { - const configuration = useConfiguration(); - return new ApprovalRequestApi(configuration); -} diff --git a/employee-portal/src/lib/businessModules/dental/api/downloads/files.ts b/employee-portal/src/lib/businessModules/dental/api/downloads/files.ts deleted file mode 100644 index 2f24b17e8..000000000 --- a/employee-portal/src/lib/businessModules/dental/api/downloads/files.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** - * Copyright 2025 cronn GmbH - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { useFileApi } from "@/lib/businessModules/dental/api/clients"; -import { useDownloadFile } from "@/lib/shared/api/download/files"; - -export function useDownloadDentalFile() { - const fileApi = useFileApi(); - return useDownloadFile((fileId: string) => - fileApi.downloadFileRaw({ fileId }), - ); -} diff --git a/employee-portal/src/lib/businessModules/dental/api/mutations/approvalRequestApi.ts b/employee-portal/src/lib/businessModules/dental/api/mutations/approvalRequestApi.ts deleted file mode 100644 index fc50279b7..000000000 --- a/employee-portal/src/lib/businessModules/dental/api/mutations/approvalRequestApi.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Copyright 2025 cronn GmbH - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { useApprovalRequestApi } from "@/lib/businessModules/dental/api/clients"; -import { - useDecideApprovalRequestTemplate, - useGrantDeletionForAllRequestsTemplate, -} from "@/lib/shared/api/mutations/approvalRequests"; - -export function useDecideApprovalRequest() { - return useDecideApprovalRequestTemplate(useApprovalRequestApi); -} - -export function useGrantDeletionForAllRequests() { - return useGrantDeletionForAllRequestsTemplate(useApprovalRequestApi); -} diff --git a/employee-portal/src/lib/businessModules/dental/api/mutations/fileApi.ts b/employee-portal/src/lib/businessModules/dental/api/mutations/fileApi.ts deleted file mode 100644 index d6290a299..000000000 --- a/employee-portal/src/lib/businessModules/dental/api/mutations/fileApi.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Copyright 2025 cronn GmbH - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { useFileApi } from "@/lib/businessModules/dental/api/clients"; -import { - useDeleteFileTemplate, - useRequestFileDeletionTemplate, -} from "@/lib/shared/api/mutations/files"; - -export function useDeleteFile() { - return useDeleteFileTemplate(useFileApi); -} - -export function useRequestFileDeletion() { - return useRequestFileDeletionTemplate(useFileApi); -} diff --git a/employee-portal/src/lib/businessModules/dental/api/mutations/importApi.ts b/employee-portal/src/lib/businessModules/dental/api/mutations/importApi.ts deleted file mode 100644 index 8b6ba0acb..000000000 --- a/employee-portal/src/lib/businessModules/dental/api/mutations/importApi.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright 2025 cronn GmbH - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { ApiImportStatistics, ImportXlsxRequest } from "@eshg/dental-api"; -import { useHandledMutation } from "@eshg/lib-portal/api/useHandledMutation"; -import { mapRequiredValue } from "@eshg/lib-portal/helpers/form"; - -import { useChildApi } from "@/lib/businessModules/dental/api/clients"; -import { ImportChildrenFormValues } from "@/lib/businessModules/dental/import/ImportChildrenSidebar"; -import { parseImportResult } from "@/lib/shared/helpers/import"; - -export function useImportChildren() { - const childApi = useChildApi(); - return useHandledMutation({ - mutationFn: (values: ImportChildrenFormValues) => - childApi - .importXlsxRaw(mapImportChildrenFormValues(values)) - .then(parseImportResult<ApiImportStatistics>), - }); -} - -function mapImportChildrenFormValues( - values: ImportChildrenFormValues, -): ImportXlsxRequest { - return { - file: mapRequiredValue(values.file), - institutionId: mapRequiredValue(values.institution).id, - schoolYear: mapRequiredValue(values.schoolYear), - }; -} diff --git a/employee-portal/src/lib/businessModules/dental/api/mutations/progressEntryApi.ts b/employee-portal/src/lib/businessModules/dental/api/mutations/progressEntryApi.ts deleted file mode 100644 index 6a155ad46..000000000 --- a/employee-portal/src/lib/businessModules/dental/api/mutations/progressEntryApi.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Copyright 2025 cronn GmbH - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { - useFileApi, - useProgressEntryApi, -} from "@/lib/businessModules/dental/api/clients"; -import { - useCreateProgressEntryTemplate, - useDeleteProgressEntryTemplate, - usePatchProgressEntryTemplate, - useRequestProgressEntryDeletionTemplate, -} from "@/lib/shared/api/mutations/progressEntries"; - -export function useCreateProgressEntry() { - return useCreateProgressEntryTemplate(useProgressEntryApi); -} - -export function useDeleteProgressEntry() { - return useDeleteProgressEntryTemplate(useProgressEntryApi); -} - -export function usePatchProgressEntry() { - return usePatchProgressEntryTemplate(useProgressEntryApi, useFileApi); -} - -export function useRequestProgressEntryDeletion() { - return useRequestProgressEntryDeletionTemplate(useProgressEntryApi); -} diff --git a/employee-portal/src/lib/businessModules/dental/api/queries/fileApi.ts b/employee-portal/src/lib/businessModules/dental/api/queries/fileApi.ts deleted file mode 100644 index a10ab4e60..000000000 --- a/employee-portal/src/lib/businessModules/dental/api/queries/fileApi.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * Copyright 2025 cronn GmbH - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { useFileApi } from "@/lib/businessModules/dental/api/clients"; -import { useGetMetaDataHistoryTemplate } from "@/lib/shared/api/queries/files"; - -import { fileApiQueryKey } from "./apiQueryKeys"; - -export function useGetMetaDataHistory(fileId: string) { - return useGetMetaDataHistoryTemplate(useFileApi, fileApiQueryKey, fileId); -} diff --git a/employee-portal/src/lib/businessModules/dental/api/queries/progressEntryApi.ts b/employee-portal/src/lib/businessModules/dental/api/queries/progressEntryApi.ts deleted file mode 100644 index 7b9772abe..000000000 --- a/employee-portal/src/lib/businessModules/dental/api/queries/progressEntryApi.ts +++ /dev/null @@ -1,54 +0,0 @@ -/** - * Copyright 2025 cronn GmbH - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { ApiUserRole } from "@eshg/base-api"; - -import { - useProcedureApi, - useProgressEntryApi, -} from "@/lib/businessModules/dental/api/clients"; -import { - useFetchProgressEntriesTemplate, - useFetchProgressEntryDetailsTemplate, - useGetManualProgressEntryHistoryTemplate, -} from "@/lib/shared/api/queries/progressEntries"; -import { ProgressEntriesFilters } from "@/lib/shared/components/procedures/progress-entries/types"; - -import { progressEntryApiQueryKey } from "./apiQueryKeys"; - -export function useFetchProgressEntries( - procedureId: string, - leaderRole: ApiUserRole, - progressEntryFilter: ProgressEntriesFilters, -) { - return useFetchProgressEntriesTemplate( - useProgressEntryApi, - useProcedureApi, - progressEntryApiQueryKey, - procedureId, - leaderRole, - progressEntryFilter, - ); -} - -export function useFetchProgressEntryDetails( - procedureId: string, - entryId: string, -) { - return useFetchProgressEntryDetailsTemplate( - useProgressEntryApi, - progressEntryApiQueryKey, - procedureId, - entryId, - ); -} - -export function useGetManualProgressEntryHistory(entryId: string) { - return useGetManualProgressEntryHistoryTemplate( - useProgressEntryApi, - progressEntryApiQueryKey, - entryId, - ); -} diff --git a/employee-portal/src/lib/businessModules/dental/features/children/ChildrenFilterSettings.tsx b/employee-portal/src/lib/businessModules/dental/features/children/ChildrenFilterSettings.tsx index 265f5bbb3..bd39d03a7 100644 --- a/employee-portal/src/lib/businessModules/dental/features/children/ChildrenFilterSettings.tsx +++ b/employee-portal/src/lib/businessModules/dental/features/children/ChildrenFilterSettings.tsx @@ -4,13 +4,13 @@ */ import { GetChildrenRequest } from "@eshg/dental-api"; +import { useSearchInstitutionGroups } from "@eshg/dental/api/queries/childApi"; import { SelectOptions } from "@eshg/lib-portal/components/formFields/SelectOptions"; import { useHasChanged } from "@eshg/lib-portal/hooks/useHasChanged"; import { CircularProgress, FormControl, FormLabel, Select } from "@mui/joy"; import { useEffect } from "react"; import { isDefined } from "remeda"; -import { useSearchInstitutionGroups } from "@/lib/businessModules/dental/api/queries/childApi"; import { ResetButton } from "@/lib/shared/components/ResetButton"; import { ActiveFilter } from "@/lib/shared/components/filterSettings/ActiveFilter"; import { FilterSettingsContent } from "@/lib/shared/components/filterSettings/FilterSettingsContent"; diff --git a/employee-portal/src/lib/businessModules/dental/features/children/ChildrenTable.tsx b/employee-portal/src/lib/businessModules/dental/features/children/ChildrenTable.tsx index 2e80dcf69..df1acbe3a 100644 --- a/employee-portal/src/lib/businessModules/dental/features/children/ChildrenTable.tsx +++ b/employee-portal/src/lib/businessModules/dental/features/children/ChildrenTable.tsx @@ -6,6 +6,8 @@ "use client"; import { ApiChildSortKey } from "@eshg/dental-api"; +import { Child } from "@eshg/dental/api/models/Child"; +import { useGetChildrenQuery } from "@eshg/dental/api/queries/childApi"; import { routes } from "@eshg/dental/shared/routes"; import { ApiBusinessModule } from "@eshg/employee-portal-api/businessProcedures"; import { formatDate } from "@eshg/lib-portal/formatters/dateTime"; @@ -14,8 +16,6 @@ import { useSuspenseQueries } from "@tanstack/react-query"; import { ColumnSort, createColumnHelper } from "@tanstack/react-table"; import { ReactNode } from "react"; -import { Child } from "@/lib/businessModules/dental/api/models/Child"; -import { useGetChildrenQuery } from "@/lib/businessModules/dental/api/queries/childApi"; import { useGetGdprValidationBannerQuery } from "@/lib/shared/api/queries/gdpr"; import { ButtonBar } from "@/lib/shared/components/buttons/ButtonBar"; import { FilterButton } from "@/lib/shared/components/buttons/FilterButton"; diff --git a/employee-portal/src/lib/businessModules/dental/features/children/CloseSchoolYearButton.tsx b/employee-portal/src/lib/businessModules/dental/features/children/CloseSchoolYearButton.tsx index 0c8df8419..fcba0b978 100644 --- a/employee-portal/src/lib/businessModules/dental/features/children/CloseSchoolYearButton.tsx +++ b/employee-portal/src/lib/businessModules/dental/features/children/CloseSchoolYearButton.tsx @@ -3,11 +3,11 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +import { useCloseSchoolYear } from "@eshg/dental/api/mutations/childApi"; import { PublishedWithChanges } from "@mui/icons-material"; import { Button } from "@mui/joy"; import { useState } from "react"; -import { useCloseSchoolYear } from "@/lib/businessModules/dental/api/mutations/childApi"; import { BUTTON_SIZE } from "@/lib/businessModules/schoolEntry/features/procedures/new/constants"; import { EmployeePortalConfirmationDialog } from "@/lib/shared/components/confirmationDialog/EmployeePortalConfirmationDialog"; diff --git a/employee-portal/src/lib/businessModules/dental/features/children/details/AdditionalInformation.tsx b/employee-portal/src/lib/businessModules/dental/features/children/details/AdditionalInformation.tsx new file mode 100644 index 000000000..183109907 --- /dev/null +++ b/employee-portal/src/lib/businessModules/dental/features/children/details/AdditionalInformation.tsx @@ -0,0 +1,39 @@ +/** + * Copyright 2025 cronn GmbH + * SPDX-License-Identifier: AGPL-3.0-only + */ + +import { BooleanSelectField } from "@eshg/lib-portal/components/formFields/BooleanSelectField"; +import { SelectField } from "@eshg/lib-portal/components/formFields/SelectField"; + +import { ORAL_HYGIENE_STATUS_OPTIONS } from "@/lib/businessModules/dental/features/children/options"; +import { DetailsSection } from "@/lib/shared/components/detailsSection/DetailsSection"; +import { InformationSheet } from "@/lib/shared/components/infoTile/InformationSheet"; + +interface Props { + screening: boolean; + fluoridation: boolean; +} + +export function AdditionalInformation(props: Props) { + return ( + <InformationSheet> + <DetailsSection title="Zusatzinfos"> + {props.screening && ( + <SelectField + name="oralHygieneStatus" + label="Mundhygienestatus" + options={ORAL_HYGIENE_STATUS_OPTIONS} + /> + )} + {props.fluoridation && ( + <BooleanSelectField + name="fluorideVarnishApplied" + label="Fluoridierung" + required="Bitte angeben, ob fluoridiert wurde." + /> + )} + </DetailsSection> + </InformationSheet> + ); +} diff --git a/employee-portal/src/lib/businessModules/dental/features/children/details/AnnualInstitutionsTable.tsx b/employee-portal/src/lib/businessModules/dental/features/children/details/AnnualInstitutionsTable.tsx index 1c5a529da..da258b7fe 100644 --- a/employee-portal/src/lib/businessModules/dental/features/children/details/AnnualInstitutionsTable.tsx +++ b/employee-portal/src/lib/businessModules/dental/features/children/details/AnnualInstitutionsTable.tsx @@ -5,9 +5,9 @@ "use client"; +import { AnnualInstitution } from "@eshg/dental/api/models/Institution"; import { createColumnHelper } from "@tanstack/react-table"; -import { AnnualInstitution } from "@/lib/businessModules/dental/api/models/Institution"; import { DataTable } from "@/lib/shared/components/table/DataTable"; import { TablePage } from "@/lib/shared/components/table/TablePage"; import { TableSheet } from "@/lib/shared/components/table/TableSheet"; diff --git a/employee-portal/src/lib/businessModules/dental/features/children/details/ChildDetails.tsx b/employee-portal/src/lib/businessModules/dental/features/children/details/ChildDetails.tsx index 99dde688b..347031cee 100644 --- a/employee-portal/src/lib/businessModules/dental/features/children/details/ChildDetails.tsx +++ b/employee-portal/src/lib/businessModules/dental/features/children/details/ChildDetails.tsx @@ -3,11 +3,11 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +import { ChildDetails } from "@eshg/dental/api/models/ChildDetails"; import { useIsFormDisabled } from "@eshg/lib-portal/components/form/DisabledFormContext"; import { formatDate } from "@eshg/lib-portal/formatters/dateTime"; import { Divider, Grid, Stack, Typography } from "@mui/joy"; -import { ChildDetails } from "@/lib/businessModules/dental/api/models/ChildDetails"; import { AnnualInstitutionsTable } from "@/lib/businessModules/dental/features/children/details/AnnualInstitutionsTable"; import { FluoridationConsentTable } from "@/lib/businessModules/dental/features/children/details/FluoridationConsentTable"; import { useUpdateAnnualChildSidebar } from "@/lib/businessModules/dental/features/children/details/UpdateAnnualChildSidebar"; diff --git a/employee-portal/src/lib/businessModules/dental/features/children/details/ChildToolbar.tsx b/employee-portal/src/lib/businessModules/dental/features/children/details/ChildToolbar.tsx index d6355e894..df669db4e 100644 --- a/employee-portal/src/lib/businessModules/dental/features/children/details/ChildToolbar.tsx +++ b/employee-portal/src/lib/businessModules/dental/features/children/details/ChildToolbar.tsx @@ -6,6 +6,8 @@ "use client"; import { ApiUserRole } from "@eshg/base-api"; +import { getChildDetailsQuery } from "@eshg/dental/api/queries/childApi"; +import { useDentalApi } from "@eshg/dental/shared/DentalProvider"; import { routes } from "@eshg/dental/shared/routes"; import { FormatListBulletedOutlined, @@ -14,8 +16,6 @@ import { } from "@mui/icons-material"; import { useSuspenseQuery } from "@tanstack/react-query"; -import { useChildApi } from "@/lib/businessModules/dental/api/clients"; -import { getChildDetailsQuery } from "@/lib/businessModules/dental/api/queries/childApi"; import { PersonToolbarHeader } from "@/lib/shared/components/layout/PersonToolbarHeader"; import { TabNavigationItem } from "@/lib/shared/components/tabNavigation/types"; import { TabNavigationToolbar } from "@/lib/shared/components/tabNavigationToolbar/TabNavigationToolbar"; @@ -28,7 +28,7 @@ interface ChildToolbarProps { export function ChildToolbar(props: ChildToolbarProps) { const { childId } = props; const hasDentalAdminRole = useHasUserRoleCheck(ApiUserRole.DentalAdmin); - const childApi = useChildApi(); + const { childApi } = useDentalApi(); const { data: child } = useSuspenseQuery( getChildDetailsQuery(childApi, childId), ); diff --git a/employee-portal/src/lib/businessModules/dental/features/children/details/ExaminationDetails.tsx b/employee-portal/src/lib/businessModules/dental/features/children/details/ExaminationDetails.tsx index b22a03966..d1d6ce232 100644 --- a/employee-portal/src/lib/businessModules/dental/features/children/details/ExaminationDetails.tsx +++ b/employee-portal/src/lib/businessModules/dental/features/children/details/ExaminationDetails.tsx @@ -5,15 +5,24 @@ "use client"; +import { ApiOralHygieneStatus } from "@eshg/dental-api"; import { InputField } from "@eshg/lib-portal/components/formFields/InputField"; import { FormProps, OptionalFieldValue } from "@eshg/lib-portal/types/form"; +import { Grid } from "@mui/joy"; import { Formik } from "formik"; +import { AdditionalInformation } from "@/lib/businessModules/dental/features/children/details/AdditionalInformation"; import { FormFooter } from "@/lib/businessModules/schoolEntry/features/procedures/examinations/FormFooter"; import { FormStack } from "@/lib/shared/components/form/FormStack"; +import { InformationSheet } from "@/lib/shared/components/infoTile/InformationSheet"; +import { PageGrid } from "@/lib/shared/components/page/PageGrid"; export interface ExaminationFormValues { + screening: boolean; + fluoridation: boolean; note: OptionalFieldValue<string>; + oralHygieneStatus?: OptionalFieldValue<ApiOralHygieneStatus>; + fluorideVarnishApplied: OptionalFieldValue<boolean>; } export function ExaminationDetails(props: FormProps<ExaminationFormValues>) { @@ -26,7 +35,19 @@ export function ExaminationDetails(props: FormProps<ExaminationFormValues>) { {({ handleSubmit, isSubmitting }) => { return ( <FormStack onSubmit={handleSubmit}> - <InputField type="text" label="Bemerkung" name="note" /> + <PageGrid> + <Grid xxs={12} md={4}> + <AdditionalInformation + screening={props.initialValues.screening} + fluoridation={props.initialValues.fluoridation} + /> + </Grid> + <Grid xxs={12} md={8}> + <InformationSheet> + <InputField type="text" label="Bemerkung" name="note" /> + </InformationSheet> + </Grid> + </PageGrid> <FormFooter isSubmitting={isSubmitting} /> </FormStack> ); diff --git a/employee-portal/src/lib/businessModules/dental/features/children/details/ExaminationsTable.tsx b/employee-portal/src/lib/businessModules/dental/features/children/details/ExaminationsTable.tsx index 1513332bc..74ca1ae7c 100644 --- a/employee-portal/src/lib/businessModules/dental/features/children/details/ExaminationsTable.tsx +++ b/employee-portal/src/lib/businessModules/dental/features/children/details/ExaminationsTable.tsx @@ -5,11 +5,11 @@ "use client"; +import { Examination } from "@eshg/dental/api/models/Examination"; import { routes } from "@eshg/dental/shared/routes"; import { formatDate } from "@eshg/lib-portal/formatters/dateTime"; import { ColumnSort, createColumnHelper } from "@tanstack/react-table"; -import { Examination } from "@/lib/businessModules/dental/api/models/Examination"; import { ExaminationStatusChip } from "@/lib/businessModules/dental/features/examinations/ExaminationStatusChip"; import { PROPHYLAXIS_TYPES } from "@/lib/businessModules/dental/features/prophylaxisSessions/translations"; import { DataTable } from "@/lib/shared/components/table/DataTable"; diff --git a/employee-portal/src/lib/businessModules/dental/features/children/details/UpdateAnnualChildSidebar.tsx b/employee-portal/src/lib/businessModules/dental/features/children/details/UpdateAnnualChildSidebar.tsx index 086d09aad..ae6871de8 100644 --- a/employee-portal/src/lib/businessModules/dental/features/children/details/UpdateAnnualChildSidebar.tsx +++ b/employee-portal/src/lib/businessModules/dental/features/children/details/UpdateAnnualChildSidebar.tsx @@ -4,6 +4,9 @@ */ import { UpdateChildRequest } from "@eshg/dental-api"; +import { ChildDetails } from "@eshg/dental/api/models/ChildDetails"; +import { Institution } from "@eshg/dental/api/models/Institution"; +import { useUpdateAnnualChild } from "@eshg/dental/api/mutations/childApi"; import { BooleanSelectField } from "@eshg/lib-portal/components/formFields/BooleanSelectField"; import { DateField } from "@eshg/lib-portal/components/formFields/DateField"; import { useSnackbar } from "@eshg/lib-portal/components/snackbar/SnackbarProvider"; @@ -20,9 +23,6 @@ import { FormikProvider, useFormik } from "formik"; import { isDefined } from "remeda"; import { SCHOOL_OR_DAYCARE } from "@/lib/baseModule/api/queries/contacts"; -import { ChildDetails } from "@/lib/businessModules/dental/api/models/ChildDetails"; -import { Institution } from "@/lib/businessModules/dental/api/models/Institution"; -import { useUpdateAnnualChild } from "@/lib/businessModules/dental/api/mutations/childApi"; import { SearchGroupField } from "@/lib/businessModules/dental/features/prophylaxisSessions/SearchGroupField"; import { FormButtonBar } from "@/lib/shared/components/form/FormButtonBar"; import { SidebarForm } from "@/lib/shared/components/form/SidebarForm"; diff --git a/employee-portal/src/lib/businessModules/dental/features/children/new/CreateChildSidebar.tsx b/employee-portal/src/lib/businessModules/dental/features/children/new/CreateChildSidebar.tsx index 4a3291c1e..9534a6f06 100644 --- a/employee-portal/src/lib/businessModules/dental/features/children/new/CreateChildSidebar.tsx +++ b/employee-portal/src/lib/businessModules/dental/features/children/new/CreateChildSidebar.tsx @@ -7,19 +7,19 @@ import { ApiAddContact200Response } from "@eshg/base-api"; import { ApiCreateChildRequest } from "@eshg/dental-api"; +import { useCreateChild } from "@eshg/dental/api/mutations/childApi"; +import { getChildrenByPersonQuery } from "@eshg/dental/api/queries/childApi"; +import { useDentalApi } from "@eshg/dental/shared/DentalProvider"; import { routes } from "@eshg/dental/shared/routes"; -import { ApiCreatePerson } from "@eshg/employee-portal-api/schoolEntry"; import { mapRequiredValue } from "@eshg/lib-portal/helpers/form"; import { OptionalFieldValue } from "@eshg/lib-portal/types/form"; +import { ApiCreatePerson } from "@eshg/school-entry-api"; import { Add } from "@mui/icons-material"; import { Button } from "@mui/joy"; import { useRouter } from "next/navigation"; import { useRef, useState } from "react"; import { SCHOOL_OR_DAYCARE } from "@/lib/baseModule/api/queries/contacts"; -import { useChildApi } from "@/lib/businessModules/dental/api/clients"; -import { useCreateChild } from "@/lib/businessModules/dental/api/mutations/childApi"; -import { getChildrenByPersonQuery } from "@/lib/businessModules/dental/api/queries/childApi"; import { ChildProcedureCard } from "@/lib/businessModules/dental/features/children/new/ChildProcedureCard"; import { SearchGroupField } from "@/lib/businessModules/dental/features/prophylaxisSessions/SearchGroupField"; import { BUTTON_SIZE } from "@/lib/businessModules/schoolEntry/features/procedures/new/constants"; @@ -124,7 +124,7 @@ export function CreateChildSidebar() { ); } - const childApi = useChildApi(); + const { childApi } = useDentalApi(); return ( <> <Button diff --git a/employee-portal/src/lib/businessModules/dental/features/children/options.ts b/employee-portal/src/lib/businessModules/dental/features/children/options.ts new file mode 100644 index 000000000..495d4d669 --- /dev/null +++ b/employee-portal/src/lib/businessModules/dental/features/children/options.ts @@ -0,0 +1,12 @@ +/** + * Copyright 2025 cronn GmbH + * SPDX-License-Identifier: AGPL-3.0-only + */ + +import { ApiOralHygieneStatus } from "@eshg/dental-api"; +import { buildEnumOptions } from "@eshg/lib-portal/helpers/form"; + +import { ORAL_HYGIENE_STATUS_STATUS } from "@/lib/businessModules/dental/features/children/translations"; + +export const ORAL_HYGIENE_STATUS_OPTIONS = + buildEnumOptions<ApiOralHygieneStatus>(ORAL_HYGIENE_STATUS_STATUS, true); diff --git a/employee-portal/src/lib/businessModules/dental/features/children/translations.ts b/employee-portal/src/lib/businessModules/dental/features/children/translations.ts new file mode 100644 index 000000000..621dbfc60 --- /dev/null +++ b/employee-portal/src/lib/businessModules/dental/features/children/translations.ts @@ -0,0 +1,13 @@ +/** + * Copyright 2025 cronn GmbH + * SPDX-License-Identifier: AGPL-3.0-only + */ + +import { ApiOralHygieneStatus } from "@eshg/dental-api"; +import { EnumMap } from "@eshg/lib-portal/types/helpers"; + +export const ORAL_HYGIENE_STATUS_STATUS: EnumMap<ApiOralHygieneStatus> = { + [ApiOralHygieneStatus.Excellent]: "Sehr gut", + [ApiOralHygieneStatus.Good]: "Gut", + [ApiOralHygieneStatus.Poor]: "Schlecht", +}; diff --git a/employee-portal/src/lib/businessModules/dental/features/examinations/ExaminationStatusChip.tsx b/employee-portal/src/lib/businessModules/dental/features/examinations/ExaminationStatusChip.tsx index 9d697b44b..0bff96c02 100644 --- a/employee-portal/src/lib/businessModules/dental/features/examinations/ExaminationStatusChip.tsx +++ b/employee-portal/src/lib/businessModules/dental/features/examinations/ExaminationStatusChip.tsx @@ -3,10 +3,9 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +import { ExaminationStatus } from "@eshg/dental/api/models/ExaminationStatus"; import { Chip, ChipProps } from "@mui/joy"; -import { ExaminationStatus } from "@/lib/businessModules/dental/api/models/ExaminationStatus"; - import { EXAMINATION_STATUS } from "./translations"; const examinationStatusColors: Record<ExaminationStatus, ChipProps["color"]> = { diff --git a/employee-portal/src/lib/businessModules/dental/features/examinations/translations.ts b/employee-portal/src/lib/businessModules/dental/features/examinations/translations.ts index f0d1ed4a2..0bb168189 100644 --- a/employee-portal/src/lib/businessModules/dental/features/examinations/translations.ts +++ b/employee-portal/src/lib/businessModules/dental/features/examinations/translations.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ExaminationStatus } from "@/lib/businessModules/dental/api/models/ExaminationStatus"; +import { ExaminationStatus } from "@eshg/dental/api/models/ExaminationStatus"; export const EXAMINATION_STATUS: Record<ExaminationStatus, string> = { OPEN: "offen", diff --git a/employee-portal/src/lib/businessModules/dental/features/prophylaxisSessions/AddChildToProphylaxisSessionSidebar.tsx b/employee-portal/src/lib/businessModules/dental/features/prophylaxisSessions/AddChildToProphylaxisSessionSidebar.tsx index 2ab460bc0..7d1734b62 100644 --- a/employee-portal/src/lib/businessModules/dental/features/prophylaxisSessions/AddChildToProphylaxisSessionSidebar.tsx +++ b/employee-portal/src/lib/businessModules/dental/features/prophylaxisSessions/AddChildToProphylaxisSessionSidebar.tsx @@ -3,6 +3,10 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +import { ChildExamination } from "@eshg/dental/api/models/ChildExamination"; +import { ChildSearchResult } from "@eshg/dental/api/models/ChildSearchResult"; +import { useUpdateProphylaxisSessionParticipants } from "@eshg/dental/api/mutations/prophylaxisSessionApi"; +import { useSearchChildren } from "@eshg/dental/api/queries/childApi"; import { InputField } from "@eshg/lib-portal/components/formFields/InputField"; import { RadioGroupField } from "@eshg/lib-portal/components/formFields/RadioGroupField"; import { useSnackbar } from "@eshg/lib-portal/components/snackbar/SnackbarProvider"; @@ -25,10 +29,6 @@ import { Formik } from "formik"; import { ReactNode } from "react"; import { useDebounce } from "use-debounce"; -import { ChildExamination } from "@/lib/businessModules/dental/api/models/ChildExamination"; -import { ChildSearchResult } from "@/lib/businessModules/dental/api/models/ChildSearchResult"; -import { useUpdateProphylaxisSessionParticipants } from "@/lib/businessModules/dental/api/mutations/prophylaxisSessionApi"; -import { useSearchChildren } from "@/lib/businessModules/dental/api/queries/childApi"; import { NoSearchResults } from "@/lib/shared/components/NoSearchResult"; import { SelectableCard } from "@/lib/shared/components/cards/SelectableCard"; import { DrawerProps } from "@/lib/shared/components/drawer/drawerContext"; diff --git a/employee-portal/src/lib/businessModules/dental/features/prophylaxisSessions/CreateProphylaxisSessionSidebar.tsx b/employee-portal/src/lib/businessModules/dental/features/prophylaxisSessions/CreateProphylaxisSessionSidebar.tsx index 81d7e43ca..341861c0d 100644 --- a/employee-portal/src/lib/businessModules/dental/features/prophylaxisSessions/CreateProphylaxisSessionSidebar.tsx +++ b/employee-portal/src/lib/businessModules/dental/features/prophylaxisSessions/CreateProphylaxisSessionSidebar.tsx @@ -11,6 +11,11 @@ import { ApiFluoridationVarnish, ApiProphylaxisType, } from "@eshg/dental-api"; +import { useCreateProphylaxisSession } from "@eshg/dental/api/mutations/prophylaxisSessionApi"; +import { + getAllDentalAssistantsQuery, + getAllDentistsQuery, +} from "@eshg/dental/api/queries/staffApi"; import { SelectField } from "@eshg/lib-portal/components/formFields/SelectField"; import { mapRequiredValue } from "@eshg/lib-portal/helpers/form"; import { useHasChanged } from "@eshg/lib-portal/hooks/useHasChanged"; @@ -22,11 +27,6 @@ import { forwardRef, useEffect } from "react"; import { useUserApi } from "@/lib/baseModule/api/clients"; import { SCHOOL_OR_DAYCARE } from "@/lib/baseModule/api/queries/contacts"; -import { useCreateProphylaxisSession } from "@/lib/businessModules/dental/api/mutations/prophylaxisSessionApi"; -import { - getAllDentalAssistantsQuery, - getAllDentistsQuery, -} from "@/lib/businessModules/dental/api/queries/staff"; import { FluoridationField } from "@/lib/businessModules/dental/features/prophylaxisSessions/FluoridationField"; import { SearchGroupField } from "@/lib/businessModules/dental/features/prophylaxisSessions/SearchGroupField"; import { PROPHYLAXIS_TYPE_OPTIONS } from "@/lib/businessModules/dental/features/prophylaxisSessions/options"; diff --git a/employee-portal/src/lib/businessModules/dental/features/prophylaxisSessions/ProphylaxisSessionExaminationToolbar.tsx b/employee-portal/src/lib/businessModules/dental/features/prophylaxisSessions/ProphylaxisSessionExaminationToolbar.tsx index a6a39e902..e12db2ce1 100644 --- a/employee-portal/src/lib/businessModules/dental/features/prophylaxisSessions/ProphylaxisSessionExaminationToolbar.tsx +++ b/employee-portal/src/lib/businessModules/dental/features/prophylaxisSessions/ProphylaxisSessionExaminationToolbar.tsx @@ -5,10 +5,10 @@ "use client"; +import { ChildExamination } from "@eshg/dental/api/models/ChildExamination"; import { routes } from "@eshg/dental/shared/routes"; import { MedicalServicesOutlined } from "@mui/icons-material"; -import { ChildExamination } from "@/lib/businessModules/dental/api/models/ChildExamination"; import { PersonToolbarHeader } from "@/lib/shared/components/layout/PersonToolbarHeader"; import { TabNavigationToolbar } from "@/lib/shared/components/tabNavigationToolbar/TabNavigationToolbar"; diff --git a/employee-portal/src/lib/businessModules/dental/features/prophylaxisSessions/ProphylaxisSessionParticipantsTable.tsx b/employee-portal/src/lib/businessModules/dental/features/prophylaxisSessions/ProphylaxisSessionParticipantsTable.tsx index dbe8c7b56..12542721e 100644 --- a/employee-portal/src/lib/businessModules/dental/features/prophylaxisSessions/ProphylaxisSessionParticipantsTable.tsx +++ b/employee-portal/src/lib/businessModules/dental/features/prophylaxisSessions/ProphylaxisSessionParticipantsTable.tsx @@ -3,6 +3,8 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +import { ChildExamination } from "@eshg/dental/api/models/ChildExamination"; +import { useUpdateProphylaxisSessionParticipants } from "@eshg/dental/api/mutations/prophylaxisSessionApi"; import { routes } from "@eshg/dental/shared/routes"; import { GENDER_VALUES } from "@eshg/lib-portal/components/formFields/constants"; import { InternalLinkButton } from "@eshg/lib-portal/components/navigation/InternalLinkButton"; @@ -15,8 +17,6 @@ import { createColumnHelper } from "@tanstack/react-table"; import { useEffect } from "react"; import { isDefined } from "remeda"; -import { ChildExamination } from "@/lib/businessModules/dental/api/models/ChildExamination"; -import { useUpdateProphylaxisSessionParticipants } from "@/lib/businessModules/dental/api/mutations/prophylaxisSessionApi"; import { ExaminationStatusChip } from "@/lib/businessModules/dental/features/examinations/ExaminationStatusChip"; import { useAddChildToProphylaxisSessionSidebar } from "@/lib/businessModules/dental/features/prophylaxisSessions/AddChildToProphylaxisSessionSidebar"; import { ActionsMenu } from "@/lib/shared/components/buttons/ActionsMenu"; diff --git a/employee-portal/src/lib/businessModules/dental/features/prophylaxisSessions/ProphylaxisSessionsTable.tsx b/employee-portal/src/lib/businessModules/dental/features/prophylaxisSessions/ProphylaxisSessionsTable.tsx index 16234054e..f1e55ece1 100644 --- a/employee-portal/src/lib/businessModules/dental/features/prophylaxisSessions/ProphylaxisSessionsTable.tsx +++ b/employee-portal/src/lib/businessModules/dental/features/prophylaxisSessions/ProphylaxisSessionsTable.tsx @@ -6,14 +6,14 @@ "use client"; import { ApiProphylaxisSessionSortKey } from "@eshg/dental-api"; +import { ProphylaxisSession } from "@eshg/dental/api/models/ProphylaxisSession"; +import { useGetProphylaxisSessions } from "@eshg/dental/api/queries/prophylaxisSessionApi"; import { routes } from "@eshg/dental/shared/routes"; import { formatDateTime } from "@eshg/lib-portal/formatters/dateTime"; import { useToggleableState } from "@eshg/lib-portal/hooks/useToggleableState"; import { ColumnSort, createColumnHelper } from "@tanstack/react-table"; import { ReactNode } from "react"; -import { ProphylaxisSession } from "@/lib/businessModules/dental/api/models/ProphylaxisSession"; -import { useGetProphylaxisSessions } from "@/lib/businessModules/dental/api/queries/prophylaxisSessionApi"; import { ProphylaxisSessionFilterSettings, ProphylaxisSessionFilters, diff --git a/employee-portal/src/lib/businessModules/dental/features/prophylaxisSessions/SearchGroupField.tsx b/employee-portal/src/lib/businessModules/dental/features/prophylaxisSessions/SearchGroupField.tsx index 188ddcdce..0b4c42496 100644 --- a/employee-portal/src/lib/businessModules/dental/features/prophylaxisSessions/SearchGroupField.tsx +++ b/employee-portal/src/lib/businessModules/dental/features/prophylaxisSessions/SearchGroupField.tsx @@ -3,10 +3,10 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +import { useSearchInstitutionGroups } from "@eshg/dental/api/queries/childApi"; import { SingleAutocompleteField } from "@eshg/lib-portal/components/formFields/autocomplete/SingleAutocompleteField"; import { SearchOutlined } from "@mui/icons-material"; -import { useSearchInstitutionGroups } from "@/lib/businessModules/dental/api/queries/childApi"; import { mapToSelectOption } from "@/lib/shared/helpers/selectOptionMapper"; interface SearchGroupFieldProps { diff --git a/employee-portal/src/lib/businessModules/dental/features/prophylaxisSessions/store/ProphylaxisSessionStoreProvider.tsx b/employee-portal/src/lib/businessModules/dental/features/prophylaxisSessions/store/ProphylaxisSessionStoreProvider.tsx index fd0b0ea40..d616915a8 100644 --- a/employee-portal/src/lib/businessModules/dental/features/prophylaxisSessions/store/ProphylaxisSessionStoreProvider.tsx +++ b/employee-portal/src/lib/businessModules/dental/features/prophylaxisSessions/store/ProphylaxisSessionStoreProvider.tsx @@ -5,14 +5,13 @@ "use client"; +import { ChildExamination } from "@eshg/dental/api/models/ChildExamination"; +import { ProphylaxisSessionDetails } from "@eshg/dental/api/models/ProphylaxisSessionDetails"; import { RequiresChildren } from "@eshg/lib-portal/types/react"; import { createContext, useContext, useEffect, useState } from "react"; import { useStore } from "zustand"; import { useShallow } from "zustand/react/shallow"; -import { ChildExamination } from "@/lib/businessModules/dental/api/models/ChildExamination"; -import { ProphylaxisSessionDetails } from "@/lib/businessModules/dental/api/models/ProphylaxisSessionDetails"; - import { filterParticipants } from "./participantFilters"; import { sortParticipants } from "./participantSorting"; import { diff --git a/employee-portal/src/lib/businessModules/dental/features/prophylaxisSessions/store/participantFilters.ts b/employee-portal/src/lib/businessModules/dental/features/prophylaxisSessions/store/participantFilters.ts index 6cd731b2b..145148f3c 100644 --- a/employee-portal/src/lib/businessModules/dental/features/prophylaxisSessions/store/participantFilters.ts +++ b/employee-portal/src/lib/businessModules/dental/features/prophylaxisSessions/store/participantFilters.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ChildExamination } from "@/lib/businessModules/dental/api/models/ChildExamination"; +import { ChildExamination } from "@eshg/dental/api/models/ChildExamination"; export interface ParticipantFilters { gender: GenderFilter; diff --git a/employee-portal/src/lib/businessModules/dental/features/prophylaxisSessions/store/participantSorting.ts b/employee-portal/src/lib/businessModules/dental/features/prophylaxisSessions/store/participantSorting.ts index ccc0c1fd1..42464b16d 100644 --- a/employee-portal/src/lib/businessModules/dental/features/prophylaxisSessions/store/participantSorting.ts +++ b/employee-portal/src/lib/businessModules/dental/features/prophylaxisSessions/store/participantSorting.ts @@ -3,10 +3,10 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +import { ChildExamination } from "@eshg/dental/api/models/ChildExamination"; import { GENDER_VALUES } from "@eshg/lib-portal/components/formFields/constants"; import { isDefined } from "remeda"; -import { ChildExamination } from "@/lib/businessModules/dental/api/models/ChildExamination"; import { EXAMINATION_STATUS } from "@/lib/businessModules/dental/features/examinations/translations"; import { displayBoolean } from "@/lib/shared/helpers/booleans"; diff --git a/employee-portal/src/lib/businessModules/dental/features/prophylaxisSessions/store/prophylaxisSessionStore.ts b/employee-portal/src/lib/businessModules/dental/features/prophylaxisSessions/store/prophylaxisSessionStore.ts index 9ddd15ed0..64280cb3a 100644 --- a/employee-portal/src/lib/businessModules/dental/features/prophylaxisSessions/store/prophylaxisSessionStore.ts +++ b/employee-portal/src/lib/businessModules/dental/features/prophylaxisSessions/store/prophylaxisSessionStore.ts @@ -3,10 +3,9 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +import { ProphylaxisSessionDetails } from "@eshg/dental/api/models/ProphylaxisSessionDetails"; import { createStore } from "zustand"; -import { ProphylaxisSessionDetails } from "@/lib/businessModules/dental/api/models/ProphylaxisSessionDetails"; - import { ParticipantFilters } from "./participantFilters"; import { ParticipantSorting } from "./participantSorting"; diff --git a/employee-portal/src/lib/businessModules/dental/import/ImportChildrenSidebar.tsx b/employee-portal/src/lib/businessModules/dental/import/ImportChildrenSidebar.tsx index 581ecfa7e..f7ccc9123 100644 --- a/employee-portal/src/lib/businessModules/dental/import/ImportChildrenSidebar.tsx +++ b/employee-portal/src/lib/businessModules/dental/import/ImportChildrenSidebar.tsx @@ -4,6 +4,7 @@ */ import { ApiAddContact200Response } from "@eshg/base-api"; +import { useImportChildren } from "@eshg/dental/api/mutations/importApi"; import { downloadFileAndOpen } from "@eshg/lib-portal/api/files/download"; import { FileType } from "@eshg/lib-portal/components/formFields/file/FileType"; import { mapRequiredValue } from "@eshg/lib-portal/helpers/form"; @@ -12,7 +13,6 @@ import { Stack } from "@mui/joy"; import { Formik } from "formik"; import { SCHOOL_OR_DAYCARE } from "@/lib/baseModule/api/queries/contacts"; -import { useImportChildren } from "@/lib/businessModules/dental/api/mutations/importApi"; import { SelectContactField } from "@/lib/shared/components/formFields/SelectContactField"; import { FileField } from "@/lib/shared/components/formFields/file/FileField"; import { SchoolYearField } from "@/lib/shared/components/formFields/schoolYear"; @@ -51,7 +51,7 @@ function ImportChildrenSidebar(props: SidebarWithFormRefProps) { await importChildren( { file: mapRequiredValue(values.file), - institution: mapRequiredValue(values.institution), + institutionId: mapRequiredValue(values.institution).id, schoolYear: mapRequiredValue(values.schoolYear), }, { diff --git a/employee-portal/src/lib/businessModules/inspection/api/download/files.ts b/employee-portal/src/lib/businessModules/inspection/api/download/files.ts deleted file mode 100644 index 5585b30cb..000000000 --- a/employee-portal/src/lib/businessModules/inspection/api/download/files.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Copyright 2025 SCOOP Software GmbH, cronn GmbH - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { useParams } from "next/navigation"; - -import { EditInspectionPageParams } from "@/app/(businessModules)/inspection/procedures/[id]/layout"; -import { useFileApi } from "@/lib/businessModules/inspection/api/clients"; -import { getHeadersForOfflineCaching } from "@/lib/businessModules/inspection/shared/offline/getHeadersForOfflineCaching"; -import { useDownloadFile } from "@/lib/shared/api/download/files"; -import { ProgressEntriesUrlParams } from "@/lib/shared/components/procedures/progress-entries/types"; - -export function useDownloadInspectionFile() { - const fileApi = useFileApi(); - const { id } = - useParams<ProgressEntriesUrlParams<EditInspectionPageParams>["params"]>(); - return useDownloadFile((fileId: string) => - fileApi.downloadFileRaw({ fileId }, getHeadersForOfflineCaching(id)), - ); -} diff --git a/employee-portal/src/lib/businessModules/inspection/api/mutations/approvalRequests.ts b/employee-portal/src/lib/businessModules/inspection/api/mutations/approvalRequests.ts deleted file mode 100644 index d8bd15465..000000000 --- a/employee-portal/src/lib/businessModules/inspection/api/mutations/approvalRequests.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Copyright 2025 SCOOP Software GmbH, cronn GmbH - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { useApprovalRequestApi } from "@/lib/businessModules/inspection/api/clients"; -import { - useDecideApprovalRequestTemplate, - useGrantDeletionForAllRequestsTemplate, -} from "@/lib/shared/api/mutations/approvalRequests"; - -export function useDecideApprovalRequest() { - return useDecideApprovalRequestTemplate(useApprovalRequestApi); -} - -export function useGrantDeletionForAllRequests() { - return useGrantDeletionForAllRequestsTemplate(useApprovalRequestApi); -} diff --git a/employee-portal/src/lib/businessModules/inspection/api/mutations/files.ts b/employee-portal/src/lib/businessModules/inspection/api/mutations/files.ts deleted file mode 100644 index f5d1e8afc..000000000 --- a/employee-portal/src/lib/businessModules/inspection/api/mutations/files.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Copyright 2025 SCOOP Software GmbH, cronn GmbH - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { useFileApi } from "@/lib/businessModules/inspection/api/clients"; -import { - useDeleteFileTemplate, - useRequestFileDeletionTemplate, -} from "@/lib/shared/api/mutations/files"; - -export function useDeleteFile() { - return useDeleteFileTemplate(useFileApi); -} - -export function useRequestFileDeletion() { - return useRequestFileDeletionTemplate(useFileApi); -} diff --git a/employee-portal/src/lib/businessModules/inspection/api/mutations/progressEntries.ts b/employee-portal/src/lib/businessModules/inspection/api/mutations/progressEntries.ts deleted file mode 100644 index 6b042966b..000000000 --- a/employee-portal/src/lib/businessModules/inspection/api/mutations/progressEntries.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Copyright 2025 SCOOP Software GmbH, cronn GmbH - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { - useFileApi, - useProgressEntryApi, -} from "@/lib/businessModules/inspection/api/clients"; -import { - useCreateProgressEntryTemplate, - useDeleteProgressEntryTemplate, - usePatchProgressEntryTemplate, - useRequestProgressEntryDeletionTemplate, -} from "@/lib/shared/api/mutations/progressEntries"; - -export function useCreateProgressEntry() { - return useCreateProgressEntryTemplate(useProgressEntryApi); -} - -export function useDeleteProgressEntry() { - return useDeleteProgressEntryTemplate(useProgressEntryApi); -} - -export function usePatchProgressEntry() { - return usePatchProgressEntryTemplate(useProgressEntryApi, useFileApi); -} - -export function useRequestProgressEntryDeletion() { - return useRequestProgressEntryDeletionTemplate(useProgressEntryApi); -} diff --git a/employee-portal/src/lib/businessModules/inspection/api/queries/files.ts b/employee-portal/src/lib/businessModules/inspection/api/queries/files.ts deleted file mode 100644 index 239b8ec8b..000000000 --- a/employee-portal/src/lib/businessModules/inspection/api/queries/files.ts +++ /dev/null @@ -1,12 +0,0 @@ -/** - * Copyright 2025 SCOOP Software GmbH, cronn GmbH - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { useFileApi } from "@/lib/businessModules/inspection/api/clients"; -import { fileApiQueryKey } from "@/lib/businessModules/inspection/api/queries/apiQueryKeys"; -import { useGetMetaDataHistoryTemplate } from "@/lib/shared/api/queries/files"; - -export function useGetMetaDataHistory(fileId: string) { - return useGetMetaDataHistoryTemplate(useFileApi, fileApiQueryKey, fileId); -} diff --git a/employee-portal/src/lib/businessModules/inspection/api/queries/progressEntries.ts b/employee-portal/src/lib/businessModules/inspection/api/queries/progressEntries.ts deleted file mode 100644 index 0e30a43ee..000000000 --- a/employee-portal/src/lib/businessModules/inspection/api/queries/progressEntries.ts +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Copyright 2025 SCOOP Software GmbH, cronn GmbH - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { ApiUserRole } from "@eshg/base-api"; - -import { - useProcedureApi, - useProgressEntryApi, -} from "@/lib/businessModules/inspection/api/clients"; -import { progressEntryApiQueryKey } from "@/lib/businessModules/inspection/api/queries/apiQueryKeys"; -import { - useFetchProgressEntriesTemplate, - useFetchProgressEntryDetailsTemplate, - useGetManualProgressEntryHistoryTemplate, -} from "@/lib/shared/api/queries/progressEntries"; -import { ProgressEntriesFilters } from "@/lib/shared/components/procedures/progress-entries/types"; - -export function useFetchProgressEntries( - procedureId: string, - leaderRole: ApiUserRole, - progressEntryFilter: ProgressEntriesFilters, -) { - return useFetchProgressEntriesTemplate( - useProgressEntryApi, - useProcedureApi, - progressEntryApiQueryKey, - procedureId, - leaderRole, - progressEntryFilter, - true, - ); -} - -export function useFetchProgressEntryDetails( - procedureId: string, - entryId: string, -) { - return useFetchProgressEntryDetailsTemplate( - useProgressEntryApi, - progressEntryApiQueryKey, - procedureId, - entryId, - true, - ); -} - -export function useGetManualProgressEntryHistory(entryId: string) { - return useGetManualProgressEntryHistoryTemplate( - useProgressEntryApi, - progressEntryApiQueryKey, - entryId, - ); -} diff --git a/employee-portal/src/lib/businessModules/inspection/components/checklistDefinition/editor/elements/ChecklistDefinitionElement.tsx b/employee-portal/src/lib/businessModules/inspection/components/checklistDefinition/editor/elements/ChecklistDefinitionElement.tsx index fd12c537b..06ae3f6bb 100644 --- a/employee-portal/src/lib/businessModules/inspection/components/checklistDefinition/editor/elements/ChecklistDefinitionElement.tsx +++ b/employee-portal/src/lib/businessModules/inspection/components/checklistDefinition/editor/elements/ChecklistDefinitionElement.tsx @@ -163,7 +163,7 @@ export function ChecklistDefinitionElement({ borderRadius={12} component="section" aria-label={`Element ${sectionIndex + 1}.${elementIndex + 1}`} - style={{ + sx={{ background: "var(--background-level-1, #F0F4F8)", }} > @@ -175,9 +175,9 @@ export function ChecklistDefinitionElement({ alignItems={"center"} > <Divider - style={{ - marginTop: 24, - marginBottom: 24, + sx={{ + marginTop: 3, + marginBottom: 3, display: "flex", flex: 1, }} diff --git a/employee-portal/src/lib/businessModules/inspection/components/checklistDefinition/editor/elements/ChecklistDefinitionElementsList.tsx b/employee-portal/src/lib/businessModules/inspection/components/checklistDefinition/editor/elements/ChecklistDefinitionElementsList.tsx index 6c989ada1..2a84816ac 100644 --- a/employee-portal/src/lib/businessModules/inspection/components/checklistDefinition/editor/elements/ChecklistDefinitionElementsList.tsx +++ b/employee-portal/src/lib/businessModules/inspection/components/checklistDefinition/editor/elements/ChecklistDefinitionElementsList.tsx @@ -11,7 +11,7 @@ import { Droppable, NotDraggingStyle, } from "@hello-pangea/dnd"; -import { Stack } from "@mui/joy"; +import { Box, Stack } from "@mui/joy"; import { FieldArray, useFormikContext } from "formik"; import { FormChecklistDefinitionVersion } from "@/lib/businessModules/inspection/api/mutations/checklistDefinition"; @@ -46,7 +46,7 @@ export function ChecklistDefinitionElementsList({ spacing={2} {...provided.droppableProps} ref={provided.innerRef} - style={getListStyle(snapshot.isDraggingOver)} + sx={getListStyle(snapshot.isDraggingOver)} > {values.context.sections[sectionIndex]?.elements.map( (element, elementIndex) => ( @@ -56,10 +56,10 @@ export function ChecklistDefinitionElementsList({ index={elementIndex} > {(provided, snapshot) => ( - <div + <Box ref={provided.innerRef} {...provided.draggableProps} - style={getItemStyle( + sx={getItemStyle( snapshot.isDragging, provided.draggableProps.style, )} @@ -76,7 +76,7 @@ export function ChecklistDefinitionElementsList({ sectionIndex={sectionIndex} elementIndex={elementIndex} /> - </div> + </Box> )} </Draggable> ), diff --git a/employee-portal/src/lib/businessModules/inspection/components/checklistDefinition/editor/elements/inner/ChecklistDefinitionElementMultiInner.tsx b/employee-portal/src/lib/businessModules/inspection/components/checklistDefinition/editor/elements/inner/ChecklistDefinitionElementMultiInner.tsx index 1d43e5fda..1c179d1b8 100644 --- a/employee-portal/src/lib/businessModules/inspection/components/checklistDefinition/editor/elements/inner/ChecklistDefinitionElementMultiInner.tsx +++ b/employee-portal/src/lib/businessModules/inspection/components/checklistDefinition/editor/elements/inner/ChecklistDefinitionElementMultiInner.tsx @@ -82,7 +82,7 @@ export function ChecklistDefinitionElementMultiInner({ <Button onClick={() => addItem()} startDecorator={<Add />} - style={{ alignSelf: "flex-start" }} + sx={{ alignSelf: "flex-start" }} variant="plain" > Antwortmöglichkeit hinzufügen diff --git a/employee-portal/src/lib/businessModules/inspection/components/checklistDefinition/editor/sections/ChecklistDefinitionSection.tsx b/employee-portal/src/lib/businessModules/inspection/components/checklistDefinition/editor/sections/ChecklistDefinitionSection.tsx index f56454a1c..4815c0a2c 100644 --- a/employee-portal/src/lib/businessModules/inspection/components/checklistDefinition/editor/sections/ChecklistDefinitionSection.tsx +++ b/employee-portal/src/lib/businessModules/inspection/components/checklistDefinition/editor/sections/ChecklistDefinitionSection.tsx @@ -78,7 +78,9 @@ export function ChecklistDefinitionSection({ <AccordionGroup variant="plain" transition="0.5s" - style={{ marginLeft: -12, marginRight: -12 }} + sx={{ + marginX: -1.5, + }} > <Accordion defaultExpanded> <Stack @@ -136,7 +138,7 @@ export function ChecklistDefinitionSection({ }, }} > - <Stack spacing={2} style={{ marginLeft: "3rem" }}> + <Stack spacing={2} sx={{ marginLeft: "3rem" }}> <ChecklistDefinitionElementsList sectionIndex={sectionIndex} /> <Stack spacing={2} direction={"row"}> <Button diff --git a/employee-portal/src/lib/businessModules/inspection/components/checklistDefinition/editor/sections/ChecklistDefinitionSectionsList.tsx b/employee-portal/src/lib/businessModules/inspection/components/checklistDefinition/editor/sections/ChecklistDefinitionSectionsList.tsx index b2489775e..522026f65 100644 --- a/employee-portal/src/lib/businessModules/inspection/components/checklistDefinition/editor/sections/ChecklistDefinitionSectionsList.tsx +++ b/employee-portal/src/lib/businessModules/inspection/components/checklistDefinition/editor/sections/ChecklistDefinitionSectionsList.tsx @@ -14,7 +14,7 @@ import { NotDraggingStyle, } from "@hello-pangea/dnd"; import { CreateNewFolder } from "@mui/icons-material"; -import { Button, Stack } from "@mui/joy"; +import { Box, Button, Stack } from "@mui/joy"; import { FieldArray, useFormikContext } from "formik"; import { v4 as uuidv4 } from "uuid"; @@ -46,7 +46,7 @@ export function ChecklistDefinitionSectionsList() { spacing={2} {...provided.droppableProps} ref={provided.innerRef} - style={getListStyle(snapshot.isDraggingOver)} + sx={getListStyle(snapshot.isDraggingOver)} > {values.context.sections.map((section, sectionIndex) => ( <Draggable @@ -55,10 +55,10 @@ export function ChecklistDefinitionSectionsList() { index={sectionIndex} > {(provided, snapshot) => ( - <div + <Box ref={provided.innerRef} {...provided.draggableProps} - style={getItemStyle( + sx={getItemStyle( snapshot.isDragging, provided.draggableProps.style, )} @@ -73,7 +73,7 @@ export function ChecklistDefinitionSectionsList() { addSection={(section) => push(section)} sectionIndex={sectionIndex} /> - </div> + </Box> )} </Draggable> ))} @@ -87,7 +87,7 @@ export function ChecklistDefinitionSectionsList() { onClick={() => push(createNewSection())} variant="plain" startDecorator={<CreateNewFolder />} - style={{ alignSelf: "flex-start" }} + sx={{ alignSelf: "flex-start" }} > Neue Sektion erstellen </Button> diff --git a/employee-portal/src/lib/businessModules/inspection/components/inspection/execution/FinalizeInspectionModalContent.tsx b/employee-portal/src/lib/businessModules/inspection/components/inspection/execution/FinalizeInspectionModalContent.tsx index 237595967..3b3769064 100644 --- a/employee-portal/src/lib/businessModules/inspection/components/inspection/execution/FinalizeInspectionModalContent.tsx +++ b/employee-portal/src/lib/businessModules/inspection/components/inspection/execution/FinalizeInspectionModalContent.tsx @@ -8,7 +8,14 @@ import { ApiInspectionPhase } from "@eshg/employee-portal-api/inspection"; import { FormPlus } from "@eshg/lib-portal/components/form/FormPlus"; import { InputField } from "@eshg/lib-portal/components/formFields/InputField"; -import { Button, FormControl, FormHelperText, Sheet, Stack } from "@mui/joy"; +import { + Box, + Button, + FormControl, + FormHelperText, + Sheet, + Stack, +} from "@mui/joy"; import { type Drauu, createDrauu } from "drauu"; import { Formik } from "formik"; import { useRouter } from "next/navigation"; @@ -127,7 +134,11 @@ export function FinalizeInspectionModalContent({ touchAction: "none", }} > - <svg ref={svgRef} style={{ width: "100%", height: "100%" }} /> + <Box + component={"svg"} + ref={svgRef} + sx={{ width: "100%", height: "100%" }} + /> </Sheet> <FormHelperText>Bitte Signatur zeichnen.</FormHelperText> </FormControl> diff --git a/employee-portal/src/lib/businessModules/inspection/components/inspection/execution/checklist/form/ChecklistIncidentToggle.tsx b/employee-portal/src/lib/businessModules/inspection/components/inspection/execution/checklist/form/ChecklistIncidentToggle.tsx index ada883e52..fcce9ce3c 100644 --- a/employee-portal/src/lib/businessModules/inspection/components/inspection/execution/checklist/form/ChecklistIncidentToggle.tsx +++ b/employee-portal/src/lib/businessModules/inspection/components/inspection/execution/checklist/form/ChecklistIncidentToggle.tsx @@ -25,7 +25,7 @@ export function ChecklistIncidentToggle({ <Checkbox name={field.name} color={element.incident ? "danger" : "neutral"} - style={{ alignSelf: "flex-start" }} + sx={{ alignSelf: "flex-start" }} size="sm" checkedIcon={<CloseOutlined />} uncheckedIcon={<WarningAmberOutlined />} diff --git a/employee-portal/src/lib/businessModules/inspection/components/inspection/new/AddInspectionTiles.tsx b/employee-portal/src/lib/businessModules/inspection/components/inspection/new/AddInspectionTiles.tsx index 8a276e161..f3ec84a73 100644 --- a/employee-portal/src/lib/businessModules/inspection/components/inspection/new/AddInspectionTiles.tsx +++ b/employee-portal/src/lib/businessModules/inspection/components/inspection/new/AddInspectionTiles.tsx @@ -55,7 +55,7 @@ export function AddInspectionTiles({ <Grid xl={9}> <FacilityTile facility={facility} onEdit={openEdit} /> </Grid> - <Grid xl={3} style={{ flex: 1 }}> + <Grid xl={3} sx={{ flex: 1 }}> <AdditionalInfoTile procedureId={inspection.externalId} objectTypes={objectTypes} diff --git a/employee-portal/src/lib/businessModules/inspection/components/inspection/new/AdditionalInfoTile.tsx b/employee-portal/src/lib/businessModules/inspection/components/inspection/new/AdditionalInfoTile.tsx index ea66a818f..15c964d8e 100644 --- a/employee-portal/src/lib/businessModules/inspection/components/inspection/new/AdditionalInfoTile.tsx +++ b/employee-portal/src/lib/businessModules/inspection/components/inspection/new/AdditionalInfoTile.tsx @@ -117,7 +117,7 @@ export function AdditionalInfoTile({ <InfoTile name="additional-infos" title="Zusatzinfos"> <Formik initialValues={initialValues} onSubmit={handleSubmit}> {({ isSubmitting, setFieldValue, values }) => ( - <FormPlus style={{ display: "contents" }}> + <FormPlus sx={{ display: "contents" }}> {isNonNullish(facility.objectType) ? ( <Alert color="primary" diff --git a/employee-portal/src/lib/businessModules/inspection/components/inspection/planning/packlist/Packlist.tsx b/employee-portal/src/lib/businessModules/inspection/components/inspection/planning/packlist/Packlist.tsx index fe6d5d795..77f47f459 100644 --- a/employee-portal/src/lib/businessModules/inspection/components/inspection/planning/packlist/Packlist.tsx +++ b/employee-portal/src/lib/businessModules/inspection/components/inspection/planning/packlist/Packlist.tsx @@ -77,10 +77,10 @@ export function Packlist({ </Typography> <AccordionSummary - style={{ + sx={{ minHeight: "1px", height: "1px", - marginTop: -10, + marginTop: -1.25, }} slotProps={{ button: { @@ -110,11 +110,11 @@ export function Packlist({ <Stack direction="column" gap={2} - sx={{ paddingX: 2 }} data-testid="packlists" - style={{ - marginTop: 20, - marginLeft: -12, + sx={{ + paddingX: 2, + marginTop: 2.5, + marginLeft: -1.5, }} > {packlist.elements.map((element) => { diff --git a/employee-portal/src/lib/businessModules/inspection/components/packlistDefinition/elements/PacklistDefinitionElement.tsx b/employee-portal/src/lib/businessModules/inspection/components/packlistDefinition/elements/PacklistDefinitionElement.tsx index 723270f28..84ef86e01 100644 --- a/employee-portal/src/lib/businessModules/inspection/components/packlistDefinition/elements/PacklistDefinitionElement.tsx +++ b/employee-portal/src/lib/businessModules/inspection/components/packlistDefinition/elements/PacklistDefinitionElement.tsx @@ -8,7 +8,7 @@ import { ApiPacklistDefinitionElement } from "@eshg/employee-portal-api/inspection"; import { DraggableProvidedDragHandleProps } from "@hello-pangea/dnd"; import { DeleteOutlined, DragIndicatorOutlined } from "@mui/icons-material"; -import { IconButton, Input, Stack } from "@mui/joy"; +import { Box, IconButton, Input, Stack } from "@mui/joy"; import { doNothing } from "remeda"; interface PacklistDefinitionElementProps { @@ -49,29 +49,29 @@ export function PacklistDefinitionElement({ justifyContent="center" alignItems="center" > - <div + <Box {...dragHandleProps} aria-label={`Element ${defaultIndex} ziehen und verschieben`} role="button" - style={{ + sx={{ display: "flex", alignItems: "center", justifyContent: "center", }} > <DragIndicatorOutlined - style={{ + sx={{ backgroundColor: "#E3EFFB", - borderRadius: 50, - padding: 4, - width: 32, - height: 32, + borderRadius: 6.25, + padding: 0.5, + width: "32px", + height: "32px", }} /> - </div> + </Box> <Input disabled={readOnlyMode} - style={{ flex: 1, height: 51 }} + sx={{ flex: 1, height: "51px" }} defaultValue={element?.text ?? ""} placeholder={`Text für Eintrag ${defaultIndex} eingeben`} onBlur={(event) => setTitle(event.target.value)} diff --git a/employee-portal/src/lib/businessModules/inspection/components/packlistDefinition/elements/PacklistDefinitionElementsList.tsx b/employee-portal/src/lib/businessModules/inspection/components/packlistDefinition/elements/PacklistDefinitionElementsList.tsx index bc2e0e3f2..4e5a8b95b 100644 --- a/employee-portal/src/lib/businessModules/inspection/components/packlistDefinition/elements/PacklistDefinitionElementsList.tsx +++ b/employee-portal/src/lib/businessModules/inspection/components/packlistDefinition/elements/PacklistDefinitionElementsList.tsx @@ -13,7 +13,7 @@ import { NotDraggingStyle, } from "@hello-pangea/dnd"; import { Add } from "@mui/icons-material"; -import { Button, Stack, Typography } from "@mui/joy"; +import { Box, Button, Stack, Typography } from "@mui/joy"; import { FieldArray, useFormikContext } from "formik"; import { v4 as uuidv4 } from "uuid"; @@ -61,7 +61,7 @@ export function PacklistDefinitionElementsList({ spacing={1} {...provided.droppableProps} ref={provided.innerRef} - style={getListStyle(snapshot.isDraggingOver)} + sx={getListStyle(snapshot.isDraggingOver)} > {values.elements.map((element, elementIndex) => ( <Draggable @@ -70,10 +70,10 @@ export function PacklistDefinitionElementsList({ index={elementIndex} > {(provided, snapshot) => ( - <div + <Box ref={provided.innerRef} {...provided.draggableProps} - style={getItemStyle( + sx={getItemStyle( snapshot.isDragging, provided.draggableProps.style, )} @@ -88,7 +88,7 @@ export function PacklistDefinitionElementsList({ elementIndex={elementIndex} readOnlyMode={readOnlyMode} /> - </div> + </Box> )} </Draggable> ))} @@ -103,7 +103,7 @@ export function PacklistDefinitionElementsList({ onClick={() => push(createNewElement())} variant="plain" startDecorator={<Add />} - style={{ alignSelf: "flex-start" }} + sx={{ alignSelf: "flex-start" }} > Neuen Eintrag erstellen </Button> diff --git a/employee-portal/src/lib/businessModules/inspection/components/packlistDefinition/sidebars/PacklistDefinitionRevisionTile.tsx b/employee-portal/src/lib/businessModules/inspection/components/packlistDefinition/sidebars/PacklistDefinitionRevisionTile.tsx index 122ce52d0..17a746b08 100644 --- a/employee-portal/src/lib/businessModules/inspection/components/packlistDefinition/sidebars/PacklistDefinitionRevisionTile.tsx +++ b/employee-portal/src/lib/businessModules/inspection/components/packlistDefinition/sidebars/PacklistDefinitionRevisionTile.tsx @@ -39,12 +39,12 @@ export function PacklistDefinitionRevisionTile({ <Stack spacing={1} direction="row" alignItems={"flex-start"}> <Grid container> <FactCheckOutlined - style={{ + sx={{ backgroundColor: "#F0F4F8", - borderRadius: 5, - padding: 8, - width: 40, - height: 40, + borderRadius: "5px", + padding: 1, + width: "40px", + height: "40px", }} /> </Grid> diff --git a/employee-portal/src/lib/businessModules/measlesProtection/api/clients.ts b/employee-portal/src/lib/businessModules/measlesProtection/api/clients.ts index 06fd32025..e9727de04 100644 --- a/employee-portal/src/lib/businessModules/measlesProtection/api/clients.ts +++ b/employee-portal/src/lib/businessModules/measlesProtection/api/clients.ts @@ -3,6 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +import { useApiConfiguration } from "@eshg/lib-portal/api/ApiProvider"; import { AccessRestrictionApi, AppointmentBlockApi, @@ -22,8 +23,7 @@ import { ProofSubmissionApi, ProtectionProcedureApi, StatusTransitionApi, -} from "@eshg/employee-portal-api/measlesProtection"; -import { useApiConfiguration } from "@eshg/lib-portal/api/ApiProvider"; +} from "@eshg/measles-protection-api"; function useConfiguration() { const configurationParameters = useApiConfiguration( diff --git a/employee-portal/src/lib/businessModules/measlesProtection/api/download/files.ts b/employee-portal/src/lib/businessModules/measlesProtection/api/download/files.ts deleted file mode 100644 index 31cdf3fbb..000000000 --- a/employee-portal/src/lib/businessModules/measlesProtection/api/download/files.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** - * Copyright 2025 cronn GmbH - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { useFileApi } from "@/lib/businessModules/measlesProtection/api/clients"; -import { useDownloadFile } from "@/lib/shared/api/download/files"; - -export function useDownloadMeaslesProtectionFile() { - const fileApi = useFileApi(); - return useDownloadFile((fileId: string) => - fileApi.downloadFileRaw({ fileId }), - ); -} diff --git a/employee-portal/src/lib/businessModules/measlesProtection/api/models/AppointmentBlockGroup.ts b/employee-portal/src/lib/businessModules/measlesProtection/api/models/AppointmentBlockGroup.ts index 0ef6db7cb..5ae18b9cb 100644 --- a/employee-portal/src/lib/businessModules/measlesProtection/api/models/AppointmentBlockGroup.ts +++ b/employee-portal/src/lib/businessModules/measlesProtection/api/models/AppointmentBlockGroup.ts @@ -3,16 +3,18 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +import { + BaseEntity, + mapBaseEntity, +} from "@eshg/lib-employee-portal/api/models/BaseEntity"; +import { assertNonEmptyArray } from "@eshg/lib-portal/helpers/assertions"; import { ApiAppointmentType, ApiGetAppointmentBlock, ApiGetAppointmentBlockGroup, -} from "@eshg/employee-portal-api/measlesProtection"; -import { assertNonEmptyArray } from "@eshg/lib-portal/helpers/assertions"; +} from "@eshg/measles-protection-api"; import { first, last, sumBy } from "remeda"; -import { BaseEntity, mapBaseEntity } from "@/lib/shared/api/models/BaseEntity"; - export interface AppointmentBlockMeasles extends BaseEntity { readonly start: Date; readonly end: Date; diff --git a/employee-portal/src/lib/businessModules/measlesProtection/api/mutations/appointmentBlockApi.ts b/employee-portal/src/lib/businessModules/measlesProtection/api/mutations/appointmentBlockApi.ts index cfc0afaf3..2c7f0dbd5 100644 --- a/employee-portal/src/lib/businessModules/measlesProtection/api/mutations/appointmentBlockApi.ts +++ b/employee-portal/src/lib/businessModules/measlesProtection/api/mutations/appointmentBlockApi.ts @@ -3,8 +3,8 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiCreateDailyAppointmentBlockGroupRequest } from "@eshg/employee-portal-api/measlesProtection"; import { useSnackbar } from "@eshg/lib-portal/components/snackbar/SnackbarProvider"; +import { ApiCreateDailyAppointmentBlockGroupRequest } from "@eshg/measles-protection-api"; import { useMutation } from "@tanstack/react-query"; import { useAppointmentBlockApi } from "@/lib/businessModules/measlesProtection/api/clients"; diff --git a/employee-portal/src/lib/businessModules/measlesProtection/api/mutations/appointmentBookingApi.ts b/employee-portal/src/lib/businessModules/measlesProtection/api/mutations/appointmentBookingApi.ts index 5a74b9a01..525e7d70b 100644 --- a/employee-portal/src/lib/businessModules/measlesProtection/api/mutations/appointmentBookingApi.ts +++ b/employee-portal/src/lib/businessModules/measlesProtection/api/mutations/appointmentBookingApi.ts @@ -3,9 +3,9 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { BookAppointmentForProcedureRequest } from "@eshg/employee-portal-api/measlesProtection"; import { useHandledMutation } from "@eshg/lib-portal/api/useHandledMutation"; import { useSnackbar } from "@eshg/lib-portal/components/snackbar/SnackbarProvider"; +import { BookAppointmentForProcedureRequest } from "@eshg/measles-protection-api"; import { useAppointmentBookingApi } from "@/lib/businessModules/measlesProtection/api/clients"; import { measlesProtectionApiQueryKey } from "@/lib/businessModules/measlesProtection/api/queries/apiQueryKeys"; diff --git a/employee-portal/src/lib/businessModules/measlesProtection/api/mutations/approvalRequests.ts b/employee-portal/src/lib/businessModules/measlesProtection/api/mutations/approvalRequests.ts deleted file mode 100644 index a7c43eff0..000000000 --- a/employee-portal/src/lib/businessModules/measlesProtection/api/mutations/approvalRequests.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Copyright 2025 cronn GmbH - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { useApprovalRequestApi } from "@/lib/businessModules/measlesProtection/api/clients"; -import { progressEntryApiQueryKey } from "@/lib/businessModules/measlesProtection/api/queries/apiQueryKeys"; -import { - useDecideApprovalRequestTemplate, - useGrantDeletionForAllRequestsTemplate, -} from "@/lib/shared/api/mutations/approvalRequests"; - -export function useDecideApprovalRequest() { - return useDecideApprovalRequestTemplate( - useApprovalRequestApi, - progressEntryApiQueryKey([]), - ); -} - -export function useGrantDeletionForAllRequests() { - return useGrantDeletionForAllRequestsTemplate( - useApprovalRequestApi, - progressEntryApiQueryKey([]), - ); -} diff --git a/employee-portal/src/lib/businessModules/measlesProtection/api/mutations/files.ts b/employee-portal/src/lib/businessModules/measlesProtection/api/mutations/files.ts deleted file mode 100644 index 6affc7dd3..000000000 --- a/employee-portal/src/lib/businessModules/measlesProtection/api/mutations/files.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Copyright 2025 cronn GmbH - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { useFileApi } from "@/lib/businessModules/measlesProtection/api/clients"; -import { measlesProtectionApiQueryKey } from "@/lib/businessModules/measlesProtection/api/queries/apiQueryKeys"; -import { - useDeleteFileTemplate, - useRequestFileDeletionTemplate, -} from "@/lib/shared/api/mutations/files"; - -export function useDeleteFile() { - return useDeleteFileTemplate( - useFileApi, - measlesProtectionApiQueryKey(["files"]), - ); -} - -export function useRequestFileDeletion() { - return useRequestFileDeletionTemplate( - useFileApi, - measlesProtectionApiQueryKey(["files"]), - ); -} diff --git a/employee-portal/src/lib/businessModules/measlesProtection/api/mutations/measlesProtectionApi.ts b/employee-portal/src/lib/businessModules/measlesProtection/api/mutations/measlesProtectionApi.ts index 9989852bb..fd8a614c9 100644 --- a/employee-portal/src/lib/businessModules/measlesProtection/api/mutations/measlesProtectionApi.ts +++ b/employee-portal/src/lib/businessModules/measlesProtection/api/mutations/measlesProtectionApi.ts @@ -3,10 +3,10 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { BookAppointmentForProcedureRequest } from "@eshg/employee-portal-api/measlesProtection"; import { unwrapRawResponse } from "@eshg/lib-portal/api/unwrapRawResponse"; import { useHandledMutation } from "@eshg/lib-portal/api/useHandledMutation"; import { useSnackbar } from "@eshg/lib-portal/components/snackbar/SnackbarProvider"; +import { BookAppointmentForProcedureRequest } from "@eshg/measles-protection-api"; import { useAppointmentBookingApi } from "@/lib/businessModules/measlesProtection/api/clients"; diff --git a/employee-portal/src/lib/businessModules/measlesProtection/api/mutations/procedures.ts b/employee-portal/src/lib/businessModules/measlesProtection/api/mutations/procedures.ts index c992046eb..d22695236 100644 --- a/employee-portal/src/lib/businessModules/measlesProtection/api/mutations/procedures.ts +++ b/employee-portal/src/lib/businessModules/measlesProtection/api/mutations/procedures.ts @@ -6,6 +6,11 @@ "use client"; import { ApiGetReferencePersonResponse } from "@eshg/base-api"; +import { getFilenameFromHeader } from "@eshg/lib-portal/api/files/download"; +import { unwrapRawResponse } from "@eshg/lib-portal/api/unwrapRawResponse"; +import { useHandledMutation } from "@eshg/lib-portal/api/useHandledMutation"; +import { mapOptionalValue } from "@eshg/lib-portal/helpers/form"; +import { MutationPassThrough } from "@eshg/lib-portal/types/query"; import { ApiAccessRestriction, ApiAccessRestrictionLetter, @@ -31,12 +36,7 @@ import { ApiUpdateAccessRestriction, ApiUpdateProcedureRequest, CreateProofSubmissionRequest, -} from "@eshg/employee-portal-api/measlesProtection"; -import { getFilenameFromHeader } from "@eshg/lib-portal/api/files/download"; -import { unwrapRawResponse } from "@eshg/lib-portal/api/unwrapRawResponse"; -import { useHandledMutation } from "@eshg/lib-portal/api/useHandledMutation"; -import { mapOptionalValue } from "@eshg/lib-portal/helpers/form"; -import { MutationPassThrough } from "@eshg/lib-portal/types/query"; +} from "@eshg/measles-protection-api"; import { useMutation } from "@tanstack/react-query"; import { isNullish } from "remeda"; diff --git a/employee-portal/src/lib/businessModules/measlesProtection/api/mutations/progressEntries.ts b/employee-portal/src/lib/businessModules/measlesProtection/api/mutations/progressEntries.ts deleted file mode 100644 index 6691ed0c3..000000000 --- a/employee-portal/src/lib/businessModules/measlesProtection/api/mutations/progressEntries.ts +++ /dev/null @@ -1,45 +0,0 @@ -/** - * Copyright 2025 cronn GmbH - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { - useFileApi, - useProgressEntryApi, -} from "@/lib/businessModules/measlesProtection/api/clients"; -import { progressEntryApiQueryKey } from "@/lib/businessModules/measlesProtection/api/queries/apiQueryKeys"; -import { - useCreateProgressEntryTemplate, - useDeleteProgressEntryTemplate, - usePatchProgressEntryTemplate, - useRequestProgressEntryDeletionTemplate, -} from "@/lib/shared/api/mutations/progressEntries"; - -export function useCreateProgressEntry() { - return useCreateProgressEntryTemplate( - useProgressEntryApi, - progressEntryApiQueryKey([]), - ); -} - -export function useDeleteProgressEntry() { - return useDeleteProgressEntryTemplate( - useProgressEntryApi, - progressEntryApiQueryKey([]), - ); -} - -export function usePatchProgressEntry() { - return usePatchProgressEntryTemplate( - useProgressEntryApi, - useFileApi, - progressEntryApiQueryKey([]), - ); -} - -export function useRequestProgressEntryDeletion() { - return useRequestProgressEntryDeletionTemplate( - useProgressEntryApi, - progressEntryApiQueryKey([]), - ); -} diff --git a/employee-portal/src/lib/businessModules/measlesProtection/api/queries/appointmentBlockApi.ts b/employee-portal/src/lib/businessModules/measlesProtection/api/queries/appointmentBlockApi.ts index f6e37d610..506f3b579 100644 --- a/employee-portal/src/lib/businessModules/measlesProtection/api/queries/appointmentBlockApi.ts +++ b/employee-portal/src/lib/businessModules/measlesProtection/api/queries/appointmentBlockApi.ts @@ -3,13 +3,13 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { GetAppointmentBlockGroupsRequest } from "@eshg/employee-portal-api/measlesProtection"; +import { mapPaginatedList } from "@eshg/lib-employee-portal/api/models/PaginatedList"; import { unwrapRawResponse } from "@eshg/lib-portal/api/unwrapRawResponse"; +import { GetAppointmentBlockGroupsRequest } from "@eshg/measles-protection-api"; import { useSuspenseQuery } from "@tanstack/react-query"; import { useAppointmentBlockApi } from "@/lib/businessModules/measlesProtection/api/clients"; import { mapAppointmentBlockGroup } from "@/lib/businessModules/measlesProtection/api/models/AppointmentBlockGroup"; -import { mapPaginatedList } from "@/lib/shared/api/models/PaginatedList"; import { appointmentBlockApiQueryKey } from "./apiQueryKeys"; diff --git a/employee-portal/src/lib/businessModules/measlesProtection/api/queries/featureTogglesApi.ts b/employee-portal/src/lib/businessModules/measlesProtection/api/queries/featureTogglesApi.ts index 2713718ee..3827def71 100644 --- a/employee-portal/src/lib/businessModules/measlesProtection/api/queries/featureTogglesApi.ts +++ b/employee-portal/src/lib/businessModules/measlesProtection/api/queries/featureTogglesApi.ts @@ -3,15 +3,15 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { - ApiGetMeaslesProtectionFeatureTogglesResponse, - ApiMeaslesProtectionFeature, -} from "@eshg/employee-portal-api/measlesProtection"; import { selectDisabledOldFeature, selectEnabledNewFeature, useGetFeatureToggle, } from "@eshg/lib-portal/api/featureToggles"; +import { + ApiGetMeaslesProtectionFeatureTogglesResponse, + ApiMeaslesProtectionFeature, +} from "@eshg/measles-protection-api"; import { useFeatureTogglesApi } from "@/lib/businessModules/measlesProtection/api/clients"; import { measlesProtectionApiQueryKey } from "@/lib/businessModules/measlesProtection/api/queries/apiQueryKeys"; diff --git a/employee-portal/src/lib/businessModules/measlesProtection/api/queries/files.ts b/employee-portal/src/lib/businessModules/measlesProtection/api/queries/files.ts index 010b7a7e4..9e4984bf7 100644 --- a/employee-portal/src/lib/businessModules/measlesProtection/api/queries/files.ts +++ b/employee-portal/src/lib/businessModules/measlesProtection/api/queries/files.ts @@ -6,11 +6,7 @@ import { useSuspenseQuery } from "@tanstack/react-query"; import { useFileApi } from "@/lib/businessModules/measlesProtection/api/clients"; -import { - fileApiQueryKey, - measlesProtectionApiQueryKey, -} from "@/lib/businessModules/measlesProtection/api/queries/apiQueryKeys"; -import { useGetMetaDataHistoryTemplate } from "@/lib/shared/api/queries/files"; +import { measlesProtectionApiQueryKey } from "@/lib/businessModules/measlesProtection/api/queries/apiQueryKeys"; export function useGetFile(fileId: string) { const fileApi = useFileApi(); @@ -19,7 +15,3 @@ export function useGetFile(fileId: string) { queryKey: measlesProtectionApiQueryKey(["files", "get", fileId]), }); } - -export function useGetMetaDataHistory(fileId: string) { - return useGetMetaDataHistoryTemplate(useFileApi, fileApiQueryKey, fileId); -} diff --git a/employee-portal/src/lib/businessModules/measlesProtection/api/queries/procedures.ts b/employee-portal/src/lib/businessModules/measlesProtection/api/queries/procedures.ts index 44e935577..4ee1a5ded 100644 --- a/employee-portal/src/lib/businessModules/measlesProtection/api/queries/procedures.ts +++ b/employee-portal/src/lib/businessModules/measlesProtection/api/queries/procedures.ts @@ -10,7 +10,7 @@ import { ApiGetMeaslesProtectionProceduresSortOrder, ApiGetProcedure200Response, ProtectionProcedureApi, -} from "@eshg/employee-portal-api/measlesProtection"; +} from "@eshg/measles-protection-api"; import { queryOptions, useSuspenseQuery } from "@tanstack/react-query"; import { DeepKeys } from "@tanstack/react-table"; diff --git a/employee-portal/src/lib/businessModules/measlesProtection/api/queries/progressEntries.ts b/employee-portal/src/lib/businessModules/measlesProtection/api/queries/progressEntries.ts deleted file mode 100644 index 9ede32312..000000000 --- a/employee-portal/src/lib/businessModules/measlesProtection/api/queries/progressEntries.ts +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Copyright 2025 cronn GmbH - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { ApiUserRole } from "@eshg/base-api"; - -import { - useProcedureApi, - useProgressEntryApi, -} from "@/lib/businessModules/measlesProtection/api/clients"; -import { progressEntryApiQueryKey } from "@/lib/businessModules/measlesProtection/api/queries/apiQueryKeys"; -import { - useFetchProgressEntriesTemplate, - useFetchProgressEntryDetailsTemplate, - useGetManualProgressEntryHistoryTemplate, -} from "@/lib/shared/api/queries/progressEntries"; -import { ProgressEntriesFilters } from "@/lib/shared/components/procedures/progress-entries/types"; - -export function useFetchProgressEntries( - procedureId: string, - leaderRole: ApiUserRole, - progressEntryFilter: ProgressEntriesFilters, -) { - return useFetchProgressEntriesTemplate( - useProgressEntryApi, - useProcedureApi, - progressEntryApiQueryKey, - procedureId, - leaderRole, - progressEntryFilter, - ); -} - -export function useFetchProgressEntryDetails( - procedureId: string, - entryId: string, -) { - return useFetchProgressEntryDetailsTemplate( - useProgressEntryApi, - progressEntryApiQueryKey, - procedureId, - entryId, - ); -} - -export function useGetManualProgressEntryHistory(entryId: string) { - return useGetManualProgressEntryHistoryTemplate( - useProgressEntryApi, - progressEntryApiQueryKey, - entryId, - ); -} diff --git a/employee-portal/src/lib/businessModules/measlesProtection/api/queries/proofRequestLetters.ts b/employee-portal/src/lib/businessModules/measlesProtection/api/queries/proofRequestLetters.ts index cda71f208..b70b7c68b 100644 --- a/employee-portal/src/lib/businessModules/measlesProtection/api/queries/proofRequestLetters.ts +++ b/employee-portal/src/lib/businessModules/measlesProtection/api/queries/proofRequestLetters.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ProofRequestLetterApi } from "@eshg/employee-portal-api/measlesProtection"; +import { ProofRequestLetterApi } from "@eshg/measles-protection-api"; import { queryOptions, useSuspenseQuery } from "@tanstack/react-query"; import { useProofRequestLetterApi } from "@/lib/businessModules/measlesProtection/api/clients"; diff --git a/employee-portal/src/lib/businessModules/measlesProtection/components/appointmentBlocks/AppointmentBlockGroupsTable.tsx b/employee-portal/src/lib/businessModules/measlesProtection/components/appointmentBlocks/AppointmentBlockGroupsTable.tsx index 9a50c7e4e..43ded2395 100644 --- a/employee-portal/src/lib/businessModules/measlesProtection/components/appointmentBlocks/AppointmentBlockGroupsTable.tsx +++ b/employee-portal/src/lib/businessModules/measlesProtection/components/appointmentBlocks/AppointmentBlockGroupsTable.tsx @@ -5,11 +5,11 @@ "use client"; +import { formatDateTime } from "@eshg/lib-portal/formatters/dateTime"; import { ApiAppointmentBlockSortKey, ApiAppointmentType, -} from "@eshg/employee-portal-api/measlesProtection"; -import { formatDateTime } from "@eshg/lib-portal/formatters/dateTime"; +} from "@eshg/measles-protection-api"; import { Chip } from "@mui/joy"; import { ColumnSort, Row, createColumnHelper } from "@tanstack/react-table"; import { ReactNode } from "react"; diff --git a/employee-portal/src/lib/businessModules/measlesProtection/components/appointmentBlocks/CreateAppointmentBlockGroupForm.tsx b/employee-portal/src/lib/businessModules/measlesProtection/components/appointmentBlocks/CreateAppointmentBlockGroupForm.tsx index 8f97f51b6..ffcac6c2f 100644 --- a/employee-portal/src/lib/businessModules/measlesProtection/components/appointmentBlocks/CreateAppointmentBlockGroupForm.tsx +++ b/employee-portal/src/lib/businessModules/measlesProtection/components/appointmentBlocks/CreateAppointmentBlockGroupForm.tsx @@ -9,7 +9,7 @@ import { ApiAppointmentType, ApiCreateDailyAppointmentBlock, ApiCreateDailyAppointmentBlockGroupRequest, -} from "@eshg/employee-portal-api/measlesProtection"; +} from "@eshg/measles-protection-api"; import { useRouter } from "next/navigation"; import { AppointmentDurationsMeasles } from "@/lib/businessModules/measlesProtection/api/models/AppointmentBlockGroup"; diff --git a/employee-portal/src/lib/businessModules/measlesProtection/components/appointmentBlocks/options.ts b/employee-portal/src/lib/businessModules/measlesProtection/components/appointmentBlocks/options.ts index fc39b47f0..e2d670ea3 100644 --- a/employee-portal/src/lib/businessModules/measlesProtection/components/appointmentBlocks/options.ts +++ b/employee-portal/src/lib/businessModules/measlesProtection/components/appointmentBlocks/options.ts @@ -3,8 +3,8 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiAppointmentType } from "@eshg/employee-portal-api/measlesProtection"; import { buildEnumOptions } from "@eshg/lib-portal/helpers/form"; +import { ApiAppointmentType } from "@eshg/measles-protection-api"; import { APPOINTMENT_TYPES } from "@/lib/businessModules/measlesProtection/shared/constants"; diff --git a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/constants.ts b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/constants.ts index ee7e4415d..ff735afa2 100644 --- a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/constants.ts +++ b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/constants.ts @@ -11,7 +11,7 @@ import { ApiReportingReason, ApiRoleStatus, ApiSubmissionResult, -} from "@eshg/employee-portal-api/measlesProtection"; +} from "@eshg/measles-protection-api"; export const facilityTypeNames: Record<ApiMPFacilityType, string> = { [ApiMPFacilityType.School]: "Schule", diff --git a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/createProceduresForm/NewPersonButton.tsx b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/createProceduresForm/NewPersonButton.tsx index 3694b13f9..443ec1e16 100644 --- a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/createProceduresForm/NewPersonButton.tsx +++ b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/createProceduresForm/NewPersonButton.tsx @@ -6,9 +6,9 @@ "use client"; import type { ApiGetReferencePersonResponse } from "@eshg/base-api"; -import { type ApiAffectedPersonDetails } from "@eshg/employee-portal-api/measlesProtection"; import { useSnackbar } from "@eshg/lib-portal/components/snackbar/SnackbarProvider"; import { mapOptionalValue } from "@eshg/lib-portal/helpers/form"; +import { type ApiAffectedPersonDetails } from "@eshg/measles-protection-api"; import { Add } from "@mui/icons-material"; import { Button } from "@mui/joy"; import { useRouter } from "next/navigation"; diff --git a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/AccessRestrictionLetterSidebar.tsx b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/AccessRestrictionLetterSidebar.tsx index 9d5fff067..3364734f7 100644 --- a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/AccessRestrictionLetterSidebar.tsx +++ b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/AccessRestrictionLetterSidebar.tsx @@ -3,9 +3,9 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiGetProcedure200Response } from "@eshg/employee-portal-api/measlesProtection"; import { FileType } from "@eshg/lib-portal/components/formFields/file/FileType"; import { useSnackbar } from "@eshg/lib-portal/components/snackbar/SnackbarProvider"; +import { ApiGetProcedure200Response } from "@eshg/measles-protection-api"; import { Stack } from "@mui/joy"; import { Formik, useFormikContext } from "formik"; import { useCallback } from "react"; diff --git a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/AddCustodianSidebar.tsx b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/AddCustodianSidebar.tsx index a83b8fb94..82a39dd7c 100644 --- a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/AddCustodianSidebar.tsx +++ b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/AddCustodianSidebar.tsx @@ -3,9 +3,9 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiDraftMeaslesProcedure } from "@eshg/employee-portal-api/measlesProtection"; import { useSnackbar } from "@eshg/lib-portal/components/snackbar/SnackbarProvider"; import { isAdult } from "@eshg/lib-portal/helpers/dateTime"; +import { ApiDraftMeaslesProcedure } from "@eshg/measles-protection-api"; import { FormikErrors } from "formik"; import { useAddCustodianMutation } from "@/lib/businessModules/measlesProtection/api/mutations/procedures"; diff --git a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/AdditionalInfoSection.tsx b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/AdditionalInfoSection.tsx index 4b21a183d..816ab100d 100644 --- a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/AdditionalInfoSection.tsx +++ b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/AdditionalInfoSection.tsx @@ -3,12 +3,12 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +import { useSnackbar } from "@eshg/lib-portal/components/snackbar/SnackbarProvider"; +import { formatDate } from "@eshg/lib-portal/formatters/dateTime"; import { ApiMeaslesProtectionProcedure, ApiReportingReason, -} from "@eshg/employee-portal-api/measlesProtection"; -import { useSnackbar } from "@eshg/lib-portal/components/snackbar/SnackbarProvider"; -import { formatDate } from "@eshg/lib-portal/formatters/dateTime"; +} from "@eshg/measles-protection-api"; import { EditOutlined } from "@mui/icons-material"; import { Button, IconButton, Sheet, Stack } from "@mui/joy"; import { useState } from "react"; diff --git a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/AdditionalInfoUpdateSidebar.tsx b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/AdditionalInfoUpdateSidebar.tsx index 4164792f7..c2293b8f6 100644 --- a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/AdditionalInfoUpdateSidebar.tsx +++ b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/AdditionalInfoUpdateSidebar.tsx @@ -3,8 +3,8 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiMeaslesProtectionProcedure } from "@eshg/employee-portal-api/measlesProtection"; import { useSnackbar } from "@eshg/lib-portal/components/snackbar/SnackbarProvider"; +import { ApiMeaslesProtectionProcedure } from "@eshg/measles-protection-api"; import { Stack } from "@mui/joy"; import { useFormikContext } from "formik"; import { forwardRef, useImperativeHandle, useRef } from "react"; diff --git a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/AddressDetails.tsx b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/AddressDetails.tsx index 7f4fb321b..e62610998 100644 --- a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/AddressDetails.tsx +++ b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/AddressDetails.tsx @@ -3,12 +3,12 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +import { Row } from "@eshg/lib-portal/components/Row"; +import { translateCountry } from "@eshg/lib-portal/helpers/countryOption"; import { ApiDomesticAddress, ApiPostboxAddress, -} from "@eshg/employee-portal-api/measlesProtection"; -import { Row } from "@eshg/lib-portal/components/Row"; -import { translateCountry } from "@eshg/lib-portal/helpers/countryOption"; +} from "@eshg/measles-protection-api"; import { Stack } from "@mui/joy"; import { DetailsCell } from "@/lib/shared/components/detailsSection/DetailsCell"; diff --git a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/AffectedPerson.tsx b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/AffectedPerson.tsx index 13539b04d..6796bef0b 100644 --- a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/AffectedPerson.tsx +++ b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/AffectedPerson.tsx @@ -8,7 +8,7 @@ import { ApiDraftMeaslesProcedure, ApiMeaslesProtectionProcedure, -} from "@eshg/employee-portal-api/measlesProtection"; +} from "@eshg/measles-protection-api"; import { Sheet } from "@mui/joy"; import { SxProps } from "@mui/joy/styles/types"; diff --git a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/AppointmentSidebar.tsx b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/AppointmentSidebar.tsx index 01d2dd4b6..970ab32dd 100644 --- a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/AppointmentSidebar.tsx +++ b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/AppointmentSidebar.tsx @@ -5,10 +5,10 @@ "use client"; -import { ApiAppointment } from "@eshg/employee-portal-api/measlesProtection"; import { SelectObjectField } from "@eshg/lib-portal/components/formFields/SelectObjectField"; import { formatDateTime } from "@eshg/lib-portal/formatters/dateTime"; import { mapRequiredValue } from "@eshg/lib-portal/helpers/form"; +import { ApiAppointment } from "@eshg/measles-protection-api"; import { Stack } from "@mui/joy"; import { Formik, useFormikContext } from "formik"; import { useCallback } from "react"; diff --git a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/CaseStatusSelect.tsx b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/CaseStatusSelect.tsx index 58648cf67..6de3a4c02 100644 --- a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/CaseStatusSelect.tsx +++ b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/CaseStatusSelect.tsx @@ -5,15 +5,15 @@ "use client"; -import { - ApiCaseStatus, - ApiGetProcedure200Response, -} from "@eshg/employee-portal-api/measlesProtection"; import { SelectOptions, optionsFromRecord, } from "@eshg/lib-portal/components/formFields/SelectOptions"; import { useSnackbar } from "@eshg/lib-portal/components/snackbar/SnackbarProvider"; +import { + ApiCaseStatus, + ApiGetProcedure200Response, +} from "@eshg/measles-protection-api"; import { FormControl, Select } from "@mui/joy"; import { useUpdateCaseStatusMutation } from "@/lib/businessModules/measlesProtection/api/mutations/procedures"; diff --git a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/Custodians.tsx b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/Custodians.tsx index a5392234a..a37a2f392 100644 --- a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/Custodians.tsx +++ b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/Custodians.tsx @@ -6,7 +6,7 @@ import { ApiDraftMeaslesProcedure, ApiMeaslesProtectionProcedure, -} from "@eshg/employee-portal-api/measlesProtection"; +} from "@eshg/measles-protection-api"; import { Sheet } from "@mui/joy"; import { SxProps } from "@mui/joy/styles/types"; diff --git a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/EditAccessRestrictionSidebar.tsx b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/EditAccessRestrictionSidebar.tsx index 83002f348..a75f1c939 100644 --- a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/EditAccessRestrictionSidebar.tsx +++ b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/EditAccessRestrictionSidebar.tsx @@ -3,13 +3,13 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { - ApiAccessRestriction, - ApiMeaslesProtectionProcedure, -} from "@eshg/employee-portal-api/measlesProtection"; import { useSnackbar } from "@eshg/lib-portal/components/snackbar/SnackbarProvider"; import { formatDate } from "@eshg/lib-portal/formatters/dateTime"; import { isDateString } from "@eshg/lib-portal/helpers/dateTime"; +import { + ApiAccessRestriction, + ApiMeaslesProtectionProcedure, +} from "@eshg/measles-protection-api"; import { Divider, Stack } from "@mui/joy"; import { formatISO } from "date-fns"; import { Formik, useFormikContext } from "formik"; diff --git a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/EditAffectedPersonSidebar.tsx b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/EditAffectedPersonSidebar.tsx index c56cb6a3d..85b0f0fa2 100644 --- a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/EditAffectedPersonSidebar.tsx +++ b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/EditAffectedPersonSidebar.tsx @@ -5,12 +5,12 @@ "use client"; +import { useSnackbar } from "@eshg/lib-portal/components/snackbar/SnackbarProvider"; +import { toDateString } from "@eshg/lib-portal/helpers/dateTime"; import { type ApiAffectedPerson, ApiDomesticAddress, -} from "@eshg/employee-portal-api/measlesProtection"; -import { useSnackbar } from "@eshg/lib-portal/components/snackbar/SnackbarProvider"; -import { toDateString } from "@eshg/lib-portal/helpers/dateTime"; +} from "@eshg/measles-protection-api"; import { MEASLES_PROTECTION_AFFECTED_PERSON_CONFIG } from "@/lib/businessModules/measlesProtection/components/procedures/createProceduresForm/NewPersonButton"; import { ApiFacilityAddressType } from "@/lib/shared/components/form/address/legacyTypes"; diff --git a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/EditCustodianButton.tsx b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/EditCustodianButton.tsx index 4b8b00d96..2d739215d 100644 --- a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/EditCustodianButton.tsx +++ b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/EditCustodianButton.tsx @@ -5,7 +5,7 @@ "use client"; -import { ApiCustodian } from "@eshg/employee-portal-api/measlesProtection"; +import { ApiCustodian } from "@eshg/measles-protection-api"; import { useSearchParam } from "@/lib/shared/hooks/searchParams/useSearchParam"; diff --git a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/EditCustodianSidebar.tsx b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/EditCustodianSidebar.tsx index 83fc19307..b63e59018 100644 --- a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/EditCustodianSidebar.tsx +++ b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/EditCustodianSidebar.tsx @@ -5,12 +5,9 @@ "use client"; -import { - ApiCustodian, - ApiDomesticAddress, -} from "@eshg/employee-portal-api/measlesProtection"; import { useSnackbar } from "@eshg/lib-portal/components/snackbar/SnackbarProvider"; import { toDateString } from "@eshg/lib-portal/helpers/dateTime"; +import { ApiCustodian, ApiDomesticAddress } from "@eshg/measles-protection-api"; import { MEASLES_PROTECTION_CUSTODIAN_CONFIG } from "@/lib/businessModules/measlesProtection/components/procedures/procedureDetails/NewCustodianButton"; import { ApiFacilityAddressType } from "@/lib/shared/components/form/address/legacyTypes"; diff --git a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/EditFacilitySidebar.tsx b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/EditFacilitySidebar.tsx index 423070f93..7444ec2d8 100644 --- a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/EditFacilitySidebar.tsx +++ b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/EditFacilitySidebar.tsx @@ -5,8 +5,8 @@ "use client"; -import { ApiFacility } from "@eshg/employee-portal-api/measlesProtection"; import { useSnackbar } from "@eshg/lib-portal/components/snackbar/SnackbarProvider"; +import { ApiFacility } from "@eshg/measles-protection-api"; import { MeaslesFacility, diff --git a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/Facility.tsx b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/Facility.tsx index 118f11d90..5108289af 100644 --- a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/Facility.tsx +++ b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/Facility.tsx @@ -3,11 +3,11 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +import { isNonEmptyString } from "@eshg/lib-portal/helpers/guards"; import { ApiDraftMeaslesProcedure, ApiMeaslesProtectionProcedure, -} from "@eshg/employee-portal-api/measlesProtection"; -import { isNonEmptyString } from "@eshg/lib-portal/helpers/guards"; +} from "@eshg/measles-protection-api"; import { Sheet } from "@mui/joy"; import { SxProps } from "@mui/joy/styles/types"; diff --git a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/FacilityContact.tsx b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/FacilityContact.tsx index 543a42f19..73085666b 100644 --- a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/FacilityContact.tsx +++ b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/FacilityContact.tsx @@ -3,9 +3,9 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiFacilityContactPerson } from "@eshg/employee-portal-api/measlesProtection"; import { Row } from "@eshg/lib-portal/components/Row"; import { SALUTATION_VALUES } from "@eshg/lib-portal/components/formFields/constants"; +import { ApiFacilityContactPerson } from "@eshg/measles-protection-api"; import { Grid, Sheet, Stack } from "@mui/joy"; import { DetailsCell } from "@/lib/shared/components/detailsSection/DetailsCell"; diff --git a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/FineSidebar.tsx b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/FineSidebar.tsx index d468b8ec6..a607ce518 100644 --- a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/FineSidebar.tsx +++ b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/FineSidebar.tsx @@ -5,8 +5,8 @@ "use client"; -import { ApiCreateMonetaryFine } from "@eshg/employee-portal-api/measlesProtection"; import { useSnackbar } from "@eshg/lib-portal/components/snackbar/SnackbarProvider"; +import { ApiCreateMonetaryFine } from "@eshg/measles-protection-api"; import { Stack } from "@mui/joy"; import { Formik, useFormikContext } from "formik"; import { useCallback } from "react"; diff --git a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/LetterRecipientField.tsx b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/LetterRecipientField.tsx index 1082478e4..b913f9b3b 100644 --- a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/LetterRecipientField.tsx +++ b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/LetterRecipientField.tsx @@ -3,11 +3,11 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +import { SelectOption } from "@eshg/lib-portal/components/formFields/SelectOptions"; import { ApiDraftMeaslesProcedure, ApiMeaslesProtectionProcedure, -} from "@eshg/employee-portal-api/measlesProtection"; -import { SelectOption } from "@eshg/lib-portal/components/formFields/SelectOptions"; +} from "@eshg/measles-protection-api"; import { useFormikContext } from "formik"; import { useEffect } from "react"; diff --git a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/MeaslesFacilityTypeSelect.tsx b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/MeaslesFacilityTypeSelect.tsx index 949fcf82f..08d558738 100644 --- a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/MeaslesFacilityTypeSelect.tsx +++ b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/MeaslesFacilityTypeSelect.tsx @@ -5,9 +5,9 @@ "use client"; -import { ApiFacilityType } from "@eshg/employee-portal-api/measlesProtection"; import { InputField } from "@eshg/lib-portal/components/formFields/InputField"; import { buildEnumOptions } from "@eshg/lib-portal/helpers/form"; +import { ApiFacilityType } from "@eshg/measles-protection-api"; import { useFormikContext } from "formik"; import { useState } from "react"; diff --git a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/MeaslesProtectionProcedureData.tsx b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/MeaslesProtectionProcedureData.tsx index 53ea7a9b8..0cb9ae394 100644 --- a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/MeaslesProtectionProcedureData.tsx +++ b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/MeaslesProtectionProcedureData.tsx @@ -5,8 +5,8 @@ "use client"; -import { ApiReportingReason } from "@eshg/employee-portal-api/measlesProtection"; import { buildEnumOptions } from "@eshg/lib-portal/helpers/form"; +import { ApiReportingReason } from "@eshg/measles-protection-api"; import { Grid, Stack } from "@mui/joy"; import { useFormikContext } from "formik"; import { useRouter } from "next/navigation"; diff --git a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/MeaslesProtectionProcedureDraftClientPage.tsx b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/MeaslesProtectionProcedureDraftClientPage.tsx index 8222ec304..128000665 100644 --- a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/MeaslesProtectionProcedureDraftClientPage.tsx +++ b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/MeaslesProtectionProcedureDraftClientPage.tsx @@ -5,9 +5,9 @@ "use client"; -import { ApiDraftMeaslesProcedure } from "@eshg/employee-portal-api/measlesProtection"; import { useSnackbar } from "@eshg/lib-portal/components/snackbar/SnackbarProvider"; import { formatDate } from "@eshg/lib-portal/formatters/dateTime"; +import { ApiDraftMeaslesProcedure } from "@eshg/measles-protection-api"; import { Grid, Stack } from "@mui/joy"; import { useRouter } from "next/navigation"; import { useEffect } from "react"; diff --git a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/NewCustodianButton.tsx b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/NewCustodianButton.tsx index cebea3191..73f1a73d1 100644 --- a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/NewCustodianButton.tsx +++ b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/NewCustodianButton.tsx @@ -8,7 +8,7 @@ import { ApiAddCustodianRequest, ApiCustodianDetails, -} from "@eshg/employee-portal-api/measlesProtection"; +} from "@eshg/measles-protection-api"; import { Add } from "@mui/icons-material"; import { Button, Sheet } from "@mui/joy"; diff --git a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/NewFacilitySidebar.tsx b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/NewFacilitySidebar.tsx index 58b2f1e93..8a26f71a7 100644 --- a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/NewFacilitySidebar.tsx +++ b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/NewFacilitySidebar.tsx @@ -3,7 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiDraftMeaslesProcedure } from "@eshg/employee-portal-api/measlesProtection"; +import { ApiDraftMeaslesProcedure } from "@eshg/measles-protection-api"; import { doNothing } from "remeda"; import { diff --git a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/ProofRequestLetterSidebar.tsx b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/ProofRequestLetterSidebar.tsx index 67a8461f2..f59dd2dd2 100644 --- a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/ProofRequestLetterSidebar.tsx +++ b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/ProofRequestLetterSidebar.tsx @@ -3,12 +3,12 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +import { AlertProps } from "@eshg/lib-portal/components/Alert"; +import { useSnackbar } from "@eshg/lib-portal/components/snackbar/SnackbarProvider"; import { ApiDraftMeaslesProcedure, ApiMeaslesProtectionProcedure, -} from "@eshg/employee-portal-api/measlesProtection"; -import { AlertProps } from "@eshg/lib-portal/components/Alert"; -import { useSnackbar } from "@eshg/lib-portal/components/snackbar/SnackbarProvider"; +} from "@eshg/measles-protection-api"; import TabOutlined from "@mui/icons-material/TabOutlined"; import { Stack, Typography } from "@mui/joy"; import { addWeeks } from "date-fns"; diff --git a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/ProofSidebar.tsx b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/ProofSidebar.tsx index 6c9eee2be..0661975e5 100644 --- a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/ProofSidebar.tsx +++ b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/ProofSidebar.tsx @@ -5,13 +5,13 @@ "use client"; -import { - ApiSubmissionResult, - CreateProofSubmissionRequest, -} from "@eshg/employee-portal-api/measlesProtection"; import { DateField } from "@eshg/lib-portal/components/formFields/DateField"; import { FileType } from "@eshg/lib-portal/components/formFields/file/FileType"; import { useSnackbar } from "@eshg/lib-portal/components/snackbar/SnackbarProvider"; +import { + ApiSubmissionResult, + CreateProofSubmissionRequest, +} from "@eshg/measles-protection-api"; import { Stack } from "@mui/joy"; import { Formik, useFormikContext } from "formik"; import { useCallback } from "react"; diff --git a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/ProofTab.tsx b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/ProofTab.tsx index f16fccfd2..da3e77eca 100644 --- a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/ProofTab.tsx +++ b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/ProofTab.tsx @@ -5,6 +5,8 @@ "use client"; +import { Row } from "@eshg/lib-portal/components/Row"; +import { formatDate } from "@eshg/lib-portal/formatters/dateTime"; import { ApiMeaslesProtectionFeature, ApiMeaslesProtectionProcedure, @@ -12,9 +14,7 @@ import { ApiProofRequestLetter, ApiProofSubmission, ApiSubmissionResult, -} from "@eshg/employee-portal-api/measlesProtection"; -import { Row } from "@eshg/lib-portal/components/Row"; -import { formatDate } from "@eshg/lib-portal/formatters/dateTime"; +} from "@eshg/measles-protection-api"; import { Add } from "@mui/icons-material"; import { Button, Grid, Sheet, Stack } from "@mui/joy"; import { useSuspenseQueries } from "@tanstack/react-query"; @@ -218,7 +218,7 @@ function FineCard({ <DetailsSection title="Bußgeld"> <Stack spacing={3} alignItems={"start"} width={"100%"}> {monetaryFines.length > 0 && ( - <Stack gap={1} style={{ flexBasis: "auto" }}> + <Stack gap={1} sx={{ flexBasis: "auto" }}> {monetaryFines.map((fine) => ( <DetailsCell key={fine.externalId} diff --git a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/UpdateProcedureSection.tsx b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/UpdateProcedureSection.tsx index d0c826bb7..9665183a4 100644 --- a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/UpdateProcedureSection.tsx +++ b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/UpdateProcedureSection.tsx @@ -3,14 +3,14 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { - ApiDraftMeaslesProcedure, - ApiMeaslesProtectionProcedure, -} from "@eshg/employee-portal-api/measlesProtection"; import { Alert as SharedAlert } from "@eshg/lib-portal/components/Alert"; import { SubmitButton } from "@eshg/lib-portal/components/buttons/SubmitButton"; import { FormPlus } from "@eshg/lib-portal/components/form/FormPlus"; import { DateField } from "@eshg/lib-portal/components/formFields/DateField"; +import { + ApiDraftMeaslesProcedure, + ApiMeaslesProtectionProcedure, +} from "@eshg/measles-protection-api"; import { Sheet, Stack } from "@mui/joy"; import { Formik, useFormikContext } from "formik"; import { PropsWithChildren, useCallback } from "react"; @@ -51,7 +51,7 @@ export function ProcedureForm({ onSubmit={(form) => submitProcedure(transformToValid(form))} validate={validate} > - <FormPlus style={{ display: "contents" }}>{children}</FormPlus> + <FormPlus sx={{ display: "contents" }}>{children}</FormPlus> </Formik> ); } diff --git a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/helpers.ts b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/helpers.ts index 5ca13a292..e66651da4 100644 --- a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/helpers.ts +++ b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/helpers.ts @@ -3,6 +3,8 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +import { AlertProps as SharedAlertProps } from "@eshg/lib-portal/components/Alert"; +import { isAdult } from "@eshg/lib-portal/helpers/dateTime"; import { ApiDraftMeaslesProcedure, ApiMeaslesProtectionProcedure, @@ -10,9 +12,7 @@ import { ApiReportingReason, ApiRoleStatus, ApiUpdateProcedureRequest, -} from "@eshg/employee-portal-api/measlesProtection"; -import { AlertProps as SharedAlertProps } from "@eshg/lib-portal/components/Alert"; -import { isAdult } from "@eshg/lib-portal/helpers/dateTime"; +} from "@eshg/measles-protection-api"; import { isObjectType } from "remeda"; export interface UpdateProcedureForm { diff --git a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/proof/AccessRestrictionCard.tsx b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/proof/AccessRestrictionCard.tsx index 1ea5942b3..08c261ff1 100644 --- a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/proof/AccessRestrictionCard.tsx +++ b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/proof/AccessRestrictionCard.tsx @@ -3,12 +3,12 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +import { formatDate } from "@eshg/lib-portal/formatters/dateTime"; import { ApiAccessRestriction, ApiMeaslesProtectionFeature, ApiMeaslesProtectionProcedure, -} from "@eshg/employee-portal-api/measlesProtection"; -import { formatDate } from "@eshg/lib-portal/formatters/dateTime"; +} from "@eshg/measles-protection-api"; import { Add, EditOutlined } from "@mui/icons-material"; import { Button, IconButton, Sheet, Stack } from "@mui/joy"; diff --git a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/proof/AppointmentCard.tsx b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/proof/AppointmentCard.tsx index ec50a63f7..c77631eea 100644 --- a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/proof/AppointmentCard.tsx +++ b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/proof/AppointmentCard.tsx @@ -3,8 +3,8 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiAppointment } from "@eshg/employee-portal-api/measlesProtection"; import { formatDate, formatTime } from "@eshg/lib-portal/formatters/dateTime"; +import { ApiAppointment } from "@eshg/measles-protection-api"; import { Add, DeleteOutline, EditOutlined } from "@mui/icons-material"; import { Button, Sheet, Stack } from "@mui/joy"; @@ -82,7 +82,7 @@ export function AppointmentCard({ > <Stack spacing={3} alignItems={"start"} width={"100%"}> {appointment ? ( - <Stack gap={1} style={{ flexBasis: "auto" }}> + <Stack gap={1} sx={{ flexBasis: "auto" }}> <DetailsCell label="Datum" value={formatDate(appointment.start)} diff --git a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/proof/ProofTabFileCard.tsx b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/proof/ProofTabFileCard.tsx index 8c8f094ed..ac616324a 100644 --- a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/proof/ProofTabFileCard.tsx +++ b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/procedureDetails/proof/ProofTabFileCard.tsx @@ -3,14 +3,13 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiAbstractFile } from "@eshg/employee-portal-api/measlesProtection"; -import { downloadFileAndOpen } from "@eshg/lib-portal/api/files/download"; +import { useFileDownload } from "@eshg/lib-portal/api/files/download"; +import { ApiAbstractFile } from "@eshg/measles-protection-api"; import { FileDownloadOutlined } from "@mui/icons-material"; import { Box } from "@mui/joy"; import { useFileApi } from "@/lib/businessModules/measlesProtection/api/clients"; import { useGetFile } from "@/lib/businessModules/measlesProtection/api/queries/files"; -import { useDownloadFile } from "@/lib/shared/api/download/files"; import { FileCard, FileCardActionProps, @@ -29,17 +28,12 @@ export function ProofTabFileCard({ //TODO: Remove this File-API call when all file data is provided by our own API const file = useGetFile(fileId); const fileApi = useFileApi(); - const downloadFile = useDownloadFile((fileId: string) => + const { download } = useFileDownload((fileId: string) => fileApi.downloadFileRaw({ fileId }), ); - async function downloadFileOnClick() { - const downloadedFile = await downloadFile(fileId); - downloadFileAndOpen(downloadedFile); - } - const downloadActionProps: FileCardActionProps = { - onClick: downloadFileOnClick, + onClick: () => download(fileId), indicator: <FileDownloadOutlined />, color: "primary", name: "Download", diff --git a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/proceduresTable/ProceduresTable.tsx b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/proceduresTable/ProceduresTable.tsx index ced8e5c2c..bcee4566d 100644 --- a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/proceduresTable/ProceduresTable.tsx +++ b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/proceduresTable/ProceduresTable.tsx @@ -7,9 +7,9 @@ import { ApiUserRole } from "@eshg/base-api"; import { ApiBusinessModule } from "@eshg/employee-portal-api/businessProcedures"; -import { ApiGetProcedure200Response } from "@eshg/employee-portal-api/measlesProtection"; import { Row } from "@eshg/lib-portal/components/Row"; import { formatDate } from "@eshg/lib-portal/formatters/dateTime"; +import { ApiGetProcedure200Response } from "@eshg/measles-protection-api"; import { EditOutlined, Preview, ToggleOffOutlined } from "@mui/icons-material"; import { Chip } from "@mui/joy"; import { useSuspenseQueries } from "@tanstack/react-query"; diff --git a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/proceduresTable/ProceduresTableFilters.tsx b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/proceduresTable/ProceduresTableFilters.tsx index f9f528b20..e46791bba 100644 --- a/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/proceduresTable/ProceduresTableFilters.tsx +++ b/employee-portal/src/lib/businessModules/measlesProtection/components/procedures/proceduresTable/ProceduresTableFilters.tsx @@ -4,6 +4,7 @@ */ import { ApiProcedureStatus } from "@eshg/base-api"; +import { ifDefined } from "@eshg/lib-portal/helpers/ifDefined"; import { ApiCaseStatus, ApiMPFacilityType, @@ -11,8 +12,7 @@ import { ApiProofRequestSent, ApiRoleStatus, ApiSubmissionResult, -} from "@eshg/employee-portal-api/measlesProtection"; -import { ifDefined } from "@eshg/lib-portal/helpers/ifDefined"; +} from "@eshg/measles-protection-api"; import { useMemo } from "react"; import { diff --git a/employee-portal/src/lib/businessModules/measlesProtection/shared/ProceduresContext.tsx b/employee-portal/src/lib/businessModules/measlesProtection/shared/ProceduresContext.tsx index c045689e0..8ba951cfc 100644 --- a/employee-portal/src/lib/businessModules/measlesProtection/shared/ProceduresContext.tsx +++ b/employee-portal/src/lib/businessModules/measlesProtection/shared/ProceduresContext.tsx @@ -6,8 +6,8 @@ "use client"; import { ApiUserRole } from "@eshg/base-api"; -import { ApiGetProcedure200Response } from "@eshg/employee-portal-api/measlesProtection"; import { RequiresChildren } from "@eshg/lib-portal/types/react"; +import { ApiGetProcedure200Response } from "@eshg/measles-protection-api"; import { createContext, useContext, useState } from "react"; import { isNullish } from "remeda"; diff --git a/employee-portal/src/lib/businessModules/measlesProtection/shared/constants.ts b/employee-portal/src/lib/businessModules/measlesProtection/shared/constants.ts index cae8c23d6..5fda99329 100644 --- a/employee-portal/src/lib/businessModules/measlesProtection/shared/constants.ts +++ b/employee-portal/src/lib/businessModules/measlesProtection/shared/constants.ts @@ -3,12 +3,12 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +import { EnumMap } from "@eshg/lib-portal/types/helpers"; import { ApiAppointmentType, ApiProcedureType, ApiTaskType, -} from "@eshg/employee-portal-api/measlesProtection"; -import { EnumMap } from "@eshg/lib-portal/types/helpers"; +} from "@eshg/measles-protection-api"; export const procedureTypes = [ApiProcedureType.MeaslesProtection]; diff --git a/employee-portal/src/lib/businessModules/measlesProtection/shared/helpers.ts b/employee-portal/src/lib/businessModules/measlesProtection/shared/helpers.ts index 9f3b20cb4..f7143abf3 100644 --- a/employee-portal/src/lib/businessModules/measlesProtection/shared/helpers.ts +++ b/employee-portal/src/lib/businessModules/measlesProtection/shared/helpers.ts @@ -3,8 +3,8 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiDomesticAddress } from "@eshg/employee-portal-api/measlesProtection"; import { mapOptionalValue } from "@eshg/lib-portal/helpers/form"; +import { ApiDomesticAddress } from "@eshg/measles-protection-api"; import { LegacyBaseAddress } from "@/lib/shared/components/form/address/LegacyAddressForm"; diff --git a/employee-portal/src/lib/businessModules/medicalRegistry/api/mutations/approvalRequests.ts b/employee-portal/src/lib/businessModules/medicalRegistry/api/mutations/approvalRequests.ts deleted file mode 100644 index bf5c18cbb..000000000 --- a/employee-portal/src/lib/businessModules/medicalRegistry/api/mutations/approvalRequests.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Copyright 2025 cronn GmbH - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { useApprovalRequestApi } from "@/lib/businessModules/medicalRegistry/api/clients"; -import { - useDecideApprovalRequestTemplate, - useGrantDeletionForAllRequestsTemplate, -} from "@/lib/shared/api/mutations/approvalRequests"; - -export function useDecideApprovalRequest() { - return useDecideApprovalRequestTemplate(useApprovalRequestApi); -} - -export function useGrantDeletionForAllRequests() { - return useGrantDeletionForAllRequestsTemplate(useApprovalRequestApi); -} diff --git a/employee-portal/src/lib/businessModules/medicalRegistry/api/mutations/files.ts b/employee-portal/src/lib/businessModules/medicalRegistry/api/mutations/files.ts deleted file mode 100644 index a3dc44303..000000000 --- a/employee-portal/src/lib/businessModules/medicalRegistry/api/mutations/files.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Copyright 2025 cronn GmbH - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { useFileApi } from "@/lib/businessModules/medicalRegistry/api/clients"; -import { - useDeleteFileTemplate, - useRequestFileDeletionTemplate, -} from "@/lib/shared/api/mutations/files"; - -export function useDeleteFile() { - return useDeleteFileTemplate(useFileApi); -} - -export function useRequestFileDeletion() { - return useRequestFileDeletionTemplate(useFileApi); -} diff --git a/employee-portal/src/lib/businessModules/medicalRegistry/api/mutations/progressEntries.ts b/employee-portal/src/lib/businessModules/medicalRegistry/api/mutations/progressEntries.ts deleted file mode 100644 index 6495a14a4..000000000 --- a/employee-portal/src/lib/businessModules/medicalRegistry/api/mutations/progressEntries.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Copyright 2025 cronn GmbH - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { - useFileApi, - useProgressEntryApi, -} from "@/lib/businessModules/medicalRegistry/api/clients"; -import { - useCreateProgressEntryTemplate, - useDeleteProgressEntryTemplate, - usePatchProgressEntryTemplate, - useRequestProgressEntryDeletionTemplate, -} from "@/lib/shared/api/mutations/progressEntries"; - -export function useCreateProgressEntry() { - return useCreateProgressEntryTemplate(useProgressEntryApi); -} - -export function useDeleteProgressEntry() { - return useDeleteProgressEntryTemplate(useProgressEntryApi); -} - -export function usePatchProgressEntry() { - return usePatchProgressEntryTemplate(useProgressEntryApi, useFileApi); -} - -export function useRequestProgressEntryDeletion() { - return useRequestProgressEntryDeletionTemplate(useProgressEntryApi); -} diff --git a/employee-portal/src/lib/businessModules/medicalRegistry/api/queries/files.ts b/employee-portal/src/lib/businessModules/medicalRegistry/api/queries/files.ts deleted file mode 100644 index f1b36ea56..000000000 --- a/employee-portal/src/lib/businessModules/medicalRegistry/api/queries/files.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Copyright 2025 cronn GmbH - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { useFileApi } from "@/lib/businessModules/medicalRegistry/api/clients"; -import { fileApiQueryKey } from "@/lib/businessModules/medicalRegistry/api/queries/apiQueryKeys"; -import { useDownloadFile } from "@/lib/shared/api/download/files"; -import { useGetMetaDataHistoryTemplate } from "@/lib/shared/api/queries/files"; - -export function useGetMetaDataHistory(fileId: string) { - return useGetMetaDataHistoryTemplate(useFileApi, fileApiQueryKey, fileId); -} - -export function useDownloadMedicalRegistryFile() { - const fileApi = useFileApi(); - return useDownloadFile((fileId: string) => - fileApi.downloadFileRaw({ fileId }), - ); -} diff --git a/employee-portal/src/lib/businessModules/medicalRegistry/api/queries/progressEntries.ts b/employee-portal/src/lib/businessModules/medicalRegistry/api/queries/progressEntries.ts deleted file mode 100644 index 1c2d3d831..000000000 --- a/employee-portal/src/lib/businessModules/medicalRegistry/api/queries/progressEntries.ts +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Copyright 2025 cronn GmbH - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { ApiUserRole } from "@eshg/base-api"; - -import { - useProcedureApi, - useProgressEntryApi, -} from "@/lib/businessModules/medicalRegistry/api/clients"; -import { progressEntryApiQueryKey } from "@/lib/businessModules/medicalRegistry/api/queries/apiQueryKeys"; -import { - useFetchProgressEntriesTemplate, - useFetchProgressEntryDetailsTemplate, - useGetManualProgressEntryHistoryTemplate, -} from "@/lib/shared/api/queries/progressEntries"; -import { ProgressEntriesFilters } from "@/lib/shared/components/procedures/progress-entries/types"; - -export function useFetchProgressEntries( - procedureId: string, - leaderRole: ApiUserRole, - progressEntryFilter: ProgressEntriesFilters, -) { - return useFetchProgressEntriesTemplate( - useProgressEntryApi, - useProcedureApi, - progressEntryApiQueryKey, - procedureId, - leaderRole, - progressEntryFilter, - ); -} - -export function useFetchProgressEntryDetails( - procedureId: string, - entryId: string, -) { - return useFetchProgressEntryDetailsTemplate( - useProgressEntryApi, - progressEntryApiQueryKey, - procedureId, - entryId, - ); -} - -export function useGetManualProgressEntryHistory(entryId: string) { - return useGetManualProgressEntryHistoryTemplate( - useProgressEntryApi, - progressEntryApiQueryKey, - entryId, - ); -} diff --git a/employee-portal/src/lib/businessModules/officialMedicalService/api/clients.ts b/employee-portal/src/lib/businessModules/officialMedicalService/api/clients.ts index 49e183ddf..a13a2be43 100644 --- a/employee-portal/src/lib/businessModules/officialMedicalService/api/clients.ts +++ b/employee-portal/src/lib/businessModules/officialMedicalService/api/clients.ts @@ -11,6 +11,7 @@ import { Configuration, EmployeeOmsProcedureApi, FileApi, + OmsAppointmentApi, ProcedureApi, ProgressEntryApi, } from "@eshg/employee-portal-api/officialMedicalService"; @@ -57,3 +58,8 @@ export function useConcernApi() { const configuration = useConfiguration(); return new ConcernApi(configuration); } + +export function useOmsAppointmentApi() { + const configuration = useConfiguration(); + return new OmsAppointmentApi(configuration); +} diff --git a/employee-portal/src/lib/businessModules/officialMedicalService/api/download/files.ts b/employee-portal/src/lib/businessModules/officialMedicalService/api/download/files.ts deleted file mode 100644 index 8393b57aa..000000000 --- a/employee-portal/src/lib/businessModules/officialMedicalService/api/download/files.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** - * Copyright 2025 cronn GmbH - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { useFileApi } from "@/lib/businessModules/officialMedicalService/api/clients"; -import { useDownloadFile } from "@/lib/shared/api/download/files"; - -export function useDownloadOfficialMedicalFileFile() { - const fileApi = useFileApi(); - return useDownloadFile((fileId: string) => - fileApi.downloadFileRaw({ fileId }), - ); -} diff --git a/employee-portal/src/lib/businessModules/officialMedicalService/api/models/AppointmentBlockGroup.ts b/employee-portal/src/lib/businessModules/officialMedicalService/api/models/AppointmentBlockGroup.ts index d6c8308cd..6b18e9e1b 100644 --- a/employee-portal/src/lib/businessModules/officialMedicalService/api/models/AppointmentBlockGroup.ts +++ b/employee-portal/src/lib/businessModules/officialMedicalService/api/models/AppointmentBlockGroup.ts @@ -8,11 +8,13 @@ import { ApiGetAppointmentBlock, ApiGetAppointmentBlockGroup, } from "@eshg/employee-portal-api/officialMedicalService"; +import { + BaseEntity, + mapBaseEntity, +} from "@eshg/lib-employee-portal/api/models/BaseEntity"; import { assertNonEmptyArray } from "@eshg/lib-portal/helpers/assertions"; import { first, last, sumBy } from "remeda"; -import { BaseEntity, mapBaseEntity } from "@/lib/shared/api/models/BaseEntity"; - export interface AppointmentBlockGroup extends AppointmentBlock { readonly type: ApiAppointmentType; readonly parallelExaminations: number; diff --git a/employee-portal/src/lib/businessModules/officialMedicalService/api/models/AppointmentTypeConfig.ts b/employee-portal/src/lib/businessModules/officialMedicalService/api/models/AppointmentTypeConfig.ts index a7190f68a..ffc2e5390 100644 --- a/employee-portal/src/lib/businessModules/officialMedicalService/api/models/AppointmentTypeConfig.ts +++ b/employee-portal/src/lib/businessModules/officialMedicalService/api/models/AppointmentTypeConfig.ts @@ -7,8 +7,10 @@ import { ApiAppointmentType, ApiAppointmentTypeConfig, } from "@eshg/employee-portal-api/officialMedicalService"; - -import { BaseEntity, mapBaseEntity } from "@/lib/shared/api/models/BaseEntity"; +import { + BaseEntity, + mapBaseEntity, +} from "@eshg/lib-employee-portal/api/models/BaseEntity"; export interface AppointmentTypeConfig extends BaseEntity { appointmentTypeDto: ApiAppointmentType; diff --git a/employee-portal/src/lib/businessModules/officialMedicalService/api/mutations/appointmentApi.ts b/employee-portal/src/lib/businessModules/officialMedicalService/api/mutations/appointmentApi.ts new file mode 100644 index 000000000..c1fb33a51 --- /dev/null +++ b/employee-portal/src/lib/businessModules/officialMedicalService/api/mutations/appointmentApi.ts @@ -0,0 +1,37 @@ +/** + * Copyright 2025 cronn GmbH + * SPDX-License-Identifier: AGPL-3.0-only + */ + +import { ApiBookingInfo } from "@eshg/employee-portal-api/officialMedicalService"; +import { useHandledMutation } from "@eshg/lib-portal/api/useHandledMutation"; +import { useSnackbar } from "@eshg/lib-portal/components/snackbar/SnackbarProvider"; + +import { useOmsAppointmentApi } from "@/lib/businessModules/officialMedicalService/api/clients"; + +export function useBookAppointment() { + const snackbar = useSnackbar(); + const employeeOmsProcedureApi = useOmsAppointmentApi(); + + return useHandledMutation({ + mutationFn: ({ + appointmentId, + request, + }: { + appointmentId: string; + request: ApiBookingInfo; + }) => employeeOmsProcedureApi.bookAppointment(appointmentId, request), + onSuccess: () => snackbar.confirmation("Termin gebucht."), + }); +} + +export function useCancelAppointment() { + const snackbar = useSnackbar(); + const employeeOmsProcedureApi = useOmsAppointmentApi(); + + return useHandledMutation({ + mutationFn: ({ appointmentId }: { appointmentId: string }) => + employeeOmsProcedureApi.cancelAppointment(appointmentId), + onSuccess: () => snackbar.confirmation("Termin abgesagt."), + }); +} diff --git a/employee-portal/src/lib/businessModules/officialMedicalService/api/mutations/approvalRequests.ts b/employee-portal/src/lib/businessModules/officialMedicalService/api/mutations/approvalRequests.ts deleted file mode 100644 index 4609cc8a6..000000000 --- a/employee-portal/src/lib/businessModules/officialMedicalService/api/mutations/approvalRequests.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Copyright 2025 cronn GmbH - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { useApprovalRequestApi } from "@/lib/businessModules/officialMedicalService/api/clients"; -import { - useDecideApprovalRequestTemplate, - useGrantDeletionForAllRequestsTemplate, -} from "@/lib/shared/api/mutations/approvalRequests"; - -export function useDecideApprovalRequest() { - return useDecideApprovalRequestTemplate(useApprovalRequestApi); -} - -export function useGrantDeletionForAllRequests() { - return useGrantDeletionForAllRequestsTemplate(useApprovalRequestApi); -} diff --git a/employee-portal/src/lib/businessModules/officialMedicalService/api/mutations/files.ts b/employee-portal/src/lib/businessModules/officialMedicalService/api/mutations/files.ts deleted file mode 100644 index d252cebd7..000000000 --- a/employee-portal/src/lib/businessModules/officialMedicalService/api/mutations/files.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Copyright 2025 cronn GmbH - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { useFileApi } from "@/lib/businessModules/officialMedicalService/api/clients"; -import { - useDeleteFileTemplate, - useRequestFileDeletionTemplate, -} from "@/lib/shared/api/mutations/files"; - -export function useDeleteFile() { - return useDeleteFileTemplate(useFileApi); -} - -export function useRequestFileDeletion() { - return useRequestFileDeletionTemplate(useFileApi); -} diff --git a/employee-portal/src/lib/businessModules/officialMedicalService/api/mutations/progressEntries.ts b/employee-portal/src/lib/businessModules/officialMedicalService/api/mutations/progressEntries.ts deleted file mode 100644 index d803d0be7..000000000 --- a/employee-portal/src/lib/businessModules/officialMedicalService/api/mutations/progressEntries.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Copyright 2025 cronn GmbH - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { - useFileApi, - useProgressEntryApi, -} from "@/lib/businessModules/officialMedicalService/api/clients"; -import { - useCreateProgressEntryTemplate, - useDeleteProgressEntryTemplate, - usePatchProgressEntryTemplate, - useRequestProgressEntryDeletionTemplate, -} from "@/lib/shared/api/mutations/progressEntries"; - -export function useCreateProgressEntry() { - return useCreateProgressEntryTemplate(useProgressEntryApi); -} - -export function useDeleteProgressEntry() { - return useDeleteProgressEntryTemplate(useProgressEntryApi); -} - -export function usePatchProgressEntry() { - return usePatchProgressEntryTemplate(useProgressEntryApi, useFileApi); -} - -export function useRequestProgressEntryDeletion() { - return useRequestProgressEntryDeletionTemplate(useProgressEntryApi); -} diff --git a/employee-portal/src/lib/businessModules/officialMedicalService/api/queries/appointmentBlocksApi.ts b/employee-portal/src/lib/businessModules/officialMedicalService/api/queries/appointmentBlocksApi.ts index 28fa38d82..0b99cee4c 100644 --- a/employee-portal/src/lib/businessModules/officialMedicalService/api/queries/appointmentBlocksApi.ts +++ b/employee-portal/src/lib/businessModules/officialMedicalService/api/queries/appointmentBlocksApi.ts @@ -4,16 +4,21 @@ */ import { + ApiAppointmentType, ApiCreateDailyAppointmentBlockGroupRequest, GetAppointmentBlockGroupsRequest, } from "@eshg/employee-portal-api/officialMedicalService"; +import { mapPaginatedList } from "@eshg/lib-employee-portal/api/models/PaginatedList"; import { unwrapRawResponse } from "@eshg/lib-portal/api/unwrapRawResponse"; -import { queryOptions, useQuery } from "@tanstack/react-query"; +import { + queryOptions, + useQuery, + useSuspenseQuery, +} from "@tanstack/react-query"; import { useAppointmentBlockApi } from "@/lib/businessModules/officialMedicalService/api/clients"; import { mapAppointmentBlockGroup } from "@/lib/businessModules/officialMedicalService/api/models/AppointmentBlockGroup"; import { appointmentBlockApiQueryKey } from "@/lib/businessModules/officialMedicalService/api/queries/apiQueryKeys"; -import { mapPaginatedList } from "@/lib/shared/api/models/PaginatedList"; export function useGetAppointmentBlockGroupsQuery( request: GetAppointmentBlockGroupsRequest, @@ -47,3 +52,16 @@ export function useValidateDailyAppointmentBlocksForGroup( : null, }); } + +export function useGetFreeAppointmentsQuery(physicianId?: string) { + const appointmentApi = useAppointmentBlockApi(); + return useSuspenseQuery({ + queryKey: appointmentBlockApiQueryKey(["getFreeAppointments", physicianId]), + queryFn: () => + appointmentApi.getFreeAppointments( + ApiAppointmentType.OfficialMedicalService, + undefined, + physicianId, + ), + }); +} diff --git a/employee-portal/src/lib/businessModules/officialMedicalService/api/queries/files.ts b/employee-portal/src/lib/businessModules/officialMedicalService/api/queries/files.ts deleted file mode 100644 index e08bcc98e..000000000 --- a/employee-portal/src/lib/businessModules/officialMedicalService/api/queries/files.ts +++ /dev/null @@ -1,12 +0,0 @@ -/** - * Copyright 2025 cronn GmbH - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { useFileApi } from "@/lib/businessModules/officialMedicalService/api/clients"; -import { fileApiQueryKey } from "@/lib/businessModules/officialMedicalService/api/queries/apiQueryKeys"; -import { useGetMetaDataHistoryTemplate } from "@/lib/shared/api/queries/files"; - -export function useGetMetaDataHistory(fileId: string) { - return useGetMetaDataHistoryTemplate(useFileApi, fileApiQueryKey, fileId); -} diff --git a/employee-portal/src/lib/businessModules/officialMedicalService/api/queries/progressEntries.ts b/employee-portal/src/lib/businessModules/officialMedicalService/api/queries/progressEntries.ts deleted file mode 100644 index 6ecd0a8c6..000000000 --- a/employee-portal/src/lib/businessModules/officialMedicalService/api/queries/progressEntries.ts +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Copyright 2025 cronn GmbH - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { ApiUserRole } from "@eshg/base-api"; - -import { - useProcedureApi, - useProgressEntryApi, -} from "@/lib/businessModules/officialMedicalService/api/clients"; -import { progressEntryApiQueryKey } from "@/lib/businessModules/officialMedicalService/api/queries/apiQueryKeys"; -import { - useFetchProgressEntriesTemplate, - useFetchProgressEntryDetailsTemplate, - useGetManualProgressEntryHistoryTemplate, -} from "@/lib/shared/api/queries/progressEntries"; -import { ProgressEntriesFilters } from "@/lib/shared/components/procedures/progress-entries/types"; - -export function useFetchProgressEntries( - procedureId: string, - leaderRole: ApiUserRole, - progressEntryFilter: ProgressEntriesFilters, -) { - return useFetchProgressEntriesTemplate( - useProgressEntryApi, - useProcedureApi, - progressEntryApiQueryKey, - procedureId, - leaderRole, - progressEntryFilter, - ); -} - -export function useFetchProgressEntryDetails( - procedureId: string, - entryId: string, -) { - return useFetchProgressEntryDetailsTemplate( - useProgressEntryApi, - progressEntryApiQueryKey, - procedureId, - entryId, - ); -} - -export function useGetManualProgressEntryHistory(entryId: string) { - return useGetManualProgressEntryHistoryTemplate( - useProgressEntryApi, - progressEntryApiQueryKey, - entryId, - ); -} diff --git a/employee-portal/src/lib/businessModules/officialMedicalService/components/procedures/details/AdditionalInfoPanel.tsx b/employee-portal/src/lib/businessModules/officialMedicalService/components/procedures/details/AdditionalInfoPanel.tsx index 46c75b7b0..1fd594057 100644 --- a/employee-portal/src/lib/businessModules/officialMedicalService/components/procedures/details/AdditionalInfoPanel.tsx +++ b/employee-portal/src/lib/businessModules/officialMedicalService/components/procedures/details/AdditionalInfoPanel.tsx @@ -17,6 +17,7 @@ import { isDefined } from "remeda"; import { useConcernSidebar } from "@/lib/businessModules/officialMedicalService/components/procedures/details/ConcernSidebar"; import { usePhysicianSidebar } from "@/lib/businessModules/officialMedicalService/components/procedures/details/PhysicianSidebar"; import { DetailsCellInlineEdit } from "@/lib/businessModules/officialMedicalService/shared/DetailsCellInlineEdit"; +import { isProcedureFinalized } from "@/lib/businessModules/officialMedicalService/shared/helpers"; import { EditButton } from "@/lib/shared/components/buttons/EditButton"; import { InfoTile } from "@/lib/shared/components/infoTile/InfoTile"; import { InfoTileAddButton } from "@/lib/shared/components/infoTile/InfoTileAddButton"; @@ -44,7 +45,7 @@ export function AdditionalInfoPanel({ Anliegen hinzufügen </InfoTileAddButton> )} - {!procedure.physician && ( + {!isProcedureFinalized(procedure) && !procedure.physician && ( <InfoTileAddButton onClick={() => physicianSidebar.open({ @@ -87,7 +88,7 @@ export function AdditionalInfoPanel({ {procedure.physician && ( <DetailsCellInlineEdit renderEditButton={ - procedure.status !== ApiProcedureStatus.Closed && ( + !isProcedureFinalized(procedure) && ( <EditButton aria-label="Ärzt:in bearbeiten" onClick={() => physicianSidebar.open({ procedure })} diff --git a/employee-portal/src/lib/businessModules/officialMedicalService/components/procedures/details/AppointmentSidebar.tsx b/employee-portal/src/lib/businessModules/officialMedicalService/components/procedures/details/AppointmentSidebar.tsx index bd21ed4b8..7ffc1ef1c 100644 --- a/employee-portal/src/lib/businessModules/officialMedicalService/components/procedures/details/AppointmentSidebar.tsx +++ b/employee-portal/src/lib/businessModules/officialMedicalService/components/procedures/details/AppointmentSidebar.tsx @@ -4,8 +4,11 @@ */ import { + ApiAppointment, ApiAppointmentType, ApiBookingType, + ApiOmsAppointment, + ApiUser, } from "@eshg/employee-portal-api/officialMedicalService"; import { SubmitButton } from "@eshg/lib-portal/components/buttons/SubmitButton"; import { NumberField } from "@eshg/lib-portal/components/formFields/NumberField"; @@ -13,16 +16,21 @@ import { AppointmentPickerField, FIELD_LABELS_DE, } from "@eshg/lib-portal/components/formFields/appointmentPicker/AppointmentPickerField"; +import { assertNever } from "@eshg/lib-portal/helpers/assertions"; +import { toDateTimeString } from "@eshg/lib-portal/helpers/dateTime"; import { validateIntegerAnd, validateRange, } from "@eshg/lib-portal/helpers/validators"; -import { Button, Sheet, Stack } from "@mui/joy"; -import { addMinutes } from "date-fns"; -import { Formik } from "formik"; -import { useState } from "react"; +import { Box, Button, Sheet, Stack, Typography } from "@mui/joy"; +import { addMinutes, isEqual } from "date-fns"; +import { Formik, useFormikContext } from "formik"; +import { useMemo, useState } from "react"; +import { isEmpty, prop, sortBy } from "remeda"; +import { useBookAppointment } from "@/lib/businessModules/officialMedicalService/api/mutations/appointmentApi"; import { usePostAppointment } from "@/lib/businessModules/officialMedicalService/api/mutations/employeeOmsProcedureApi"; +import { useGetFreeAppointmentsQuery } from "@/lib/businessModules/officialMedicalService/api/queries/appointmentBlocksApi"; import { ButtonBar } from "@/lib/shared/components/buttons/ButtonBar"; import { SidebarForm } from "@/lib/shared/components/form/SidebarForm"; import { DateTimeField } from "@/lib/shared/components/formFields/DateTimeField"; @@ -37,29 +45,22 @@ import { useSidebarWithFormRef, } from "@/lib/shared/hooks/useSidebarWithFormRef"; -const now = new Date(); - interface Appointment { start: Date; end: Date; } -const appointments = new Array(100).fill(0).map((_, t): Appointment => { - const start = addMinutes(now, t * 15 + (t % 10) * 3600); - return { - start, - end: addMinutes(start, 10), - }; -}); - interface AppointmentFormValues { - bookingType: ApiBookingType; + bookingType: ApiBookingType | "SelfBooking"; appointment?: Appointment; start: string; duration: number; } -export function useCreateAppointmentSidebar(procedureId: string) { +export function useCreateAppointmentSidebar( + procedureId: string, + physician?: ApiUser, +) { const { mutateAsync: createAppointment } = usePostAppointment(); return useSidebarWithFormRef({ @@ -69,62 +70,118 @@ export function useCreateAppointmentSidebar(procedureId: string) { procedureId, request: { appointmentType: ApiAppointmentType.OfficialMedicalService, - bookingInfo: { - bookingType: values.bookingType, - start: new Date(values.start), - duration: values.duration, - }, + bookingInfo: + values.bookingType === "SelfBooking" + ? undefined + : { + bookingType: values.bookingType, + start: new Date(values.start), + duration: values.duration, + }, }, }); } - return EmbeddedAppointmentSidebar({ onSave: handleSave, ...props }); + return EmbeddedAppointmentSidebar({ + onSave: handleSave, + allowSelfBooking: true, + physician, + ...props, + }); }, }); } -export function useAppointmentSidebar() { +export function useAppointmentSidebar(physician?: ApiUser) { + const { mutateAsync: bookAppointment } = useBookAppointment(); + return useSidebarWithFormRef({ - component: EmbeddedAppointmentSidebar, + component: (props: Readonly<ExternalAppointmentSidebarProps>) => { + async function handleSave(values: AppointmentFormValues) { + if (values.bookingType === "SelfBooking") { + throw new Error("Unexpected SelfBooking"); + } + await bookAppointment({ + appointmentId: props.appointment.appointmentId, + request: { + bookingType: values.bookingType, + start: new Date(values.start), + duration: values.duration, + }, + }); + } + + return EmbeddedAppointmentSidebar({ + onSave: handleSave, + allowSelfBooking: false, + physician, + ...props, + }); + }, }); } +interface ExternalAppointmentSidebarProps extends SidebarWithFormRefProps { + appointment: ApiOmsAppointment; +} + interface AppointmentSidebarProps extends SidebarWithFormRefProps { - onSave?: (values: AppointmentFormValues) => Promise<void>; + onSave: (values: AppointmentFormValues) => Promise<void>; + appointment?: ApiOmsAppointment; + allowSelfBooking: boolean; + physician?: ApiUser; } function EmbeddedAppointmentSidebar({ formRef, onClose: handleClose, onSave, + appointment, + allowSelfBooking, + physician, }: Readonly<AppointmentSidebarProps>) { + const { appointments, initialValues } = useAppointments( + appointment, + physician?.userId, + ); + async function handleSubmit(values: AppointmentFormValues) { - await onSave?.(values); + if (values.bookingType === ApiBookingType.AppointmentBlock) { + values = { + bookingType: ApiBookingType.AppointmentBlock, + start: toDateTimeString(values.appointment!.start), + duration: Math.round( + (values.appointment!.end.getTime() - + values.appointment!.start.getTime()) / + 1000 / + 60, + ), + }; + } + await onSave(values); handleClose(true); } return ( - <Formik - initialValues={ - { - bookingType: ApiBookingType.AppointmentBlock, - appointment: undefined, - start: "", - duration: 30, - } as AppointmentFormValues - } - onSubmit={handleSubmit} - > + <Formik initialValues={initialValues} onSubmit={handleSubmit}> {({ isSubmitting }) => ( <SidebarForm ref={formRef}> <SidebarContent title="Termin buchen"> - <RadioAccordionGroupField name="bookingType"> + <AssignedPhysician physician={physician} /> + <RadioAccordionGroupField + name="bookingType" + data-testid="booking-type-radio-control" + > <RadioAccordionItem value={ApiBookingType.AppointmentBlock} label="Aus Terminblock" > {(isExpanded) => ( - <AppointmentBlockForm isExpanded={isExpanded} /> + <AppointmentBlockForm + isExpanded={isExpanded} + appointments={appointments} + initialMonth={initialValues.appointment?.start} + /> )} </RadioAccordionItem> <RadioAccordionItem @@ -135,55 +192,191 @@ function EmbeddedAppointmentSidebar({ <AppointmentUserDefinedForm isExpanded={isExpanded} /> )} </RadioAccordionItem> + {allowSelfBooking && ( + <RadioAccordionItem + sx={{ "& .MuiAccordionDetails-root": { height: 0 } }} + value={"SelfBooking"} + label="Selbstbuchung" + /> + )} </RadioAccordionGroupField> </SidebarContent> - <SidebarActions> - <ButtonBar - left={ - <Button - variant="plain" - color="primary" - onClick={() => handleClose(true)} - > - Abbrechen - </Button> - } - right={ - <SubmitButton submitting={isSubmitting}>Buchen</SubmitButton> - } - /> - </SidebarActions> + <AppointmentSidebarActions + isSubmitting={isSubmitting} + onClose={handleClose} + initialValues={initialValues} + /> </SidebarForm> )} </Formik> ); } +function AppointmentSidebarActions({ + isSubmitting, + onClose, + initialValues, +}: { + isSubmitting: boolean; + onClose: (force?: boolean) => void; + initialValues: AppointmentFormValues; +}) { + const { values } = useFormikContext<AppointmentFormValues>(); + const dirty = !isAppointmentFormValuesEqual(initialValues, values); + + return ( + <SidebarActions> + <ButtonBar + left={ + dirty && ( + <Button + variant="plain" + color="primary" + onClick={() => onClose(true)} + > + Abbrechen + </Button> + ) + } + right={ + dirty ? ( + <SubmitButton submitting={isSubmitting}>Buchen</SubmitButton> + ) : ( + <Button onClick={() => onClose(true)}>Schließen</Button> + ) + } + /> + </SidebarActions> + ); +} + +function isAppointmentFormValuesEqual( + v1: AppointmentFormValues, + v2: AppointmentFormValues, +) { + if (v1.bookingType !== v2.bookingType) return false; + switch (v1.bookingType) { + case ApiBookingType.AppointmentBlock: + if (!v1.appointment || !v2.appointment) + return v1.appointment == v2.appointment; + return ( + isEqual(v1.appointment.start, v2.appointment.start) && + isEqual(v1.appointment.end, v2.appointment.end) + ); + case ApiBookingType.UserDefined: + return v1.start === v2.start && v1.duration === v2.duration; + case "SelfBooking": + return true; + default: + assertNever(v1.bookingType); + } +} + +function useAppointments( + appointment?: ApiOmsAppointment, + physicianId?: string, +): { + appointments: ApiAppointment[]; + initialValues: AppointmentFormValues; +} { + const { data } = useGetFreeAppointmentsQuery(physicianId); + + const [appointments, setAppointments] = useState(data.appointments); + + return useMemo(() => { + let blockAppointment: ApiAppointment | undefined = undefined; + if ( + appointment?.bookingType === ApiBookingType.AppointmentBlock && + appointment?.start && + appointment?.duration + ) { + const start = new Date(appointment.start); + const end = addMinutes(start, appointment.duration); + blockAppointment = appointments.find( + (apt) => isEqual(apt.start, start) && isEqual(apt.end, end), + ); + if (!blockAppointment) { + blockAppointment = { + start, + end, + }; + setAppointments( + sortBy([...appointments, blockAppointment], prop("start")), + ); + } + } + const start = + appointment?.bookingType === ApiBookingType.UserDefined + ? appointment?.start + : undefined; + const duration = + appointment?.bookingType === ApiBookingType.UserDefined + ? appointment?.duration + : undefined; + return { + appointments, + initialValues: { + bookingType: + appointment?.bookingType ?? ApiBookingType.AppointmentBlock, + appointment: blockAppointment, + start: start ? toDateTimeString(start) : "", + duration: duration ?? 30, + }, + }; + }, [appointments, appointment]); +} + function AppointmentBlockForm({ isExpanded = true, + appointments, + initialMonth, }: Readonly<{ isExpanded?: boolean; + appointments: ApiAppointment[]; + initialMonth?: Date; }>) { - const [month, setMonth] = useState<Date>(new Date()); + const [month, setMonth] = useState<Date>(initialMonth ?? new Date()); return ( <Sheet variant="plain" sx={{ borderRadius: "8px" }}> - <AppointmentPickerField - sx={{ - // just for aligning the separator line - width: "min-content", - }} - name="appointment" - currentMonth={month} - setCurrentMonth={setMonth} - monthAppointments={appointments} - required={isExpanded} - labels={FIELD_LABELS_DE} - /> + {isEmpty(appointments) ? ( + <Typography>Keine freien Terminblöcke verfügbar ☹</Typography> + ) : ( + <AppointmentPickerField + sx={{ + // just for aligning the separator line + width: "min-content", + }} + name="appointment" + currentMonth={month} + setCurrentMonth={setMonth} + monthAppointments={appointments} + required={isExpanded} + labels={FIELD_LABELS_DE} + isAppointmentEqual={(apt1: ApiAppointment, apt2: ApiAppointment) => + isEqual(apt1.start, apt2.start) && isEqual(apt1.end, apt2.end) + } + /> + )} </Sheet> ); } +function AssignedPhysician({ physician }: { physician?: ApiUser }) { + return ( + physician && ( + <Box component="dl"> + <Typography component="dt" my={2} level="title-md"> + Zugewiesene:r Arzt/Ärztin + </Typography> + <Typography component="dd" my={2}> + {physician.firstName} {physician.lastName} + </Typography> + </Box> + ) + ); +} + function AppointmentUserDefinedForm({ isExpanded = true, }: Readonly<{ diff --git a/employee-portal/src/lib/businessModules/officialMedicalService/components/procedures/details/AppointmentsPanel.tsx b/employee-portal/src/lib/businessModules/officialMedicalService/components/procedures/details/AppointmentsPanel.tsx index e48285e30..df47b2159 100644 --- a/employee-portal/src/lib/businessModules/officialMedicalService/components/procedures/details/AppointmentsPanel.tsx +++ b/employee-portal/src/lib/businessModules/officialMedicalService/components/procedures/details/AppointmentsPanel.tsx @@ -8,6 +8,7 @@ import { Button } from "@mui/joy"; import { useCreateAppointmentSidebar } from "@/lib/businessModules/officialMedicalService/components/procedures/details/AppointmentSidebar"; import { AppointmentsTable } from "@/lib/businessModules/officialMedicalService/components/procedures/details/AppointmentsTable"; +import { isProcedureFinalized } from "@/lib/businessModules/officialMedicalService/shared/helpers"; import { CalendarAddDay } from "@/lib/shared/components/icons/CalendarAddDay"; import { InfoTile } from "@/lib/shared/components/infoTile/InfoTile"; @@ -16,21 +17,27 @@ export function AppointmentsPanel({ }: Readonly<{ procedure: ApiEmployeeOmsProcedureDetails; }>) { - const { open: openSidebar } = useCreateAppointmentSidebar(procedure.id); + const { open: openSidebar } = useCreateAppointmentSidebar( + procedure.id, + procedure.physician, + ); return ( <InfoTile title="Termine" name="appointments" + data-testid="appointments" footer={ - <Button - variant="plain" - sx={{ justifyContent: "start", width: "fit-content" }} - startDecorator={<CalendarAddDay />} - onClick={openSidebar} - > - Termin hinzufügen - </Button> + !isProcedureFinalized(procedure) && ( + <Button + variant="plain" + sx={{ justifyContent: "start", width: "fit-content" }} + startDecorator={<CalendarAddDay />} + onClick={openSidebar} + > + Termin hinzufügen + </Button> + ) } > <AppointmentsTable procedure={procedure} /> diff --git a/employee-portal/src/lib/businessModules/officialMedicalService/components/procedures/details/AppointmentsTable.tsx b/employee-portal/src/lib/businessModules/officialMedicalService/components/procedures/details/AppointmentsTable.tsx index d7fa2091e..e87190af8 100644 --- a/employee-portal/src/lib/businessModules/officialMedicalService/components/procedures/details/AppointmentsTable.tsx +++ b/employee-portal/src/lib/businessModules/officialMedicalService/components/procedures/details/AppointmentsTable.tsx @@ -22,8 +22,10 @@ import { Chip, Typography } from "@mui/joy"; import { DefaultColorPalette } from "@mui/joy/styles/types"; import { createColumnHelper } from "@tanstack/react-table"; +import { useCancelAppointment } from "@/lib/businessModules/officialMedicalService/api/mutations/appointmentApi"; import { APPOINTMENT_TYPES } from "@/lib/businessModules/officialMedicalService/components/appointmentBlocks/constants"; import { useAppointmentSidebar } from "@/lib/businessModules/officialMedicalService/components/procedures/details/AppointmentSidebar"; +import { isProcedureFinalized } from "@/lib/businessModules/officialMedicalService/shared/helpers"; import { ActionsItem, ActionsMenu, @@ -67,10 +69,10 @@ function createAppointmentColumns({ openCloseAppointmentDialog, openWithdrawAppointmentDialog, }: { - openBookingSidebar: () => void; - openCancelAppointmentDialog: () => void; - openCloseAppointmentDialog: () => void; - openWithdrawAppointmentDialog: () => void; + openBookingSidebar?: (appointment: ApiOmsAppointment) => void; + openCancelAppointmentDialog?: (appointment: ApiOmsAppointment) => void; + openCloseAppointmentDialog?: () => void; + openWithdrawAppointmentDialog?: () => void; }) { return [ columnHelper.accessor("appointmentType", { @@ -125,16 +127,20 @@ function createAppointmentColumns({ if ( (bookingState === ApiBookingState.Bookable || bookingState === ApiBookingState.Cancelled) && - appointmentState === ApiAppointmentState.Open + appointmentState === ApiAppointmentState.Open && + openBookingSidebar ) { items.push({ label: "Terminbuchung vornehmen", startDecorator: <CalendarAddDay />, - onClick: openBookingSidebar, + onClick: () => openBookingSidebar(ctx.row.original), }); } - if (bookingState === ApiBookingState.Bookable) { + if ( + bookingState === ApiBookingState.Bookable && + openWithdrawAppointmentDialog + ) { items.push({ label: "Terminbuchung zurückziehen", startDecorator: <Delete />, @@ -145,25 +151,28 @@ function createAppointmentColumns({ if ( bookingState === ApiBookingState.Booked && - appointmentState === ApiAppointmentState.Open + appointmentState === ApiAppointmentState.Open && + openBookingSidebar && + openCancelAppointmentDialog ) { items.push({ label: "Terminbuchung bearbeiten", startDecorator: <EditCalendarOutlined />, - onClick: openBookingSidebar, + onClick: () => openBookingSidebar(ctx.row.original), }); items.push({ label: "Terminbuchung absagen", startDecorator: <EventBusyOutlined />, - onClick: openCancelAppointmentDialog, + onClick: () => openCancelAppointmentDialog(ctx.row.original), }); } if ( (bookingState === ApiBookingState.Cancelled || bookingState === ApiBookingState.Booked) && - appointmentState === ApiAppointmentState.Open + appointmentState === ApiAppointmentState.Open && + openCloseAppointmentDialog ) { items.push({ label: "Als abgeschlossen markieren", @@ -192,22 +201,25 @@ export function AppointmentsTable({ }: Readonly<{ procedure: ApiEmployeeOmsProcedureDetails; }>) { - const { open: openBookingSidebar } = useAppointmentSidebar(); + const { open: openBookingSidebar } = useAppointmentSidebar( + procedure.physician, + ); const { openConfirmationDialog } = useConfirmationDialog(); + const { mutateAsync: cancelAppointment } = useCancelAppointment(); const snackbar = useSnackbar(); if (procedure.appointments.length === 0) { return; } - function openCancelAppointmentDialog() { + function openCancelAppointmentDialog(appointment: ApiOmsAppointment) { openConfirmationDialog({ title: "Termin absagen?", description: "Der/die Bürger:in wird per E-Mail informiert. Ein neuer Termin kann gebucht werden.", color: "danger", confirmLabel: "Absagen", - onConfirm: () => snackbar.notification("TODO"), + onConfirm: () => cancelAppointment(appointment), }); } @@ -232,12 +244,16 @@ export function AppointmentsTable({ }); } - const columns = createAppointmentColumns({ - openBookingSidebar: () => openBookingSidebar({}), - openCancelAppointmentDialog, - openCloseAppointmentDialog, - openWithdrawAppointmentDialog, - }); + const columns = isProcedureFinalized(procedure) + ? createAppointmentColumns({}) + : createAppointmentColumns({ + openBookingSidebar: (appointment) => + openBookingSidebar({ appointment }), + openCancelAppointmentDialog: (appointment) => + openCancelAppointmentDialog(appointment), + openCloseAppointmentDialog, + openWithdrawAppointmentDialog, + }); return <DataTable data={procedure.appointments} columns={columns} />; } diff --git a/employee-portal/src/lib/businessModules/officialMedicalService/components/procedures/details/UpdateAffectedPersonSidebar.tsx b/employee-portal/src/lib/businessModules/officialMedicalService/components/procedures/details/UpdateAffectedPersonSidebar.tsx index 5c84fa14c..241173c56 100644 --- a/employee-portal/src/lib/businessModules/officialMedicalService/components/procedures/details/UpdateAffectedPersonSidebar.tsx +++ b/employee-portal/src/lib/businessModules/officialMedicalService/components/procedures/details/UpdateAffectedPersonSidebar.tsx @@ -4,11 +4,11 @@ */ import { ApiAffectedPerson } from "@eshg/employee-portal-api/officialMedicalService"; +import { mapOptional } from "@eshg/lib-employee-portal/api/models/utils"; import { toDateString } from "@eshg/lib-portal/helpers/dateTime"; import { usePatchAffectedPerson } from "@/lib/businessModules/officialMedicalService/api/mutations/employeeOmsProcedureApi"; import { mapToPatchAffectedPersonRequest } from "@/lib/businessModules/officialMedicalService/shared/helpers"; -import { mapOptional } from "@/lib/shared/api/models/utils"; import { mapApiAddressToForm } from "@/lib/shared/components/form/address/helpers"; import { PersonEditSidebar } from "@/lib/shared/components/personSidebar/PersonEditSidebar"; import { diff --git a/employee-portal/src/lib/businessModules/officialMedicalService/components/procedures/overview/ProceduresOverviewTable.tsx b/employee-portal/src/lib/businessModules/officialMedicalService/components/procedures/overview/ProceduresOverviewTable.tsx index 8416e0a80..f70709afd 100644 --- a/employee-portal/src/lib/businessModules/officialMedicalService/components/procedures/overview/ProceduresOverviewTable.tsx +++ b/employee-portal/src/lib/businessModules/officialMedicalService/components/procedures/overview/ProceduresOverviewTable.tsx @@ -6,15 +6,33 @@ "use client"; import { ApiBusinessModule } from "@eshg/employee-portal-api/businessProcedures"; +import { GetAllEmployeeProceduresRequest } from "@eshg/employee-portal-api/officialMedicalService"; +import { optionsFromRecord } from "@eshg/lib-portal/components/formFields/SelectOptions"; import { useSuspenseQueries } from "@tanstack/react-query"; import { ColumnSort } from "@tanstack/react-table"; -import { ReactNode } from "react"; +import { ReactNode, useMemo, useState } from "react"; import { useGetAllProceduresQuery } from "@/lib/businessModules/officialMedicalService/api/queries/employeeOmsProcedureApi"; import { procedureOverviewTableColumns } from "@/lib/businessModules/officialMedicalService/components/procedures/overview/procedureOverviewColumns"; +import { + omsProcedureAssignedFilterNames, + omsProcedureHighPriorityFilterNames, + omsProcedureStatusFilterNames, + omsProcedureTodayFilterNames, +} from "@/lib/businessModules/officialMedicalService/shared/enums"; import { routes } from "@/lib/businessModules/officialMedicalService/shared/routes"; import { useGetGdprValidationBannerQuery } from "@/lib/shared/api/queries/gdpr"; import { ButtonBar } from "@/lib/shared/components/buttons/ButtonBar"; +import { FilterButton } from "@/lib/shared/components/buttons/FilterButton"; +import { FilterSettings } from "@/lib/shared/components/filterSettings/FilterSettings"; +import { FilterSettingsSheet } from "@/lib/shared/components/filterSettings/FilterSettingsSheet"; +import { FilterDefinition } from "@/lib/shared/components/filterSettings/models/FilterDefinition"; +import { FilterValue } from "@/lib/shared/components/filterSettings/models/FilterValue"; +import { + FilterSettingsStateProvider, + useFilterSettings, +} from "@/lib/shared/components/filterSettings/useFilterSettings"; +import { useSearchParamStateProvider } from "@/lib/shared/components/filterSettings/useSearchParamStateProvider"; import { useGdprValidationTasksAlert } from "@/lib/shared/components/gdpr/useGdprValidationTasksAlert"; import { Pagination } from "@/lib/shared/components/pagination/Pagination"; import { DataTable } from "@/lib/shared/components/table/DataTable"; @@ -28,6 +46,7 @@ import { useTableControl } from "@/lib/shared/hooks/searchParams/useTableControl interface ProceduresOverviewTableProps { buttons?: ReactNode[]; + filter: GetAllEmployeeProceduresRequest; } const initialSorting: ColumnSort = { @@ -35,6 +54,35 @@ const initialSorting: ColumnSort = { desc: true, }; +function createFilterDefinitions(): FilterDefinition[] { + return [ + { + type: "Enum", + key: "assigned", + name: "Zugewiesen", + options: optionsFromRecord(omsProcedureAssignedFilterNames), + }, + { + type: "Enum", + key: "status", + name: "Vorgang Status", + options: optionsFromRecord(omsProcedureStatusFilterNames), + }, + { + type: "Enum", + key: "highPriority", + name: "Dringender Fall", + options: optionsFromRecord(omsProcedureHighPriorityFilterNames), + }, + { + type: "Enum", + key: "today", + name: "Termin heute", + options: optionsFromRecord(omsProcedureTodayFilterNames), + }, + ]; +} + export function ProceduresOverviewTable( props: Readonly<ProceduresOverviewTableProps>, ) { @@ -46,6 +94,7 @@ export function ProceduresOverviewTable( }); const proceduresQuery = useGetAllProceduresQuery({ + ...props.filter, pageNumber: tableControl.paginationProps.pageNumber, pageSize: tableControl.paginationProps.pageSize, sortKey: getSortKey(tableControl.tableSorting), @@ -65,11 +114,44 @@ export function ProceduresOverviewTable( businessModule: ApiBusinessModule.OfficialMedicalService, }); + const filterDefinitions = createFilterDefinitions(); + const paramStateProvider = useSearchParamStateProvider( + filterDefinitions, + true, + ); + + const { stateProvider } = useOmsProceduresFilterState({ + stateProvider: paramStateProvider, + defaults: [], + filter: props.filter, + }); + + const filterSettings = useFilterSettings({ + definitions: filterDefinitions, + stateProvider, + // eslint-disable-next-line @typescript-eslint/no-empty-function + onValuesSubmit: (_values) => {}, + showSearch: false, + }); + return ( <TablePage fullHeight - controls={<ButtonBar right={props.buttons} alignItems="flex-end" />} + controls={ + <ButtonBar + left={<FilterButton {...filterSettings.filterButtonProps} />} + right={props.buttons} + alignItems="flex-end" + /> + } data-testid="procedures-table" + filterSettings={ + filterSettings.filterSettingsVisible && ( + <FilterSettingsSheet {...filterSettings.filterSettingsSheetProps}> + <FilterSettings {...filterSettings.filterSettingsProps} /> + </FilterSettingsSheet> + ) + } > <TableSheet loading={procedures.isFetching} @@ -95,3 +177,56 @@ export function ProceduresOverviewTable( </TablePage> ); } + +function useOmsProceduresFilterState(options: { + stateProvider: FilterSettingsStateProvider; + filter: GetAllEmployeeProceduresRequest; + defaults: FilterValue[]; +}) { + const { activeValues, setActiveValues, ...rest } = options.stateProvider; + const [touched, setTouched] = useState(activeValues.length > 0); + + const stateProvider: FilterSettingsStateProvider = { + activeValues: touched ? activeValues : options.defaults, + setActiveValues: (values) => { + setTouched(true); + setActiveValues(values); + }, + ...rest, + }; + + const filter: GetAllEmployeeProceduresRequest = useMemo( + () => ({ + ...options.filter, + ...(touched ? {} : activeValuesToFilters(options.defaults)), + }), + [options.filter, options.defaults, touched], + ); + + return { + stateProvider, + filter, + }; +} + +function activeValuesToFilters( + activeValues: FilterValue[], +): GetAllEmployeeProceduresRequest { + const filters = new Map<string, unknown>(); + + for (const value of activeValues) { + switch (value.type) { + case "Date": + case "EnumSingle": + filters.set(value.key, value.selectedValue); + break; + case "Enum": + filters.set(value.key, value.selectedValues); + break; + case "Number": + break; + } + } + + return Object.fromEntries(filters); +} diff --git a/employee-portal/src/lib/businessModules/officialMedicalService/components/procedures/overview/procedureOverviewColumns.tsx b/employee-portal/src/lib/businessModules/officialMedicalService/components/procedures/overview/procedureOverviewColumns.tsx index 5cda81453..e4fdb8e6f 100644 --- a/employee-portal/src/lib/businessModules/officialMedicalService/components/procedures/overview/procedureOverviewColumns.tsx +++ b/employee-portal/src/lib/businessModules/officialMedicalService/components/procedures/overview/procedureOverviewColumns.tsx @@ -5,6 +5,7 @@ import { ApiEmployeeOmsProcedureOverview } from "@eshg/employee-portal-api/officialMedicalService"; import { formatDate } from "@eshg/lib-portal/formatters/dateTime"; +import { formatDateTime } from "@eshg/lib-portal/formatters/dateTime"; import { WarningAmberOutlined } from "@mui/icons-material"; import { Chip, Tooltip } from "@mui/joy"; import { ColumnHelper, createColumnHelper } from "@tanstack/react-table"; @@ -42,7 +43,7 @@ export function procedureOverviewTableColumns() { columnHelper.accessor("firstName", { header: "Vorname", cell: (props) => props.getValue(), - enableSorting: false, + enableSorting: true, meta: { width: 180, canNavigate: { @@ -53,7 +54,7 @@ export function procedureOverviewTableColumns() { columnHelper.accessor("lastName", { header: "Nachname", cell: (props) => props.getValue(), - enableSorting: false, + enableSorting: true, meta: { width: 180, canNavigate: { @@ -64,7 +65,7 @@ export function procedureOverviewTableColumns() { columnHelper.accessor("dateOfBirth", { header: "Geburtsdatum", cell: (props) => formatDate(props.getValue()), - enableSorting: false, + enableSorting: true, meta: { width: 120, canNavigate: { @@ -72,25 +73,21 @@ export function procedureOverviewTableColumns() { }, }, }), - columnHelper.accessor("status", { - header: "Vorgang Status", - cell: (props) => ( - <Chip color={statusColors[props.getValue()]} size="md"> - {procedureStatusNames[props.getValue()]} - </Chip> - ), - enableSorting: false, + columnHelper.accessor("facilityName", { + header: "Auftraggeber", + cell: (props) => props.getValue(), + enableSorting: true, meta: { - width: 100, + width: 200, canNavigate: { parentRow: true, }, }, }), - columnHelper.accessor("facilityName", { - header: "Auftraggeber", + columnHelper.accessor("physicianName", { + header: "Ärzt:in", cell: (props) => props.getValue(), - enableSorting: false, + enableSorting: true, meta: { width: 200, canNavigate: { @@ -98,10 +95,25 @@ export function procedureOverviewTableColumns() { }, }, }), - columnHelper.accessor("physicianName", { - header: "Ärzt:in", - cell: (props) => props.getValue(), - enableSorting: false, + columnHelper.accessor("status", { + header: "Vorgang Status", + cell: (props) => ( + <Chip color={statusColors[props.getValue()]} size="md"> + {procedureStatusNames[props.getValue()]} + </Chip> + ), + enableSorting: true, + meta: { + width: 100, + canNavigate: { + parentRow: true, + }, + }, + }), + columnHelper.accessor("nextAppointment", { + header: "Nächster Termin", + cell: (props) => formatDateTime(props.getValue()), + enableSorting: true, meta: { width: 200, canNavigate: { diff --git a/employee-portal/src/lib/businessModules/officialMedicalService/shared/constants.ts b/employee-portal/src/lib/businessModules/officialMedicalService/shared/constants.ts index b739087bb..7bb25e0a5 100644 --- a/employee-portal/src/lib/businessModules/officialMedicalService/shared/constants.ts +++ b/employee-portal/src/lib/businessModules/officialMedicalService/shared/constants.ts @@ -4,7 +4,8 @@ */ export const systemProgressEntryTypeTitles: Record<string, string> = { - SYNC_AFFECTED_PERSON: "Geänderte Personendaten übernommen", + UPDATE_AFFECTED_PERSON: "Geänderte Personendaten übernommen", + SYNC_AFFECTED_PERSON: "Geänderte Personendaten synchronisiert", SYNC_FACILITY: "Geänderte Auftraggeberdaten übernommen", PHYSICIAN_CHANGED: "Geänderte(r) Ärzt:in übernommen", PROCEDURE_STARTED: "Vorgang gestartet", diff --git a/employee-portal/src/lib/businessModules/officialMedicalService/shared/enums.ts b/employee-portal/src/lib/businessModules/officialMedicalService/shared/enums.ts new file mode 100644 index 000000000..c42e9157c --- /dev/null +++ b/employee-portal/src/lib/businessModules/officialMedicalService/shared/enums.ts @@ -0,0 +1,27 @@ +/** + * Copyright 2025 cronn GmbH + * SPDX-License-Identifier: AGPL-3.0-only + */ + +import { ApiProcedureStatus } from "@eshg/base-api"; + +import { procedureStatusNames } from "@/lib/baseModule/api/procedures/enums"; + +export const omsProcedureAssignedFilterNames = { + ["true"]: "Nur mir zugewiesene Fälle", +} satisfies Record<string, string>; + +export const omsProcedureStatusFilterNames = { + [ApiProcedureStatus.Draft]: procedureStatusNames[ApiProcedureStatus.Draft], + [ApiProcedureStatus.Open]: procedureStatusNames[ApiProcedureStatus.Open], + [ApiProcedureStatus.InProgress]: + procedureStatusNames[ApiProcedureStatus.InProgress], +} satisfies Record<string, string>; + +export const omsProcedureHighPriorityFilterNames = { + ["true"]: "Nur dringende Fälle", +} satisfies Record<string, string>; + +export const omsProcedureTodayFilterNames = { + ["true"]: "Nur Vorgänge mit Termin heute", +} satisfies Record<string, string>; diff --git a/employee-portal/src/lib/businessModules/officialMedicalService/shared/helpers.ts b/employee-portal/src/lib/businessModules/officialMedicalService/shared/helpers.ts index adca56b93..3da15bb72 100644 --- a/employee-portal/src/lib/businessModules/officialMedicalService/shared/helpers.ts +++ b/employee-portal/src/lib/businessModules/officialMedicalService/shared/helpers.ts @@ -13,6 +13,7 @@ import { ApiPatchAffectedPersonRequest, ApiPatchEmployeeOmsProcedureFacilityRequest, ApiPostEmployeeOmsProcedureRequest, + ApiProcedureStatus, } from "@eshg/employee-portal-api/officialMedicalService"; import { DefaultFacilityFormValues } from "@/lib/shared/components/facilitySidebar/create/FacilityForm"; @@ -109,3 +110,13 @@ export function mapToApiPatchFacilityRequest( }, }; } + +export function isProcedureFinalized(procedure: { + status: ApiProcedureStatus; +}): boolean { + const finalizedStates: ApiProcedureStatus[] = [ + ApiProcedureStatus.Closed, + ApiProcedureStatus.Aborted, + ]; + return finalizedStates.includes(procedure.status); +} diff --git a/employee-portal/src/lib/businessModules/schoolEntry/api/clients.ts b/employee-portal/src/lib/businessModules/schoolEntry/api/clients.ts index 77485fd9a..25a2e98c2 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/api/clients.ts +++ b/employee-portal/src/lib/businessModules/schoolEntry/api/clients.ts @@ -3,6 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +import { useApiConfiguration } from "@eshg/lib-portal/api/ApiProvider"; import { AppointmentBlockApi, AppointmentTypeApi, @@ -20,8 +21,7 @@ import { SchoolEntryCountryCodesApi, SchoolEntryFeatureTogglesApi, ValueEvaluatorApi, -} from "@eshg/employee-portal-api/schoolEntry"; -import { useApiConfiguration } from "@eshg/lib-portal/api/ApiProvider"; +} from "@eshg/school-entry-api"; function useConfiguration() { const configurationParameters = useApiConfiguration( diff --git a/employee-portal/src/lib/businessModules/schoolEntry/api/download/files.ts b/employee-portal/src/lib/businessModules/schoolEntry/api/download/files.ts deleted file mode 100644 index 8a9c64156..000000000 --- a/employee-portal/src/lib/businessModules/schoolEntry/api/download/files.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** - * Copyright 2025 cronn GmbH - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { useFileApi } from "@/lib/businessModules/schoolEntry/api/clients"; -import { useDownloadFile } from "@/lib/shared/api/download/files"; - -export function useDownloadSchoolEntryFile() { - const fileApi = useFileApi(); - return useDownloadFile((fileId: string) => - fileApi.downloadFileRaw({ fileId }), - ); -} diff --git a/employee-portal/src/lib/businessModules/schoolEntry/api/models/Anamnesis.ts b/employee-portal/src/lib/businessModules/schoolEntry/api/models/Anamnesis.ts index 1b57da62a..03885e9f1 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/api/models/Anamnesis.ts +++ b/employee-portal/src/lib/businessModules/schoolEntry/api/models/Anamnesis.ts @@ -3,6 +3,10 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +import { + Versioned, + mapVersioned, +} from "@eshg/lib-employee-portal/api/models/Versioned"; import { ApiAdditionalChildInfo, ApiAnamnesis, @@ -15,9 +19,7 @@ import { ApiMigrationBackground, ApiPromotionBeforeSchoolEntry, ApiPromotionTherapyAndAidInfo, -} from "@eshg/employee-portal-api/schoolEntry"; - -import { Versioned, mapVersioned } from "@/lib/shared/api/models/Versioned"; +} from "@eshg/school-entry-api"; export interface Anamnesis extends Versioned { childLanguageScreening?: boolean; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/api/models/Appointment.ts b/employee-portal/src/lib/businessModules/schoolEntry/api/models/Appointment.ts index dbbd88589..f8afb2b19 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/api/models/Appointment.ts +++ b/employee-portal/src/lib/businessModules/schoolEntry/api/models/Appointment.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiAppointment } from "@eshg/employee-portal-api/schoolEntry"; +import { ApiAppointment } from "@eshg/school-entry-api"; export interface Appointment { readonly start: Date; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/api/models/AppointmentBlockGroup.ts b/employee-portal/src/lib/businessModules/schoolEntry/api/models/AppointmentBlockGroup.ts index d885f8c5d..7b3c71a06 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/api/models/AppointmentBlockGroup.ts +++ b/employee-portal/src/lib/businessModules/schoolEntry/api/models/AppointmentBlockGroup.ts @@ -3,17 +3,19 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +import { + BaseEntity, + mapBaseEntity, +} from "@eshg/lib-employee-portal/api/models/BaseEntity"; +import { assertNonEmptyArray } from "@eshg/lib-portal/helpers/assertions"; import { ApiAppointmentLocation, ApiAppointmentType, ApiGetAppointmentBlock, ApiGetAppointmentBlockGroup, -} from "@eshg/employee-portal-api/schoolEntry"; -import { assertNonEmptyArray } from "@eshg/lib-portal/helpers/assertions"; +} from "@eshg/school-entry-api"; import { first, last, sumBy } from "remeda"; -import { BaseEntity, mapBaseEntity } from "@/lib/shared/api/models/BaseEntity"; - export interface AppointmentBlockGroup extends AppointmentBlock { readonly type: ApiAppointmentType; readonly parallelExaminations: number; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/api/models/AppointmentTypeConfig.ts b/employee-portal/src/lib/businessModules/schoolEntry/api/models/AppointmentTypeConfig.ts index c5c9f36de..31ba4eb23 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/api/models/AppointmentTypeConfig.ts +++ b/employee-portal/src/lib/businessModules/schoolEntry/api/models/AppointmentTypeConfig.ts @@ -3,12 +3,14 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +import { + BaseEntity, + mapBaseEntity, +} from "@eshg/lib-employee-portal/api/models/BaseEntity"; import { ApiAppointmentType, ApiAppointmentTypeConfig, -} from "@eshg/employee-portal-api/schoolEntry"; - -import { BaseEntity, mapBaseEntity } from "@/lib/shared/api/models/BaseEntity"; +} from "@eshg/school-entry-api"; export interface AppointmentTypeConfig extends BaseEntity { appointmentTypeDto: ApiAppointmentType; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/api/models/CountryCodes.ts b/employee-portal/src/lib/businessModules/schoolEntry/api/models/CountryCodes.ts index fb2334047..ce015fb81 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/api/models/CountryCodes.ts +++ b/employee-portal/src/lib/businessModules/schoolEntry/api/models/CountryCodes.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiGetCountryCodesResponse } from "@eshg/employee-portal-api/schoolEntry"; +import { ApiGetCountryCodesResponse } from "@eshg/school-entry-api"; export type CountryCodes = Record<string, number>; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/api/models/Label.ts b/employee-portal/src/lib/businessModules/schoolEntry/api/models/Label.ts index 9d62da3fd..5db1d4f7e 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/api/models/Label.ts +++ b/employee-portal/src/lib/businessModules/schoolEntry/api/models/Label.ts @@ -3,9 +3,11 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiSchoolEntryLabel } from "@eshg/employee-portal-api/schoolEntry"; - -import { BaseEntity, mapBaseEntity } from "@/lib/shared/api/models/BaseEntity"; +import { + BaseEntity, + mapBaseEntity, +} from "@eshg/lib-employee-portal/api/models/BaseEntity"; +import { ApiSchoolEntryLabel } from "@eshg/school-entry-api"; export interface Label extends BaseEntity { readonly version: number; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/api/models/Person.ts b/employee-portal/src/lib/businessModules/schoolEntry/api/models/Person.ts index 429a7dec4..8805ec22c 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/api/models/Person.ts +++ b/employee-portal/src/lib/businessModules/schoolEntry/api/models/Person.ts @@ -3,15 +3,15 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +import { mapOptional } from "@eshg/lib-employee-portal/api/models/utils"; +import { toDateString } from "@eshg/lib-portal/helpers/dateTime"; import { ApiCountryCode, ApiGender, ApiPersonDetails, ApiSalutation, -} from "@eshg/employee-portal-api/schoolEntry"; -import { toDateString } from "@eshg/lib-portal/helpers/dateTime"; +} from "@eshg/school-entry-api"; -import { mapOptional } from "@/lib/shared/api/models/utils"; import { mapApiAddressToForm } from "@/lib/shared/components/form/address/helpers"; import { DefaultPersonFormValues } from "@/lib/shared/components/personSidebar/form/DefaultPersonForm"; import { normalizeListInputs } from "@/lib/shared/components/personSidebar/helpers"; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/api/models/Procedure.ts b/employee-portal/src/lib/businessModules/schoolEntry/api/models/Procedure.ts index 0114d58b7..aa670891c 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/api/models/Procedure.ts +++ b/employee-portal/src/lib/businessModules/schoolEntry/api/models/Procedure.ts @@ -3,14 +3,16 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +import { + BaseEntity, + mapBaseEntity, +} from "@eshg/lib-employee-portal/api/models/BaseEntity"; +import { mapOptional } from "@eshg/lib-employee-portal/api/models/utils"; import { ApiSchoolEntryProcedure, ApiSchoolEntryProcedureType, ApiSchoolEntryStatusType, -} from "@eshg/employee-portal-api/schoolEntry"; - -import { BaseEntity, mapBaseEntity } from "@/lib/shared/api/models/BaseEntity"; -import { mapOptional } from "@/lib/shared/api/models/utils"; +} from "@eshg/school-entry-api"; import { Label, mapLabels } from "./Label"; import { Location, mapLocation } from "./Location"; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/api/models/ProcedureDetails.ts b/employee-portal/src/lib/businessModules/schoolEntry/api/models/ProcedureDetails.ts index 49fdbc1c2..99567b196 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/api/models/ProcedureDetails.ts +++ b/employee-portal/src/lib/businessModules/schoolEntry/api/models/ProcedureDetails.ts @@ -3,10 +3,9 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiProcedureDetails } from "@eshg/employee-portal-api/schoolEntry"; +import { mapOptional } from "@eshg/lib-employee-portal/api/models/utils"; import { mapOptionalValue } from "@eshg/lib-portal/helpers/form"; - -import { mapOptional } from "@/lib/shared/api/models/utils"; +import { ApiProcedureDetails } from "@eshg/school-entry-api"; import { Appointment, mapAppointment } from "./Appointment"; import { Label, mapLabels } from "./Label"; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/api/models/VaccinationStatus.ts b/employee-portal/src/lib/businessModules/schoolEntry/api/models/VaccinationStatus.ts index f893112bd..732f7d4ba 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/api/models/VaccinationStatus.ts +++ b/employee-portal/src/lib/businessModules/schoolEntry/api/models/VaccinationStatus.ts @@ -3,14 +3,16 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +import { + Versioned, + mapVersioned, +} from "@eshg/lib-employee-portal/api/models/Versioned"; import { ApiBooleanWithUnknown, ApiOtherVaccination, ApiVaccinationSchemeValue, ApiVaccinationStatus, -} from "@eshg/employee-portal-api/schoolEntry"; - -import { Versioned, mapVersioned } from "@/lib/shared/api/models/Versioned"; +} from "@eshg/school-entry-api"; export interface VaccinationStatus extends Versioned { vaccinationScheme?: ApiVaccinationSchemeValue; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/api/models/WaitingRoom.ts b/employee-portal/src/lib/businessModules/schoolEntry/api/models/WaitingRoom.ts index b26ace569..f12a5394f 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/api/models/WaitingRoom.ts +++ b/employee-portal/src/lib/businessModules/schoolEntry/api/models/WaitingRoom.ts @@ -3,18 +3,24 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +import { + BaseEntity, + mapBaseEntity, +} from "@eshg/lib-employee-portal/api/models/BaseEntity"; +import { + Versioned, + mapVersioned, +} from "@eshg/lib-employee-portal/api/models/Versioned"; import { ApiWaitingRoom, ApiWaitingRoomProcedure, ApiWaitingStatus, -} from "@eshg/employee-portal-api/schoolEntry"; +} from "@eshg/school-entry-api"; import { Person, mapPerson, } from "@/lib/businessModules/schoolEntry/api/models/Person"; -import { BaseEntity, mapBaseEntity } from "@/lib/shared/api/models/BaseEntity"; -import { Versioned, mapVersioned } from "@/lib/shared/api/models/Versioned"; export interface WaitingRoom extends Versioned { description?: string; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/api/models/examinations/DevelopmentScreeningResult.ts b/employee-portal/src/lib/businessModules/schoolEntry/api/models/examinations/DevelopmentScreeningResult.ts index 2d850298e..a2119e9a1 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/api/models/examinations/DevelopmentScreeningResult.ts +++ b/employee-portal/src/lib/businessModules/schoolEntry/api/models/examinations/DevelopmentScreeningResult.ts @@ -3,6 +3,10 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +import { + Versioned, + mapVersioned, +} from "@eshg/lib-employee-portal/api/models/Versioned"; import { ApiGetDevelopmentScreeningResult, ApiHandicap, @@ -12,9 +16,7 @@ import { ApiSchoolFeedback, ApiSchoolRecommendation, ApiSocioEducationalPerformance, -} from "@eshg/employee-portal-api/schoolEntry"; - -import { Versioned, mapVersioned } from "@/lib/shared/api/models/Versioned"; +} from "@eshg/school-entry-api"; import { Percentiles, mapPercentiles } from "./Percentiles"; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/api/models/examinations/ExaminationResult.ts b/employee-portal/src/lib/businessModules/schoolEntry/api/models/examinations/ExaminationResult.ts index e2d68d2c0..13ba3e421 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/api/models/examinations/ExaminationResult.ts +++ b/employee-portal/src/lib/businessModules/schoolEntry/api/models/examinations/ExaminationResult.ts @@ -7,7 +7,7 @@ import { ApiDoctorLetterValue, ApiExaminationResult, ApiExaminationResultValue, -} from "@eshg/employee-portal-api/schoolEntry"; +} from "@eshg/school-entry-api"; export interface ExaminationResult { examinationResultValue?: ApiExaminationResultValue; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/api/models/examinations/EyeExaminationResult.ts b/employee-portal/src/lib/businessModules/schoolEntry/api/models/examinations/EyeExaminationResult.ts index f9ebd3913..87f7693a5 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/api/models/examinations/EyeExaminationResult.ts +++ b/employee-portal/src/lib/businessModules/schoolEntry/api/models/examinations/EyeExaminationResult.ts @@ -3,18 +3,21 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +import { + Versioned, + mapVersioned, +} from "@eshg/lib-employee-portal/api/models/Versioned"; import { ApiExaminationResult, ApiEyeExaminationResult, ApiEyeExaminationType, ApiPercentageValue, -} from "@eshg/employee-portal-api/schoolEntry"; +} from "@eshg/school-entry-api"; import { ExaminationResult, mapExaminationResult, } from "@/lib/businessModules/schoolEntry/api/models/examinations/ExaminationResult"; -import { Versioned, mapVersioned } from "@/lib/shared/api/models/Versioned"; export interface EyeExaminationResult extends Versioned { leftEye: EyeExamination; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/api/models/examinations/HearingTestResult.ts b/employee-portal/src/lib/businessModules/schoolEntry/api/models/examinations/HearingTestResult.ts index 907c7d8a5..16cd56237 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/api/models/examinations/HearingTestResult.ts +++ b/employee-portal/src/lib/businessModules/schoolEntry/api/models/examinations/HearingTestResult.ts @@ -3,17 +3,20 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +import { + Versioned, + mapVersioned, +} from "@eshg/lib-employee-portal/api/models/Versioned"; import { ApiDecibelValue, ApiHearingTestResult, ApiHertzValue, -} from "@eshg/employee-portal-api/schoolEntry"; +} from "@eshg/school-entry-api"; import { ExaminationResult, mapExaminationResult, } from "@/lib/businessModules/schoolEntry/api/models/examinations/ExaminationResult"; -import { Versioned, mapVersioned } from "@/lib/shared/api/models/Versioned"; export interface HearingTestResult extends Versioned { leftEar: HearingTest; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/api/models/examinations/Percentiles.ts b/employee-portal/src/lib/businessModules/schoolEntry/api/models/examinations/Percentiles.ts index 6fca61858..9d505d68a 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/api/models/examinations/Percentiles.ts +++ b/employee-portal/src/lib/businessModules/schoolEntry/api/models/examinations/Percentiles.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiPercentiles } from "@eshg/employee-portal-api/schoolEntry"; +import { ApiPercentiles } from "@eshg/school-entry-api"; export interface Percentiles { bmi?: number; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/api/models/examinations/SopessExaminationResult.ts b/employee-portal/src/lib/businessModules/schoolEntry/api/models/examinations/SopessExaminationResult.ts index 9464b8c76..a3ef61ae2 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/api/models/examinations/SopessExaminationResult.ts +++ b/employee-portal/src/lib/businessModules/schoolEntry/api/models/examinations/SopessExaminationResult.ts @@ -3,6 +3,10 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +import { + Versioned, + mapVersioned, +} from "@eshg/lib-employee-portal/api/models/Versioned"; import { ApiArticulation, ApiHandednessValue, @@ -11,9 +15,7 @@ import { ApiScoredEvaluationExamination, ApiSopessExaminationResult, ApiSpeechEvaluationExamination, -} from "@eshg/employee-portal-api/schoolEntry"; - -import { Versioned, mapVersioned } from "@/lib/shared/api/models/Versioned"; +} from "@eshg/school-entry-api"; export interface SopessExaminationResult extends Versioned { grossMotorSkills: ApiScoredEvaluationExamination; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/api/mutations/appointmentBlockApi.ts b/employee-portal/src/lib/businessModules/schoolEntry/api/mutations/appointmentBlockApi.ts index 1892046a1..0bd9f3027 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/api/mutations/appointmentBlockApi.ts +++ b/employee-portal/src/lib/businessModules/schoolEntry/api/mutations/appointmentBlockApi.ts @@ -3,9 +3,9 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiCreateDailyAppointmentBlockGroupRequest } from "@eshg/employee-portal-api/schoolEntry"; import { useHandledMutation } from "@eshg/lib-portal/api/useHandledMutation"; import { useSnackbar } from "@eshg/lib-portal/components/snackbar/SnackbarProvider"; +import { ApiCreateDailyAppointmentBlockGroupRequest } from "@eshg/school-entry-api"; import { useAppointmentBlockApi } from "@/lib/businessModules/schoolEntry/api/clients"; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/api/mutations/approvalRequests.ts b/employee-portal/src/lib/businessModules/schoolEntry/api/mutations/approvalRequests.ts deleted file mode 100644 index ac7dcfac1..000000000 --- a/employee-portal/src/lib/businessModules/schoolEntry/api/mutations/approvalRequests.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Copyright 2025 cronn GmbH - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { useApprovalRequestApi } from "@/lib/businessModules/schoolEntry/api/clients"; -import { - useDecideApprovalRequestTemplate, - useGrantDeletionForAllRequestsTemplate, -} from "@/lib/shared/api/mutations/approvalRequests"; - -export function useDecideApprovalRequest() { - return useDecideApprovalRequestTemplate(useApprovalRequestApi); -} - -export function useGrantDeletionForAllRequests() { - return useGrantDeletionForAllRequestsTemplate(useApprovalRequestApi); -} diff --git a/employee-portal/src/lib/businessModules/schoolEntry/api/mutations/files.ts b/employee-portal/src/lib/businessModules/schoolEntry/api/mutations/files.ts deleted file mode 100644 index 8e3fbf1a1..000000000 --- a/employee-portal/src/lib/businessModules/schoolEntry/api/mutations/files.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Copyright 2025 cronn GmbH - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { useFileApi } from "@/lib/businessModules/schoolEntry/api/clients"; -import { - useDeleteFileTemplate, - useRequestFileDeletionTemplate, -} from "@/lib/shared/api/mutations/files"; - -export function useDeleteFile() { - return useDeleteFileTemplate(useFileApi); -} - -export function useRequestFileDeletion() { - return useRequestFileDeletionTemplate(useFileApi); -} diff --git a/employee-portal/src/lib/businessModules/schoolEntry/api/mutations/importApi.ts b/employee-portal/src/lib/businessModules/schoolEntry/api/mutations/importApi.ts index 807786cc0..bc5fe8376 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/api/mutations/importApi.ts +++ b/employee-portal/src/lib/businessModules/schoolEntry/api/mutations/importApi.ts @@ -3,22 +3,22 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { - ApiImportStatistics, - ImportCitizenListRequest, - ImportPastProcedureListRequest, - ImportSchoolListRequest, -} from "@eshg/employee-portal-api/schoolEntry"; +import { parseImportResult } from "@eshg/lib-employee-portal/helpers/import"; import { useHandledMutation } from "@eshg/lib-portal/api/useHandledMutation"; import { mapOptionalValue, mapRequiredValue, } from "@eshg/lib-portal/helpers/form"; +import { + ApiImportStatistics, + ImportCitizenListRequest, + ImportPastProcedureListRequest, + ImportSchoolListRequest, +} from "@eshg/school-entry-api"; import { useImportApi } from "@/lib/businessModules/schoolEntry/api/clients"; import { ImportDataValues } from "@/lib/businessModules/schoolEntry/features/procedures/importData/ImportDataSidebar"; import { ImportListType } from "@/lib/businessModules/schoolEntry/features/procedures/importData/importTypes"; -import { parseImportResult } from "@/lib/shared/helpers/import"; export function useImportData() { const importApi = useImportApi(); diff --git a/employee-portal/src/lib/businessModules/schoolEntry/api/mutations/labelsApi.ts b/employee-portal/src/lib/businessModules/schoolEntry/api/mutations/labelsApi.ts index c99a90f06..1bbb57437 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/api/mutations/labelsApi.ts +++ b/employee-portal/src/lib/businessModules/schoolEntry/api/mutations/labelsApi.ts @@ -3,13 +3,10 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { - CreateLabelRequest, - UpdateLabelRequest, -} from "@eshg/employee-portal-api/schoolEntry"; import { unwrapRawResponse } from "@eshg/lib-portal/api/unwrapRawResponse"; import { useHandledMutation } from "@eshg/lib-portal/api/useHandledMutation"; import { useSnackbar } from "@eshg/lib-portal/components/snackbar/SnackbarProvider"; +import { CreateLabelRequest, UpdateLabelRequest } from "@eshg/school-entry-api"; import { useLabelApi } from "@/lib/businessModules/schoolEntry/api/clients"; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/api/mutations/progressEntries.ts b/employee-portal/src/lib/businessModules/schoolEntry/api/mutations/progressEntries.ts deleted file mode 100644 index efc2b4a69..000000000 --- a/employee-portal/src/lib/businessModules/schoolEntry/api/mutations/progressEntries.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Copyright 2025 cronn GmbH - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { - useFileApi, - useProgressEntryApi, -} from "@/lib/businessModules/schoolEntry/api/clients"; -import { - useCreateProgressEntryTemplate, - useDeleteProgressEntryTemplate, - usePatchProgressEntryTemplate, - useRequestProgressEntryDeletionTemplate, -} from "@/lib/shared/api/mutations/progressEntries"; - -export function useCreateProgressEntry() { - return useCreateProgressEntryTemplate(useProgressEntryApi); -} - -export function useDeleteProgressEntry() { - return useDeleteProgressEntryTemplate(useProgressEntryApi); -} - -export function usePatchProgressEntry() { - return usePatchProgressEntryTemplate(useProgressEntryApi, useFileApi); -} - -export function useRequestProgressEntryDeletion() { - return useRequestProgressEntryDeletionTemplate(useProgressEntryApi); -} diff --git a/employee-portal/src/lib/businessModules/schoolEntry/api/mutations/schoolEntryApi.ts b/employee-portal/src/lib/businessModules/schoolEntry/api/mutations/schoolEntryApi.ts index cfee70098..39b7c5014 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/api/mutations/schoolEntryApi.ts +++ b/employee-portal/src/lib/businessModules/schoolEntry/api/mutations/schoolEntryApi.ts @@ -3,6 +3,9 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +import { unwrapRawResponse } from "@eshg/lib-portal/api/unwrapRawResponse"; +import { useHandledMutation } from "@eshg/lib-portal/api/useHandledMutation"; +import { useSnackbar } from "@eshg/lib-portal/components/snackbar/SnackbarProvider"; import { ApiAddCustodianRequest, ApiAnamnesis, @@ -30,10 +33,7 @@ import { UpdateProcedureRequest, UpdateSopessExaminationResultRequest, UpdateVaccinationStatusRequest, -} from "@eshg/employee-portal-api/schoolEntry"; -import { unwrapRawResponse } from "@eshg/lib-portal/api/unwrapRawResponse"; -import { useHandledMutation } from "@eshg/lib-portal/api/useHandledMutation"; -import { useSnackbar } from "@eshg/lib-portal/components/snackbar/SnackbarProvider"; +} from "@eshg/school-entry-api"; import { MutationOptions, useQueryClient } from "@tanstack/react-query"; import { useSchoolEntryApi } from "@/lib/businessModules/schoolEntry/api/clients"; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/api/queries/appointmentBlockApi.ts b/employee-portal/src/lib/businessModules/schoolEntry/api/queries/appointmentBlockApi.ts index f61a9bf20..7d19ed5da 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/api/queries/appointmentBlockApi.ts +++ b/employee-portal/src/lib/businessModules/schoolEntry/api/queries/appointmentBlockApi.ts @@ -3,17 +3,17 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +import { mapPaginatedList } from "@eshg/lib-employee-portal/api/models/PaginatedList"; +import { unwrapRawResponse } from "@eshg/lib-portal/api/unwrapRawResponse"; import { ApiCreateDailyAppointmentBlockGroupRequest, AppointmentBlockApi, GetAppointmentBlockGroupsRequest, -} from "@eshg/employee-portal-api/schoolEntry"; -import { unwrapRawResponse } from "@eshg/lib-portal/api/unwrapRawResponse"; +} from "@eshg/school-entry-api"; import { queryOptions, useQuery } from "@tanstack/react-query"; import { useAppointmentBlockApi } from "@/lib/businessModules/schoolEntry/api/clients"; import { mapAppointmentBlockGroup } from "@/lib/businessModules/schoolEntry/api/models/AppointmentBlockGroup"; -import { mapPaginatedList } from "@/lib/shared/api/models/PaginatedList"; import { appointmentBlockApiQueryKey } from "./apiQueryKeys"; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/api/queries/appointmentTypeApi.ts b/employee-portal/src/lib/businessModules/schoolEntry/api/queries/appointmentTypeApi.ts index 7ed811d40..522a78615 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/api/queries/appointmentTypeApi.ts +++ b/employee-portal/src/lib/businessModules/schoolEntry/api/queries/appointmentTypeApi.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { AppointmentTypeApi } from "@eshg/employee-portal-api/schoolEntry"; +import { AppointmentTypeApi } from "@eshg/school-entry-api"; import { queryOptions } from "@tanstack/react-query"; import { mapAppointmentTypeConfig } from "@/lib/businessModules/schoolEntry/api/models/AppointmentTypeConfig"; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/api/queries/configApi.ts b/employee-portal/src/lib/businessModules/schoolEntry/api/queries/configApi.ts index 01688e0bf..63823f728 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/api/queries/configApi.ts +++ b/employee-portal/src/lib/businessModules/schoolEntry/api/queries/configApi.ts @@ -3,11 +3,11 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +import { STATIC_QUERY_OPTIONS } from "@eshg/lib-portal/api/queryOptions"; import { ApiGetSchoolEntryConfigResponse, SchoolEntryConfigApi, -} from "@eshg/employee-portal-api/schoolEntry"; -import { STATIC_QUERY_OPTIONS } from "@eshg/lib-portal/api/queryOptions"; +} from "@eshg/school-entry-api"; import { queryOptions, useSuspenseQuery } from "@tanstack/react-query"; import { useConfigApi } from "@/lib/businessModules/schoolEntry/api/clients"; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/api/queries/countryCodesApi.ts b/employee-portal/src/lib/businessModules/schoolEntry/api/queries/countryCodesApi.ts index af39d568b..894e48287 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/api/queries/countryCodesApi.ts +++ b/employee-portal/src/lib/businessModules/schoolEntry/api/queries/countryCodesApi.ts @@ -3,8 +3,8 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { SchoolEntryCountryCodesApi } from "@eshg/employee-portal-api/schoolEntry"; import { STATIC_QUERY_OPTIONS } from "@eshg/lib-portal/api/queryOptions"; +import { SchoolEntryCountryCodesApi } from "@eshg/school-entry-api"; import { queryOptions } from "@tanstack/react-query"; import { mapCountryCodes } from "@/lib/businessModules/schoolEntry/api/models/CountryCodes"; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/api/queries/featureTogglesApi.ts b/employee-portal/src/lib/businessModules/schoolEntry/api/queries/featureTogglesApi.ts index b01fe6f0f..54866d0fc 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/api/queries/featureTogglesApi.ts +++ b/employee-portal/src/lib/businessModules/schoolEntry/api/queries/featureTogglesApi.ts @@ -3,10 +3,6 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { - ApiGetSchoolEntryFeatureTogglesResponse, - ApiSchoolEntryFeature, -} from "@eshg/employee-portal-api/schoolEntry"; import { FeatureToggleQueryOptions, selectDisabledOldFeature, @@ -14,6 +10,10 @@ import { useGetFeatureToggle, useGetFeatureToggleUnsuspended, } from "@eshg/lib-portal/api/featureToggles"; +import { + ApiGetSchoolEntryFeatureTogglesResponse, + ApiSchoolEntryFeature, +} from "@eshg/school-entry-api"; import { UseQueryResult } from "@tanstack/react-query"; import { useFeatureTogglesApi } from "@/lib/businessModules/schoolEntry/api/clients"; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/api/queries/files.ts b/employee-portal/src/lib/businessModules/schoolEntry/api/queries/files.ts deleted file mode 100644 index cfb9a6266..000000000 --- a/employee-portal/src/lib/businessModules/schoolEntry/api/queries/files.ts +++ /dev/null @@ -1,12 +0,0 @@ -/** - * Copyright 2025 cronn GmbH - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { useFileApi } from "@/lib/businessModules/schoolEntry/api/clients"; -import { fileApiQueryKey } from "@/lib/businessModules/schoolEntry/api/queries/apiQueryKeys"; -import { useGetMetaDataHistoryTemplate } from "@/lib/shared/api/queries/files"; - -export function useGetMetaDataHistory(fileId: string) { - return useGetMetaDataHistoryTemplate(useFileApi, fileApiQueryKey, fileId); -} diff --git a/employee-portal/src/lib/businessModules/schoolEntry/api/queries/progressEntries.ts b/employee-portal/src/lib/businessModules/schoolEntry/api/queries/progressEntries.ts deleted file mode 100644 index 90ecb23dc..000000000 --- a/employee-portal/src/lib/businessModules/schoolEntry/api/queries/progressEntries.ts +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Copyright 2025 cronn GmbH - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { ApiUserRole } from "@eshg/base-api"; - -import { - useProcedureApi, - useProgressEntryApi, -} from "@/lib/businessModules/schoolEntry/api/clients"; -import { progressEntryApiQueryKey } from "@/lib/businessModules/schoolEntry/api/queries/apiQueryKeys"; -import { - useFetchProgressEntriesTemplate, - useFetchProgressEntryDetailsTemplate, - useGetManualProgressEntryHistoryTemplate, -} from "@/lib/shared/api/queries/progressEntries"; -import { ProgressEntriesFilters } from "@/lib/shared/components/procedures/progress-entries/types"; - -export function useFetchProgressEntries( - procedureId: string, - leaderRole: ApiUserRole, - progressEntryFilter: ProgressEntriesFilters, -) { - return useFetchProgressEntriesTemplate( - useProgressEntryApi, - useProcedureApi, - progressEntryApiQueryKey, - procedureId, - leaderRole, - progressEntryFilter, - ); -} - -export function useFetchProgressEntryDetails( - procedureId: string, - entryId: string, -) { - return useFetchProgressEntryDetailsTemplate( - useProgressEntryApi, - progressEntryApiQueryKey, - procedureId, - entryId, - ); -} - -export function useGetManualProgressEntryHistory(entryId: string) { - return useGetManualProgressEntryHistoryTemplate( - useProgressEntryApi, - progressEntryApiQueryKey, - entryId, - ); -} diff --git a/employee-portal/src/lib/businessModules/schoolEntry/api/queries/schoolEntryApi.ts b/employee-portal/src/lib/businessModules/schoolEntry/api/queries/schoolEntryApi.ts index a21bf920f..e8dc7c92b 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/api/queries/schoolEntryApi.ts +++ b/employee-portal/src/lib/businessModules/schoolEntry/api/queries/schoolEntryApi.ts @@ -3,14 +3,15 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +import { mapPaginatedList } from "@eshg/lib-employee-portal/api/models/PaginatedList"; +import { unwrapRawResponse } from "@eshg/lib-portal/api/unwrapRawResponse"; +import { useHandledBackgroundQuery } from "@eshg/lib-portal/api/useHandledBackgroundQuery"; import { GetFreeAppointmentsForProcedureRequest, GetProceduresRequest, GetWaitingRoomProceduresRequest, SchoolEntryApi, -} from "@eshg/employee-portal-api/schoolEntry"; -import { unwrapRawResponse } from "@eshg/lib-portal/api/unwrapRawResponse"; -import { useHandledBackgroundQuery } from "@eshg/lib-portal/api/useHandledBackgroundQuery"; +} from "@eshg/school-entry-api"; import { queryOptions, useSuspenseQuery } from "@tanstack/react-query"; import { isDefined } from "remeda"; @@ -26,7 +27,6 @@ import { mapEyeExaminationResult } from "@/lib/businessModules/schoolEntry/api/m import { mapHearingTestResult } from "@/lib/businessModules/schoolEntry/api/models/examinations/HearingTestResult"; import { mapSopessExaminationResult } from "@/lib/businessModules/schoolEntry/api/models/examinations/SopessExaminationResult"; import { schoolEntryApiQueryKey } from "@/lib/businessModules/schoolEntry/api/queries/apiQueryKeys"; -import { mapPaginatedList } from "@/lib/shared/api/models/PaginatedList"; export function getProceduresQuery( schoolEntryApi: SchoolEntryApi, diff --git a/employee-portal/src/lib/businessModules/schoolEntry/api/queries/valueEvaluatorApi.ts b/employee-portal/src/lib/businessModules/schoolEntry/api/queries/valueEvaluatorApi.ts index 3914fdad6..4cbdb576a 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/api/queries/valueEvaluatorApi.ts +++ b/employee-portal/src/lib/businessModules/schoolEntry/api/queries/valueEvaluatorApi.ts @@ -3,8 +3,8 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { GetPercentilesRequest } from "@eshg/employee-portal-api/schoolEntry"; import { unwrapRawResponse } from "@eshg/lib-portal/api/unwrapRawResponse"; +import { GetPercentilesRequest } from "@eshg/school-entry-api"; import { useQuery } from "@tanstack/react-query"; import { useDebounce } from "use-debounce"; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/features/appointmentBlocks/appointmentBlocksGroupForm/AppointmentBlockGroupForm.tsx b/employee-portal/src/lib/businessModules/schoolEntry/features/appointmentBlocks/appointmentBlocksGroupForm/AppointmentBlockGroupForm.tsx index 42e0f8bf4..e7607af7d 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/features/appointmentBlocks/appointmentBlocksGroupForm/AppointmentBlockGroupForm.tsx +++ b/employee-portal/src/lib/businessModules/schoolEntry/features/appointmentBlocks/appointmentBlocksGroupForm/AppointmentBlockGroupForm.tsx @@ -4,8 +4,8 @@ */ import { ApiUser } from "@eshg/base-api"; -import { ApiLocationSelectionMode } from "@eshg/employee-portal-api/schoolEntry"; import { isEmptyString } from "@eshg/lib-portal/helpers/guards"; +import { ApiLocationSelectionMode } from "@eshg/school-entry-api"; import { Divider, Stack } from "@mui/joy"; import { Formik, FormikErrors } from "formik"; import { isDefined, isEmpty, mapToObj } from "remeda"; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/features/appointmentBlocks/appointmentBlocksGroupForm/CreateAppointmentBlockGroupForm.tsx b/employee-portal/src/lib/businessModules/schoolEntry/features/appointmentBlocks/appointmentBlocksGroupForm/CreateAppointmentBlockGroupForm.tsx index 99ae670e5..84173bcd0 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/features/appointmentBlocks/appointmentBlocksGroupForm/CreateAppointmentBlockGroupForm.tsx +++ b/employee-portal/src/lib/businessModules/schoolEntry/features/appointmentBlocks/appointmentBlocksGroupForm/CreateAppointmentBlockGroupForm.tsx @@ -6,17 +6,17 @@ "use client"; import { ApiAddContact200Response } from "@eshg/base-api"; -import { - ApiAppointmentType, - ApiCreateDailyAppointmentBlock, - ApiCreateDailyAppointmentBlockGroupRequest, -} from "@eshg/employee-portal-api/schoolEntry"; import { useSnackbar } from "@eshg/lib-portal/components/snackbar/SnackbarProvider"; import { mapOptionalValue, mapRequiredValue, } from "@eshg/lib-portal/helpers/form"; import { OptionalFieldValue } from "@eshg/lib-portal/types/form"; +import { + ApiAppointmentType, + ApiCreateDailyAppointmentBlock, + ApiCreateDailyAppointmentBlockGroupRequest, +} from "@eshg/school-entry-api"; import { useSuspenseQueries } from "@tanstack/react-query"; import { useRouter } from "next/navigation"; import { useEffect, useState } from "react"; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/features/appointmentBlocks/appointmentBlocksTable/AppointmentBlockGroupsTable.tsx b/employee-portal/src/lib/businessModules/schoolEntry/features/appointmentBlocks/appointmentBlocksTable/AppointmentBlockGroupsTable.tsx index 5f80c9288..6c09a6d3c 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/features/appointmentBlocks/appointmentBlocksTable/AppointmentBlockGroupsTable.tsx +++ b/employee-portal/src/lib/businessModules/schoolEntry/features/appointmentBlocks/appointmentBlocksTable/AppointmentBlockGroupsTable.tsx @@ -5,13 +5,13 @@ "use client"; +import { formatDateTime } from "@eshg/lib-portal/formatters/dateTime"; import { ApiAppointmentBlockSortKey, ApiAppointmentLocation, ApiAppointmentType, ApiLocationSelectionMode, -} from "@eshg/employee-portal-api/schoolEntry"; -import { formatDateTime } from "@eshg/lib-portal/formatters/dateTime"; +} from "@eshg/school-entry-api"; import { Chip } from "@mui/joy"; import { useSuspenseQueries } from "@tanstack/react-query"; import { diff --git a/employee-portal/src/lib/businessModules/schoolEntry/features/labels/CreateLabelSidebar.tsx b/employee-portal/src/lib/businessModules/schoolEntry/features/labels/CreateLabelSidebar.tsx index 6cf5f44cb..364543945 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/features/labels/CreateLabelSidebar.tsx +++ b/employee-portal/src/lib/businessModules/schoolEntry/features/labels/CreateLabelSidebar.tsx @@ -5,8 +5,8 @@ "use client"; -import { CreateLabelRequest } from "@eshg/employee-portal-api/schoolEntry"; import { mapOptionalValue } from "@eshg/lib-portal/helpers/form"; +import { CreateLabelRequest } from "@eshg/school-entry-api"; import { Formik } from "formik"; import { useCreateLabel } from "@/lib/businessModules/schoolEntry/api/mutations/labelsApi"; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/features/labels/UpdateLabelSidebar.tsx b/employee-portal/src/lib/businessModules/schoolEntry/features/labels/UpdateLabelSidebar.tsx index 25a966524..7e9527929 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/features/labels/UpdateLabelSidebar.tsx +++ b/employee-portal/src/lib/businessModules/schoolEntry/features/labels/UpdateLabelSidebar.tsx @@ -5,11 +5,11 @@ "use client"; -import { UpdateLabelRequest } from "@eshg/employee-portal-api/schoolEntry"; import { mapOptionalValue, parseOptionalValue, } from "@eshg/lib-portal/helpers/form"; +import { UpdateLabelRequest } from "@eshg/school-entry-api"; import { Formik } from "formik"; import { Label } from "@/lib/businessModules/schoolEntry/api/models/Label"; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/anamnesis/AnamnesisForm.tsx b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/anamnesis/AnamnesisForm.tsx index 8b558867d..f748f14eb 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/anamnesis/AnamnesisForm.tsx +++ b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/anamnesis/AnamnesisForm.tsx @@ -5,11 +5,6 @@ "use client"; -import { - ApiBooleanWithUnknown, - ApiSchoolEntryCountryCode, - UpdateAnamnesisRequest, -} from "@eshg/employee-portal-api/schoolEntry"; import { SoftRequiredBooleanSelectField } from "@eshg/lib-portal/businessModules/schoolEntry/features/procedures/fieldVariants"; import { BooleanSelectField } from "@eshg/lib-portal/components/formFields/BooleanSelectField"; import { HorizontalField } from "@eshg/lib-portal/components/formFields/HorizontalField"; @@ -21,6 +16,11 @@ import { import { createFieldNameMapper } from "@eshg/lib-portal/helpers/form"; import { FormProps, OptionalFieldValue } from "@eshg/lib-portal/types/form"; import { MutationBundle } from "@eshg/lib-portal/types/query"; +import { + ApiBooleanWithUnknown, + ApiSchoolEntryCountryCode, + UpdateAnamnesisRequest, +} from "@eshg/school-entry-api"; import { Divider, FormLabel, Stack } from "@mui/joy"; import { Formik } from "formik"; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/anamnesis/MigrationBackgroundForm.tsx b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/anamnesis/MigrationBackgroundForm.tsx index 7b8d53d00..94b143b80 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/anamnesis/MigrationBackgroundForm.tsx +++ b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/anamnesis/MigrationBackgroundForm.tsx @@ -5,7 +5,6 @@ "use client"; -import { ApiSchoolEntryCountryCode } from "@eshg/employee-portal-api/schoolEntry"; import { SoftRequiredBooleanSelectField } from "@eshg/lib-portal/businessModules/schoolEntry/features/procedures/fieldVariants"; import { HorizontalField } from "@eshg/lib-portal/components/formFields/HorizontalField"; import { MonthAndYearFields } from "@eshg/lib-portal/components/formFields/MonthAndYearFields"; @@ -15,6 +14,7 @@ import { NestedFormProps, SetFieldValueHelper, } from "@eshg/lib-portal/types/form"; +import { ApiSchoolEntryCountryCode } from "@eshg/school-entry-api"; import { FormLabel, Stack, Typography } from "@mui/joy"; import { SxProps } from "@mui/joy/styles/types"; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/developmentScreening/DevelopmentScreeningForm.tsx b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/developmentScreening/DevelopmentScreeningForm.tsx index cf9b6bf54..3482ed704 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/developmentScreening/DevelopmentScreeningForm.tsx +++ b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/developmentScreening/DevelopmentScreeningForm.tsx @@ -5,13 +5,13 @@ "use client"; +import { FormProps, OptionalFieldValue } from "@eshg/lib-portal/types/form"; +import { MutationBundle } from "@eshg/lib-portal/types/query"; import { ApiSchoolFeedback, ApiSchoolRecommendation, UpdateDevelopmentScreeningResultRequest, -} from "@eshg/employee-portal-api/schoolEntry"; -import { FormProps, OptionalFieldValue } from "@eshg/lib-portal/types/form"; -import { MutationBundle } from "@eshg/lib-portal/types/query"; +} from "@eshg/school-entry-api"; import { Divider } from "@mui/joy"; import { Formik, FormikHelpers } from "formik"; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/developmentScreening/HandicapFields.tsx b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/developmentScreening/HandicapFields.tsx index 1eb8979fa..3029e161e 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/developmentScreening/HandicapFields.tsx +++ b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/developmentScreening/HandicapFields.tsx @@ -3,7 +3,6 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiDisabilityType } from "@eshg/employee-portal-api/schoolEntry"; import { SoftRequiredSelectField } from "@eshg/lib-portal/businessModules/schoolEntry/features/procedures/fieldVariants"; import { createFieldNameMapper } from "@eshg/lib-portal/helpers/form"; import { @@ -11,6 +10,7 @@ import { OptionalFieldValue, SetFieldValueHelper, } from "@eshg/lib-portal/types/form"; +import { ApiDisabilityType } from "@eshg/school-entry-api"; import { Stack, Typography } from "@mui/joy"; import { SxProps } from "@mui/joy/styles/types"; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/developmentScreening/Icd10Sidebar.tsx b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/developmentScreening/Icd10Sidebar.tsx index 97153f206..814d8bb1e 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/developmentScreening/Icd10Sidebar.tsx +++ b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/developmentScreening/Icd10Sidebar.tsx @@ -8,6 +8,7 @@ import { ApiIcd10Code } from "@eshg/base-api"; import { Close, SearchOutlined } from "@mui/icons-material"; import { + Box, Button, Checkbox, FormControl, @@ -18,7 +19,8 @@ import { Table, styled, } from "@mui/joy"; -import { ChangeEvent, useState } from "react"; +import { SxProps } from "@mui/joy/styles/types"; +import { ChangeEvent, TdHTMLAttributes, useState } from "react"; import { useDebounce } from "use-debounce"; import { useSearchIcd10Codes } from "@/lib/baseModule/api/queries/icd10Codes"; @@ -51,6 +53,19 @@ const StyledTable = styled(Table)({ }, }); +function StyledTd({ + children, + ...props +}: Omit<TdHTMLAttributes<HTMLTableDataCellElement>, "style"> & { + sx?: SxProps; +}) { + return ( + <Box component={"td"} {...props}> + {children} + </Box> + ); +} + function Icd10Sidebar(props: Idc10SidebarProps) { const [selectedCodes, setSelectedCodes] = useState<string[]>( props.initiallySelectedCodes, @@ -130,7 +145,7 @@ function Icd10Sidebar(props: Idc10SidebarProps) { } }} > - <td style={{ width: "40px", paddingLeft: 0 }}> + <StyledTd sx={{ width: "40px", paddingLeft: 0 }}> <Checkbox checked={selectedCodes.includes(currentRowCode.code)} size="sm" @@ -142,26 +157,26 @@ function Icd10Sidebar(props: Idc10SidebarProps) { }, }} /> - </td> - <td + </StyledTd> + <StyledTd id={`${currentRowCode.code}-code`} - style={{ + sx={{ width: "72px", fontWeight: currentRowCode.isGroup ? "500" : "normal", whiteSpace: "nowrap", }} > {currentRowCode.code} - </td> - <td + </StyledTd> + <StyledTd id={`${currentRowCode.code}-title`} - style={{ + sx={{ paddingRight: 0, fontWeight: currentRowCode.isGroup ? "500" : "normal", }} > {currentRowCode.title} - </td> + </StyledTd> </tr> ))} </tbody> diff --git a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/developmentScreening/MeasurementFields.tsx b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/developmentScreening/MeasurementFields.tsx index 5837d7002..98438133b 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/developmentScreening/MeasurementFields.tsx +++ b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/developmentScreening/MeasurementFields.tsx @@ -5,7 +5,6 @@ "use client"; -import { GetPercentilesRequest } from "@eshg/employee-portal-api/schoolEntry"; import { SoftRequiredNumberField } from "@eshg/lib-portal/businessModules/schoolEntry/features/procedures/fieldVariants"; import { createFieldNameMapper, @@ -15,6 +14,7 @@ import { NestedFormProps, OptionalFieldValue, } from "@eshg/lib-portal/types/form"; +import { GetPercentilesRequest } from "@eshg/school-entry-api"; import { Stack, Typography } from "@mui/joy"; import { SxProps } from "@mui/joy/styles/types/theme"; import { FormikErrors } from "formik"; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/developmentScreening/PhysicalExaminationFields.tsx b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/developmentScreening/PhysicalExaminationFields.tsx index b3f99b35c..20d8bf45c 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/developmentScreening/PhysicalExaminationFields.tsx +++ b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/developmentScreening/PhysicalExaminationFields.tsx @@ -3,15 +3,15 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { - ApiDoctorLetterValue, - ApiExaminationResultValue, -} from "@eshg/employee-portal-api/schoolEntry"; import { createFieldNameMapper } from "@eshg/lib-portal/helpers/form"; import { NestedFormProps, SetFieldValueHelper, } from "@eshg/lib-portal/types/form"; +import { + ApiDoctorLetterValue, + ApiExaminationResultValue, +} from "@eshg/school-entry-api"; import { Stack, Typography } from "@mui/joy"; import { diff --git a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/examinations/ExaminationResultFields.tsx b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/examinations/ExaminationResultFields.tsx index 18567446c..8823c5057 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/examinations/ExaminationResultFields.tsx +++ b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/examinations/ExaminationResultFields.tsx @@ -3,10 +3,6 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { - ApiDoctorLetterValue, - ApiExaminationResultValue, -} from "@eshg/employee-portal-api/schoolEntry"; import { createFieldNameMapper, mapOptionalValue, @@ -15,6 +11,10 @@ import { OptionalFieldValue, SetFieldValueHelper, } from "@eshg/lib-portal/types/form"; +import { + ApiDoctorLetterValue, + ApiExaminationResultValue, +} from "@eshg/school-entry-api"; import { Grid } from "@mui/joy"; import { isDefined } from "remeda"; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/examinations/ExaminationWithDiagnosisFields.tsx b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/examinations/ExaminationWithDiagnosisFields.tsx index bdcdb9415..4c8d77b22 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/examinations/ExaminationWithDiagnosisFields.tsx +++ b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/examinations/ExaminationWithDiagnosisFields.tsx @@ -3,15 +3,15 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { - ApiDoctorLetterValue, - ApiExaminationResultValue, -} from "@eshg/employee-portal-api/schoolEntry"; import { createFieldNameMapper } from "@eshg/lib-portal/helpers/form"; import { OptionalFieldValue, SetFieldValueHelper, } from "@eshg/lib-portal/types/form"; +import { + ApiDoctorLetterValue, + ApiExaminationResultValue, +} from "@eshg/school-entry-api"; import { Stack } from "@mui/joy"; import { SxProps } from "@mui/joy/styles/types"; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/examinations/RequiredProcedureDataModal.tsx b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/examinations/RequiredProcedureDataModal.tsx index 89fdd63d7..3177b0e4e 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/examinations/RequiredProcedureDataModal.tsx +++ b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/examinations/RequiredProcedureDataModal.tsx @@ -3,11 +3,11 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiRequiredProcedureData } from "@eshg/employee-portal-api/schoolEntry"; import { BaseModal, BaseModalProps, } from "@eshg/lib-portal/components/BaseModal"; +import { ApiRequiredProcedureData } from "@eshg/school-entry-api"; import { Typography } from "@mui/joy"; import { REQUIRED_PROCEDURE_DATA } from "@/lib/businessModules/schoolEntry/features/procedures/translations"; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/examinations/ResponseDoctorLetterField.tsx b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/examinations/ResponseDoctorLetterField.tsx index e6073b868..2b978e44a 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/examinations/ResponseDoctorLetterField.tsx +++ b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/examinations/ResponseDoctorLetterField.tsx @@ -3,12 +3,12 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiExaminationResultValue } from "@eshg/employee-portal-api/schoolEntry"; import { SoftRequiredSelectField, SoftRequiredSelectFieldProps, } from "@eshg/lib-portal/businessModules/schoolEntry/features/procedures/fieldVariants"; import { OptionalFieldValue } from "@eshg/lib-portal/types/form"; +import { ApiExaminationResultValue } from "@eshg/school-entry-api"; import { RESPONSE_DOCTOR_LETTER_OPTIONS } from "@/lib/businessModules/schoolEntry/features/procedures/options"; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/examinations/examinationResultHelpers.ts b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/examinations/examinationResultHelpers.ts index 7e8f9bc4f..3caf4bd76 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/examinations/examinationResultHelpers.ts +++ b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/examinations/examinationResultHelpers.ts @@ -3,14 +3,14 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +import { SelectFieldOption } from "@eshg/lib-portal/components/formFields/SelectField"; +import { parseOptionalValue } from "@eshg/lib-portal/helpers/form"; +import { SetFieldValueHelper } from "@eshg/lib-portal/types/form"; import { ApiDoctorLetterValue, ApiExaminationResult, ApiExaminationResultValue, -} from "@eshg/employee-portal-api/schoolEntry"; -import { SelectFieldOption } from "@eshg/lib-portal/components/formFields/SelectField"; -import { parseOptionalValue } from "@eshg/lib-portal/helpers/form"; -import { SetFieldValueHelper } from "@eshg/lib-portal/types/form"; +} from "@eshg/school-entry-api"; import { SxProps } from "@mui/joy/styles/types"; import { isDefined } from "remeda"; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/eyeExamination/EyeExaminationForm.tsx b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/eyeExamination/EyeExaminationForm.tsx index 382433f0b..125489865 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/eyeExamination/EyeExaminationForm.tsx +++ b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/eyeExamination/EyeExaminationForm.tsx @@ -5,18 +5,18 @@ "use client"; -import { - ApiDoctorLetterValue, - ApiEyeExaminationType, - ApiPercentageValue, - UpdateEyeExaminationResultRequest, -} from "@eshg/employee-portal-api/schoolEntry"; import { FormProps, OptionalFieldValue, SetFieldValueHelper, } from "@eshg/lib-portal/types/form"; import { MutationBundle } from "@eshg/lib-portal/types/query"; +import { + ApiDoctorLetterValue, + ApiEyeExaminationType, + ApiPercentageValue, + UpdateEyeExaminationResultRequest, +} from "@eshg/school-entry-api"; import { Divider, Grid, Stack } from "@mui/joy"; import { Formik, FormikHelpers } from "formik"; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/hearingTest/EarForm.tsx b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/hearingTest/EarForm.tsx index 9a216712c..83d1bae7b 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/hearingTest/EarForm.tsx +++ b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/hearingTest/EarForm.tsx @@ -3,11 +3,8 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { - ApiDecibelValue, - ApiHertzValue, -} from "@eshg/employee-portal-api/schoolEntry"; import { createFieldNameMapper } from "@eshg/lib-portal/helpers/form"; +import { ApiDecibelValue, ApiHertzValue } from "@eshg/school-entry-api"; import { Stack } from "@mui/joy"; import { ExaminationFormProps } from "@/lib/businessModules/schoolEntry/features/procedures/examinations/ExaminationFormProps"; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/hearingTest/HearingTestForm.tsx b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/hearingTest/HearingTestForm.tsx index 05f015d71..6b2afbe74 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/hearingTest/HearingTestForm.tsx +++ b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/hearingTest/HearingTestForm.tsx @@ -5,13 +5,13 @@ "use client"; +import { FormProps, OptionalFieldValue } from "@eshg/lib-portal/types/form"; +import { MutationBundle } from "@eshg/lib-portal/types/query"; import { ApiDecibelValue, ApiHertzValue, UpdateHearingTestResultRequest, -} from "@eshg/employee-portal-api/schoolEntry"; -import { FormProps, OptionalFieldValue } from "@eshg/lib-portal/types/form"; -import { MutationBundle } from "@eshg/lib-portal/types/query"; +} from "@eshg/school-entry-api"; import { Divider, Grid } from "@mui/joy"; import { Formik, FormikHelpers } from "formik"; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/importData/ImportDataFields.tsx b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/importData/ImportDataFields.tsx index e2588199c..7b6fd182b 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/importData/ImportDataFields.tsx +++ b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/importData/ImportDataFields.tsx @@ -4,7 +4,6 @@ */ import { ApiContactCategory, ApiResponse } from "@eshg/base-api"; -import { ApiLocationSelectionMode } from "@eshg/employee-portal-api/schoolEntry"; import { useFileDownload } from "@eshg/lib-portal/api/files/download"; import { ButtonLink } from "@eshg/lib-portal/components/buttons/ButtonLink"; import { RadioGroupField } from "@eshg/lib-portal/components/formFields/RadioGroupField"; @@ -12,6 +11,7 @@ import { FileType } from "@eshg/lib-portal/components/formFields/file/FileType"; import { InternalLinkButton } from "@eshg/lib-portal/components/navigation/InternalLinkButton"; import { SetFieldValueHelper } from "@eshg/lib-portal/types/form"; import { EnumMap } from "@eshg/lib-portal/types/helpers"; +import { ApiLocationSelectionMode } from "@eshg/school-entry-api"; import { FileDownload } from "@mui/icons-material"; import AddIcon from "@mui/icons-material/Add"; import { Stack } from "@mui/joy"; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/new/CreateProcedureSidebar.tsx b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/new/CreateProcedureSidebar.tsx index ddac4f51e..e388bcd62 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/new/CreateProcedureSidebar.tsx +++ b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/new/CreateProcedureSidebar.tsx @@ -5,14 +5,14 @@ "use client"; +import { SelectField } from "@eshg/lib-portal/components/formFields/SelectField"; +import { mapRequiredValue } from "@eshg/lib-portal/helpers/form"; +import { OptionalFieldValue } from "@eshg/lib-portal/types/form"; import { ApiCreatePerson, ApiCreateProcedureRequest, ApiSchoolEntryProcedureType, -} from "@eshg/employee-portal-api/schoolEntry"; -import { SelectField } from "@eshg/lib-portal/components/formFields/SelectField"; -import { mapRequiredValue } from "@eshg/lib-portal/helpers/form"; -import { OptionalFieldValue } from "@eshg/lib-portal/types/form"; +} from "@eshg/school-entry-api"; import { Add } from "@mui/icons-material"; import { Button } from "@mui/joy"; import { useRouter } from "next/navigation"; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/new/ProcedureCard.tsx b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/new/ProcedureCard.tsx index b4b82596d..c15d6fe33 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/new/ProcedureCard.tsx +++ b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/new/ProcedureCard.tsx @@ -3,10 +3,10 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiProcedureDetails } from "@eshg/employee-portal-api/schoolEntry"; import { Row } from "@eshg/lib-portal/components/Row"; import { InternalLinkIconButton } from "@eshg/lib-portal/components/navigation/InternalLinkIconButton"; import { formatDate } from "@eshg/lib-portal/formatters/dateTime"; +import { ApiProcedureDetails } from "@eshg/school-entry-api"; import OpenInNewIcon from "@mui/icons-material/OpenInNew"; import { Chip, Grid, Sheet, Typography } from "@mui/joy"; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/options.ts b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/options.ts index a413ccc55..aa3bea076 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/options.ts +++ b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/options.ts @@ -3,11 +3,11 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +import { buildEnumOptions } from "@eshg/lib-portal/helpers/form"; import { ApiAppointmentType, ApiSchoolEntryProcedureType, -} from "@eshg/employee-portal-api/schoolEntry"; -import { buildEnumOptions } from "@eshg/lib-portal/helpers/form"; +} from "@eshg/school-entry-api"; import { isDraft } from "@/lib/businessModules/schoolEntry/features/procedures/procedureDetails/options"; import { diff --git a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/procedureDetails/AddCustodianPanel.tsx b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/procedureDetails/AddCustodianPanel.tsx index c133d16ec..551af3b40 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/procedureDetails/AddCustodianPanel.tsx +++ b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/procedureDetails/AddCustodianPanel.tsx @@ -4,7 +4,7 @@ */ import { ApiGetReferencePersonResponse } from "@eshg/base-api"; -import { ApiAddCustodianRequest } from "@eshg/employee-portal-api/schoolEntry"; +import { ApiAddCustodianRequest } from "@eshg/school-entry-api"; import AddIcon from "@mui/icons-material/Add"; import { Button } from "@mui/joy"; import { useRef, useState } from "react"; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/procedureDetails/ProcedureDetails.tsx b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/procedureDetails/ProcedureDetails.tsx index e4414ae20..b66a9a250 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/procedureDetails/ProcedureDetails.tsx +++ b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/procedureDetails/ProcedureDetails.tsx @@ -5,8 +5,8 @@ "use client"; -import { ApiLocationSelectionMode } from "@eshg/employee-portal-api/schoolEntry"; import { useControlledAlert } from "@eshg/lib-portal/errorHandling/AlertContext"; +import { ApiLocationSelectionMode } from "@eshg/school-entry-api"; import { Grid, Stack } from "@mui/joy"; import { isDefined } from "remeda"; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/procedureDetails/ProcedureDetailsSection.tsx b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/procedureDetails/ProcedureDetailsSection.tsx index d9339eb7b..370ba9e30 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/procedureDetails/ProcedureDetailsSection.tsx +++ b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/procedureDetails/ProcedureDetailsSection.tsx @@ -3,11 +3,11 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiLocationSelectionMode } from "@eshg/employee-portal-api/schoolEntry"; import { formatDate, formatDateTime, } from "@eshg/lib-portal/formatters/dateTime"; +import { ApiLocationSelectionMode } from "@eshg/school-entry-api"; import { Divider, Stack } from "@mui/joy"; import { isDefined } from "remeda"; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/procedureDetails/UpdateProcedureSidebar.tsx b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/procedureDetails/UpdateProcedureSidebar.tsx index 62bc68a5e..4001b4936 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/procedureDetails/UpdateProcedureSidebar.tsx +++ b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/procedureDetails/UpdateProcedureSidebar.tsx @@ -4,12 +4,6 @@ */ import { ApiContactCategory } from "@eshg/base-api"; -import { - ApiAppointment, - ApiLocationSelectionMode, - ApiSchoolEntryProcedureType, - UpdateProcedureRequest, -} from "@eshg/employee-portal-api/schoolEntry"; import { Alert, AlertProps } from "@eshg/lib-portal/components/Alert"; import { DateField } from "@eshg/lib-portal/components/formFields/DateField"; import { HorizontalField } from "@eshg/lib-portal/components/formFields/HorizontalField"; @@ -28,6 +22,12 @@ import { isEmptyString } from "@eshg/lib-portal/helpers/guards"; import { validatePastOrTodayDate } from "@eshg/lib-portal/helpers/validators"; import { useHasChanged } from "@eshg/lib-portal/hooks/useHasChanged"; import { OptionalFieldValue } from "@eshg/lib-portal/types/form"; +import { + ApiAppointment, + ApiLocationSelectionMode, + ApiSchoolEntryProcedureType, + UpdateProcedureRequest, +} from "@eshg/school-entry-api"; import { Divider, Stack } from "@mui/joy"; import { FormikProvider, useFormik } from "formik"; import { ReactNode, useEffect } from "react"; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/procedureDetails/WaitingRoomPanel.tsx b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/procedureDetails/WaitingRoomPanel.tsx index 89ab0e3a2..c5fcfe625 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/procedureDetails/WaitingRoomPanel.tsx +++ b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/procedureDetails/WaitingRoomPanel.tsx @@ -3,10 +3,6 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { - ApiWaitingRoom, - ApiWaitingStatus, -} from "@eshg/employee-portal-api/schoolEntry"; import { SubmitButton } from "@eshg/lib-portal/components/buttons/SubmitButton"; import { SelectField } from "@eshg/lib-portal/components/formFields/SelectField"; import { @@ -18,6 +14,7 @@ import { OptionalFieldValue, SetFieldValueHelper, } from "@eshg/lib-portal/types/form"; +import { ApiWaitingRoom, ApiWaitingStatus } from "@eshg/school-entry-api"; import { Button } from "@mui/joy"; import { Formik } from "formik"; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/procedureDetails/options.ts b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/procedureDetails/options.ts index 3ee347f3f..1f9a5cbd4 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/procedureDetails/options.ts +++ b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/procedureDetails/options.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiSchoolEntryProcedureType } from "@eshg/employee-portal-api/schoolEntry"; +import { ApiSchoolEntryProcedureType } from "@eshg/school-entry-api"; export function isDraft(type: string) { return ( diff --git a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/proceduresTable/ProcedureFilterSettings.tsx b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/proceduresTable/ProcedureFilterSettings.tsx index 80eece686..ddf2a7e25 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/proceduresTable/ProcedureFilterSettings.tsx +++ b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/proceduresTable/ProcedureFilterSettings.tsx @@ -3,13 +3,13 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { GetProceduresRequest } from "@eshg/employee-portal-api/schoolEntry"; import { SelectOptions } from "@eshg/lib-portal/components/formFields/SelectOptions"; import { isDateString, toDateString, toUtcDate, } from "@eshg/lib-portal/helpers/dateTime"; +import { GetProceduresRequest } from "@eshg/school-entry-api"; import { FormControl, FormLabel, Input, Select } from "@mui/joy"; import { isDefined, isEmpty } from "remeda"; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/proceduresTable/ProceduresTable.tsx b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/proceduresTable/ProceduresTable.tsx index 47bcb2607..6904a6c94 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/proceduresTable/ProceduresTable.tsx +++ b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/proceduresTable/ProceduresTable.tsx @@ -6,12 +6,12 @@ "use client"; import { ApiBusinessModule } from "@eshg/employee-portal-api/businessProcedures"; -import { ApiSchoolEntryProcedureSortKey } from "@eshg/employee-portal-api/schoolEntry"; import { formatDate, formatDateTime, } from "@eshg/lib-portal/formatters/dateTime"; import { useToggleableState } from "@eshg/lib-portal/hooks/useToggleableState"; +import { ApiSchoolEntryProcedureSortKey } from "@eshg/school-entry-api"; import { Chip, Stack } from "@mui/joy"; import { useSuspenseQueries } from "@tanstack/react-query"; import { diff --git a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/proceduresTable/bulkCreateAppointments/useBulkAppointmentCreationMessage.tsx b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/proceduresTable/bulkCreateAppointments/useBulkAppointmentCreationMessage.tsx index 9f706c540..d6d20cfd1 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/proceduresTable/bulkCreateAppointments/useBulkAppointmentCreationMessage.tsx +++ b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/proceduresTable/bulkCreateAppointments/useBulkAppointmentCreationMessage.tsx @@ -3,9 +3,9 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiCreateAppointmentsBulkResponse } from "@eshg/employee-portal-api/schoolEntry"; import { useSnackbar } from "@eshg/lib-portal/components/snackbar/SnackbarProvider"; import { useAlert } from "@eshg/lib-portal/errorHandling/AlertContext"; +import { ApiCreateAppointmentsBulkResponse } from "@eshg/school-entry-api"; interface UseBulkAppointmentCreationMessageResult { open: (response: ApiCreateAppointmentsBulkResponse) => void; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/proceduresTable/bulkDownloadInvitations/useBulkDownloadInvitations.ts b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/proceduresTable/bulkDownloadInvitations/useBulkDownloadInvitations.ts index 12cc09b27..8852f5872 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/proceduresTable/bulkDownloadInvitations/useBulkDownloadInvitations.ts +++ b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/proceduresTable/bulkDownloadInvitations/useBulkDownloadInvitations.ts @@ -3,8 +3,8 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { DownloadInvitationsRequest } from "@eshg/employee-portal-api/schoolEntry"; import { useFileDownload } from "@eshg/lib-portal/api/files/download"; +import { DownloadInvitationsRequest } from "@eshg/school-entry-api"; import { useState } from "react"; import { doNothing } from "remeda"; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/reports/SchoolInfoLetterSidebar.tsx b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/reports/SchoolInfoLetterSidebar.tsx index 511dd15ce..3a304ab5b 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/reports/SchoolInfoLetterSidebar.tsx +++ b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/reports/SchoolInfoLetterSidebar.tsx @@ -3,11 +3,11 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiCreateSchoolInfoLetterRequest } from "@eshg/employee-portal-api/schoolEntry"; import { useFileDownload } from "@eshg/lib-portal/api/files/download"; import { SubmitButton } from "@eshg/lib-portal/components/buttons/SubmitButton"; import { mapOptionalValue } from "@eshg/lib-portal/helpers/form"; import { OptionalFieldValue } from "@eshg/lib-portal/types/form"; +import { ApiCreateSchoolInfoLetterRequest } from "@eshg/school-entry-api"; import { Button, Divider, Stack, Typography } from "@mui/joy"; import { Formik } from "formik"; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/sopessExamination/ArticulationForm.tsx b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/sopessExamination/ArticulationForm.tsx index 6b259487d..622b3576f 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/sopessExamination/ArticulationForm.tsx +++ b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/sopessExamination/ArticulationForm.tsx @@ -3,7 +3,6 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiArticulationValue } from "@eshg/employee-portal-api/schoolEntry"; import { useIsFormDisabled } from "@eshg/lib-portal/components/form/DisabledFormContext"; import { createFieldNameMapper } from "@eshg/lib-portal/helpers/form"; import { isEmptyString } from "@eshg/lib-portal/helpers/guards"; @@ -11,6 +10,7 @@ import { OptionalFieldValue, SetFieldValueHelper, } from "@eshg/lib-portal/types/form"; +import { ApiArticulationValue } from "@eshg/school-entry-api"; import { Button, Stack, Typography } from "@mui/joy"; import { StatusChip } from "@/lib/businessModules/schoolEntry/features/procedures/examinations/StatusChip"; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/sopessExamination/BodyCoordinationForm.tsx b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/sopessExamination/BodyCoordinationForm.tsx index 2ab6bae83..39fef80d1 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/sopessExamination/BodyCoordinationForm.tsx +++ b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/sopessExamination/BodyCoordinationForm.tsx @@ -3,16 +3,16 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { - ApiDoctorLetterValue, - ApiSopessExaminationResultValue, -} from "@eshg/employee-portal-api/schoolEntry"; import { SoftRequiredNumberField } from "@eshg/lib-portal/businessModules/schoolEntry/features/procedures/fieldVariants"; import { createFieldNameMapper } from "@eshg/lib-portal/helpers/form"; import { OptionalFieldValue, SetFieldValueHelper, } from "@eshg/lib-portal/types/form"; +import { + ApiDoctorLetterValue, + ApiSopessExaminationResultValue, +} from "@eshg/school-entry-api"; import { Stack } from "@mui/joy"; import { StatusChip } from "@/lib/businessModules/schoolEntry/features/procedures/examinations/StatusChip"; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/sopessExamination/LanguageForm.tsx b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/sopessExamination/LanguageForm.tsx index fc5098427..dbbb326a6 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/sopessExamination/LanguageForm.tsx +++ b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/sopessExamination/LanguageForm.tsx @@ -3,9 +3,9 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiPrimaryLanguageValue } from "@eshg/employee-portal-api/schoolEntry"; import { SoftRequiredSelectField } from "@eshg/lib-portal/businessModules/schoolEntry/features/procedures/fieldVariants"; import { createFieldNameMapper } from "@eshg/lib-portal/helpers/form"; +import { ApiPrimaryLanguageValue } from "@eshg/school-entry-api"; import { Stack, Typography } from "@mui/joy"; import { SxProps } from "@mui/joy/styles/types"; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/sopessExamination/PluralForm.tsx b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/sopessExamination/PluralForm.tsx index 491ae6ed5..44001f7fd 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/sopessExamination/PluralForm.tsx +++ b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/sopessExamination/PluralForm.tsx @@ -3,13 +3,13 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiSopessExaminationResultValue } from "@eshg/employee-portal-api/schoolEntry"; import { SoftRequiredNumberField } from "@eshg/lib-portal/businessModules/schoolEntry/features/procedures/fieldVariants"; import { createFieldNameMapper } from "@eshg/lib-portal/helpers/form"; import { OptionalFieldValue, SetFieldValueHelper, } from "@eshg/lib-portal/types/form"; +import { ApiSopessExaminationResultValue } from "@eshg/school-entry-api"; import { Stack } from "@mui/joy"; import { StatusChip } from "@/lib/businessModules/schoolEntry/features/procedures/examinations/StatusChip"; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/sopessExamination/PseudowordForm.tsx b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/sopessExamination/PseudowordForm.tsx index 7838ca14c..e35b6a1a1 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/sopessExamination/PseudowordForm.tsx +++ b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/sopessExamination/PseudowordForm.tsx @@ -3,13 +3,13 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiSopessExaminationResultValue } from "@eshg/employee-portal-api/schoolEntry"; import { SoftRequiredNumberField } from "@eshg/lib-portal/businessModules/schoolEntry/features/procedures/fieldVariants"; import { createFieldNameMapper } from "@eshg/lib-portal/helpers/form"; import { OptionalFieldValue, SetFieldValueHelper, } from "@eshg/lib-portal/types/form"; +import { ApiSopessExaminationResultValue } from "@eshg/school-entry-api"; import { Stack } from "@mui/joy"; import { StatusChip } from "@/lib/businessModules/schoolEntry/features/procedures/examinations/StatusChip"; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/sopessExamination/QuantityKnowledgeForm.tsx b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/sopessExamination/QuantityKnowledgeForm.tsx index 312f35392..5596a5a9b 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/sopessExamination/QuantityKnowledgeForm.tsx +++ b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/sopessExamination/QuantityKnowledgeForm.tsx @@ -3,13 +3,13 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiSopessExaminationResultValue } from "@eshg/employee-portal-api/schoolEntry"; import { SoftRequiredNumberField } from "@eshg/lib-portal/businessModules/schoolEntry/features/procedures/fieldVariants"; import { createFieldNameMapper } from "@eshg/lib-portal/helpers/form"; import { OptionalFieldValue, SetFieldValueHelper, } from "@eshg/lib-portal/types/form"; +import { ApiSopessExaminationResultValue } from "@eshg/school-entry-api"; import { Stack } from "@mui/joy"; import { StatusChip } from "@/lib/businessModules/schoolEntry/features/procedures/examinations/StatusChip"; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/sopessExamination/SelectiveAttentionForm.tsx b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/sopessExamination/SelectiveAttentionForm.tsx index a918ba863..cb577a16f 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/sopessExamination/SelectiveAttentionForm.tsx +++ b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/sopessExamination/SelectiveAttentionForm.tsx @@ -3,16 +3,16 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { - ApiDoctorLetterValue, - ApiSopessExaminationResultValue, -} from "@eshg/employee-portal-api/schoolEntry"; import { SoftRequiredNumberField } from "@eshg/lib-portal/businessModules/schoolEntry/features/procedures/fieldVariants"; import { createFieldNameMapper } from "@eshg/lib-portal/helpers/form"; import { OptionalFieldValue, SetFieldValueHelper, } from "@eshg/lib-portal/types/form"; +import { + ApiDoctorLetterValue, + ApiSopessExaminationResultValue, +} from "@eshg/school-entry-api"; import { Stack } from "@mui/joy"; import { StatusChip } from "@/lib/businessModules/schoolEntry/features/procedures/examinations/StatusChip"; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/sopessExamination/SopessExaminationFields.tsx b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/sopessExamination/SopessExaminationFields.tsx index 5db4edfa3..2470d8ceb 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/sopessExamination/SopessExaminationFields.tsx +++ b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/sopessExamination/SopessExaminationFields.tsx @@ -3,15 +3,15 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { - ApiDoctorLetterValue, - ApiSopessExaminationResultValue, -} from "@eshg/employee-portal-api/schoolEntry"; import { SoftRequiredSelectField } from "@eshg/lib-portal/businessModules/schoolEntry/features/procedures/fieldVariants"; import { OptionalFieldValue, SetFieldValueHelper, } from "@eshg/lib-portal/types/form"; +import { + ApiDoctorLetterValue, + ApiSopessExaminationResultValue, +} from "@eshg/school-entry-api"; import { FIXED_WIDTH_STYLE, diff --git a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/sopessExamination/SopessExaminationForm.tsx b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/sopessExamination/SopessExaminationForm.tsx index fc5120768..111741362 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/sopessExamination/SopessExaminationForm.tsx +++ b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/sopessExamination/SopessExaminationForm.tsx @@ -5,6 +5,9 @@ "use client"; +import { isEmptyString } from "@eshg/lib-portal/helpers/guards"; +import { FormProps, OptionalFieldValue } from "@eshg/lib-portal/types/form"; +import { MutationBundle } from "@eshg/lib-portal/types/query"; import { ApiArticulationValue, ApiDoctorLetterValue, @@ -15,10 +18,7 @@ import { ApiPrimaryLanguageValue, ApiSopessExaminationResultValue, UpdateSopessExaminationResultRequest, -} from "@eshg/employee-portal-api/schoolEntry"; -import { isEmptyString } from "@eshg/lib-portal/helpers/guards"; -import { FormProps, OptionalFieldValue } from "@eshg/lib-portal/types/form"; -import { MutationBundle } from "@eshg/lib-portal/types/query"; +} from "@eshg/school-entry-api"; import { Divider, Stack } from "@mui/joy"; import { Formik, FormikHelpers } from "formik"; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/sopessExamination/VisualPerceptionForm.tsx b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/sopessExamination/VisualPerceptionForm.tsx index 2d5846d12..10a577f7f 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/sopessExamination/VisualPerceptionForm.tsx +++ b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/sopessExamination/VisualPerceptionForm.tsx @@ -3,16 +3,16 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { - ApiDoctorLetterValue, - ApiSopessExaminationResultValue, -} from "@eshg/employee-portal-api/schoolEntry"; import { SoftRequiredNumberField } from "@eshg/lib-portal/businessModules/schoolEntry/features/procedures/fieldVariants"; import { createFieldNameMapper } from "@eshg/lib-portal/helpers/form"; import { OptionalFieldValue, SetFieldValueHelper, } from "@eshg/lib-portal/types/form"; +import { + ApiDoctorLetterValue, + ApiSopessExaminationResultValue, +} from "@eshg/school-entry-api"; import { Stack } from "@mui/joy"; import { StatusChip } from "@/lib/businessModules/schoolEntry/features/procedures/examinations/StatusChip"; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/sopessExamination/VisuoMotorSkillsForm.tsx b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/sopessExamination/VisuoMotorSkillsForm.tsx index 7f23cdb2c..0aef80604 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/sopessExamination/VisuoMotorSkillsForm.tsx +++ b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/sopessExamination/VisuoMotorSkillsForm.tsx @@ -3,16 +3,16 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { - ApiDoctorLetterValue, - ApiSopessExaminationResultValue, -} from "@eshg/employee-portal-api/schoolEntry"; import { SoftRequiredNumberField } from "@eshg/lib-portal/businessModules/schoolEntry/features/procedures/fieldVariants"; import { createFieldNameMapper } from "@eshg/lib-portal/helpers/form"; import { OptionalFieldValue, SetFieldValueHelper, } from "@eshg/lib-portal/types/form"; +import { + ApiDoctorLetterValue, + ApiSopessExaminationResultValue, +} from "@eshg/school-entry-api"; import { Stack } from "@mui/joy"; import { StatusChip } from "@/lib/businessModules/schoolEntry/features/procedures/examinations/StatusChip"; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/translations.ts b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/translations.ts index fe0411a22..a776d0ca4 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/translations.ts +++ b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/translations.ts @@ -3,6 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +import { EnumMap } from "@eshg/lib-portal/types/helpers"; import { ApiAppointmentType, ApiArticulationValue, @@ -29,8 +30,7 @@ import { ApiSopessExaminationResultValue, ApiVaccinationSchemeValue, ApiWaitingStatus, -} from "@eshg/employee-portal-api/schoolEntry"; -import { EnumMap } from "@eshg/lib-portal/types/helpers"; +} from "@eshg/school-entry-api"; export const PROCEDURE_TYPES: EnumMap<ApiSchoolEntryProcedureType> = { [ApiSchoolEntryProcedureType.DraftCitizenOfficeImport]: diff --git a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/vaccination/VaccinationForm.tsx b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/vaccination/VaccinationForm.tsx index 5f5fde8b9..026fd4445 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/vaccination/VaccinationForm.tsx +++ b/employee-portal/src/lib/businessModules/schoolEntry/features/procedures/vaccination/VaccinationForm.tsx @@ -5,11 +5,6 @@ "use client"; -import { - ApiBooleanWithUnknown, - ApiVaccinationSchemeValue, - UpdateVaccinationStatusRequest, -} from "@eshg/employee-portal-api/schoolEntry"; import { SoftRequiredBooleanSelectField, SoftRequiredSelectField, @@ -28,6 +23,11 @@ import { SetFieldValueHelper, } from "@eshg/lib-portal/types/form"; import { MutationBundle } from "@eshg/lib-portal/types/query"; +import { + ApiBooleanWithUnknown, + ApiVaccinationSchemeValue, + UpdateVaccinationStatusRequest, +} from "@eshg/school-entry-api"; import { Add, DeleteOutlined } from "@mui/icons-material"; import { Button, Divider, Stack } from "@mui/joy"; import { SxProps } from "@mui/joy/styles/types"; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/features/waitingRoom/WaitingRoomTable.tsx b/employee-portal/src/lib/businessModules/schoolEntry/features/waitingRoom/WaitingRoomTable.tsx index 2732d84cd..e9c2d71c8 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/features/waitingRoom/WaitingRoomTable.tsx +++ b/employee-portal/src/lib/businessModules/schoolEntry/features/waitingRoom/WaitingRoomTable.tsx @@ -5,11 +5,11 @@ "use client"; -import { ApiWaitingRoomSortKey } from "@eshg/employee-portal-api/schoolEntry"; import { formatDate, formatDateTime, } from "@eshg/lib-portal/formatters/dateTime"; +import { ApiWaitingRoomSortKey } from "@eshg/school-entry-api"; import { ColumnSort, createColumnHelper } from "@tanstack/react-table"; import { isDefined, isNullish } from "remeda"; diff --git a/employee-portal/src/lib/businessModules/schoolEntry/shared/constants.ts b/employee-portal/src/lib/businessModules/schoolEntry/shared/constants.ts index b6bec5e34..fc12b1825 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/shared/constants.ts +++ b/employee-portal/src/lib/businessModules/schoolEntry/shared/constants.ts @@ -3,10 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { - ApiProcedureType, - ApiTaskType, -} from "@eshg/employee-portal-api/schoolEntry"; +import { ApiProcedureType, ApiTaskType } from "@eshg/school-entry-api"; export const procedureTypes = [ ApiProcedureType.RegularExamination, diff --git a/employee-portal/src/lib/businessModules/schoolEntry/shared/sideNavigationItem.tsx b/employee-portal/src/lib/businessModules/schoolEntry/shared/sideNavigationItem.tsx index e8aeea41d..78343d65a 100644 --- a/employee-portal/src/lib/businessModules/schoolEntry/shared/sideNavigationItem.tsx +++ b/employee-portal/src/lib/businessModules/schoolEntry/shared/sideNavigationItem.tsx @@ -4,8 +4,8 @@ */ import { ApiBaseFeature, ApiUserRole } from "@eshg/base-api"; -import { ApiLocationSelectionMode } from "@eshg/employee-portal-api/schoolEntry"; import { hasUserRole } from "@eshg/lib-employee-portal/helpers/accessControl"; +import { ApiLocationSelectionMode } from "@eshg/school-entry-api"; import { WcOutlined } from "@mui/icons-material"; import { useQuery } from "@tanstack/react-query"; diff --git a/employee-portal/src/lib/businessModules/statistics/api/clients.ts b/employee-portal/src/lib/businessModules/statistics/api/clients.ts index a7d90eef6..a867fe11e 100644 --- a/employee-portal/src/lib/businessModules/statistics/api/clients.ts +++ b/employee-portal/src/lib/businessModules/statistics/api/clients.ts @@ -3,6 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +import { useApiConfiguration } from "@eshg/lib-portal/api/ApiProvider"; import { AnalysisApi, Configuration, @@ -16,8 +17,7 @@ import { ReportSeriesApi, StatisticsCentralRepositoryApi, StatisticsFeatureTogglesApi, -} from "@eshg/employee-portal-api/statistics"; -import { useApiConfiguration } from "@eshg/lib-portal/api/ApiProvider"; +} from "@eshg/statistics-api"; function useConfiguration() { const params = useApiConfiguration("PUBLIC_STATISTICS_BACKEND_URL"); diff --git a/employee-portal/src/lib/businessModules/statistics/api/mapper/mapAttributeSelectionKey.ts b/employee-portal/src/lib/businessModules/statistics/api/mapper/mapAttributeSelectionKey.ts index 321dbeae3..9b3d7b086 100644 --- a/employee-portal/src/lib/businessModules/statistics/api/mapper/mapAttributeSelectionKey.ts +++ b/employee-portal/src/lib/businessModules/statistics/api/mapper/mapAttributeSelectionKey.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiAttributeSelection } from "@eshg/employee-portal-api/statistics"; +import { ApiAttributeSelection } from "@eshg/statistics-api"; const MAPPING_DICTIONARY = new Map<string, ApiAttributeSelection>(); diff --git a/employee-portal/src/lib/businessModules/statistics/api/mapper/mapAttributesToLabels.ts b/employee-portal/src/lib/businessModules/statistics/api/mapper/mapAttributesToLabels.ts index aeabea637..74d72c559 100644 --- a/employee-portal/src/lib/businessModules/statistics/api/mapper/mapAttributesToLabels.ts +++ b/employee-portal/src/lib/businessModules/statistics/api/mapper/mapAttributesToLabels.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiBusinessDataAttributeWithName } from "@eshg/employee-portal-api/statistics"; +import { ApiBusinessDataAttributeWithName } from "@eshg/statistics-api"; import { getAttributeLabel } from "@/lib/businessModules/statistics/components/evaluations/getAttributeLabel"; diff --git a/employee-portal/src/lib/businessModules/statistics/api/mapper/mapDateSpanFilterToApiDateSpan.ts b/employee-portal/src/lib/businessModules/statistics/api/mapper/mapDateSpanFilterToApiDateSpan.ts index 1ec63ae5b..6d93cfe59 100644 --- a/employee-portal/src/lib/businessModules/statistics/api/mapper/mapDateSpanFilterToApiDateSpan.ts +++ b/employee-portal/src/lib/businessModules/statistics/api/mapper/mapDateSpanFilterToApiDateSpan.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiDateSpan } from "@eshg/employee-portal-api/statistics"; +import { ApiDateSpan } from "@eshg/statistics-api"; import { addDays, parseISO, startOfDay } from "date-fns"; import { DateSpanFilterValue } from "@/lib/shared/components/filterSettings/models/DateSpanFilter"; diff --git a/employee-portal/src/lib/businessModules/statistics/api/models/anonymizationOptions.ts b/employee-portal/src/lib/businessModules/statistics/api/models/anonymizationOptions.ts index 337f77fae..f18b5e81d 100644 --- a/employee-portal/src/lib/businessModules/statistics/api/models/anonymizationOptions.ts +++ b/employee-portal/src/lib/businessModules/statistics/api/models/anonymizationOptions.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiDataSourceSensitivity } from "@eshg/employee-portal-api/statistics"; +import { ApiDataSourceSensitivity } from "@eshg/statistics-api"; export const AnonymizationOptions = { Choice: "CHOICE", diff --git a/employee-portal/src/lib/businessModules/statistics/api/models/dataSourceSensitivity.ts b/employee-portal/src/lib/businessModules/statistics/api/models/dataSourceSensitivity.ts index 5b33abf11..b6b0a8628 100644 --- a/employee-portal/src/lib/businessModules/statistics/api/models/dataSourceSensitivity.ts +++ b/employee-portal/src/lib/businessModules/statistics/api/models/dataSourceSensitivity.ts @@ -3,11 +3,11 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +import { EnumMap } from "@eshg/lib-portal/types/helpers"; import { ApiDataSourceSensitivity, ApiReportDataSensitivity, -} from "@eshg/employee-portal-api/statistics"; -import { EnumMap } from "@eshg/lib-portal/types/helpers"; +} from "@eshg/statistics-api"; import { isDefined } from "remeda"; export const DataSourceSensitivity = { diff --git a/employee-portal/src/lib/businessModules/statistics/api/models/evaluationDetailsTableData.ts b/employee-portal/src/lib/businessModules/statistics/api/models/evaluationDetailsTableData.ts index ce3781b3b..9bc08a764 100644 --- a/employee-portal/src/lib/businessModules/statistics/api/models/evaluationDetailsTableData.ts +++ b/employee-portal/src/lib/businessModules/statistics/api/models/evaluationDetailsTableData.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiDataRow } from "@eshg/employee-portal-api/statistics"; +import { ApiDataRow } from "@eshg/statistics-api"; import { FlatAttribute } from "@/lib/businessModules/statistics/api/models/flatAttribute"; diff --git a/employee-portal/src/lib/businessModules/statistics/api/models/evaluationDetailsTableView.ts b/employee-portal/src/lib/businessModules/statistics/api/models/evaluationDetailsTableView.ts index 50f0e08fd..2aa45e078 100644 --- a/employee-portal/src/lib/businessModules/statistics/api/models/evaluationDetailsTableView.ts +++ b/employee-portal/src/lib/businessModules/statistics/api/models/evaluationDetailsTableView.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiGetEvaluationResponse } from "@eshg/employee-portal-api/statistics"; +import { ApiGetEvaluationResponse } from "@eshg/statistics-api"; import { mapTimeRangeEndApiToFrontend } from "@/lib/businessModules/statistics/api/mapper/mapTimeRangeEnd"; import { diff --git a/employee-portal/src/lib/businessModules/statistics/api/models/evaluationDetailsViewTypes.ts b/employee-portal/src/lib/businessModules/statistics/api/models/evaluationDetailsViewTypes.ts index 630ba5470..36f391cc1 100644 --- a/employee-portal/src/lib/businessModules/statistics/api/models/evaluationDetailsViewTypes.ts +++ b/employee-portal/src/lib/businessModules/statistics/api/models/evaluationDetailsViewTypes.ts @@ -11,7 +11,7 @@ import { ApiOrientation, ApiRange, ApiScaling, -} from "@eshg/employee-portal-api/statistics"; +} from "@eshg/statistics-api"; import { DataSourceSensitivity } from "@/lib/businessModules/statistics/api/models/dataSourceSensitivity"; import { FlatAttribute } from "@/lib/businessModules/statistics/api/models/flatAttribute"; diff --git a/employee-portal/src/lib/businessModules/statistics/api/models/evaluationFilterType.ts b/employee-portal/src/lib/businessModules/statistics/api/models/evaluationFilterType.ts index 372c1b697..4d648c66e 100644 --- a/employee-portal/src/lib/businessModules/statistics/api/models/evaluationFilterType.ts +++ b/employee-portal/src/lib/businessModules/statistics/api/models/evaluationFilterType.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiGetEvaluationRequest } from "@eshg/employee-portal-api/statistics"; +import { ApiGetEvaluationRequest } from "@eshg/statistics-api"; export type EvaluationFilter = NonNullable< ApiGetEvaluationRequest["filters"] diff --git a/employee-portal/src/lib/businessModules/statistics/api/models/evaluationOverview.ts b/employee-portal/src/lib/businessModules/statistics/api/models/evaluationOverview.ts index 51448c0af..59b40d738 100644 --- a/employee-portal/src/lib/businessModules/statistics/api/models/evaluationOverview.ts +++ b/employee-portal/src/lib/businessModules/statistics/api/models/evaluationOverview.ts @@ -3,10 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { - ApiEvaluationState, - ApiUser, -} from "@eshg/employee-portal-api/statistics"; +import { ApiEvaluationState, ApiUser } from "@eshg/statistics-api"; import { DataSourceSensitivity } from "@/lib/businessModules/statistics/api/models/dataSourceSensitivity"; diff --git a/employee-portal/src/lib/businessModules/statistics/api/models/evaluationReports.ts b/employee-portal/src/lib/businessModules/statistics/api/models/evaluationReports.ts index 4edc1d7f2..4d0c7a0ed 100644 --- a/employee-portal/src/lib/businessModules/statistics/api/models/evaluationReports.ts +++ b/employee-portal/src/lib/businessModules/statistics/api/models/evaluationReports.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiReportState } from "@eshg/employee-portal-api/statistics"; +import { ApiReportState } from "@eshg/statistics-api"; import { DataSourceSensitivity } from "@/lib/businessModules/statistics/api/models/dataSourceSensitivity"; diff --git a/employee-portal/src/lib/businessModules/statistics/api/models/flatAttribute.ts b/employee-portal/src/lib/businessModules/statistics/api/models/flatAttribute.ts index ca020c835..69c9c1645 100644 --- a/employee-portal/src/lib/businessModules/statistics/api/models/flatAttribute.ts +++ b/employee-portal/src/lib/businessModules/statistics/api/models/flatAttribute.ts @@ -7,7 +7,7 @@ import { ApiBusinessModule } from "@eshg/base-api"; import { ApiAttributeSelection, ApiTableColumnHeader, -} from "@eshg/employee-portal-api/statistics"; +} from "@eshg/statistics-api"; import { mapAttributeSelectionToKey } from "@/lib/businessModules/statistics/api/mapper/mapAttributeSelectionKey"; import { mapToApiBusinessModule } from "@/lib/businessModules/statistics/api/mapper/mapToApiBusinessModule"; diff --git a/employee-portal/src/lib/businessModules/statistics/api/models/geoShapesTableView.ts b/employee-portal/src/lib/businessModules/statistics/api/models/geoShapesTableView.ts index 64bb02b1c..598caa83a 100644 --- a/employee-portal/src/lib/businessModules/statistics/api/models/geoShapesTableView.ts +++ b/employee-portal/src/lib/businessModules/statistics/api/models/geoShapesTableView.ts @@ -6,7 +6,7 @@ import { ApiGeoShapeSortKey, ApiGetGeoShapesResponse, -} from "@eshg/employee-portal-api/statistics"; +} from "@eshg/statistics-api"; export const GeoShapeStatus = { Active: "ACTIVE", diff --git a/employee-portal/src/lib/businessModules/statistics/api/mutations/useAddAnalysis.ts b/employee-portal/src/lib/businessModules/statistics/api/mutations/useAddAnalysis.ts index 7a87a1de6..a5231931b 100644 --- a/employee-portal/src/lib/businessModules/statistics/api/mutations/useAddAnalysis.ts +++ b/employee-portal/src/lib/businessModules/statistics/api/mutations/useAddAnalysis.ts @@ -3,12 +3,12 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +import { useHandledMutation } from "@eshg/lib-portal/api/useHandledMutation"; +import { useSnackbar } from "@eshg/lib-portal/components/snackbar/SnackbarProvider"; import { ApiAddAnalysisRequest, ApiAddAnalysisRequestChartConfiguration, -} from "@eshg/employee-portal-api/statistics"; -import { useHandledMutation } from "@eshg/lib-portal/api/useHandledMutation"; -import { useSnackbar } from "@eshg/lib-portal/components/snackbar/SnackbarProvider"; +} from "@eshg/statistics-api"; import { isNonNullish } from "remeda"; import { useAnalysisApi } from "@/lib/businessModules/statistics/api/clients"; diff --git a/employee-portal/src/lib/businessModules/statistics/api/mutations/useAddAutoReportSeries.ts b/employee-portal/src/lib/businessModules/statistics/api/mutations/useAddAutoReportSeries.ts index 409c86b36..257061f46 100644 --- a/employee-portal/src/lib/businessModules/statistics/api/mutations/useAddAutoReportSeries.ts +++ b/employee-portal/src/lib/businessModules/statistics/api/mutations/useAddAutoReportSeries.ts @@ -3,13 +3,13 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +import { useHandledMutation } from "@eshg/lib-portal/api/useHandledMutation"; +import { useSnackbar } from "@eshg/lib-portal/components/snackbar/SnackbarProvider"; import { ApiAddReportSeriesRequest, ApiFrequency, ApiReportingPeriod, -} from "@eshg/employee-portal-api/statistics"; -import { useHandledMutation } from "@eshg/lib-portal/api/useHandledMutation"; -import { useSnackbar } from "@eshg/lib-portal/components/snackbar/SnackbarProvider"; +} from "@eshg/statistics-api"; import { useReportSeriesApi } from "@/lib/businessModules/statistics/api/clients"; import { diff --git a/employee-portal/src/lib/businessModules/statistics/api/mutations/useAddEvaluation.ts b/employee-portal/src/lib/businessModules/statistics/api/mutations/useAddEvaluation.ts index 8512fa47d..8ff9c14ab 100644 --- a/employee-portal/src/lib/businessModules/statistics/api/mutations/useAddEvaluation.ts +++ b/employee-portal/src/lib/businessModules/statistics/api/mutations/useAddEvaluation.ts @@ -3,9 +3,9 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiAddEvaluationRequest } from "@eshg/employee-portal-api/statistics"; import { useHandledMutation } from "@eshg/lib-portal/api/useHandledMutation"; import { useSnackbar } from "@eshg/lib-portal/components/snackbar/SnackbarProvider"; +import { ApiAddEvaluationRequest } from "@eshg/statistics-api"; import { useEvaluationApi } from "@/lib/businessModules/statistics/api/clients"; import { mapTimeRangeEndFrontendToApi } from "@/lib/businessModules/statistics/api/mapper/mapTimeRangeEnd"; diff --git a/employee-portal/src/lib/businessModules/statistics/api/mutations/useDuplicateEvaluation.ts b/employee-portal/src/lib/businessModules/statistics/api/mutations/useDuplicateEvaluation.ts index 97c528d43..a0db75dd0 100644 --- a/employee-portal/src/lib/businessModules/statistics/api/mutations/useDuplicateEvaluation.ts +++ b/employee-portal/src/lib/businessModules/statistics/api/mutations/useDuplicateEvaluation.ts @@ -3,9 +3,9 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiCloneEvaluationRequest } from "@eshg/employee-portal-api/statistics"; import { useHandledMutation } from "@eshg/lib-portal/api/useHandledMutation"; import { useSnackbar } from "@eshg/lib-portal/components/snackbar/SnackbarProvider"; +import { ApiCloneEvaluationRequest } from "@eshg/statistics-api"; import { useEvaluationApi } from "@/lib/businessModules/statistics/api/clients"; diff --git a/employee-portal/src/lib/businessModules/statistics/api/queries/useGetAnalysis.ts b/employee-portal/src/lib/businessModules/statistics/api/queries/useGetAnalysis.ts index e13bafd3e..bc33c2ea0 100644 --- a/employee-portal/src/lib/businessModules/statistics/api/queries/useGetAnalysis.ts +++ b/employee-portal/src/lib/businessModules/statistics/api/queries/useGetAnalysis.ts @@ -8,7 +8,7 @@ import { ApiAnalysisWithDiagrams, ApiDiagramDiagramData, ApiValueWithOptionsAttribute, -} from "@eshg/employee-portal-api/statistics"; +} from "@eshg/statistics-api"; import { useSuspenseQuery } from "@tanstack/react-query"; import { isNonNullish } from "remeda"; diff --git a/employee-portal/src/lib/businessModules/statistics/api/queries/useGetAvailableDataSources.ts b/employee-portal/src/lib/businessModules/statistics/api/queries/useGetAvailableDataSources.ts index f057b96fb..0fe881710 100644 --- a/employee-portal/src/lib/businessModules/statistics/api/queries/useGetAvailableDataSources.ts +++ b/employee-portal/src/lib/businessModules/statistics/api/queries/useGetAvailableDataSources.ts @@ -6,7 +6,7 @@ import { ApiGetAvailableDataSourcesResponse, DataSourceApi, -} from "@eshg/employee-portal-api/statistics"; +} from "@eshg/statistics-api"; import { useSuspenseQuery } from "@tanstack/react-query"; import { useDataSourceApi } from "@/lib/businessModules/statistics/api/clients"; diff --git a/employee-portal/src/lib/businessModules/statistics/api/queries/useGetDetailPageInformation.ts b/employee-portal/src/lib/businessModules/statistics/api/queries/useGetDetailPageInformation.ts index cf90b13d3..1d0e645e2 100644 --- a/employee-portal/src/lib/businessModules/statistics/api/queries/useGetDetailPageInformation.ts +++ b/employee-portal/src/lib/businessModules/statistics/api/queries/useGetDetailPageInformation.ts @@ -9,7 +9,7 @@ import { ApiAttributeSelection, ApiGetDetailPageInformationResponse, EvaluationApi, -} from "@eshg/employee-portal-api/statistics"; +} from "@eshg/statistics-api"; import { useSuspenseQuery } from "@tanstack/react-query"; import { useEvaluationApi } from "@/lib/businessModules/statistics/api/clients"; diff --git a/employee-portal/src/lib/businessModules/statistics/api/queries/useGetEvaluation.ts b/employee-portal/src/lib/businessModules/statistics/api/queries/useGetEvaluation.ts index efe09e11c..ae0b4a8f7 100644 --- a/employee-portal/src/lib/businessModules/statistics/api/queries/useGetEvaluation.ts +++ b/employee-portal/src/lib/businessModules/statistics/api/queries/useGetEvaluation.ts @@ -3,11 +3,8 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { - EvaluationApi, - GetEvaluationRequest, -} from "@eshg/employee-portal-api/statistics"; import { unwrapRawResponse } from "@eshg/lib-portal/api/unwrapRawResponse"; +import { EvaluationApi, GetEvaluationRequest } from "@eshg/statistics-api"; import { mapEvaluationToTableView } from "@/lib/businessModules/statistics/api/models/evaluationDetailsTableView"; diff --git a/employee-portal/src/lib/businessModules/statistics/api/queries/useGetEvaluationDetails.ts b/employee-portal/src/lib/businessModules/statistics/api/queries/useGetEvaluationDetails.ts index b119b4128..18e3ff40a 100644 --- a/employee-portal/src/lib/businessModules/statistics/api/queries/useGetEvaluationDetails.ts +++ b/employee-portal/src/lib/businessModules/statistics/api/queries/useGetEvaluationDetails.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiExpectedEvaluationTemplate } from "@eshg/employee-portal-api/statistics"; +import { ApiExpectedEvaluationTemplate } from "@eshg/statistics-api"; import { useSuspenseQuery } from "@tanstack/react-query"; import { useEvaluationTemplateApi } from "@/lib/businessModules/statistics/api/clients"; diff --git a/employee-portal/src/lib/businessModules/statistics/api/queries/useGetEvaluationDetailsPage.ts b/employee-portal/src/lib/businessModules/statistics/api/queries/useGetEvaluationDetailsPage.ts index e73e12e0d..650247986 100644 --- a/employee-portal/src/lib/businessModules/statistics/api/queries/useGetEvaluationDetailsPage.ts +++ b/employee-portal/src/lib/businessModules/statistics/api/queries/useGetEvaluationDetailsPage.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { GetGeoShapesRequest } from "@eshg/employee-portal-api/statistics"; +import { GetGeoShapesRequest } from "@eshg/statistics-api"; import { useSuspenseQueries } from "@tanstack/react-query"; import { diff --git a/employee-portal/src/lib/businessModules/statistics/api/queries/useGetEvaluationDetailsTablePage.ts b/employee-portal/src/lib/businessModules/statistics/api/queries/useGetEvaluationDetailsTablePage.ts index bff1db93f..065b5c108 100644 --- a/employee-portal/src/lib/businessModules/statistics/api/queries/useGetEvaluationDetailsTablePage.ts +++ b/employee-portal/src/lib/businessModules/statistics/api/queries/useGetEvaluationDetailsTablePage.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { GetEvaluationRequest } from "@eshg/employee-portal-api/statistics"; +import { GetEvaluationRequest } from "@eshg/statistics-api"; import { useSuspenseQueries } from "@tanstack/react-query"; import { diff --git a/employee-portal/src/lib/businessModules/statistics/api/queries/useGetEvaluationReports.ts b/employee-portal/src/lib/businessModules/statistics/api/queries/useGetEvaluationReports.ts index 292fe7363..a2da5ccfa 100644 --- a/employee-portal/src/lib/businessModules/statistics/api/queries/useGetEvaluationReports.ts +++ b/employee-portal/src/lib/businessModules/statistics/api/queries/useGetEvaluationReports.ts @@ -10,7 +10,7 @@ import { ApiReportSeries, ApiReportState, ApiReportingPeriod, -} from "@eshg/employee-portal-api/statistics"; +} from "@eshg/statistics-api"; import { useSuspenseQuery } from "@tanstack/react-query"; import { isNonNullish } from "remeda"; diff --git a/employee-portal/src/lib/businessModules/statistics/api/queries/useGetEvaluationTemplateDetails.ts b/employee-portal/src/lib/businessModules/statistics/api/queries/useGetEvaluationTemplateDetails.ts index 0de571162..53fd4f220 100644 --- a/employee-portal/src/lib/businessModules/statistics/api/queries/useGetEvaluationTemplateDetails.ts +++ b/employee-portal/src/lib/businessModules/statistics/api/queries/useGetEvaluationTemplateDetails.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiEvaluationTemplate } from "@eshg/employee-portal-api/statistics"; +import { ApiEvaluationTemplate } from "@eshg/statistics-api"; import { useSuspenseQuery } from "@tanstack/react-query"; import { useEvaluationTemplateApi } from "@/lib/businessModules/statistics/api/clients"; diff --git a/employee-portal/src/lib/businessModules/statistics/api/queries/useGetEvaluationTemplateFromRepository.ts b/employee-portal/src/lib/businessModules/statistics/api/queries/useGetEvaluationTemplateFromRepository.ts index 9741c05af..68b40e105 100644 --- a/employee-portal/src/lib/businessModules/statistics/api/queries/useGetEvaluationTemplateFromRepository.ts +++ b/employee-portal/src/lib/businessModules/statistics/api/queries/useGetEvaluationTemplateFromRepository.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiEvaluationTemplateDetailsFromRepository } from "@eshg/employee-portal-api/statistics"; +import { ApiEvaluationTemplateDetailsFromRepository } from "@eshg/statistics-api"; import { useSuspenseQuery } from "@tanstack/react-query"; import { useCentralRepositoryApi } from "@/lib/businessModules/statistics/api/clients"; diff --git a/employee-portal/src/lib/businessModules/statistics/api/queries/useGetEvaluationTemplates.ts b/employee-portal/src/lib/businessModules/statistics/api/queries/useGetEvaluationTemplates.ts index 8146d1466..389b08e78 100644 --- a/employee-portal/src/lib/businessModules/statistics/api/queries/useGetEvaluationTemplates.ts +++ b/employee-portal/src/lib/businessModules/statistics/api/queries/useGetEvaluationTemplates.ts @@ -6,7 +6,7 @@ import { ApiGetAllMinimalEvaluationTemplateInfosResponse, EvaluationTemplateApi, -} from "@eshg/employee-portal-api/statistics"; +} from "@eshg/statistics-api"; import { useSuspenseQuery } from "@tanstack/react-query"; import { useEvaluationTemplateApi } from "@/lib/businessModules/statistics/api/clients"; diff --git a/employee-portal/src/lib/businessModules/statistics/api/queries/useGetEvaluationTemplatesFromRepository.ts b/employee-portal/src/lib/businessModules/statistics/api/queries/useGetEvaluationTemplatesFromRepository.ts index b5ba9fd33..54db7c022 100644 --- a/employee-portal/src/lib/businessModules/statistics/api/queries/useGetEvaluationTemplatesFromRepository.ts +++ b/employee-portal/src/lib/businessModules/statistics/api/queries/useGetEvaluationTemplatesFromRepository.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiGetEvaluationTemplatesFromRepositoryResponse } from "@eshg/employee-portal-api/statistics"; +import { ApiGetEvaluationTemplatesFromRepositoryResponse } from "@eshg/statistics-api"; import { useSuspenseQuery } from "@tanstack/react-query"; import { useCentralRepositoryApi } from "@/lib/businessModules/statistics/api/clients"; diff --git a/employee-portal/src/lib/businessModules/statistics/api/queries/useGetEvaluationTemplatesOverview.ts b/employee-portal/src/lib/businessModules/statistics/api/queries/useGetEvaluationTemplatesOverview.ts index 22c49bf2e..4d15367dd 100644 --- a/employee-portal/src/lib/businessModules/statistics/api/queries/useGetEvaluationTemplatesOverview.ts +++ b/employee-portal/src/lib/businessModules/statistics/api/queries/useGetEvaluationTemplatesOverview.ts @@ -7,7 +7,7 @@ import { ApiDataSourceSensitivity, ApiEvaluationTemplateSortKey, ApiGetEvaluationTemplatesResponse, -} from "@eshg/employee-portal-api/statistics"; +} from "@eshg/statistics-api"; import { useSuspenseQuery } from "@tanstack/react-query"; import { isDefined } from "remeda"; diff --git a/employee-portal/src/lib/businessModules/statistics/api/queries/useGetEvaluations.ts b/employee-portal/src/lib/businessModules/statistics/api/queries/useGetEvaluations.ts index 79d9dbea9..a0d3f1436 100644 --- a/employee-portal/src/lib/businessModules/statistics/api/queries/useGetEvaluations.ts +++ b/employee-portal/src/lib/businessModules/statistics/api/queries/useGetEvaluations.ts @@ -8,7 +8,7 @@ import { ApiEvaluationState, ApiGetEvaluationsResponse, EvaluationApi, -} from "@eshg/employee-portal-api/statistics"; +} from "@eshg/statistics-api"; import { useSuspenseQuery } from "@tanstack/react-query"; import { useEvaluationApi } from "@/lib/businessModules/statistics/api/clients"; diff --git a/employee-portal/src/lib/businessModules/statistics/api/queries/useGetFilterTemplates.ts b/employee-portal/src/lib/businessModules/statistics/api/queries/useGetFilterTemplates.ts index 6db07a015..622635e6f 100644 --- a/employee-portal/src/lib/businessModules/statistics/api/queries/useGetFilterTemplates.ts +++ b/employee-portal/src/lib/businessModules/statistics/api/queries/useGetFilterTemplates.ts @@ -6,7 +6,7 @@ import { ApiGetFilterTemplatesForEvaluationResponse, FilterTemplateApi, -} from "@eshg/employee-portal-api/statistics"; +} from "@eshg/statistics-api"; import { useSuspenseQuery } from "@tanstack/react-query"; import { useFilterTemplateApi } from "@/lib/businessModules/statistics/api/clients"; diff --git a/employee-portal/src/lib/businessModules/statistics/api/queries/useGetGeoShapes.ts b/employee-portal/src/lib/businessModules/statistics/api/queries/useGetGeoShapes.ts index 031bc0eeb..e3a04b6d5 100644 --- a/employee-portal/src/lib/businessModules/statistics/api/queries/useGetGeoShapes.ts +++ b/employee-portal/src/lib/businessModules/statistics/api/queries/useGetGeoShapes.ts @@ -3,11 +3,8 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { - GeoShapeApi, - GetGeoShapesRequest, -} from "@eshg/employee-portal-api/statistics"; import { unwrapRawResponse } from "@eshg/lib-portal/api/unwrapRawResponse"; +import { GeoShapeApi, GetGeoShapesRequest } from "@eshg/statistics-api"; import { useSuspenseQuery } from "@tanstack/react-query"; import { useGeoShapeApi } from "@/lib/businessModules/statistics/api/clients"; diff --git a/employee-portal/src/lib/businessModules/statistics/api/queries/useGetReportDetails.ts b/employee-portal/src/lib/businessModules/statistics/api/queries/useGetReportDetails.ts index 6ec77d68c..5aa63d955 100644 --- a/employee-portal/src/lib/businessModules/statistics/api/queries/useGetReportDetails.ts +++ b/employee-portal/src/lib/businessModules/statistics/api/queries/useGetReportDetails.ts @@ -6,7 +6,7 @@ import { ApiGetReportDetailPageResponse, ApiReportType, -} from "@eshg/employee-portal-api/statistics"; +} from "@eshg/statistics-api"; import { useSuspenseQuery } from "@tanstack/react-query"; import { useReportApi } from "@/lib/businessModules/statistics/api/clients"; diff --git a/employee-portal/src/lib/businessModules/statistics/api/queries/useGetReportsOverview.ts b/employee-portal/src/lib/businessModules/statistics/api/queries/useGetReportsOverview.ts index 2235175a1..72acb9c4d 100644 --- a/employee-portal/src/lib/businessModules/statistics/api/queries/useGetReportsOverview.ts +++ b/employee-portal/src/lib/businessModules/statistics/api/queries/useGetReportsOverview.ts @@ -9,7 +9,7 @@ import { ApiReportSeries, ApiReportType, ReportSeriesApi, -} from "@eshg/employee-portal-api/statistics"; +} from "@eshg/statistics-api"; import { useSuspenseQueries } from "@tanstack/react-query"; import { diff --git a/employee-portal/src/lib/businessModules/statistics/api/queries/useStatisticsFeatureToggle.ts b/employee-portal/src/lib/businessModules/statistics/api/queries/useStatisticsFeatureToggle.ts index 62db0994f..207b40a43 100644 --- a/employee-portal/src/lib/businessModules/statistics/api/queries/useStatisticsFeatureToggle.ts +++ b/employee-portal/src/lib/businessModules/statistics/api/queries/useStatisticsFeatureToggle.ts @@ -3,15 +3,15 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { - ApiGetStatisticsFeatureTogglesResponse, - ApiStatisticsFeature, -} from "@eshg/employee-portal-api/statistics"; import { FeatureToggleQueryOptions, selectEnabledNewFeature, useGetFeatureToggle, } from "@eshg/lib-portal/api/featureToggles"; +import { + ApiGetStatisticsFeatureTogglesResponse, + ApiStatisticsFeature, +} from "@eshg/statistics-api"; import { useFeatureTogglesApi } from "@/lib/businessModules/statistics/api/clients"; diff --git a/employee-portal/src/lib/businessModules/statistics/components/evaluations/CreateEvaluationSidebar/CreateEvaluationSidebar.tsx b/employee-portal/src/lib/businessModules/statistics/components/evaluations/CreateEvaluationSidebar/CreateEvaluationSidebar.tsx index 30ee17770..71486b79f 100644 --- a/employee-portal/src/lib/businessModules/statistics/components/evaluations/CreateEvaluationSidebar/CreateEvaluationSidebar.tsx +++ b/employee-portal/src/lib/businessModules/statistics/components/evaluations/CreateEvaluationSidebar/CreateEvaluationSidebar.tsx @@ -6,7 +6,7 @@ import { ApiAvailableDataSource, ApiMinimalEvaluationTemplateInfo, -} from "@eshg/employee-portal-api/statistics"; +} from "@eshg/statistics-api"; import { isNonNullish } from "remeda"; import { mapToApiBusinessModule } from "@/lib/businessModules/statistics/api/mapper/mapToApiBusinessModule"; diff --git a/employee-portal/src/lib/businessModules/statistics/components/evaluations/CreateEvaluationSidebar/SummaryStep/SummaryStep.tsx b/employee-portal/src/lib/businessModules/statistics/components/evaluations/CreateEvaluationSidebar/SummaryStep/SummaryStep.tsx index f9464987f..1b52b9d2d 100644 --- a/employee-portal/src/lib/businessModules/statistics/components/evaluations/CreateEvaluationSidebar/SummaryStep/SummaryStep.tsx +++ b/employee-portal/src/lib/businessModules/statistics/components/evaluations/CreateEvaluationSidebar/SummaryStep/SummaryStep.tsx @@ -107,7 +107,6 @@ function Summary(props: SummaryProps) { </Typography> </Stack> )} - <Stack gap={1}></Stack> <Stack gap={1}> <Typography level="title-md">Betrachtungszeitraum</Typography> <Typography level="body-md"> diff --git a/employee-portal/src/lib/businessModules/statistics/components/evaluations/EvaluationsTable.tsx b/employee-portal/src/lib/businessModules/statistics/components/evaluations/EvaluationsTable.tsx index 491d646f3..a75277602 100644 --- a/employee-portal/src/lib/businessModules/statistics/components/evaluations/EvaluationsTable.tsx +++ b/employee-portal/src/lib/businessModules/statistics/components/evaluations/EvaluationsTable.tsx @@ -3,13 +3,13 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +import { InternalLinkButton } from "@eshg/lib-portal/components/navigation/InternalLinkButton"; +import { formatDate } from "@eshg/lib-portal/formatters/dateTime"; import { ApiAvailableDataSource, ApiEvaluationInfo, ApiEvaluationState, -} from "@eshg/employee-portal-api/statistics"; -import { InternalLinkButton } from "@eshg/lib-portal/components/navigation/InternalLinkButton"; -import { formatDate } from "@eshg/lib-portal/formatters/dateTime"; +} from "@eshg/statistics-api"; import { Add, Delete, diff --git a/employee-portal/src/lib/businessModules/statistics/components/evaluations/StateChip.tsx b/employee-portal/src/lib/businessModules/statistics/components/evaluations/StateChip.tsx index 15cd16e71..59e500b10 100644 --- a/employee-portal/src/lib/businessModules/statistics/components/evaluations/StateChip.tsx +++ b/employee-portal/src/lib/businessModules/statistics/components/evaluations/StateChip.tsx @@ -3,7 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiEvaluationState } from "@eshg/employee-portal-api/statistics"; +import { ApiEvaluationState } from "@eshg/statistics-api"; import { Chip, ChipProps } from "@mui/joy"; const statusNames = { diff --git a/employee-portal/src/lib/businessModules/statistics/components/evaluations/details/CreateAnalysisSidebar/ConfigureBarChartStep/ConfigureBarChartStep.tsx b/employee-portal/src/lib/businessModules/statistics/components/evaluations/details/CreateAnalysisSidebar/ConfigureBarChartStep/ConfigureBarChartStep.tsx index 62140c267..a9ee9aedf 100644 --- a/employee-portal/src/lib/businessModules/statistics/components/evaluations/details/CreateAnalysisSidebar/ConfigureBarChartStep/ConfigureBarChartStep.tsx +++ b/employee-portal/src/lib/businessModules/statistics/components/evaluations/details/CreateAnalysisSidebar/ConfigureBarChartStep/ConfigureBarChartStep.tsx @@ -13,7 +13,7 @@ import { ConfigureChartFormModel } from "@/lib/businessModules/statistics/compon import { mapAttributeToAutocompleteSelectionOption } from "@/lib/businessModules/statistics/components/evaluations/details/CreateAnalysisSidebar/mapAttribute"; import { groupingValueNames, - isBooleanOrValueWithOptions, + isCategorical, orientationValueNames, scalingValueNames, } from "@/lib/businessModules/statistics/components/shared/charts/chartHelper"; @@ -36,7 +36,7 @@ export function ConfigureBarChartStep({ values.secondaryAttribute.length > 0; const autocompleteSelectOptions: AutocompleteSelectOption[] = attributes.map( mapAttributeToAutocompleteSelectionOption((attr) => - isBooleanOrValueWithOptions(attr.type), + isCategorical(attr.type), ), ); diff --git a/employee-portal/src/lib/businessModules/statistics/components/evaluations/details/CreateAnalysisSidebar/ConfigureHistogramChartStep/ConfigureHistogramChartStep.tsx b/employee-portal/src/lib/businessModules/statistics/components/evaluations/details/CreateAnalysisSidebar/ConfigureHistogramChartStep/ConfigureHistogramChartStep.tsx index e522ed51a..fcda202ed 100644 --- a/employee-portal/src/lib/businessModules/statistics/components/evaluations/details/CreateAnalysisSidebar/ConfigureHistogramChartStep/ConfigureHistogramChartStep.tsx +++ b/employee-portal/src/lib/businessModules/statistics/components/evaluations/details/CreateAnalysisSidebar/ConfigureHistogramChartStep/ConfigureHistogramChartStep.tsx @@ -14,7 +14,7 @@ import { mapAttributeToAutocompleteSelectionOption } from "@/lib/businessModules import { binningValueNames, groupingValueNames, - isBooleanOrValueWithOptions, + isCategorical, isNumeric, scalingValueNames, } from "@/lib/businessModules/statistics/components/shared/charts/chartHelper"; @@ -45,7 +45,7 @@ export function ConfigureHistogramChartStep({ const secondaryAutocompleteSelectOptions: AutocompleteSelectOption[] = attributes.map( mapAttributeToAutocompleteSelectionOption((attr) => - isBooleanOrValueWithOptions(attr.type), + isCategorical(attr.type), ), ); diff --git a/employee-portal/src/lib/businessModules/statistics/components/evaluations/details/CreateAnalysisSidebar/ConfigureLineChartStep/ConfigureLineChartStep.tsx b/employee-portal/src/lib/businessModules/statistics/components/evaluations/details/CreateAnalysisSidebar/ConfigureLineChartStep/ConfigureLineChartStep.tsx index 57fc1fed8..127761319 100644 --- a/employee-portal/src/lib/businessModules/statistics/components/evaluations/details/CreateAnalysisSidebar/ConfigureLineChartStep/ConfigureLineChartStep.tsx +++ b/employee-portal/src/lib/businessModules/statistics/components/evaluations/details/CreateAnalysisSidebar/ConfigureLineChartStep/ConfigureLineChartStep.tsx @@ -12,7 +12,7 @@ import { ConfigureChartFormModel } from "@/lib/businessModules/statistics/compon import { mapAttributeToAutocompleteSelectionOption } from "@/lib/businessModules/statistics/components/evaluations/details/CreateAnalysisSidebar/mapAttribute"; import { axisRangeValueNames, - isBooleanOrValueWithOptions, + isCategorical, isNumeric, } from "@/lib/businessModules/statistics/components/shared/charts/chartHelper"; import { SidebarStepContentProps } from "@/lib/shared/components/SidebarStepper/sidebarStep"; @@ -34,7 +34,7 @@ export function ConfigureLineChartStep({ ); const secondaryAttributes = attributes.map( mapAttributeToAutocompleteSelectionOption((attribute) => - isBooleanOrValueWithOptions(attribute.type), + isCategorical(attribute.type), ), ); const axisRange = buildEnumOptions(axisRangeValueNames); diff --git a/employee-portal/src/lib/businessModules/statistics/components/evaluations/details/CreateAnalysisSidebar/ConfigurePieChartStep/ConfigurePieChartStep.tsx b/employee-portal/src/lib/businessModules/statistics/components/evaluations/details/CreateAnalysisSidebar/ConfigurePieChartStep/ConfigurePieChartStep.tsx index e193fcf3b..49ec0e83b 100644 --- a/employee-portal/src/lib/businessModules/statistics/components/evaluations/details/CreateAnalysisSidebar/ConfigurePieChartStep/ConfigurePieChartStep.tsx +++ b/employee-portal/src/lib/businessModules/statistics/components/evaluations/details/CreateAnalysisSidebar/ConfigurePieChartStep/ConfigurePieChartStep.tsx @@ -9,7 +9,7 @@ import { Stack } from "@mui/joy"; import { FlatAttribute } from "@/lib/businessModules/statistics/api/models/flatAttribute"; import { ConfigureChartFormModel } from "@/lib/businessModules/statistics/components/evaluations/details/CreateAnalysisSidebar/createAnalysisFormModel"; import { mapAttributeToAutocompleteSelectionOption } from "@/lib/businessModules/statistics/components/evaluations/details/CreateAnalysisSidebar/mapAttribute"; -import { isBooleanOrValueWithOptions } from "@/lib/businessModules/statistics/components/shared/charts/chartHelper"; +import { isCategorical } from "@/lib/businessModules/statistics/components/shared/charts/chartHelper"; import { AutocompleteSelectOption } from "@/lib/shared/components/AutocompleteSelectOptions"; import { SidebarStepContentProps } from "@/lib/shared/components/SidebarStepper/sidebarStep"; @@ -24,7 +24,7 @@ export function ConfigurePieChartStep({ }: ConfigurePieChartStepProps) { const primaryAttributes: AutocompleteSelectOption[] = attributes.map( mapAttributeToAutocompleteSelectionOption((attr) => - isBooleanOrValueWithOptions(attr.type), + isCategorical(attr.type), ), ); return ( diff --git a/employee-portal/src/lib/businessModules/statistics/components/evaluations/details/CreateAnalysisSidebar/ConfigureScatterChartStep/ConfigureScatterChartStep.tsx b/employee-portal/src/lib/businessModules/statistics/components/evaluations/details/CreateAnalysisSidebar/ConfigureScatterChartStep/ConfigureScatterChartStep.tsx index b244797db..374434fa5 100644 --- a/employee-portal/src/lib/businessModules/statistics/components/evaluations/details/CreateAnalysisSidebar/ConfigureScatterChartStep/ConfigureScatterChartStep.tsx +++ b/employee-portal/src/lib/businessModules/statistics/components/evaluations/details/CreateAnalysisSidebar/ConfigureScatterChartStep/ConfigureScatterChartStep.tsx @@ -12,7 +12,7 @@ import { ConfigureChartFormModel } from "@/lib/businessModules/statistics/compon import { mapAttributeToAutocompleteSelectionOption } from "@/lib/businessModules/statistics/components/evaluations/details/CreateAnalysisSidebar/mapAttribute"; import { axisRangeValueNames, - isBooleanOrValueWithOptions, + isCategorical, isNumeric, } from "@/lib/businessModules/statistics/components/shared/charts/chartHelper"; import { SidebarStepContentProps } from "@/lib/shared/components/SidebarStepper/sidebarStep"; @@ -35,7 +35,7 @@ export function ConfigureScatterChartStep({ ); const secondaryAttributes = attributes.map( mapAttributeToAutocompleteSelectionOption((attribute) => - isBooleanOrValueWithOptions(attribute.type), + isCategorical(attribute.type), ), ); const axisRange = buildEnumOptions(axisRangeValueNames); diff --git a/employee-portal/src/lib/businessModules/statistics/components/evaluations/details/dataQuality/EvaluationDataQuality.tsx b/employee-portal/src/lib/businessModules/statistics/components/evaluations/details/dataQuality/EvaluationDataQuality.tsx index dd20f4e8f..5fd29aba0 100644 --- a/employee-portal/src/lib/businessModules/statistics/components/evaluations/details/dataQuality/EvaluationDataQuality.tsx +++ b/employee-portal/src/lib/businessModules/statistics/components/evaluations/details/dataQuality/EvaluationDataQuality.tsx @@ -6,7 +6,7 @@ import { ApiGetCompletenessDataResponse, ApiGetCompletenessDataResponseCompletenessOfAttributesInner, -} from "@eshg/employee-portal-api/statistics"; +} from "@eshg/statistics-api"; import { DiamondOutlined, IndeterminateCheckBoxOutlined, diff --git a/employee-portal/src/lib/businessModules/statistics/components/evaluations/details/filter/enumFilterMappings.ts b/employee-portal/src/lib/businessModules/statistics/components/evaluations/details/filter/enumFilterMappings.ts index ea60f03aa..0b7f59309 100644 --- a/employee-portal/src/lib/businessModules/statistics/components/evaluations/details/filter/enumFilterMappings.ts +++ b/employee-portal/src/lib/businessModules/statistics/components/evaluations/details/filter/enumFilterMappings.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiValueOption } from "@eshg/employee-portal-api/statistics"; +import { ApiValueOption } from "@eshg/statistics-api"; import { EnumFilterOption } from "@/lib/shared/components/filterSettings/models/EnumFilter"; diff --git a/employee-portal/src/lib/businessModules/statistics/components/evaluations/details/reports/EvaluationReports.tsx b/employee-portal/src/lib/businessModules/statistics/components/evaluations/details/reports/EvaluationReports.tsx index 054738972..f1bcaadf4 100644 --- a/employee-portal/src/lib/businessModules/statistics/components/evaluations/details/reports/EvaluationReports.tsx +++ b/employee-portal/src/lib/businessModules/statistics/components/evaluations/details/reports/EvaluationReports.tsx @@ -5,9 +5,9 @@ "use client"; -import { ApiReportState } from "@eshg/employee-portal-api/statistics"; import { InternalLinkButton } from "@eshg/lib-portal/components/navigation/InternalLinkButton"; import { formatDate } from "@eshg/lib-portal/formatters/dateTime"; +import { ApiReportState } from "@eshg/statistics-api"; import { Add, NotInterestedOutlined } from "@mui/icons-material"; import { Box, diff --git a/employee-portal/src/lib/businessModules/statistics/components/evaluations/details/reports/ReportStateChip.tsx b/employee-portal/src/lib/businessModules/statistics/components/evaluations/details/reports/ReportStateChip.tsx index 53b8a9e92..8a69760fa 100644 --- a/employee-portal/src/lib/businessModules/statistics/components/evaluations/details/reports/ReportStateChip.tsx +++ b/employee-portal/src/lib/businessModules/statistics/components/evaluations/details/reports/ReportStateChip.tsx @@ -3,7 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiReportState } from "@eshg/employee-portal-api/statistics"; +import { ApiReportState } from "@eshg/statistics-api"; import { Chip, ChipProps } from "@mui/joy"; const statusNames = { diff --git a/employee-portal/src/lib/businessModules/statistics/components/evaluations/details/table/EvaluationDetailsTable.tsx b/employee-portal/src/lib/businessModules/statistics/components/evaluations/details/table/EvaluationDetailsTable.tsx index 161cf8ba0..0902975f1 100644 --- a/employee-portal/src/lib/businessModules/statistics/components/evaluations/details/table/EvaluationDetailsTable.tsx +++ b/employee-portal/src/lib/businessModules/statistics/components/evaluations/details/table/EvaluationDetailsTable.tsx @@ -6,7 +6,9 @@ "use client"; import { useMemo } from "react"; +import { isDefined } from "remeda"; +import { resolveProcedureDetailsRoute } from "@/lib/baseModule/moduleRegister/routeResolver"; import { mapAttributesToFilterDefinitions } from "@/lib/businessModules/statistics/api/mapper/mapAttributesToFilterDefinitions"; import { mapFilterValuesToEvaluationFilters } from "@/lib/businessModules/statistics/api/mapper/mapFilterValuesToEvaluationFilters"; import { EvaluationDetailsTableData } from "@/lib/businessModules/statistics/api/models/evaluationDetailsTableData"; @@ -15,7 +17,10 @@ import { FlatAttribute } from "@/lib/businessModules/statistics/api/models/flatA import { useAddFilterTemplate } from "@/lib/businessModules/statistics/api/mutations/useAddFilterTemplate"; import { useDeleteFilterTemplate } from "@/lib/businessModules/statistics/api/mutations/useDeleteFilterTemplate"; import { useGetFilterTemplateFilters } from "@/lib/businessModules/statistics/api/mutations/useGetFilterTemplateFilters"; -import { evaluationColumns } from "@/lib/businessModules/statistics/components/evaluations/details/table/columns"; +import { + DUMMY_COLUMN, + evaluationColumns, +} from "@/lib/businessModules/statistics/components/evaluations/details/table/columns"; import { ButtonBar } from "@/lib/shared/components/buttons/ButtonBar"; import { FilterButton } from "@/lib/shared/components/buttons/FilterButton"; import { FilterSettings } from "@/lib/shared/components/filterSettings/FilterSettings"; @@ -75,11 +80,19 @@ export function EvaluationDetailsTable(props: EvaluationDetailsTableProps) { () => evaluationColumns({ flatAttributes: props.attributes, - resolveProcedureId: props.resolveProcedureId ?? (() => undefined), }), - [props.attributes, props.resolveProcedureId], + [props.attributes], + ); + + const procedureReferenceAttribute = props.attributes.find( + (attribute) => attribute.type === "ProcedureReferenceAttribute", ); + const focusColumnAccessorKey = + props.attributes.find( + (attribute) => attribute.type !== "ProcedureReferenceAttribute", + )?.key ?? DUMMY_COLUMN; + return ( <TablePage fullHeight @@ -106,6 +119,32 @@ export function EvaluationDetailsTable(props: EvaluationDetailsTableProps) { data={props.tableData} columns={columns} sorting={props.manualSortingProps} + rowNavigation={{ + onClick: (row) => { + if ( + isDefined(procedureReferenceAttribute) && + isDefined(props.resolveProcedureId) + ) { + const procedureReferenceId = row.original[ + procedureReferenceAttribute.key + ] as string | undefined; + const procedureId = + props.resolveProcedureId(procedureReferenceId); + if (isDefined(procedureId)) { + return () => + window.open( + resolveProcedureDetailsRoute({ + businessModule: + procedureReferenceAttribute.businessModule, + procedureId, + }), + "_blank", + ); + } + } + }, + focusColumnAccessorKey, + }} /> </TableSheet> </TablePage> diff --git a/employee-portal/src/lib/businessModules/statistics/components/evaluations/details/table/columns.tsx b/employee-portal/src/lib/businessModules/statistics/components/evaluations/details/table/columns.tsx index 4e5a0b684..e4dcff1e3 100644 --- a/employee-portal/src/lib/businessModules/statistics/components/evaluations/details/table/columns.tsx +++ b/employee-portal/src/lib/businessModules/statistics/components/evaluations/details/table/columns.tsx @@ -3,28 +3,25 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { InternalLinkIconButton } from "@eshg/lib-portal/components/navigation/InternalLinkIconButton"; -import ArrowForwardIosIcon from "@mui/icons-material/ArrowForwardIos"; -import { Stack } from "@mui/joy"; import { createColumnHelper } from "@tanstack/react-table"; -import { isDefined } from "remeda"; -import { resolveProcedureDetailsRoute } from "@/lib/baseModule/moduleRegister/routeResolver"; import { EvaluationDetailsTableRow } from "@/lib/businessModules/statistics/api/models/evaluationDetailsTableData"; import { FlatAttribute } from "@/lib/businessModules/statistics/api/models/flatAttribute"; import { mapRawValueToTableCell } from "@/lib/businessModules/statistics/components/evaluations/details/table/mapRawValueToTableCell"; const columnHelper = createColumnHelper<EvaluationDetailsTableRow>(); +// TODO: this should be removed in ISSUE-7403 +export const DUMMY_COLUMN = "dummyColumn"; export function evaluationColumns({ flatAttributes, - resolveProcedureId, }: { flatAttributes: FlatAttribute[]; - resolveProcedureId: ( - procedureReferenceId: string | undefined, - ) => string | undefined; }) { + const canNavigate = flatAttributes.some( + (attribute) => attribute.type === "ProcedureReferenceAttribute", + ); + const dataColumns = flatAttributes .filter((attribute) => attribute.type !== "ProcedureReferenceAttribute") .map((attribute) => { @@ -37,47 +34,23 @@ export function evaluationColumns({ "valueOptions" in attribute ? attribute.valueOptions : undefined, ), meta: { + canNavigate: { + parentRow: canNavigate, + }, width: "12rem", }, }); }); - const procedureLinkColumns = flatAttributes - .filter((attribute) => attribute.type === "ProcedureReferenceAttribute") - .map((attribute) => { - return columnHelper.accessor(attribute.key, { - header: "", - cell: (props) => { - const procedureReferenceId = props.getValue() as string | undefined; - const procedureId = resolveProcedureId(procedureReferenceId); - const href = isDefined(procedureId) - ? resolveProcedureDetailsRoute({ - businessModule: attribute.businessModule, - procedureId, - }) - : undefined; - - return isDefined(href) ? ( - <Stack direction="row" justifyContent={"flex-end"}> - <InternalLinkIconButton - variant="plain" - color="primary" - size="sm" - href={href} - aria-label="Vorgangsdetails" - > - <ArrowForwardIosIcon /> - </InternalLinkIconButton> - </Stack> - ) : undefined; - }, - enableSorting: false, - meta: { - width: "3rem", - cellStyle: "button", - }, - }); - }); + const dummyColumn = columnHelper.accessor(DUMMY_COLUMN, { + header: "", + cell: "", + meta: { + canNavigate: { + parentRow: canNavigate, + }, + }, + }); - return [...dataColumns, ...procedureLinkColumns]; + return dataColumns.length > 0 ? dataColumns : [dummyColumn]; } diff --git a/employee-portal/src/lib/businessModules/statistics/components/evaluations/details/table/mapRawValueToTableCell.ts b/employee-portal/src/lib/businessModules/statistics/components/evaluations/details/table/mapRawValueToTableCell.ts index 51bd3e925..d67706246 100644 --- a/employee-portal/src/lib/businessModules/statistics/components/evaluations/details/table/mapRawValueToTableCell.ts +++ b/employee-portal/src/lib/businessModules/statistics/components/evaluations/details/table/mapRawValueToTableCell.ts @@ -3,8 +3,8 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiValueOption } from "@eshg/employee-portal-api/statistics"; import { formatDate } from "@eshg/lib-portal/formatters/dateTime"; +import { ApiValueOption } from "@eshg/statistics-api"; import { isDate } from "date-fns"; import { isDefined } from "remeda"; diff --git a/employee-portal/src/lib/businessModules/statistics/components/evaluations/filterDefinitions.ts b/employee-portal/src/lib/businessModules/statistics/components/evaluations/filterDefinitions.ts index df8dd4768..ee3ea617c 100644 --- a/employee-portal/src/lib/businessModules/statistics/components/evaluations/filterDefinitions.ts +++ b/employee-portal/src/lib/businessModules/statistics/components/evaluations/filterDefinitions.ts @@ -6,7 +6,7 @@ import { ApiAvailableDataSource, ApiEvaluationState, -} from "@eshg/employee-portal-api/statistics"; +} from "@eshg/statistics-api"; import { isPlainObject } from "remeda"; import { diff --git a/employee-portal/src/lib/businessModules/statistics/components/evaluations/getAttributeLabel.ts b/employee-portal/src/lib/businessModules/statistics/components/evaluations/getAttributeLabel.ts index eb6bf11c3..5562d6611 100644 --- a/employee-portal/src/lib/businessModules/statistics/components/evaluations/getAttributeLabel.ts +++ b/employee-portal/src/lib/businessModules/statistics/components/evaluations/getAttributeLabel.ts @@ -6,7 +6,7 @@ import { ApiBaseDataSourceAttribute, ApiBusinessDataSourceAttribute, -} from "@eshg/employee-portal-api/statistics"; +} from "@eshg/statistics-api"; import { isNonNullish } from "remeda"; export function getAttributeLabel( diff --git a/employee-portal/src/lib/businessModules/statistics/components/evaluations/templates/filterDefinitions.ts b/employee-portal/src/lib/businessModules/statistics/components/evaluations/templates/filterDefinitions.ts index a2b71eaba..9c045e277 100644 --- a/employee-portal/src/lib/businessModules/statistics/components/evaluations/templates/filterDefinitions.ts +++ b/employee-portal/src/lib/businessModules/statistics/components/evaluations/templates/filterDefinitions.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiAvailableDataSource } from "@eshg/employee-portal-api/statistics"; +import { ApiAvailableDataSource } from "@eshg/statistics-api"; import { FilterDefinition } from "@/lib/shared/components/filterSettings/models/FilterDefinition"; diff --git a/employee-portal/src/lib/businessModules/statistics/components/reports/filterDefinitions.ts b/employee-portal/src/lib/businessModules/statistics/components/reports/filterDefinitions.ts index 04808d4a0..d6454b666 100644 --- a/employee-portal/src/lib/businessModules/statistics/components/reports/filterDefinitions.ts +++ b/employee-portal/src/lib/businessModules/statistics/components/reports/filterDefinitions.ts @@ -3,10 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { - ApiAvailableDataSource, - ApiReportType, -} from "@eshg/employee-portal-api/statistics"; +import { ApiAvailableDataSource, ApiReportType } from "@eshg/statistics-api"; import { translateReportType } from "@/lib/businessModules/statistics/api/mapper/translateReportType"; import { diff --git a/employee-portal/src/lib/businessModules/statistics/components/shared/charts/EChart.tsx b/employee-portal/src/lib/businessModules/statistics/components/shared/charts/EChart.tsx index 27c94e9e5..22a9bbe58 100644 --- a/employee-portal/src/lib/businessModules/statistics/components/shared/charts/EChart.tsx +++ b/employee-portal/src/lib/businessModules/statistics/components/shared/charts/EChart.tsx @@ -3,6 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +import { Box } from "@mui/joy"; import { EChartsOption } from "echarts"; import ReactEChartsCore from "echarts-for-react/lib/core"; import { @@ -207,12 +208,13 @@ export function EChart(props: { ); return ( - <ReactEChartsCore + <Box + component={ReactEChartsCore} ref={ref} echarts={echarts} option={options} opts={{ locale: "DE", renderer: imageType }} - style={{ flex: 1 }} + sx={{ flex: 1 }} /> ); } diff --git a/employee-portal/src/lib/businessModules/statistics/components/shared/charts/chartHelper.ts b/employee-portal/src/lib/businessModules/statistics/components/shared/charts/chartHelper.ts index 779605796..5af5b96d4 100644 --- a/employee-portal/src/lib/businessModules/statistics/components/shared/charts/chartHelper.ts +++ b/employee-portal/src/lib/businessModules/statistics/components/shared/charts/chartHelper.ts @@ -102,8 +102,10 @@ export function isText(valueType: AttributeType) { return valueType === "TextAttribute"; } -export function isBooleanOrValueWithOptions(valueType: AttributeType) { - return isBoolean(valueType) || isValueWithOptions(valueType); +export function isCategorical(valueType: AttributeType) { + return ( + isBoolean(valueType) || isValueWithOptions(valueType) || isText(valueType) + ); } export function isNumeric(valueType: AttributeType) { diff --git a/employee-portal/src/lib/businessModules/statistics/components/shared/charts/types.ts b/employee-portal/src/lib/businessModules/statistics/components/shared/charts/types.ts index 1a3abeaa4..1dd11f3ff 100644 --- a/employee-portal/src/lib/businessModules/statistics/components/shared/charts/types.ts +++ b/employee-portal/src/lib/businessModules/statistics/components/shared/charts/types.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiBaseModuleIdAttributeAllOfBaseAttribute } from "@eshg/employee-portal-api/statistics"; +import { ApiBaseModuleIdAttributeAllOfBaseAttribute } from "@eshg/statistics-api"; export const ImageType = { SVG: "svg", diff --git a/employee-portal/src/lib/businessModules/stiProtection/api/download/files.ts b/employee-portal/src/lib/businessModules/stiProtection/api/download/files.ts deleted file mode 100644 index eccc16a00..000000000 --- a/employee-portal/src/lib/businessModules/stiProtection/api/download/files.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** - * Copyright 2025 cronn GmbH - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { useFileApi } from "@/lib/businessModules/stiProtection/api/clients"; -import { useDownloadFile } from "@/lib/shared/api/download/files"; - -export function useDownloadStiProtectionFile() { - const fileApi = useFileApi(); - return useDownloadFile((fileId: string) => - fileApi.downloadFileRaw({ fileId }), - ); -} diff --git a/employee-portal/src/lib/businessModules/stiProtection/api/models/AppointmentBlockGroup.ts b/employee-portal/src/lib/businessModules/stiProtection/api/models/AppointmentBlockGroup.ts index 6cd4d37cf..1e8cdf7de 100644 --- a/employee-portal/src/lib/businessModules/stiProtection/api/models/AppointmentBlockGroup.ts +++ b/employee-portal/src/lib/businessModules/stiProtection/api/models/AppointmentBlockGroup.ts @@ -8,11 +8,13 @@ import { ApiGetAppointmentBlock, ApiGetAppointmentBlockGroup, } from "@eshg/employee-portal-api/stiProtection"; +import { + BaseEntity, + mapBaseEntity, +} from "@eshg/lib-employee-portal/api/models/BaseEntity"; import { assertNonEmptyArray } from "@eshg/lib-portal/helpers/assertions"; import { first, last, sumBy } from "remeda"; -import { BaseEntity, mapBaseEntity } from "@/lib/shared/api/models/BaseEntity"; - export interface AppointmentBlockStiProtection extends BaseEntity { readonly start: Date; readonly end: Date; diff --git a/employee-portal/src/lib/businessModules/stiProtection/api/models/AppointmentTypeConfig.ts b/employee-portal/src/lib/businessModules/stiProtection/api/models/AppointmentTypeConfig.ts index f91530e21..9ac9d5649 100644 --- a/employee-portal/src/lib/businessModules/stiProtection/api/models/AppointmentTypeConfig.ts +++ b/employee-portal/src/lib/businessModules/stiProtection/api/models/AppointmentTypeConfig.ts @@ -7,8 +7,10 @@ import { ApiAppointmentType, ApiAppointmentTypeConfig, } from "@eshg/employee-portal-api/stiProtection"; - -import { BaseEntity, mapBaseEntity } from "@/lib/shared/api/models/BaseEntity"; +import { + BaseEntity, + mapBaseEntity, +} from "@eshg/lib-employee-portal/api/models/BaseEntity"; export interface AppointmentTypeConfig extends BaseEntity { appointmentTypeDto: ApiAppointmentType; diff --git a/employee-portal/src/lib/businessModules/stiProtection/api/mutations/approvalRequests.ts b/employee-portal/src/lib/businessModules/stiProtection/api/mutations/approvalRequests.ts deleted file mode 100644 index eb24c0372..000000000 --- a/employee-portal/src/lib/businessModules/stiProtection/api/mutations/approvalRequests.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Copyright 2025 cronn GmbH - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { useApprovalRequestApi } from "@/lib/businessModules/stiProtection/api/clients"; -import { progressEntryApiQueryKey } from "@/lib/businessModules/stiProtection/api/queries/apiQueryKeys"; -import { - useDecideApprovalRequestTemplate, - useGrantDeletionForAllRequestsTemplate, -} from "@/lib/shared/api/mutations/approvalRequests"; - -export function useDecideApprovalRequest() { - return useDecideApprovalRequestTemplate( - useApprovalRequestApi, - progressEntryApiQueryKey([]), - ); -} - -export function useGrantDeletionForAllRequests() { - return useGrantDeletionForAllRequestsTemplate( - useApprovalRequestApi, - progressEntryApiQueryKey([]), - ); -} diff --git a/employee-portal/src/lib/businessModules/stiProtection/api/mutations/files.ts b/employee-portal/src/lib/businessModules/stiProtection/api/mutations/files.ts deleted file mode 100644 index fb9210c8a..000000000 --- a/employee-portal/src/lib/businessModules/stiProtection/api/mutations/files.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Copyright 2025 cronn GmbH - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { useFileApi } from "@/lib/businessModules/stiProtection/api/clients"; -import { fileApiQueryKey } from "@/lib/businessModules/stiProtection/api/queries/apiQueryKeys"; -import { - useDeleteFileTemplate, - useRequestFileDeletionTemplate, -} from "@/lib/shared/api/mutations/files"; - -export function useDeleteFile() { - return useDeleteFileTemplate(useFileApi, fileApiQueryKey([])); -} - -export function useRequestFileDeletion() { - return useRequestFileDeletionTemplate(useFileApi, fileApiQueryKey([])); -} diff --git a/employee-portal/src/lib/businessModules/stiProtection/api/mutations/progressEntries.ts b/employee-portal/src/lib/businessModules/stiProtection/api/mutations/progressEntries.ts deleted file mode 100644 index 4e9a85bee..000000000 --- a/employee-portal/src/lib/businessModules/stiProtection/api/mutations/progressEntries.ts +++ /dev/null @@ -1,45 +0,0 @@ -/** - * Copyright 2025 cronn GmbH - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { - useFileApi, - useProgressEntryApi, -} from "@/lib/businessModules/stiProtection/api/clients"; -import { progressEntryApiQueryKey } from "@/lib/businessModules/stiProtection/api/queries/apiQueryKeys"; -import { - useCreateProgressEntryTemplate, - useDeleteProgressEntryTemplate, - usePatchProgressEntryTemplate, - useRequestProgressEntryDeletionTemplate, -} from "@/lib/shared/api/mutations/progressEntries"; - -export function useCreateProgressEntry() { - return useCreateProgressEntryTemplate( - useProgressEntryApi, - progressEntryApiQueryKey([]), - ); -} - -export function useDeleteProgressEntry() { - return useDeleteProgressEntryTemplate( - useProgressEntryApi, - progressEntryApiQueryKey([]), - ); -} - -export function usePatchProgressEntry() { - return usePatchProgressEntryTemplate( - useProgressEntryApi, - useFileApi, - progressEntryApiQueryKey([]), - ); -} - -export function useRequestProgressEntryDeletion() { - return useRequestProgressEntryDeletionTemplate( - useProgressEntryApi, - progressEntryApiQueryKey([]), - ); -} diff --git a/employee-portal/src/lib/businessModules/stiProtection/api/queries/appointmentBlocks.ts b/employee-portal/src/lib/businessModules/stiProtection/api/queries/appointmentBlocks.ts index 0c19a9586..6fc5e17e6 100644 --- a/employee-portal/src/lib/businessModules/stiProtection/api/queries/appointmentBlocks.ts +++ b/employee-portal/src/lib/businessModules/stiProtection/api/queries/appointmentBlocks.ts @@ -8,12 +8,12 @@ import { ApiCreateDailyAppointmentBlockGroupRequest, GetAppointmentBlockGroupsRequest, } from "@eshg/employee-portal-api/stiProtection"; +import { mapPaginatedList } from "@eshg/lib-employee-portal/api/models/PaginatedList"; import { unwrapRawResponse } from "@eshg/lib-portal/api/unwrapRawResponse"; import { useQuery, useSuspenseQuery } from "@tanstack/react-query"; import { useAppointmentBlockApi } from "@/lib/businessModules/stiProtection/api/clients"; import { mapAppointmentBlockGroup } from "@/lib/businessModules/stiProtection/api/models/AppointmentBlockGroup"; -import { mapPaginatedList } from "@/lib/shared/api/models/PaginatedList"; import { appointmentBlockApiQueryKey } from "./apiQueryKeys"; diff --git a/employee-portal/src/lib/businessModules/stiProtection/api/queries/files.ts b/employee-portal/src/lib/businessModules/stiProtection/api/queries/files.ts deleted file mode 100644 index 3f9628538..000000000 --- a/employee-portal/src/lib/businessModules/stiProtection/api/queries/files.ts +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Copyright 2025 cronn GmbH - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { useSuspenseQuery } from "@tanstack/react-query"; - -import { useFileApi } from "@/lib/businessModules/stiProtection/api/clients"; -import { fileApiQueryKey } from "@/lib/businessModules/stiProtection/api/queries/apiQueryKeys"; -import { useGetMetaDataHistoryTemplate } from "@/lib/shared/api/queries/files"; - -export function useGetFile(fileId: string) { - const fileApi = useFileApi(); - return useSuspenseQuery({ - queryFn: () => fileApi.getFile(fileId), - queryKey: fileApiQueryKey(["get", fileId]), - }); -} - -export function useDownloadFile(fileId: string) { - const fileApi = useFileApi(); - return useSuspenseQuery({ - queryFn: () => fileApi.downloadFile(fileId), - queryKey: fileApiQueryKey(["download", fileId]), - }); -} - -export function useGetMetaDataHistory(fileId: string) { - return useGetMetaDataHistoryTemplate(useFileApi, fileApiQueryKey, fileId); -} diff --git a/employee-portal/src/lib/businessModules/stiProtection/api/queries/progressEntries.ts b/employee-portal/src/lib/businessModules/stiProtection/api/queries/progressEntries.ts deleted file mode 100644 index 4d77eeff7..000000000 --- a/employee-portal/src/lib/businessModules/stiProtection/api/queries/progressEntries.ts +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Copyright 2025 cronn GmbH - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { ApiUserRole } from "@eshg/base-api"; - -import { - useProcedureApi, - useProgressEntryApi, -} from "@/lib/businessModules/stiProtection/api/clients"; -import { progressEntryApiQueryKey } from "@/lib/businessModules/stiProtection/api/queries/apiQueryKeys"; -import { - useFetchProgressEntriesTemplate, - useFetchProgressEntryDetailsTemplate, - useGetManualProgressEntryHistoryTemplate, -} from "@/lib/shared/api/queries/progressEntries"; -import { ProgressEntriesFilters } from "@/lib/shared/components/procedures/progress-entries/types"; - -export function useFetchProgressEntries( - procedureId: string, - leaderRole: ApiUserRole, - progressEntryFilter: ProgressEntriesFilters, -) { - return useFetchProgressEntriesTemplate( - useProgressEntryApi, - useProcedureApi, - progressEntryApiQueryKey, - procedureId, - leaderRole, - progressEntryFilter, - ); -} - -export function useFetchProgressEntryDetails( - procedureId: string, - entryId: string, -) { - return useFetchProgressEntryDetailsTemplate( - useProgressEntryApi, - progressEntryApiQueryKey, - procedureId, - entryId, - ); -} - -export function useGetManualProgressEntryHistory(entryId: string) { - return useGetManualProgressEntryHistoryTemplate( - useProgressEntryApi, - progressEntryApiQueryKey, - entryId, - ); -} diff --git a/employee-portal/src/lib/businessModules/stiProtection/features/procedures/details/CheckPinSection.tsx b/employee-portal/src/lib/businessModules/stiProtection/features/procedures/details/CheckPinSection.tsx index dca8268e2..d8029c565 100644 --- a/employee-portal/src/lib/businessModules/stiProtection/features/procedures/details/CheckPinSection.tsx +++ b/employee-portal/src/lib/businessModules/stiProtection/features/procedures/details/CheckPinSection.tsx @@ -42,7 +42,7 @@ export function CheckPinSection({ initialValues={{ pin: undefined }} onSubmit={(form) => setPinToCheck(form.pin)} > - <FormPlus style={{ display: "contents" }}> + <FormPlus sx={{ display: "contents" }}> <Row sx={{ alignItems: "end" }}> <InputField label="6-stellige PIN" diff --git a/employee-portal/src/lib/businessModules/stiProtection/features/procedures/details/CreateAppointmentSidebar.tsx b/employee-portal/src/lib/businessModules/stiProtection/features/procedures/details/CreateAppointmentSidebar.tsx index bf33e5679..d1d4c2821 100644 --- a/employee-portal/src/lib/businessModules/stiProtection/features/procedures/details/CreateAppointmentSidebar.tsx +++ b/employee-portal/src/lib/businessModules/stiProtection/features/procedures/details/CreateAppointmentSidebar.tsx @@ -3,7 +3,6 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiAppointment } from "@eshg/employee-portal-api/measlesProtection"; import { ApiAppointmentBookingType, ApiAppointmentType, @@ -13,6 +12,7 @@ import { ApiUpdateAppointmentRequest, } from "@eshg/employee-portal-api/stiProtection"; import { useSnackbar } from "@eshg/lib-portal/components/snackbar/SnackbarProvider"; +import { ApiAppointment } from "@eshg/measles-protection-api"; import { differenceInMinutes } from "date-fns"; import { Formik, FormikHelpers } from "formik"; import { ReactNode, useMemo, useReducer } from "react"; diff --git a/employee-portal/src/lib/businessModules/stiProtection/features/procedures/details/WaitingRoomSection.tsx b/employee-portal/src/lib/businessModules/stiProtection/features/procedures/details/WaitingRoomSection.tsx index 3dcffd43c..cdda8a173 100644 --- a/employee-portal/src/lib/businessModules/stiProtection/features/procedures/details/WaitingRoomSection.tsx +++ b/employee-portal/src/lib/businessModules/stiProtection/features/procedures/details/WaitingRoomSection.tsx @@ -66,7 +66,7 @@ export function WaitingRoomSection({ updateWaitingRoomDetails.mutate(transformToValid(form, procedure)) } > - <FormPlus style={{ display: "contents" }}> + <FormPlus sx={{ display: "contents" }}> <InputField label="Zusätzliche Info" name="info" diff --git a/employee-portal/src/lib/businessModules/stiProtection/features/procedures/diagnosis/DiagnosisForm.tsx b/employee-portal/src/lib/businessModules/stiProtection/features/procedures/diagnosis/DiagnosisForm.tsx index b1079a6c6..8216bbb63 100644 --- a/employee-portal/src/lib/businessModules/stiProtection/features/procedures/diagnosis/DiagnosisForm.tsx +++ b/employee-portal/src/lib/businessModules/stiProtection/features/procedures/diagnosis/DiagnosisForm.tsx @@ -71,7 +71,7 @@ export function DiagnosisForm({ return ( <Formik initialValues={mapApiToForm(diagnosis)} onSubmit={onSubmit}> - <FormPlus style={{ height: "100%" }}> + <FormPlus sx={{ height: "100%" }}> <SidecarFormLayout> <Sheet> <Stack gap={5}> diff --git a/employee-portal/src/lib/businessModules/stiProtection/features/procedures/examination/laboratoryTest/LaboratoryTestExamination.tsx b/employee-portal/src/lib/businessModules/stiProtection/features/procedures/examination/laboratoryTest/LaboratoryTestExamination.tsx index 9f3cdbbf6..538bdd499 100644 --- a/employee-portal/src/lib/businessModules/stiProtection/features/procedures/examination/laboratoryTest/LaboratoryTestExamination.tsx +++ b/employee-portal/src/lib/businessModules/stiProtection/features/procedures/examination/laboratoryTest/LaboratoryTestExamination.tsx @@ -297,7 +297,7 @@ export function LaboratoryTestExamination( enableReinitialize > {({ dirty, resetForm, isSubmitting }) => ( - <FormPlus style={{ height: "100%", overflow: "hidden" }}> + <FormPlus sx={{ height: "100%", overflow: "hidden" }}> <Box sx={{ pt: 3, diff --git a/employee-portal/src/lib/businessModules/stiProtection/features/procedures/examination/rapidTest/RapidTestExamination.tsx b/employee-portal/src/lib/businessModules/stiProtection/features/procedures/examination/rapidTest/RapidTestExamination.tsx index 2bf42c1cf..20ea6e8ca 100644 --- a/employee-portal/src/lib/businessModules/stiProtection/features/procedures/examination/rapidTest/RapidTestExamination.tsx +++ b/employee-portal/src/lib/businessModules/stiProtection/features/procedures/examination/rapidTest/RapidTestExamination.tsx @@ -166,7 +166,7 @@ export function RapidTestExamination(props: RapidTestExaminationProps) { enableReinitialize > {({ dirty, resetForm, isSubmitting }) => ( - <FormPlus style={{ height: "100%", overflow: "hidden" }}> + <FormPlus sx={{ height: "100%", overflow: "hidden" }}> <Box sx={{ pt: 3, diff --git a/employee-portal/src/lib/businessModules/travelMedicine/api/download/files.ts b/employee-portal/src/lib/businessModules/travelMedicine/api/download/files.ts index 6aed7320e..90b2802fa 100644 --- a/employee-portal/src/lib/businessModules/travelMedicine/api/download/files.ts +++ b/employee-portal/src/lib/businessModules/travelMedicine/api/download/files.ts @@ -3,36 +3,34 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +import { + GetInformationStatementPdfRequest, + GetMedicalHistoryPdfRequest, +} from "@eshg/employee-portal-api/travelMedicine"; +import { useFileDownload } from "@eshg/lib-portal/api/files/download"; + import { useFileApi, useVaccinationConsultationApi, } from "@/lib/businessModules/travelMedicine/api/clients"; -import { useDownloadFile } from "@/lib/shared/api/download/files"; export function useDownloadTravelMedicineFile() { const fileApi = useFileApi(); - return useDownloadFile((fileId: string) => + return useFileDownload((fileId: string) => fileApi.downloadFileRaw({ fileId }), ); } export function useDownloadInformationStatementPdf() { const vaccinationConsultationApi = useVaccinationConsultationApi(); - return useDownloadFile( - (procedureId: string, informationStatementId: string) => - vaccinationConsultationApi.getInformationStatementPdfRaw({ - procedureId, - informationStatementId, - }), + return useFileDownload((request: GetInformationStatementPdfRequest) => + vaccinationConsultationApi.getInformationStatementPdfRaw(request), ); } export function useDownloadMedicalHistoryPdf() { const vaccinationConsultationApi = useVaccinationConsultationApi(); - return useDownloadFile((procedureId: string, medicalHistoryId: string) => - vaccinationConsultationApi.getMedicalHistoryPdfRaw({ - procedureId, - medicalHistoryId, - }), + return useFileDownload((request: GetMedicalHistoryPdfRequest) => + vaccinationConsultationApi.getMedicalHistoryPdfRaw(request), ); } diff --git a/employee-portal/src/lib/businessModules/travelMedicine/api/models/AppointmentBlock.ts b/employee-portal/src/lib/businessModules/travelMedicine/api/models/AppointmentBlock.ts index 493c6b45a..ac085a1e9 100644 --- a/employee-portal/src/lib/businessModules/travelMedicine/api/models/AppointmentBlock.ts +++ b/employee-portal/src/lib/businessModules/travelMedicine/api/models/AppointmentBlock.ts @@ -8,11 +8,13 @@ import { ApiGetAppointmentBlock, ApiGetAppointmentBlockGroup, } from "@eshg/employee-portal-api/travelMedicine"; +import { + BaseEntity, + mapBaseEntity, +} from "@eshg/lib-employee-portal/api/models/BaseEntity"; import { assertNonEmptyArray } from "@eshg/lib-portal/helpers/assertions"; import { first, last, sumBy } from "remeda"; -import { BaseEntity, mapBaseEntity } from "@/lib/shared/api/models/BaseEntity"; - export interface AppointmentBlockGroup extends AppointmentBlock { readonly type: ApiAppointmentType; readonly parallelExaminations: number; diff --git a/employee-portal/src/lib/businessModules/travelMedicine/api/models/AppointmentTypeConfig.ts b/employee-portal/src/lib/businessModules/travelMedicine/api/models/AppointmentTypeConfig.ts index 11c383d97..819435e21 100644 --- a/employee-portal/src/lib/businessModules/travelMedicine/api/models/AppointmentTypeConfig.ts +++ b/employee-portal/src/lib/businessModules/travelMedicine/api/models/AppointmentTypeConfig.ts @@ -7,8 +7,10 @@ import { ApiAppointmentType, ApiAppointmentTypeConfig, } from "@eshg/employee-portal-api/travelMedicine"; - -import { BaseEntity, mapBaseEntity } from "@/lib/shared/api/models/BaseEntity"; +import { + BaseEntity, + mapBaseEntity, +} from "@eshg/lib-employee-portal/api/models/BaseEntity"; export interface AppointmentTypeConfig extends BaseEntity { readonly appointmentTypeDto: ApiAppointmentType; diff --git a/employee-portal/src/lib/businessModules/travelMedicine/api/models/Disease.ts b/employee-portal/src/lib/businessModules/travelMedicine/api/models/Disease.ts index 48a91c49b..985607320 100644 --- a/employee-portal/src/lib/businessModules/travelMedicine/api/models/Disease.ts +++ b/employee-portal/src/lib/businessModules/travelMedicine/api/models/Disease.ts @@ -4,10 +4,12 @@ */ import { ApiDisease } from "@eshg/employee-portal-api/travelMedicine"; +import { + BaseEntity, + mapBaseEntity, +} from "@eshg/lib-employee-portal/api/models/BaseEntity"; import { mapOptionalValue } from "@eshg/lib-portal/helpers/form"; -import { BaseEntity, mapBaseEntity } from "@/lib/shared/api/models/BaseEntity"; - export interface Disease extends BaseEntity { readonly createdAt: Date; readonly estimatedFee?: number; diff --git a/employee-portal/src/lib/businessModules/travelMedicine/api/models/InformationStatementTemplates.ts b/employee-portal/src/lib/businessModules/travelMedicine/api/models/InformationStatementTemplates.ts index 18582d83e..c531b9b46 100644 --- a/employee-portal/src/lib/businessModules/travelMedicine/api/models/InformationStatementTemplates.ts +++ b/employee-portal/src/lib/businessModules/travelMedicine/api/models/InformationStatementTemplates.ts @@ -9,10 +9,12 @@ import { ApiInformationStatementTemplateState, ApiTemplateContent, } from "@eshg/employee-portal-api/travelMedicine"; +import { + BaseEntity, + mapBaseEntity, +} from "@eshg/lib-employee-portal/api/models/BaseEntity"; import { mapOptionalValue } from "@eshg/lib-portal/helpers/form"; -import { BaseEntity, mapBaseEntity } from "@/lib/shared/api/models/BaseEntity"; - export interface InformationStatementTemplate extends BaseEntity { readonly createdAt: Date; readonly diseases: ApiDisease[]; diff --git a/employee-portal/src/lib/businessModules/travelMedicine/api/models/OtherServicesTemplates.ts b/employee-portal/src/lib/businessModules/travelMedicine/api/models/OtherServicesTemplates.ts index f534978f3..f65ea63b0 100644 --- a/employee-portal/src/lib/businessModules/travelMedicine/api/models/OtherServicesTemplates.ts +++ b/employee-portal/src/lib/businessModules/travelMedicine/api/models/OtherServicesTemplates.ts @@ -4,10 +4,12 @@ */ import { ApiOtherServiceTemplate } from "@eshg/employee-portal-api/travelMedicine"; +import { + BaseEntity, + mapBaseEntity, +} from "@eshg/lib-employee-portal/api/models/BaseEntity"; import { mapOptionalValue } from "@eshg/lib-portal/helpers/form"; -import { BaseEntity, mapBaseEntity } from "@/lib/shared/api/models/BaseEntity"; - export interface OtherServicesTemplates extends BaseEntity { readonly createdAt: Date; readonly description: string; diff --git a/employee-portal/src/lib/businessModules/travelMedicine/api/models/Vaccines.ts b/employee-portal/src/lib/businessModules/travelMedicine/api/models/Vaccines.ts index ac8711440..40d14f624 100644 --- a/employee-portal/src/lib/businessModules/travelMedicine/api/models/Vaccines.ts +++ b/employee-portal/src/lib/businessModules/travelMedicine/api/models/Vaccines.ts @@ -4,13 +4,16 @@ */ import { ApiVaccine } from "@eshg/employee-portal-api/travelMedicine"; +import { + BaseEntity, + mapBaseEntity, +} from "@eshg/lib-employee-portal/api/models/BaseEntity"; import { mapOptionalValue } from "@eshg/lib-portal/helpers/form"; import { Disease, mapDisease, } from "@/lib/businessModules/travelMedicine/api/models/Disease"; -import { BaseEntity, mapBaseEntity } from "@/lib/shared/api/models/BaseEntity"; export interface Vaccines extends BaseEntity { readonly createdAt: Date; diff --git a/employee-portal/src/lib/businessModules/travelMedicine/api/mutations/approvalRequests.ts b/employee-portal/src/lib/businessModules/travelMedicine/api/mutations/approvalRequests.ts deleted file mode 100644 index 2b2798849..000000000 --- a/employee-portal/src/lib/businessModules/travelMedicine/api/mutations/approvalRequests.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Copyright 2025 SCOOP Software GmbH, cronn GmbH - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { useApprovalRequestApi } from "@/lib/businessModules/travelMedicine/api/clients"; -import { - useDecideApprovalRequestTemplate, - useGrantDeletionForAllRequestsTemplate, -} from "@/lib/shared/api/mutations/approvalRequests"; - -export function useDecideApprovalRequest() { - return useDecideApprovalRequestTemplate(useApprovalRequestApi); -} - -export function useGrantDeletionForAllRequests() { - return useGrantDeletionForAllRequestsTemplate(useApprovalRequestApi); -} diff --git a/employee-portal/src/lib/businessModules/travelMedicine/api/mutations/files.ts b/employee-portal/src/lib/businessModules/travelMedicine/api/mutations/files.ts deleted file mode 100644 index 8f2e66f66..000000000 --- a/employee-portal/src/lib/businessModules/travelMedicine/api/mutations/files.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Copyright 2025 SCOOP Software GmbH, cronn GmbH - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { useFileApi } from "@/lib/businessModules/travelMedicine/api/clients"; -import { - useDeleteFileTemplate, - useRequestFileDeletionTemplate, -} from "@/lib/shared/api/mutations/files"; - -export function useDeleteFile() { - return useDeleteFileTemplate(useFileApi); -} - -export function useRequestFileDeletion() { - return useRequestFileDeletionTemplate(useFileApi); -} diff --git a/employee-portal/src/lib/businessModules/travelMedicine/api/mutations/progressEntries.ts b/employee-portal/src/lib/businessModules/travelMedicine/api/mutations/progressEntries.ts deleted file mode 100644 index 628fe03fa..000000000 --- a/employee-portal/src/lib/businessModules/travelMedicine/api/mutations/progressEntries.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Copyright 2025 SCOOP Software GmbH, cronn GmbH - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { - useFileApi, - useProgressEntryApi, -} from "@/lib/businessModules/travelMedicine/api/clients"; -import { - useCreateProgressEntryTemplate, - useDeleteProgressEntryTemplate, - usePatchProgressEntryTemplate, - useRequestProgressEntryDeletionTemplate, -} from "@/lib/shared/api/mutations/progressEntries"; - -export function useCreateProgressEntry() { - return useCreateProgressEntryTemplate(useProgressEntryApi); -} - -export function useDeleteProgressEntry() { - return useDeleteProgressEntryTemplate(useProgressEntryApi); -} - -export function usePatchProgressEntry() { - return usePatchProgressEntryTemplate(useProgressEntryApi, useFileApi); -} - -export function useRequestProgressEntryDeletion() { - return useRequestProgressEntryDeletionTemplate(useProgressEntryApi); -} diff --git a/employee-portal/src/lib/businessModules/travelMedicine/api/queries/appointmentBlocks.ts b/employee-portal/src/lib/businessModules/travelMedicine/api/queries/appointmentBlocks.ts index 39803f4ed..d09c177c7 100644 --- a/employee-portal/src/lib/businessModules/travelMedicine/api/queries/appointmentBlocks.ts +++ b/employee-portal/src/lib/businessModules/travelMedicine/api/queries/appointmentBlocks.ts @@ -8,6 +8,7 @@ import { ApiCreateDailyAppointmentBlockGroupRequest, GetAppointmentBlockGroupsRequest, } from "@eshg/employee-portal-api/travelMedicine"; +import { mapPaginatedList } from "@eshg/lib-employee-portal/api/models/PaginatedList"; import { unwrapRawResponse } from "@eshg/lib-portal/api/unwrapRawResponse"; import { useHandledBackgroundQuery } from "@eshg/lib-portal/api/useHandledBackgroundQuery"; import { queryOptions, useQuery } from "@tanstack/react-query"; @@ -16,7 +17,6 @@ import { useAppointmentBlockApi } from "@/lib/businessModules/travelMedicine/api import { mapAppointment } from "@/lib/businessModules/travelMedicine/api/models/Appointment"; import { mapAppointmentBlockGroup } from "@/lib/businessModules/travelMedicine/api/models/AppointmentBlock"; import { appointmentBlockApiQueryKey } from "@/lib/businessModules/travelMedicine/api/queries/queryKeys"; -import { mapPaginatedList } from "@/lib/shared/api/models/PaginatedList"; export function useGetAppointmentBlockGroupsQuery( request: GetAppointmentBlockGroupsRequest, diff --git a/employee-portal/src/lib/businessModules/travelMedicine/api/queries/files.ts b/employee-portal/src/lib/businessModules/travelMedicine/api/queries/files.ts deleted file mode 100644 index 1b3d8f4d6..000000000 --- a/employee-portal/src/lib/businessModules/travelMedicine/api/queries/files.ts +++ /dev/null @@ -1,12 +0,0 @@ -/** - * Copyright 2025 SCOOP Software GmbH, cronn GmbH - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { useFileApi } from "@/lib/businessModules/travelMedicine/api/clients"; -import { fileApiQueryKey } from "@/lib/businessModules/travelMedicine/api/queries/queryKeys"; -import { useGetMetaDataHistoryTemplate } from "@/lib/shared/api/queries/files"; - -export function useGetMetaDataHistory(fileId: string) { - return useGetMetaDataHistoryTemplate(useFileApi, fileApiQueryKey, fileId); -} diff --git a/employee-portal/src/lib/businessModules/travelMedicine/api/queries/progressEntries.ts b/employee-portal/src/lib/businessModules/travelMedicine/api/queries/progressEntries.ts deleted file mode 100644 index d3c82477f..000000000 --- a/employee-portal/src/lib/businessModules/travelMedicine/api/queries/progressEntries.ts +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Copyright 2025 SCOOP Software GmbH, cronn GmbH - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { ApiUserRole } from "@eshg/base-api"; - -import { - useProcedureApi, - useProgressEntryApi, -} from "@/lib/businessModules/travelMedicine/api/clients"; -import { progressEntryApiQueryKey } from "@/lib/businessModules/travelMedicine/api/queries/queryKeys"; -import { - useFetchProgressEntriesTemplate, - useFetchProgressEntryDetailsTemplate, - useGetManualProgressEntryHistoryTemplate, -} from "@/lib/shared/api/queries/progressEntries"; -import { ProgressEntriesFilters } from "@/lib/shared/components/procedures/progress-entries/types"; - -export function useFetchProgressEntries( - procedureId: string, - leaderRole: ApiUserRole, - progressEntryFilter: ProgressEntriesFilters, -) { - return useFetchProgressEntriesTemplate( - useProgressEntryApi, - useProcedureApi, - progressEntryApiQueryKey, - procedureId, - leaderRole, - progressEntryFilter, - ); -} - -export function useFetchProgressEntryDetails( - procedureId: string, - entryId: string, -) { - return useFetchProgressEntryDetailsTemplate( - useProgressEntryApi, - progressEntryApiQueryKey, - procedureId, - entryId, - ); -} - -export function useGetManualProgressEntryHistory(entryId: string) { - return useGetManualProgressEntryHistoryTemplate( - useProgressEntryApi, - progressEntryApiQueryKey, - entryId, - ); -} diff --git a/employee-portal/src/lib/businessModules/travelMedicine/components/templates/informationStatement/InformationStatementTemplateEditor.tsx b/employee-portal/src/lib/businessModules/travelMedicine/components/templates/informationStatement/InformationStatementTemplateEditor.tsx index 7b038d5e2..9ed21c69c 100644 --- a/employee-portal/src/lib/businessModules/travelMedicine/components/templates/informationStatement/InformationStatementTemplateEditor.tsx +++ b/employee-portal/src/lib/businessModules/travelMedicine/components/templates/informationStatement/InformationStatementTemplateEditor.tsx @@ -162,7 +162,7 @@ export function InformationStatementTemplateEditor( <Formik initialValues={template} onSubmit={handleSubmit} enableReinitialize> {({ isSubmitting, values }) => ( <FormPlus - style={{ height: "100%", overflow: "hidden" }} + sx={{ height: "100%", overflow: "hidden" }} data-testid="information-statement-template-metadata" > <Box diff --git a/employee-portal/src/lib/businessModules/travelMedicine/components/templates/medicalHistory/MedicalHistoryTemplateEditor.tsx b/employee-portal/src/lib/businessModules/travelMedicine/components/templates/medicalHistory/MedicalHistoryTemplateEditor.tsx index ffdaa0b60..a28cce2a8 100644 --- a/employee-portal/src/lib/businessModules/travelMedicine/components/templates/medicalHistory/MedicalHistoryTemplateEditor.tsx +++ b/employee-portal/src/lib/businessModules/travelMedicine/components/templates/medicalHistory/MedicalHistoryTemplateEditor.tsx @@ -145,7 +145,7 @@ export function MedicalHistoryTemplateEditor( onSubmit={onSubmit} > {({ values, isSubmitting }) => ( - <FormPlus style={{ height: "100%", overflow: "hidden" }}> + <FormPlus sx={{ height: "100%", overflow: "hidden" }}> <Box sx={{ pt: 3, diff --git a/employee-portal/src/lib/businessModules/travelMedicine/components/vaccinationConsultations/baseData/sidebars/sidebarForms/EditServiceAppointmentForm.tsx b/employee-portal/src/lib/businessModules/travelMedicine/components/vaccinationConsultations/baseData/sidebars/sidebarForms/EditServiceAppointmentForm.tsx index 2a68dd26f..9c6f07ab7 100644 --- a/employee-portal/src/lib/businessModules/travelMedicine/components/vaccinationConsultations/baseData/sidebars/sidebarForms/EditServiceAppointmentForm.tsx +++ b/employee-portal/src/lib/businessModules/travelMedicine/components/vaccinationConsultations/baseData/sidebars/sidebarForms/EditServiceAppointmentForm.tsx @@ -60,17 +60,19 @@ function formatAppointmentInfo( return ( <Stack gap={2} data-testid="booking-status"> {earliestDate && ( - <p style={{ margin: 0 }}> + <Typography sx={{ margin: 0 }}> Selbstbuchung ab: {formatDate(earliestDate)} - </p> + </Typography> )} {bookingType === "SELF_BOOKING" ? ( - <p style={{ margin: 0 }}>{formatBookingType(bookingType)}</p> + <Typography sx={{ margin: 0 }}> + {formatBookingType(bookingType)} + </Typography> ) : ( - <p style={{ margin: 0 }}> + <Typography sx={{ margin: 0 }}> {`${formatDateTime(appointmentDate)} Uhr `} {formatBookingType(bookingType)} - </p> + </Typography> )} </Stack> ); diff --git a/employee-portal/src/lib/businessModules/travelMedicine/components/vaccinationConsultations/certificates/CertificatesTable.tsx b/employee-portal/src/lib/businessModules/travelMedicine/components/vaccinationConsultations/certificates/CertificatesTable.tsx index e0ff202b0..f8634f339 100644 --- a/employee-portal/src/lib/businessModules/travelMedicine/components/vaccinationConsultations/certificates/CertificatesTable.tsx +++ b/employee-portal/src/lib/businessModules/travelMedicine/components/vaccinationConsultations/certificates/CertificatesTable.tsx @@ -9,7 +9,6 @@ import { ApiProcedureStatus, ApiTMCertificate, } from "@eshg/employee-portal-api/travelMedicine"; -import { downloadFileAndOpen } from "@eshg/lib-portal/api/files/download"; import { useSnackbar } from "@eshg/lib-portal/components/snackbar/SnackbarProvider"; import { ReceiptOutlined } from "@mui/icons-material"; import AddOutlined from "@mui/icons-material/AddOutlined"; @@ -35,7 +34,7 @@ export function CertificatesTable({ procedureId: string; }>) { const snackbar = useSnackbar(); - const downloadFile = useDownloadTravelMedicineFile(); + const file = useDownloadTravelMedicineFile(); const [ { data: tableData }, @@ -66,11 +65,7 @@ export function CertificatesTable({ async function downloadCertificate(certificate: ApiTMCertificate) { try { if (certificate.certificateFileId !== undefined) { - const downloadedFile = await downloadFile( - certificate.certificateFileId, - ); - - downloadFileAndOpen(downloadedFile); + await file.download(certificate.certificateFileId); } } catch { snackbar.error("Der Download der Bescheinigung ist fehlgeschlagen."); diff --git a/employee-portal/src/lib/businessModules/travelMedicine/components/vaccinationConsultations/informationStatements/InformationStatementsTable.tsx b/employee-portal/src/lib/businessModules/travelMedicine/components/vaccinationConsultations/informationStatements/InformationStatementsTable.tsx index 85ab4608d..7e787c832 100644 --- a/employee-portal/src/lib/businessModules/travelMedicine/components/vaccinationConsultations/informationStatements/InformationStatementsTable.tsx +++ b/employee-portal/src/lib/businessModules/travelMedicine/components/vaccinationConsultations/informationStatements/InformationStatementsTable.tsx @@ -6,7 +6,6 @@ "use client"; import { ApiProcedureStatus } from "@eshg/employee-portal-api/travelMedicine"; -import { downloadFileAndOpen } from "@eshg/lib-portal/api/files/download"; import { AddOutlined, DocumentScannerOutlined } from "@mui/icons-material"; import { Button, Stack, Typography } from "@mui/joy"; import { useSuspenseQueries } from "@tanstack/react-query"; @@ -36,7 +35,7 @@ export function InformationStatementsTable({ }>) { const resetInformationStatementApi = useResetInformationStatement(); const deleteInformationStatementApi = useDeleteInformationStatement(); - const downloadInformationStatementPdf = useDownloadInformationStatementPdf(); + const informationStatementPdf = useDownloadInformationStatementPdf(); const [{ data: allInformationStatements }, { data: status }] = useSuspenseQueries({ @@ -89,11 +88,10 @@ export function InformationStatementsTable({ } async function getInformationStatementPdf(informationStatementId: string) { - const downloadedFile = await downloadInformationStatementPdf( + await informationStatementPdf.download({ procedureId, informationStatementId, - ); - downloadFileAndOpen(downloadedFile); + }); } return ( diff --git a/employee-portal/src/lib/businessModules/travelMedicine/components/vaccinationConsultations/medicalHistory/MedicalHistory.tsx b/employee-portal/src/lib/businessModules/travelMedicine/components/vaccinationConsultations/medicalHistory/MedicalHistory.tsx index c4b91a952..05820eebb 100644 --- a/employee-portal/src/lib/businessModules/travelMedicine/components/vaccinationConsultations/medicalHistory/MedicalHistory.tsx +++ b/employee-portal/src/lib/businessModules/travelMedicine/components/vaccinationConsultations/medicalHistory/MedicalHistory.tsx @@ -143,8 +143,8 @@ export function MedicalHistory({ {element.anamnesisQuestion .subElementText && ( <Stack - style={{ - marginLeft: 16, + sx={{ + marginLeft: 2, }} > <MedicalHistoryTextareaElement diff --git a/employee-portal/src/lib/businessModules/travelMedicine/components/vaccinationConsultations/medicalHistory/MedicalHistoryContent.tsx b/employee-portal/src/lib/businessModules/travelMedicine/components/vaccinationConsultations/medicalHistory/MedicalHistoryContent.tsx index 595e20571..2de083364 100644 --- a/employee-portal/src/lib/businessModules/travelMedicine/components/vaccinationConsultations/medicalHistory/MedicalHistoryContent.tsx +++ b/employee-portal/src/lib/businessModules/travelMedicine/components/vaccinationConsultations/medicalHistory/MedicalHistoryContent.tsx @@ -9,7 +9,6 @@ import { ApiMedicalHistory, ApiProcedureStatus, } from "@eshg/employee-portal-api/travelMedicine"; -import { downloadFileAndOpen } from "@eshg/lib-portal/api/files/download"; import { useResetAlertContext } from "@eshg/lib-portal/errorHandling/AlertContext"; import { formatDate } from "@eshg/lib-portal/formatters/dateTime"; import { DownloadOutlined } from "@mui/icons-material"; @@ -38,7 +37,7 @@ export function MedicalHistoriesContent({ const [medicalHistory, setMedicalHistory] = useState<ApiMedicalHistory>(); const resetAlertContext = useResetAlertContext(); - const downloadMedicalHistoryPdf = useDownloadMedicalHistoryPdf(); + const medicalHistoryPdf = useDownloadMedicalHistoryPdf(); const [{ data: allMedicalHistories }, { data: status }] = useSuspenseQueries({ queries: [ @@ -67,11 +66,7 @@ export function MedicalHistoriesContent({ } async function getMedicalHistoryPdf(medicalHistoryId: string) { - const downloadedFile = await downloadMedicalHistoryPdf( - procedureId, - medicalHistoryId, - ); - downloadFileAndOpen(downloadedFile); + await medicalHistoryPdf.download({ procedureId, medicalHistoryId }); } useEffect(() => { diff --git a/employee-portal/src/lib/businessModules/travelMedicine/components/vaccinationConsultations/medicalHistory/MedicalHistoryMultiSelectElement.tsx b/employee-portal/src/lib/businessModules/travelMedicine/components/vaccinationConsultations/medicalHistory/MedicalHistoryMultiSelectElement.tsx index e8a534f90..4063d1fcc 100644 --- a/employee-portal/src/lib/businessModules/travelMedicine/components/vaccinationConsultations/medicalHistory/MedicalHistoryMultiSelectElement.tsx +++ b/employee-portal/src/lib/businessModules/travelMedicine/components/vaccinationConsultations/medicalHistory/MedicalHistoryMultiSelectElement.tsx @@ -61,8 +61,8 @@ export function MedicalHistoryMultiSelectElement({ return ( <Stack - style={{ - marginLeft: 16, + sx={{ + marginLeft: 2, }} > <List diff --git a/employee-portal/src/lib/businessModules/travelMedicine/components/vaccinationConsultations/medicalHistory/MedicalHistorySection.tsx b/employee-portal/src/lib/businessModules/travelMedicine/components/vaccinationConsultations/medicalHistory/MedicalHistorySection.tsx index f43aabe94..84ca98c8e 100644 --- a/employee-portal/src/lib/businessModules/travelMedicine/components/vaccinationConsultations/medicalHistory/MedicalHistorySection.tsx +++ b/employee-portal/src/lib/businessModules/travelMedicine/components/vaccinationConsultations/medicalHistory/MedicalHistorySection.tsx @@ -18,7 +18,7 @@ export function MedicalHistorySection({ <Stack data-testid={dataTestId} spacing={2} - style={{ marginLeft: 12, marginRight: 12, marginTop: 12 }} + sx={{ marginLeft: 1.5, marginRight: 1.5, marginTop: 1.5 }} > {children} </Stack> diff --git a/employee-portal/src/lib/businessModules/travelMedicine/components/vaccinationConsultations/medicalHistory/MedicalHistorySectionElement.tsx b/employee-portal/src/lib/businessModules/travelMedicine/components/vaccinationConsultations/medicalHistory/MedicalHistorySectionElement.tsx index db1832d7e..087af4f44 100644 --- a/employee-portal/src/lib/businessModules/travelMedicine/components/vaccinationConsultations/medicalHistory/MedicalHistorySectionElement.tsx +++ b/employee-portal/src/lib/businessModules/travelMedicine/components/vaccinationConsultations/medicalHistory/MedicalHistorySectionElement.tsx @@ -17,12 +17,12 @@ export function MedicalHistorySectionElement({ return ( <Stack data-testid={dataTestId} - style={{ + sx={{ flexDirection: "row", }} > <Stack - style={{ + sx={{ justifyContent: "space-between", flexDirection: "column", flex: 1, diff --git a/employee-portal/src/lib/businessModules/travelMedicine/shared/constants.ts b/employee-portal/src/lib/businessModules/travelMedicine/shared/constants.ts index 1ad382554..799e3a887 100644 --- a/employee-portal/src/lib/businessModules/travelMedicine/shared/constants.ts +++ b/employee-portal/src/lib/businessModules/travelMedicine/shared/constants.ts @@ -16,7 +16,8 @@ export const systemProgressEntryTypeTitles: Record<string, string> = { CERTIFICATE_FOR_HEALTH_INSURANCE: "Bescheinigung für Krankenkasse erstellt", VACCINATION_APPLIED: "Impfung durchgeführt", VACCINATION_EDIT: "Impfung korrigiert", - PERSON_SYNCHRONIZED: "Geänderte Personendaten übernommen", + PERSON_UPDATED: "Geänderte Personendaten übernommen", + PERSON_SYNCHRONIZED: "Geänderte Personendaten synchronisiert", NEW_APPOINTMENT: "Termin erstellt", FOLLOWUP_APPOINTMENT: "Folgetermin erstellt", CANCEL_APPOINTMENT: "Termin abgesagt", diff --git a/employee-portal/src/lib/businessModules/travelMedicine/shared/templateEditor/sections/SectionTitle.tsx b/employee-portal/src/lib/businessModules/travelMedicine/shared/templateEditor/sections/SectionTitle.tsx index 066a5fcba..eee11c25c 100644 --- a/employee-portal/src/lib/businessModules/travelMedicine/shared/templateEditor/sections/SectionTitle.tsx +++ b/employee-portal/src/lib/businessModules/travelMedicine/shared/templateEditor/sections/SectionTitle.tsx @@ -17,7 +17,7 @@ export function SectionTitle({ label: string; }>) { return ( - <Stack flex={1} direction="row" spacing={2} style={{ paddingRight: 12 }}> + <Stack flex={1} direction="row" spacing={2} sx={{ paddingRight: 1.5 }}> <InputField label aria-label={label} diff --git a/employee-portal/src/lib/businessModules/travelMedicine/shared/templateEditor/sections/dataElements/DataElementBox.tsx b/employee-portal/src/lib/businessModules/travelMedicine/shared/templateEditor/sections/dataElements/DataElementBox.tsx index 788480f6e..a24d98778 100644 --- a/employee-portal/src/lib/businessModules/travelMedicine/shared/templateEditor/sections/dataElements/DataElementBox.tsx +++ b/employee-portal/src/lib/businessModules/travelMedicine/shared/templateEditor/sections/dataElements/DataElementBox.tsx @@ -18,8 +18,8 @@ export function DataElementBox(props: Readonly<DataElementBoxProps>) { borderRadius={12} component="section" flex={1} - style={{ - padding: 12, + sx={{ + padding: 1.5, background: "var(--background-level-1, #F0F4F8)", }} data-testid={props["data-testid"]} diff --git a/employee-portal/src/lib/shared/api/download/files.ts b/employee-portal/src/lib/shared/api/download/files.ts deleted file mode 100644 index 7effc48e5..000000000 --- a/employee-portal/src/lib/shared/api/download/files.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Copyright 2025 cronn GmbH - * SPDX-License-Identifier: Apache-2.0 - */ - -import { ApiResponse } from "@eshg/employee-portal-api/businessProcedures"; -import { parseBlobResponse } from "@eshg/lib-portal/api/files/download"; - -/** - * @deprecated Use `useFileDownload` from lib-portal instead - */ -export function useDownloadFile<TParams extends unknown[]>( - downloadFileRaw: (...params: TParams) => Promise<ApiResponse<Blob>>, -) { - return async function (...params: TParams) { - return parseBlobResponse(await downloadFileRaw(...params)); - }; -} diff --git a/employee-portal/src/lib/shared/components/appointmentBlocks/AppointmentBlockFormWithDays.tsx b/employee-portal/src/lib/shared/components/appointmentBlocks/AppointmentBlockFormWithDays.tsx index c42920985..4c37c2877 100644 --- a/employee-portal/src/lib/shared/components/appointmentBlocks/AppointmentBlockFormWithDays.tsx +++ b/employee-portal/src/lib/shared/components/appointmentBlocks/AppointmentBlockFormWithDays.tsx @@ -3,11 +3,11 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { ApiDayOfWeek } from "@eshg/employee-portal-api/measlesProtection"; import { DateField } from "@eshg/lib-portal/components/formFields/DateField"; import { createFieldNameMapper } from "@eshg/lib-portal/helpers/form"; import { NestedFormProps } from "@eshg/lib-portal/types/form"; import { EnumMap } from "@eshg/lib-portal/types/helpers"; +import { ApiDayOfWeek } from "@eshg/measles-protection-api"; import { Delete } from "@mui/icons-material"; import { Button, Grid } from "@mui/joy"; import { SxProps } from "@mui/joy/styles/types"; diff --git a/employee-portal/src/lib/shared/components/appointmentBlocks/AppointmentCountWithDays.tsx b/employee-portal/src/lib/shared/components/appointmentBlocks/AppointmentCountWithDays.tsx index 08e923568..91348b22b 100644 --- a/employee-portal/src/lib/shared/components/appointmentBlocks/AppointmentCountWithDays.tsx +++ b/employee-portal/src/lib/shared/components/appointmentBlocks/AppointmentCountWithDays.tsx @@ -3,10 +3,10 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { ApiAppointmentType } from "@eshg/employee-portal-api/measlesProtection"; import { isDateString } from "@eshg/lib-portal/helpers/dateTime"; import { isEmptyString } from "@eshg/lib-portal/helpers/guards"; import { OptionalFieldValue } from "@eshg/lib-portal/types/form"; +import { ApiAppointmentType } from "@eshg/measles-protection-api"; import { Chip, Stack, Typography } from "@mui/joy"; import { eachDayOfInterval, intervalToDuration } from "date-fns"; diff --git a/employee-portal/src/lib/shared/components/appointmentBlocks/validateAppointmentBlock.ts b/employee-portal/src/lib/shared/components/appointmentBlocks/validateAppointmentBlock.ts index d6ac9d021..bddc12a41 100644 --- a/employee-portal/src/lib/shared/components/appointmentBlocks/validateAppointmentBlock.ts +++ b/employee-portal/src/lib/shared/components/appointmentBlocks/validateAppointmentBlock.ts @@ -3,9 +3,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { ApiAppointmentType } from "@eshg/employee-portal-api/schoolEntry"; import { isEmptyString } from "@eshg/lib-portal/helpers/guards"; import { OptionalFieldValue } from "@eshg/lib-portal/types/form"; +import { ApiAppointmentType } from "@eshg/school-entry-api"; import { differenceInCalendarDays, isBefore, isEqual, isPast } from "date-fns"; import { FormikErrors } from "formik"; import { isEmpty } from "remeda"; diff --git a/employee-portal/src/lib/shared/components/drawer/SidebarScope.tsx b/employee-portal/src/lib/shared/components/drawer/SidebarScope.tsx new file mode 100644 index 000000000..3486ad191 --- /dev/null +++ b/employee-portal/src/lib/shared/components/drawer/SidebarScope.tsx @@ -0,0 +1,29 @@ +/** + * Copyright 2025 cronn GmbH + * SPDX-License-Identifier: Apache-2.0 + */ + +"use client"; + +import { useUuid } from "@eshg/lib-portal/hooks/useUuid"; +import { RequiresChildren } from "@eshg/lib-portal/types/react"; +import { createContext, useContext } from "react"; + +import { SidebarSlot } from "@/lib/shared/components/drawer/SidebarSlot"; + +const SidebarScopeContext = createContext<string | undefined>(undefined); + +export function SidebarScope(props: RequiresChildren) { + const scopeId = useUuid(); + + return ( + <SidebarScopeContext.Provider value={scopeId}> + {props.children} + <SidebarSlot /> + </SidebarScopeContext.Provider> + ); +} + +export function useSidebarScope(): string | undefined { + return useContext(SidebarScopeContext); +} diff --git a/employee-portal/src/lib/shared/components/drawer/SidebarSlot.tsx b/employee-portal/src/lib/shared/components/drawer/SidebarSlot.tsx index ff9c54065..724236728 100644 --- a/employee-portal/src/lib/shared/components/drawer/SidebarSlot.tsx +++ b/employee-portal/src/lib/shared/components/drawer/SidebarSlot.tsx @@ -11,6 +11,7 @@ import { useQueryErrorResetBoundary } from "@tanstack/react-query"; import { ReactNode, Suspense } from "react"; import { ErrorBoundary, FallbackProps } from "react-error-boundary"; +import { useSidebarScope } from "@/lib/shared/components/drawer/SidebarScope"; import { DrawerFallbackOptions, DrawerInstance, @@ -21,8 +22,12 @@ import { SidebarContent } from "@/lib/shared/components/sidebar/SidebarContent"; export function SidebarSlot() { const { state, tryClose } = useDrawerContext(); + const scopeId = useSidebarScope(); const openDrawer = state.open; - const sidebar = openDrawer?.type === "sidebar" ? openDrawer : null; + const sidebar = + openDrawer?.type === "sidebar" && openDrawer?.scopeId === scopeId + ? openDrawer + : null; function renderComponentWithBoundary( sidebarInstance: DrawerInstance, diff --git a/employee-portal/src/lib/shared/components/drawer/drawerContext.tsx b/employee-portal/src/lib/shared/components/drawer/drawerContext.tsx index 520267ec6..ee1f946ae 100644 --- a/employee-portal/src/lib/shared/components/drawer/drawerContext.tsx +++ b/employee-portal/src/lib/shared/components/drawer/drawerContext.tsx @@ -23,6 +23,7 @@ interface DrawerContextValue { tryOpen: ( drawerId: string, drawerType: DrawerType, + scopeId: string | undefined, options: DrawerOpenOptions, ) => void; tryClose: (options?: DrawerCloseOptions) => Promise<boolean>; @@ -78,6 +79,7 @@ export interface DrawerProps { export interface DrawerInstance extends DrawerOpenOptions { id: string; type: DrawerType; + scopeId?: string; } type DrawerType = "sidenav" | "sidebar"; @@ -104,6 +106,7 @@ function useCreateDrawerContextValue(): DrawerContextValue { function tryOpen( overlayId: string, drawerType: DrawerType, + scopeId: string | undefined, options: DrawerOpenOptions, ): void { if (overlayId === state.open?.id || overlayId === state.pending?.id) { @@ -116,6 +119,7 @@ function useCreateDrawerContextValue(): DrawerContextValue { ...options, id: overlayId, type: drawerType, + scopeId, }, })); } diff --git a/employee-portal/src/lib/shared/components/drawer/useSidebar.tsx b/employee-portal/src/lib/shared/components/drawer/useSidebar.tsx index de9ceca71..3b79438a4 100644 --- a/employee-portal/src/lib/shared/components/drawer/useSidebar.tsx +++ b/employee-portal/src/lib/shared/components/drawer/useSidebar.tsx @@ -5,6 +5,7 @@ import { useUuid } from "@eshg/lib-portal/hooks/useUuid"; +import { useSidebarScope } from "@/lib/shared/components/drawer/SidebarScope"; import { DrawerOpenOptions, DrawerProps, @@ -44,13 +45,14 @@ export function useSidebar<TSidebarProps extends DrawerProps>( options: DrawerOpenOptions<TSidebarProps>, ): UseSidebarResult<TSidebarProps> { const drawerContext = useDrawerContext(); + const sidebarScope = useSidebarScope(); const sidebarId = useUuid(); const isOpen = isDrawer(sidebarId, drawerContext.state.open); function open(sidebarProps?: CustomSidebarProps<TSidebarProps>): void { const SidebarComponent = options.component; - drawerContext.tryOpen(sidebarId, "sidebar", { + drawerContext.tryOpen(sidebarId, "sidebar", sidebarScope, { ...options, component: (overlayProps) => { const mergedProps = { diff --git a/employee-portal/src/lib/shared/components/drawer/useSidenav.ts b/employee-portal/src/lib/shared/components/drawer/useSidenav.ts index e1f59f439..701300b04 100644 --- a/employee-portal/src/lib/shared/components/drawer/useSidenav.ts +++ b/employee-portal/src/lib/shared/components/drawer/useSidenav.ts @@ -5,6 +5,7 @@ import { v4 as uuidv4 } from "uuid"; +import { useSidebarScope } from "@/lib/shared/components/drawer/SidebarScope"; import { isDrawer, useDrawerContext, @@ -20,11 +21,12 @@ interface UseSidenavResult { export function useSidenav(): UseSidenavResult { const drawerContext = useDrawerContext(); + const scopeId = useSidebarScope(); const isOpen = isDrawer(sidenavId, drawerContext.state.open); function open(): void { - drawerContext.tryOpen(sidenavId, "sidenav", { + drawerContext.tryOpen(sidenavId, "sidenav", scopeId, { component: () => null, }); } diff --git a/employee-portal/src/lib/shared/components/form/SidebarForm.tsx b/employee-portal/src/lib/shared/components/form/SidebarForm.tsx index 9108c44fd..4ea1e82c0 100644 --- a/employee-portal/src/lib/shared/components/form/SidebarForm.tsx +++ b/employee-portal/src/lib/shared/components/form/SidebarForm.tsx @@ -51,7 +51,7 @@ export const SidebarForm = forwardRef<SidebarFormHandle, SidebarFormProps>( resetForm: formikResetForm, }); - return <FormPlus {...props} style={{ display: "contents" }} />; + return <FormPlus {...props} sx={{ display: "contents" }} />; }, ); diff --git a/employee-portal/src/lib/shared/components/form/address/LegacyAddressForm.tsx b/employee-portal/src/lib/shared/components/form/address/LegacyAddressForm.tsx index 41895d458..400b5d6c9 100644 --- a/employee-portal/src/lib/shared/components/form/address/LegacyAddressForm.tsx +++ b/employee-portal/src/lib/shared/components/form/address/LegacyAddressForm.tsx @@ -3,7 +3,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { ApiCountryCode } from "@eshg/employee-portal-api/measlesProtection"; import { InputField } from "@eshg/lib-portal/components/formFields/InputField"; import { buildEnumOptions, @@ -11,6 +10,7 @@ import { } from "@eshg/lib-portal/helpers/form"; import { validateLength } from "@eshg/lib-portal/helpers/validators"; import { NestedFormProps } from "@eshg/lib-portal/types/form"; +import { ApiCountryCode } from "@eshg/measles-protection-api"; import AddIcon from "@mui/icons-material/Add"; import DeleteIcon from "@mui/icons-material/Delete"; import { Button, Grid, IconButton, Stack, Typography } from "@mui/joy"; diff --git a/employee-portal/src/lib/shared/components/import/ImportDataForm.tsx b/employee-portal/src/lib/shared/components/import/ImportDataForm.tsx index ae93ead13..21b1100ff 100644 --- a/employee-portal/src/lib/shared/components/import/ImportDataForm.tsx +++ b/employee-portal/src/lib/shared/components/import/ImportDataForm.tsx @@ -3,12 +3,13 @@ * SPDX-License-Identifier: Apache-2.0 */ +import { ImportStatistics } from "@eshg/lib-employee-portal/api/models/import/ImportStatistics"; +import { ImportDataResult } from "@eshg/lib-employee-portal/helpers/import"; import { RequiresChildren } from "@eshg/lib-portal/types/react"; import { CircularProgress, Stack, Typography, styled } from "@mui/joy"; import { useFormikContext } from "formik"; import { Ref } from "react"; -import { ImportStatistics } from "@/lib/shared/api/models/import/ImportStatistics"; import { FormButtonBar } from "@/lib/shared/components/form/FormButtonBar"; import { SidebarForm, @@ -17,7 +18,6 @@ import { import { ImportResult } from "@/lib/shared/components/import/ImportResult"; import { SidebarActions } from "@/lib/shared/components/sidebar/SidebarActions"; import { SidebarContent } from "@/lib/shared/components/sidebar/SidebarContent"; -import { ImportDataResult } from "@/lib/shared/helpers/import"; interface ImportDataFormProps extends RequiresChildren { title: string; diff --git a/employee-portal/src/lib/shared/components/import/ImportResult.tsx b/employee-portal/src/lib/shared/components/import/ImportResult.tsx index c74c1ffc2..6a7d2272a 100644 --- a/employee-portal/src/lib/shared/components/import/ImportResult.tsx +++ b/employee-portal/src/lib/shared/components/import/ImportResult.tsx @@ -3,20 +3,20 @@ * SPDX-License-Identifier: Apache-2.0 */ +import { ImportStatistics } from "@eshg/lib-employee-portal/api/models/import/ImportStatistics"; +import { + formatDuplicatedCount, + formatFailedCount, + formatTotalCount, +} from "@eshg/lib-employee-portal/helpers/import"; import { Stack, Typography } from "@mui/joy"; -import { ImportStatistics } from "@/lib/shared/api/models/import/ImportStatistics"; import { FileDownloadButton } from "@/lib/shared/components/buttons/FileDownloadButton"; import { ImportResultProceduresSummary } from "@/lib/shared/components/import/ImportResultProceduresSummary"; import { ImportResultItem, ImportResultSummary, } from "@/lib/shared/components/import/ImportResultSummary"; -import { - formatDuplicatedCount, - formatFailedCount, - formatTotalCount, -} from "@/lib/shared/helpers/import"; function buildStatisticItems(statistics: ImportStatistics): ImportResultItem[] { if (statistics.total === 0) { diff --git a/employee-portal/src/lib/shared/components/procedures/progress-entries/FileCardWithActions.tsx b/employee-portal/src/lib/shared/components/procedures/progress-entries/FileCardWithActions.tsx index bec160c11..7a8e21de5 100644 --- a/employee-portal/src/lib/shared/components/procedures/progress-entries/FileCardWithActions.tsx +++ b/employee-portal/src/lib/shared/components/procedures/progress-entries/FileCardWithActions.tsx @@ -6,7 +6,7 @@ "use client"; import { ApiAbstractFile } from "@eshg/employee-portal-api/businessProcedures"; -import { downloadFileAndOpen } from "@eshg/lib-portal/api/files/download"; +import { useFileDownload } from "@eshg/lib-portal/api/files/download"; import DeleteIcon from "@mui/icons-material/Delete"; import FileDownloadOutlinedIcon from "@mui/icons-material/FileDownloadOutlined"; import InfoOutlinedIcon from "@mui/icons-material/InfoOutlined"; @@ -59,14 +59,11 @@ function FileCardWithOptionalDetailsLinkAndDownload({ additionalAction?: FileCardActionProps; }) { const progressEntriesContext = useContext(ProgressEntriesContext); - const { useDownloadFile } = progressEntriesContext.config; + const { fileApi } = progressEntriesContext.config; const { openEntryDetailsSidebar } = progressEntriesContext.action; - const downloadFile = useDownloadFile(); - - async function downloadFileOnClick() { - const downloadedFile = await downloadFile(file.fileId); - downloadFileAndOpen(downloadedFile); - } + const { download } = useFileDownload((fileId: string) => + fileApi.downloadFileRaw({ fileId }), + ); const actions: FileCardActionProps[] = []; @@ -86,7 +83,7 @@ function FileCardWithOptionalDetailsLinkAndDownload({ } actions.push({ - onClick: downloadFileOnClick, + onClick: () => download(file.fileId), indicator: <FileDownloadOutlinedIcon />, name: "Download", color: "neutral", diff --git a/employee-portal/src/lib/shared/components/procedures/progress-entries/ProgressEntriesPage.tsx b/employee-portal/src/lib/shared/components/procedures/progress-entries/ProgressEntriesPage.tsx index c4778627a..355a8cc72 100644 --- a/employee-portal/src/lib/shared/components/procedures/progress-entries/ProgressEntriesPage.tsx +++ b/employee-portal/src/lib/shared/components/procedures/progress-entries/ProgressEntriesPage.tsx @@ -21,6 +21,7 @@ import { PageGrid } from "@/lib/shared/components/page/PageGrid"; import { keyDocumentTypes } from "@/lib/shared/components/procedures/progress-entries/constants"; import { useDeletionProps } from "@/lib/shared/components/procedures/progress-entries/hooks/useDeletionProps"; import { useProgressEntriesFilterSettings } from "@/lib/shared/components/procedures/progress-entries/hooks/useProgressEntriesFilterSettings"; +import { useFetchProgressEntries } from "@/lib/shared/components/procedures/progress-entries/queries/progressEntryApi"; import { ApprovalRequestsOverviewSidebar } from "@/lib/shared/components/procedures/progress-entries/sidebars/approvalRequestOverviewSidebar/ApprovalRequestsOverviewSidebar"; import { Timeline } from "@/lib/shared/components/timeline/Timeline"; import { TimelineEntry } from "@/lib/shared/components/timeline/TimelineEntry"; @@ -43,8 +44,9 @@ import { ProgressEntryDetailsSidebar } from "./sidebars/progressEntryDetailsSide import { ProgressEntriesFilters, ProgressEntriesPageProps } from "./types"; export function ProgressEntriesPage({ - useFetchProgressEntries, - useFetchProgressEntryDetails, + progressEntryApiQueryKey, + progressEntryApi, + procedureApi, procedureId, searchParams, additionalKeyDocumentTypes, @@ -57,7 +59,14 @@ export function ProgressEntriesPage({ detailedProcedure, files, approvalRequestsResponse, - } = useFetchProgressEntries(procedureId, props.leaderRole, filters).data; + } = useFetchProgressEntries( + progressEntryApi, + procedureApi, + progressEntryApiQueryKey, + procedureId, + props.leaderRole, + filters, + ).data; const { data: response } = useGetUsersByGroupQuery( props.groupName, props.getInitOverrides, @@ -83,7 +92,9 @@ export function ProgressEntriesPage({ approvalRequestsResponse: approvalRequestsResponse, searchParams, filterSettings, - useFetchProgressEntryDetails, + progressEntryApiQueryKey, + progressEntryApi, + procedureApi, ...props, }} > diff --git a/employee-portal/src/lib/shared/components/procedures/progress-entries/modals/EntryDeletionRequestModal.tsx b/employee-portal/src/lib/shared/components/procedures/progress-entries/modals/EntryDeletionRequestModal.tsx index f0d71b423..24410f947 100644 --- a/employee-portal/src/lib/shared/components/procedures/progress-entries/modals/EntryDeletionRequestModal.tsx +++ b/employee-portal/src/lib/shared/components/procedures/progress-entries/modals/EntryDeletionRequestModal.tsx @@ -15,6 +15,7 @@ import { DeletionRequestForm, DeletionRequestValues, } from "@/lib/shared/components/procedures/progress-entries/forms/DeletionRequestForm"; +import { useRequestProgressEntryDeletion } from "@/lib/shared/components/procedures/progress-entries/mutations/progressEntryApi"; import { EntryDeletionModalProps } from "@/lib/shared/components/procedures/progress-entries/types"; export function EntryDeletionRequestModal(_props: EntryDeletionModalProps) { @@ -27,11 +28,12 @@ export function EntryDeletionRequestModal(_props: EntryDeletionModalProps) { export function EntryDeletionRequestModalContent() { const progressEntriesContext = useContext(ProgressEntriesContext); - const { useRequestProgressEntryDeletion } = progressEntriesContext.config; + const { progressEntryApi } = progressEntriesContext.config; const { entryIdForDeletion } = progressEntriesContext.state; const { closeEntryDeletionModal } = progressEntriesContext.action; - const requestProgressEntryDeletion = useRequestProgressEntryDeletion(); + const requestProgressEntryDeletion = + useRequestProgressEntryDeletion(progressEntryApi); async function handleSubmit(values: DeletionRequestValues) { if (entryIdForDeletion !== null) diff --git a/employee-portal/src/lib/shared/components/procedures/progress-entries/modals/EntryDirectDeletionModal.tsx b/employee-portal/src/lib/shared/components/procedures/progress-entries/modals/EntryDirectDeletionModal.tsx index 242f5f8f0..d9119cc17 100644 --- a/employee-portal/src/lib/shared/components/procedures/progress-entries/modals/EntryDirectDeletionModal.tsx +++ b/employee-portal/src/lib/shared/components/procedures/progress-entries/modals/EntryDirectDeletionModal.tsx @@ -8,6 +8,7 @@ import { useContext } from "react"; import { OverlayBoundary } from "@/lib/shared/components/boundaries/OverlayBoundary"; import { EmployeePortalConfirmationDialog } from "@/lib/shared/components/confirmationDialog/EmployeePortalConfirmationDialog"; import { ProgressEntriesContext } from "@/lib/shared/components/procedures/progress-entries/ProgressEntriesContext"; +import { useDeleteProgressEntry } from "@/lib/shared/components/procedures/progress-entries/mutations/progressEntryApi"; import { EntryDeletionModalProps } from "@/lib/shared/components/procedures/progress-entries/types"; export function EntryDirectDeletionModal(props: EntryDeletionModalProps) { @@ -22,10 +23,10 @@ export function EntryDirectDeletionModalContent( props: EntryDeletionModalProps, ) { const progressEntriesContext = useContext(ProgressEntriesContext); - const { useDeleteProgressEntry } = progressEntriesContext.config; + const { progressEntryApi } = progressEntriesContext.config; const { entryIdForDeletion } = progressEntriesContext.state; const { closeEntryDeletionModal } = progressEntriesContext.action; - const deleteProgressEntry = useDeleteProgressEntry(); + const deleteProgressEntry = useDeleteProgressEntry(progressEntryApi); return ( <EmployeePortalConfirmationDialog open={entryIdForDeletion !== null} diff --git a/employee-portal/src/lib/shared/components/procedures/progress-entries/modals/FileDeletionRequestModal.tsx b/employee-portal/src/lib/shared/components/procedures/progress-entries/modals/FileDeletionRequestModal.tsx index 507f47084..fb5eaceec 100644 --- a/employee-portal/src/lib/shared/components/procedures/progress-entries/modals/FileDeletionRequestModal.tsx +++ b/employee-portal/src/lib/shared/components/procedures/progress-entries/modals/FileDeletionRequestModal.tsx @@ -14,13 +14,14 @@ import { DeletionRequestForm, DeletionRequestValues, } from "@/lib/shared/components/procedures/progress-entries/forms/DeletionRequestForm"; +import { useRequestFileDeletion } from "@/lib/shared/components/procedures/progress-entries/mutations/fileApi"; export function FileDeletionRequestModal() { const progressEntriesContext = useContext(ProgressEntriesContext); - const { useRequestFileDeletion } = progressEntriesContext.config; + const { fileApi } = progressEntriesContext.config; const { fileIdForDeletion } = progressEntriesContext.state; const { closeFileDeletionModal } = progressEntriesContext.action; - const requestFileDeletion = useRequestFileDeletion(); + const requestFileDeletion = useRequestFileDeletion(fileApi); async function handleSubmit(values: DeletionRequestValues) { if (fileIdForDeletion !== null) diff --git a/employee-portal/src/lib/shared/components/procedures/progress-entries/modals/FileDirectDeletionModal.tsx b/employee-portal/src/lib/shared/components/procedures/progress-entries/modals/FileDirectDeletionModal.tsx index 99273f48e..513264ac7 100644 --- a/employee-portal/src/lib/shared/components/procedures/progress-entries/modals/FileDirectDeletionModal.tsx +++ b/employee-portal/src/lib/shared/components/procedures/progress-entries/modals/FileDirectDeletionModal.tsx @@ -8,6 +8,7 @@ import { useContext } from "react"; import { OverlayBoundary } from "@/lib/shared/components/boundaries/OverlayBoundary"; import { EmployeePortalConfirmationDialog } from "@/lib/shared/components/confirmationDialog/EmployeePortalConfirmationDialog"; import { ProgressEntriesContext } from "@/lib/shared/components/procedures/progress-entries/ProgressEntriesContext"; +import { useDeleteFile } from "@/lib/shared/components/procedures/progress-entries/mutations/fileApi"; export function FileDirectDeletionModal() { return ( @@ -19,10 +20,10 @@ export function FileDirectDeletionModal() { export function FileDirectDeletionModalContent() { const progressEntriesContext = useContext(ProgressEntriesContext); - const { useDeleteFile } = progressEntriesContext.config; + const { fileApi } = progressEntriesContext.config; const { fileIdForDeletion } = progressEntriesContext.state; const { closeFileDeletionModal } = progressEntriesContext.action; - const deleteFile = useDeleteFile(); + const deleteFile = useDeleteFile(fileApi); return ( <EmployeePortalConfirmationDialog open={fileIdForDeletion !== null} diff --git a/employee-portal/src/lib/shared/api/mutations/approvalRequests.ts b/employee-portal/src/lib/shared/components/procedures/progress-entries/mutations/approvalRequestApi.ts similarity index 67% rename from employee-portal/src/lib/shared/api/mutations/approvalRequests.ts rename to employee-portal/src/lib/shared/components/procedures/progress-entries/mutations/approvalRequestApi.ts index 7e90d6ebd..28d905326 100644 --- a/employee-portal/src/lib/shared/api/mutations/approvalRequests.ts +++ b/employee-portal/src/lib/shared/components/procedures/progress-entries/mutations/approvalRequestApi.ts @@ -7,42 +7,33 @@ import { ApiApprovalRequest } from "@eshg/employee-portal-api/businessProcedures import { useSnackbar } from "@eshg/lib-portal/components/snackbar/SnackbarProvider"; import { useMutation } from "@tanstack/react-query"; -interface ApprovalRequestApi { - decideApprovalRequest: ( - approvalRequestId: string, - body: string, - ) => Promise<void>; -} +import { ApprovalRequestClient } from "@/lib/shared/components/procedures/progress-entries/types"; -export function useDecideApprovalRequestTemplate( - useApprovalRequestApi: () => ApprovalRequestApi, - mutationKey?: readonly string[], +export function useDecideApprovalRequest( + approvalRequestApi: ApprovalRequestClient, ) { - const approvalRequestApi = useApprovalRequestApi(); const snackbar = useSnackbar(); return useMutation({ mutationFn: decideApprovalRequest(approvalRequestApi), onSuccess: () => snackbar.confirmation("Löschanfrage erfolgreich beantwortet."), - mutationKey, }); } -export function useGrantDeletionForAllRequestsTemplate( - useApprovalRequestApi: () => ApprovalRequestApi, - mutationKey?: readonly string[], +export function useGrantDeletionForAllRequests( + approvalRequestApi: ApprovalRequestClient, ) { - const approvalRequestApi = useApprovalRequestApi(); const snackbar = useSnackbar(); return useMutation({ mutationFn: grantDeletionForAllRequests(approvalRequestApi), onSuccess: () => snackbar.confirmation("Alle Löschanfragen wurden erfolgreich genehmigt."), - mutationKey, }); } -function grantDeletionForAllRequests(approvalRequestApi: ApprovalRequestApi) { +function grantDeletionForAllRequests( + approvalRequestApi: ApprovalRequestClient, +) { return async function (approvalRequests: ApiApprovalRequest[]) { for (const request of approvalRequests) { await decideApprovalRequest(approvalRequestApi)({ @@ -53,7 +44,7 @@ function grantDeletionForAllRequests(approvalRequestApi: ApprovalRequestApi) { }; } -function decideApprovalRequest(approvalRequestApi: ApprovalRequestApi) { +function decideApprovalRequest(approvalRequestApi: ApprovalRequestClient) { return async function ({ approvalRequestId, decision, diff --git a/employee-portal/src/lib/shared/api/mutations/files.ts b/employee-portal/src/lib/shared/components/procedures/progress-entries/mutations/fileApi.ts similarity index 58% rename from employee-portal/src/lib/shared/api/mutations/files.ts rename to employee-portal/src/lib/shared/components/procedures/progress-entries/mutations/fileApi.ts index 1de16d6f3..de792b83a 100644 --- a/employee-portal/src/lib/shared/api/mutations/files.ts +++ b/employee-portal/src/lib/shared/components/procedures/progress-entries/mutations/fileApi.ts @@ -3,40 +3,23 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { - ApiApprovalRequest, - ApiCreateApprovalRequestRequest, -} from "@eshg/employee-portal-api/businessProcedures"; +import { ApiCreateApprovalRequestRequest } from "@eshg/employee-portal-api/businessProcedures"; import { useHandledMutation } from "@eshg/lib-portal/api/useHandledMutation"; import { useSnackbar } from "@eshg/lib-portal/components/snackbar/SnackbarProvider"; -export function useDeleteFileTemplate( - useFileApi: () => { - deleteFile: (fileId: string) => Promise<void>; - }, - mutationKey?: readonly string[], -) { - const fileApi = useFileApi(); +import { FileClient } from "@/lib/shared/components/procedures/progress-entries/types"; + +export function useDeleteFile(fileApi: FileClient) { const snackbar = useSnackbar(); return useHandledMutation({ mutationFn: async (fileId: string) => await fileApi.deleteFile(fileId), onSuccess: () => { snackbar.confirmation("Datei erfolgreich gelöscht."); }, - mutationKey, }); } -export function useRequestFileDeletionTemplate( - useFileApi: () => { - requestFileDeletion: ( - fileId: string, - apiCreateApprovalRequestRequest: ApiCreateApprovalRequestRequest, - ) => Promise<ApiApprovalRequest>; - }, - mutationKey?: readonly string[], -) { - const fileApi = useFileApi(); +export function useRequestFileDeletion(fileApi: FileClient) { const snackbar = useSnackbar(); return useHandledMutation({ mutationFn: async ({ @@ -50,6 +33,5 @@ export function useRequestFileDeletionTemplate( }, onSuccess: () => snackbar.confirmation("Löschanfrage erfolgreich gesendet."), - mutationKey, }); } diff --git a/employee-portal/src/lib/shared/api/mutations/progressEntries.ts b/employee-portal/src/lib/shared/components/procedures/progress-entries/mutations/progressEntryApi.ts similarity index 63% rename from employee-portal/src/lib/shared/api/mutations/progressEntries.ts rename to employee-portal/src/lib/shared/components/procedures/progress-entries/mutations/progressEntryApi.ts index 6170552f3..7bd7fc6dd 100644 --- a/employee-portal/src/lib/shared/api/mutations/progressEntries.ts +++ b/employee-portal/src/lib/shared/components/procedures/progress-entries/mutations/progressEntryApi.ts @@ -4,12 +4,9 @@ */ import { - ApiApprovalRequest, ApiCreateApprovalRequestRequest, ApiCreateManualProgressEntryRequest, ApiFileMetaData, - ApiGetFile200Response, - ApiManualProgressEntry, ApiPatchManualProgressEntryRequest, ApiUpdateFileMetaDataRequest, } from "@eshg/employee-portal-api/businessProcedures"; @@ -18,19 +15,12 @@ import { useSnackbar } from "@eshg/lib-portal/components/snackbar/SnackbarProvid import { isDefined } from "remeda"; import { useProgressEntriesConfig } from "@/lib/shared/components/procedures/progress-entries/ProgressEntriesContext"; +import { + FileClient, + ProgressEntryClient, +} from "@/lib/shared/components/procedures/progress-entries/types"; -export function useCreateProgressEntryTemplate( - useProgressEntryApi: () => { - addProgressEntry: ( - procedureId: string, - createManualProgressEntryRequest: ApiCreateManualProgressEntryRequest, - file?: Blob, - fileMetaData?: ApiFileMetaData, - ) => Promise<ApiManualProgressEntry>; - }, - mutationKey?: readonly string[], -) { - const progressEntryApi = useProgressEntryApi(); +export function useCreateProgressEntry(progressEntryApi: ProgressEntryClient) { const { procedureId } = useProgressEntriesConfig(); const snackbar = useSnackbar(); return useHandledMutation({ @@ -51,20 +41,10 @@ export function useCreateProgressEntryTemplate( ), onSuccess: () => snackbar.confirmation("Verlaufseintrag erfolgreich angelegt."), - mutationKey, }); } -export function useDeleteProgressEntryTemplate( - useProgressEntryApi: () => { - removeProgressEntry: ( - procedureId: string, - progressEntryId: string, - ) => Promise<void>; - }, - mutationKey?: readonly string[], -) { - const progressEntryApi = useProgressEntryApi(); +export function useDeleteProgressEntry(progressEntryApi: ProgressEntryClient) { const { procedureId } = useProgressEntriesConfig(); const snackbar = useSnackbar(); return useHandledMutation({ @@ -74,28 +54,13 @@ export function useDeleteProgressEntryTemplate( onSuccess: () => { snackbar.confirmation("Verlaufseintrag erfolgreich gelöscht."); }, - mutationKey, }); } -export function usePatchProgressEntryTemplate( - useProgressEntryApi: () => { - patchProgressEntry: ( - procedureId: string, - progressEntryId: string, - apiPatchManualProgressEntryRequest: ApiPatchManualProgressEntryRequest, - ) => Promise<ApiManualProgressEntry>; - }, - useFileApi: () => { - updateFileMetaData: ( - fileId: string, - apiUpdateFileMetaDataRequest: ApiUpdateFileMetaDataRequest, - ) => Promise<ApiGetFile200Response>; - }, - mutationKey?: readonly string[], +export function usePatchProgressEntry( + progressEntryApi: ProgressEntryClient, + fileApi: FileClient, ) { - const progressEntryApi = useProgressEntryApi(); - const fileApi = useFileApi(); const { procedureId } = useProgressEntriesConfig(); const snackbar = useSnackbar(); @@ -125,23 +90,14 @@ export function usePatchProgressEntryTemplate( ]); return { entry, file }; }, - mutationKey, onSuccess: () => snackbar.confirmation("Verlaufseintrag erfolgreich bearbeitet."), }); } -export function useRequestProgressEntryDeletionTemplate( - useProgressEntryApi: () => { - requestProgressEntryDeletion( - procedureId: string, - progressEntryId: string, - apiCreateApprovalRequestRequest: ApiCreateApprovalRequestRequest, - ): Promise<ApiApprovalRequest>; - }, - mutationKey?: readonly string[], +export function useRequestProgressEntryDeletion( + progressEntryApi: ProgressEntryClient, ) { - const progressEntryApi = useProgressEntryApi(); const { procedureId } = useProgressEntriesConfig(); const snackbar = useSnackbar(); return useHandledMutation({ @@ -158,7 +114,6 @@ export function useRequestProgressEntryDeletionTemplate( createApprovalRequest, ); }, - mutationKey, onSuccess: () => snackbar.confirmation("Löschanfrage erfolgreich gesendet."), }); diff --git a/employee-portal/src/lib/shared/api/queries/files.ts b/employee-portal/src/lib/shared/components/procedures/progress-entries/queries/fileApi.ts similarity index 64% rename from employee-portal/src/lib/shared/api/queries/files.ts rename to employee-portal/src/lib/shared/components/procedures/progress-entries/queries/fileApi.ts index 14c50248f..d5482126a 100644 --- a/employee-portal/src/lib/shared/api/queries/files.ts +++ b/employee-portal/src/lib/shared/components/procedures/progress-entries/queries/fileApi.ts @@ -3,26 +3,23 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { ApiGetMetaDataHistoryResponse } from "@eshg/employee-portal-api/businessProcedures"; -import { ApiGetMetaDataHistoryResponseMetaDataHistoryInner } from "@eshg/employee-portal-api/schoolEntry"; -import { type QueryKeyFactory } from "@eshg/lib-portal/api/queryKeyFactory"; +import { QueryKeyFactory } from "@eshg/lib-portal/api/queryKeyFactory"; +import { ApiGetMetaDataHistoryResponseMetaDataHistoryInner } from "@eshg/school-entry-api"; import { useSuspenseQuery } from "@tanstack/react-query"; import { isDefined, reverse } from "remeda"; -import { HistoryItem } from "@/lib/shared/components/procedures/progress-entries/types"; +import { + FileClient, + HistoryItem, +} from "@/lib/shared/components/procedures/progress-entries/types"; -export function useGetMetaDataHistoryTemplate( - useFileApi: () => { - getMetaDataHistory: ( - fileId: string, - ) => Promise<ApiGetMetaDataHistoryResponse>; - }, - queryKeyFactory: QueryKeyFactory, +export function useGetMetaDataHistory( + fileApi: FileClient, + queryKey: QueryKeyFactory, fileId: string, ) { - const fileApi = useFileApi(); return useSuspenseQuery({ - queryKey: queryKeyFactory(["getMetaDataHistory", fileId]), + queryKey: queryKey(["getMetaDataHistory", fileId]), queryFn: async () => fileApi.getMetaDataHistory(fileId), select: (response) => isDefined(response.metaDataHistory) diff --git a/employee-portal/src/lib/shared/api/queries/progressEntries.ts b/employee-portal/src/lib/shared/components/procedures/progress-entries/queries/progressEntryApi.ts similarity index 83% rename from employee-portal/src/lib/shared/api/queries/progressEntries.ts rename to employee-portal/src/lib/shared/components/procedures/progress-entries/queries/progressEntryApi.ts index 41c9d7327..50030e5b1 100644 --- a/employee-portal/src/lib/shared/api/queries/progressEntries.ts +++ b/employee-portal/src/lib/shared/components/procedures/progress-entries/queries/progressEntryApi.ts @@ -4,11 +4,7 @@ */ import { ApiUserRole } from "@eshg/base-api"; -import { - ApiGetProceduresSortOrder, - ProcedureApi, - ProgressEntryApi, -} from "@eshg/employee-portal-api/businessProcedures"; +import { ApiGetProceduresSortOrder } from "@eshg/employee-portal-api/businessProcedures"; import { type QueryKeyFactory } from "@eshg/lib-portal/api/queryKeyFactory"; import { useSuspenseQuery } from "@tanstack/react-query"; import { useSearchParams } from "next/navigation"; @@ -18,24 +14,21 @@ import { getHeadersForOfflineCaching } from "@/lib/businessModules/inspection/sh import { useProgressEntriesConfig } from "@/lib/shared/components/procedures/progress-entries/ProgressEntriesContext"; import { HistoryItem, + ProcedureClient, ProgressEntriesFilters, + ProgressEntryClient, } from "@/lib/shared/components/procedures/progress-entries/types"; import { useHasUserRoleCheck } from "@/lib/shared/hooks/useAccessControl"; -export function useFetchProgressEntriesTemplate( - useProgressEntryApi: () => Pick<ProgressEntryApi, "getProgressEntriesRaw">, - useProcedureApi: () => Pick< - ProcedureApi, - "getDetailedProcedure" | "getProcedureFileDetails" | "getApprovalRequests" - >, +export function useFetchProgressEntries( + progressEntryApi: ProgressEntryClient, + procedureApi: ProcedureClient, queryKeyFactory: QueryKeyFactory, procedureId: string, leaderRole: ApiUserRole, progressEntryFilter: ProgressEntriesFilters, preCache?: boolean, ) { - const progressEntryApi = useProgressEntryApi(); - const procedureApi = useProcedureApi(); const searchParams = Object.fromEntries(useSearchParams().entries()); const fetchApprovalRequests = useHasUserRoleCheck(leaderRole); @@ -92,15 +85,13 @@ export function useFetchProgressEntriesTemplate( }); } -export function useFetchProgressEntryDetailsTemplate( - useProgressEntryApi: () => Pick<ProgressEntryApi, "getProgressEntry">, +export function useFetchProgressEntryDetails( + progressEntryApi: ProgressEntryClient, queryKeyFactory: QueryKeyFactory, procedureId: string, entryId: string, preCache?: boolean, ) { - const progressEntryApi = useProgressEntryApi(); - return useSuspenseQuery({ queryKey: queryKeyFactory([ "fetchProgressEntryDetails", @@ -122,15 +113,11 @@ export function useFetchProgressEntryDetailsTemplate( }); } -export function useGetManualProgressEntryHistoryTemplate( - useProgressEntryApi: () => Pick< - ProgressEntryApi, - "getManualProgressEntryHistory" - >, +export function useGetManualProgressEntryHistory( + progressEntryApi: ProgressEntryClient, queryKeyFactory: QueryKeyFactory, entryId: string, ) { - const progressEntryApi = useProgressEntryApi(); const { procedureId } = useProgressEntriesConfig(); return useSuspenseQuery({ queryKey: queryKeyFactory([ diff --git a/employee-portal/src/lib/shared/components/procedures/progress-entries/sidebars/CreateProgressEntrySidebar.tsx b/employee-portal/src/lib/shared/components/procedures/progress-entries/sidebars/CreateProgressEntrySidebar.tsx index 96be24a58..8a8d91c3a 100644 --- a/employee-portal/src/lib/shared/components/procedures/progress-entries/sidebars/CreateProgressEntrySidebar.tsx +++ b/employee-portal/src/lib/shared/components/procedures/progress-entries/sidebars/CreateProgressEntrySidebar.tsx @@ -29,6 +29,7 @@ import { hasKeyDocumentTypeField, } from "@/lib/shared/components/procedures/progress-entries/helper"; import { mapFormValuesToCreateProgressEntryRequest } from "@/lib/shared/components/procedures/progress-entries/mapper"; +import { useCreateProgressEntry } from "@/lib/shared/components/procedures/progress-entries/mutations/progressEntryApi"; import { Sidebar } from "@/lib/shared/components/sidebar/Sidebar"; import { SidebarActions } from "@/lib/shared/components/sidebar/SidebarActions"; import { SidebarContent } from "@/lib/shared/components/sidebar/SidebarContent"; @@ -69,9 +70,8 @@ function CreateProgressEntrySidebarContent({ open, onClose, }: CreateProgressEntrySidebarProps) { - const { keyDocumentTypes, useCreateProgressEntry } = - useProgressEntriesConfig(); - const createProgressEntry = useCreateProgressEntry(); + const { keyDocumentTypes, progressEntryApi } = useProgressEntriesConfig(); + const createProgressEntry = useCreateProgressEntry(progressEntryApi); const { openConfirmationDialog } = useConfirmationDialog(); async function handleSubmit( diff --git a/employee-portal/src/lib/shared/components/procedures/progress-entries/sidebars/approvalRequestOverviewSidebar/ApprovalRequestCard.tsx b/employee-portal/src/lib/shared/components/procedures/progress-entries/sidebars/approvalRequestOverviewSidebar/ApprovalRequestCard.tsx index 8cf815fb7..f30de71ce 100644 --- a/employee-portal/src/lib/shared/components/procedures/progress-entries/sidebars/approvalRequestOverviewSidebar/ApprovalRequestCard.tsx +++ b/employee-portal/src/lib/shared/components/procedures/progress-entries/sidebars/approvalRequestOverviewSidebar/ApprovalRequestCard.tsx @@ -25,13 +25,14 @@ import { ProgressEntriesContext, useResolvedUserName, } from "@/lib/shared/components/procedures/progress-entries/ProgressEntriesContext"; +import { useDecideApprovalRequest } from "@/lib/shared/components/procedures/progress-entries/mutations/approvalRequestApi"; import { FileAsApprovalRequestEntity } from "@/lib/shared/components/procedures/progress-entries/sidebars/approvalRequestOverviewSidebar/FileAsApprovalRequestEntity"; import { ProgressEntryAsApprovalRequestEntity } from "@/lib/shared/components/procedures/progress-entries/sidebars/approvalRequestOverviewSidebar/ProgressEntryAsApprovalRequestEntity"; export function ApprovalRequestCard(request: ApiApprovalRequest) { const progressEntriesContext = useContext(ProgressEntriesContext); - const { useDecideApprovalRequest } = progressEntriesContext.config; - const decideApprovalRequest = useDecideApprovalRequest(); + const { approvalRequestApi } = progressEntriesContext.config; + const decideApprovalRequest = useDecideApprovalRequest(approvalRequestApi); function decideRequest(decision: string) { return function () { diff --git a/employee-portal/src/lib/shared/components/procedures/progress-entries/sidebars/approvalRequestOverviewSidebar/ApprovalRequestsOverviewSidebar.tsx b/employee-portal/src/lib/shared/components/procedures/progress-entries/sidebars/approvalRequestOverviewSidebar/ApprovalRequestsOverviewSidebar.tsx index a4d1eaa13..9ba211e49 100644 --- a/employee-portal/src/lib/shared/components/procedures/progress-entries/sidebars/approvalRequestOverviewSidebar/ApprovalRequestsOverviewSidebar.tsx +++ b/employee-portal/src/lib/shared/components/procedures/progress-entries/sidebars/approvalRequestOverviewSidebar/ApprovalRequestsOverviewSidebar.tsx @@ -13,6 +13,7 @@ import { ProgressEntriesContext, useOpenApprovalRequests, } from "@/lib/shared/components/procedures/progress-entries/ProgressEntriesContext"; +import { useGrantDeletionForAllRequests } from "@/lib/shared/components/procedures/progress-entries/mutations/approvalRequestApi"; import { ApprovalRequestCard } from "@/lib/shared/components/procedures/progress-entries/sidebars/approvalRequestOverviewSidebar/ApprovalRequestCard"; import { Sidebar } from "@/lib/shared/components/sidebar/Sidebar"; import { SidebarActions } from "@/lib/shared/components/sidebar/SidebarActions"; @@ -29,8 +30,9 @@ export function ApprovalRequestsOverviewSidebar({ }: ApprovalRequestOverviewProps) { const approvalRequests = useOpenApprovalRequests()!; const progressEntriesContext = useContext(ProgressEntriesContext); - const { useGrantDeletionForAllRequests } = progressEntriesContext.config; - const grantDeletionForAll = useGrantDeletionForAllRequests(); + const { approvalRequestApi } = progressEntriesContext.config; + const grantDeletionForAll = + useGrantDeletionForAllRequests(approvalRequestApi); function deleteAll() { grantDeletionForAll.mutate(approvalRequests); diff --git a/employee-portal/src/lib/shared/components/procedures/progress-entries/sidebars/progressEntryDetailsSidebar/DetailsHistory.tsx b/employee-portal/src/lib/shared/components/procedures/progress-entries/sidebars/progressEntryDetailsSidebar/DetailsHistory.tsx index c270ebe38..f37ef0258 100644 --- a/employee-portal/src/lib/shared/components/procedures/progress-entries/sidebars/progressEntryDetailsSidebar/DetailsHistory.tsx +++ b/employee-portal/src/lib/shared/components/procedures/progress-entries/sidebars/progressEntryDetailsSidebar/DetailsHistory.tsx @@ -21,6 +21,8 @@ import { isDefined } from "remeda"; import { OverlayBoundary } from "@/lib/shared/components/boundaries/OverlayBoundary"; import { ButtonBar } from "@/lib/shared/components/buttons/ButtonBar"; import { useProgressEntriesConfig } from "@/lib/shared/components/procedures/progress-entries/ProgressEntriesContext"; +import { useGetMetaDataHistory } from "@/lib/shared/components/procedures/progress-entries/queries/fileApi"; +import { useGetManualProgressEntryHistory } from "@/lib/shared/components/procedures/progress-entries/queries/progressEntryApi"; import { HistoryItem } from "@/lib/shared/components/procedures/progress-entries/types"; import { SidebarActions } from "@/lib/shared/components/sidebar/SidebarActions"; import { SidebarContent } from "@/lib/shared/components/sidebar/SidebarContent"; @@ -84,14 +86,19 @@ export function DetailsHistory({ } function NoteHistory({ entry }: { entry: ApiManualProgressEntry }) { - const { useGetManualProgressEntryHistory } = useProgressEntriesConfig(); - const history = useGetManualProgressEntryHistory(entry.progressEntryId).data; + const { progressEntryApi, progressEntryApiQueryKey } = + useProgressEntriesConfig(); + const history = useGetManualProgressEntryHistory( + progressEntryApi, + progressEntryApiQueryKey, + entry.progressEntryId, + ).data; return <History items={history} />; } function FileDescriptionHistory({ fileId }: { fileId: string }) { - const { useGetMetaDataHistory } = useProgressEntriesConfig(); - const history = useGetMetaDataHistory(fileId).data; + const { fileApi, fileApiQueryKey } = useProgressEntriesConfig(); + const history = useGetMetaDataHistory(fileApi, fileApiQueryKey, fileId).data; return <History items={history} />; } diff --git a/employee-portal/src/lib/shared/components/procedures/progress-entries/sidebars/progressEntryDetailsSidebar/ManualProgressEntryDetails.tsx b/employee-portal/src/lib/shared/components/procedures/progress-entries/sidebars/progressEntryDetailsSidebar/ManualProgressEntryDetails.tsx index a916ca6e0..703be2e8b 100644 --- a/employee-portal/src/lib/shared/components/procedures/progress-entries/sidebars/progressEntryDetailsSidebar/ManualProgressEntryDetails.tsx +++ b/employee-portal/src/lib/shared/components/procedures/progress-entries/sidebars/progressEntryDetailsSidebar/ManualProgressEntryDetails.tsx @@ -30,6 +30,7 @@ import { mapToPatchRequest, mapToUpdateMetaDataRequest, } from "@/lib/shared/components/procedures/progress-entries/mapper"; +import { usePatchProgressEntry } from "@/lib/shared/components/procedures/progress-entries/mutations/progressEntryApi"; import { AllKeyDocumentVersions, DetailsContentWrapper, @@ -133,8 +134,8 @@ function EditableManualProgressEntryDetails({ onClose: () => void; onHistory: () => void; }) { - const { usePatchProgressEntry } = useProgressEntriesConfig(); - const patchProgressEntry = usePatchProgressEntry(); + const { progressEntryApi, fileApi } = useProgressEntriesConfig(); + const patchProgressEntry = usePatchProgressEntry(progressEntryApi, fileApi); const fileDescription = extractFileDescriptionValue(entry); const INITIAL_EDIT_PROGRESS_ENTRY_VALUES: ProgressEntryDetailsValues = { text: entry.note ?? "", diff --git a/employee-portal/src/lib/shared/components/procedures/progress-entries/sidebars/progressEntryDetailsSidebar/ProgressEntryDetailsSidebar.tsx b/employee-portal/src/lib/shared/components/procedures/progress-entries/sidebars/progressEntryDetailsSidebar/ProgressEntryDetailsSidebar.tsx index 130db2aed..4867b8d90 100644 --- a/employee-portal/src/lib/shared/components/procedures/progress-entries/sidebars/progressEntryDetailsSidebar/ProgressEntryDetailsSidebar.tsx +++ b/employee-portal/src/lib/shared/components/procedures/progress-entries/sidebars/progressEntryDetailsSidebar/ProgressEntryDetailsSidebar.tsx @@ -9,6 +9,7 @@ import { useContext } from "react"; import { isDefined } from "remeda"; import { ProgressEntriesContext } from "@/lib/shared/components/procedures/progress-entries/ProgressEntriesContext"; +import { useFetchProgressEntryDetails } from "@/lib/shared/components/procedures/progress-entries/queries/progressEntryApi"; import { InboxProgressEntryDetails } from "@/lib/shared/components/procedures/progress-entries/sidebars/progressEntryDetailsSidebar/InboxProgressEntryDetails"; import { ManualProgressEntryDetails } from "@/lib/shared/components/procedures/progress-entries/sidebars/progressEntryDetailsSidebar/ManualProgressEntryDetails"; import { SystemProgressEntryDetails } from "@/lib/shared/components/procedures/progress-entries/sidebars/progressEntryDetailsSidebar/SystemProgressEntryDetails"; @@ -22,11 +23,16 @@ export function ProgressEntryDetailsSidebar({ progressEntryId, }: ProgressEntryDetailsSidebarProps) { const progressEntriesContext = useContext(ProgressEntriesContext); - const { procedureId, useFetchProgressEntryDetails } = + const { procedureId, progressEntryApi, progressEntryApiQueryKey } = progressEntriesContext.config; const { closeEntryDetailsSidebar } = progressEntriesContext.action; const { progressEntry, relatedKeyDocumentProgressEntries } = - useFetchProgressEntryDetails(procedureId, progressEntryId).data; + useFetchProgressEntryDetails( + progressEntryApi, + progressEntryApiQueryKey, + procedureId, + progressEntryId, + ).data; return ( <Sidebar open onClose={closeEntryDetailsSidebar}> diff --git a/employee-portal/src/lib/shared/components/procedures/progress-entries/types.ts b/employee-portal/src/lib/shared/components/procedures/progress-entries/types.ts index 6faf1a863..2ba4d6396 100644 --- a/employee-portal/src/lib/shared/components/procedures/progress-entries/types.ts +++ b/employee-portal/src/lib/shared/components/procedures/progress-entries/types.ts @@ -7,32 +7,22 @@ import { ApiUserRole } from "@eshg/base-api"; import { - ApiApprovalRequest, - ApiCreateApprovalRequestRequest, - ApiCreateManualProgressEntryRequest, - ApiFileMetaData, ApiGetDetailedProcedureResponse, - ApiGetFile200Response, ApiGetProcedureApprovalRequestsResponse, ApiGetProgressEntriesResponseProgressEntriesInner, - ApiGetProgressEntryResponse, - ApiManualProgressEntry, - ApiPatchManualProgressEntryRequest, ApiProgressEntryClass, ApiProgressEntryReferenceFilePair, - ApiUpdateFileMetaDataRequest, + ApprovalRequestApi, + FileApi, GetProgressEntriesRequest, + ProcedureApi, + ProgressEntryApi, } from "@eshg/employee-portal-api/businessProcedures"; +import { QueryKeyFactory } from "@eshg/lib-portal/api/queryKeyFactory"; import { SearchParams } from "@eshg/lib-portal/helpers/searchParams"; -import { - UseMutationResult, - UseSuspenseQueryResult, -} from "@tanstack/react-query"; import { UseFilterSettings } from "@/lib/shared/components/filterSettings/useFilterSettings"; -export type DynamicRoute = (fileId: string) => string; - export interface EntryDeletionModalProps { onSuccessfulDeletion: () => void; } @@ -42,7 +32,7 @@ export type ProgressEntriesSearchParams = Omit< "procedureId" >; -export interface ProgressEntriesPageProps extends ProgressEntryApiMethods { +export interface ProgressEntriesPageProps extends ProgressEntryClients { procedureId: string; searchParams: SearchParams; leaderRole: ApiUserRole; @@ -52,7 +42,7 @@ export interface ProgressEntriesPageProps extends ProgressEntryApiMethods { getInitOverrides?: (inspectionId?: string) => RequestInit; } -export interface ProgressEntriesConfig extends ProgressEntryApiActions { +export interface ProgressEntriesConfig extends ProgressEntryClients { procedureId: string; progressEntries: ApiGetProgressEntriesResponseProgressEntriesInner[]; detailedProcedure: ApiGetDetailedProcedureResponse; @@ -69,102 +59,44 @@ export interface ProgressEntriesUrlParams<TPageParams = unknown> { searchParams: SearchParams; } -interface ProgressEntryApiActions { - useCreateProgressEntry: () => UseMutationResult< - ApiManualProgressEntry, - Error, - { - request: ApiCreateManualProgressEntryRequest; - file?: File | undefined; - fileMetaData?: ApiFileMetaData | undefined; - }, - unknown - >; - useDeleteFile: () => UseMutationResult<void, Error, string, unknown>; - useDeleteProgressEntry: () => UseMutationResult<void, Error, string, unknown>; +interface ProgressEntryClients { + progressEntryApiQueryKey: QueryKeyFactory; + progressEntryApi: ProgressEntryClient; + procedureApi: ProcedureClient; + fileApiQueryKey: QueryKeyFactory; + fileApi: FileClient; + approvalRequestApi: ApprovalRequestClient; +} - usePatchProgressEntry(): UseMutationResult< - { - entry?: ApiManualProgressEntry; - file?: ApiGetFile200Response; - }, - Error, - { - entryId: string; - patchProgressEntryRequest?: ApiPatchManualProgressEntryRequest; - fileId?: string; - updateFileMetaDataRequest?: ApiUpdateFileMetaDataRequest; - }, - unknown - >; +export type ProgressEntryClient = Pick< + ProgressEntryApi, + | "addProgressEntry" + | "removeProgressEntry" + | "patchProgressEntry" + | "getProgressEntriesRaw" + | "getProgressEntry" + | "requestProgressEntryDeletion" + | "getManualProgressEntryHistory" +>; - useRequestProgressEntryDeletion: () => UseMutationResult< - ApiApprovalRequest, - Error, - { - entryId: string; - createApprovalRequest: ApiCreateApprovalRequestRequest; - }, - unknown - >; - useRequestFileDeletion: () => UseMutationResult< - ApiApprovalRequest, - Error, - { - fileId: string; - createApprovalRequest: ApiCreateApprovalRequestRequest; - }, - unknown - >; - useDecideApprovalRequest: () => UseMutationResult< - void, - Error, - { - approvalRequestId: string; - decision: string; - }, - unknown - >; - useGrantDeletionForAllRequests: () => UseMutationResult< - void, - Error, - ApiApprovalRequest[], - unknown - >; - useDownloadFile: () => (fileId: string) => Promise<File>; - useGetManualProgressEntryHistory: ( - entryId: string, - ) => UseSuspenseQueryResult<HistoryItem[] | undefined, Error>; - useGetMetaDataHistory: ( - fileId: string, - ) => UseSuspenseQueryResult<HistoryItem[] | undefined, Error>; - useFetchProgressEntryDetails: ( - procedureId: string, - progressEntryId: string, - ) => UseSuspenseQueryResult<ApiGetProgressEntryResponse, Error>; -} +export type ProcedureClient = Pick< + ProcedureApi, + "getDetailedProcedure" | "getProcedureFileDetails" | "getApprovalRequests" +>; -interface ProgressEntryApiMethods extends ProgressEntryApiActions { - useFetchProgressEntries: ( - procedureId: string, - leaderRole: ApiUserRole, - progressEntryFilter: ProgressEntriesFilters, - ) => UseSuspenseQueryResult< - { - detailedProcedure: ApiGetDetailedProcedureResponse; - files: ApiProgressEntryReferenceFilePair[]; - progressEntries: ApiGetProgressEntriesResponseProgressEntriesInner[]; - approvalRequestsResponse: - | ApiGetProcedureApprovalRequestsResponse - | undefined; - }, - Error - >; - useFetchProgressEntryDetails: ( - procedureId: string, - progressEntryId: string, - ) => UseSuspenseQueryResult<ApiGetProgressEntryResponse, Error>; -} +export type FileClient = Pick< + FileApi, + | "downloadFileRaw" + | "getMetaDataHistory" + | "deleteFile" + | "requestFileDeletion" + | "updateFileMetaData" +>; + +export type ApprovalRequestClient = Pick< + ApprovalRequestApi, + "decideApprovalRequest" +>; export interface HistoryItem { changedAt: Date; diff --git a/lib-portal/eslint.config.js b/lib-portal/eslint.config.js index c2ceebe98..69316b646 100644 --- a/lib-portal/eslint.config.js +++ b/lib-portal/eslint.config.js @@ -3,11 +3,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -import tseslint from "typescript-eslint"; - import { eslintNextConfigs } from "../config/eslint.next.js"; -export default tseslint.config( - ...eslintNextConfigs.lib, - ...eslintNextConfigs.forbidStyleProp, -); +export default eslintNextConfigs.lib; diff --git a/lib-portal/src/components/form/FormPlus.tsx b/lib-portal/src/components/form/FormPlus.tsx index f202f5cb4..6a1b82752 100644 --- a/lib-portal/src/components/form/FormPlus.tsx +++ b/lib-portal/src/components/form/FormPlus.tsx @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { formControlClasses } from "@mui/joy"; +import { Box, formControlClasses } from "@mui/joy"; +import { SxProps } from "@mui/joy/styles/types"; // eslint-disable-next-line no-restricted-imports import { Form, FormikFormProps, useFormikContext } from "formik"; import { MutableRefObject, useEffect, useRef } from "react"; @@ -75,6 +76,7 @@ export function scrollToFirstFormError( interface FormPlusOptions { scrollToError?: boolean; + sx?: SxProps; } /* Formik <Form> wrapper that utilizes useScrollToError() @@ -84,14 +86,20 @@ export function FormPlus({ children, scrollToError = true, ...props -}: Omit<FormikFormProps, "autoComplete" | "noValidate" | "ref"> & +}: Omit<FormikFormProps, "autoComplete" | "noValidate" | "ref" | "style"> & FormPlusOptions) { const formRef = useRef<HTMLFormElement | null>(null); useScrollToError({ enabled: scrollToError, formRef }); return ( - <Form autoComplete="off" {...props} noValidate ref={formRef}> + <Box + component={Form} + autoComplete="off" + {...props} + noValidate + ref={formRef} + > {children} - </Form> + </Box> ); } diff --git a/lib-portal/src/components/formFields/InputField.tsx b/lib-portal/src/components/formFields/InputField.tsx index 4d45fbe1b..ea8afc09b 100644 --- a/lib-portal/src/components/formFields/InputField.tsx +++ b/lib-portal/src/components/formFields/InputField.tsx @@ -102,6 +102,7 @@ export function InputField(props: Readonly<InputFieldProps>) { maxLength: props.maxLength, "aria-details": props["aria-details"], autoFocus: props.autoFocus ?? false, + max: props.type === "date" ? "9999-12-31" : undefined, }, }} /> diff --git a/lib-portal/src/components/formFields/appointmentPicker/AppointmentListForDate.tsx b/lib-portal/src/components/formFields/appointmentPicker/AppointmentListForDate.tsx index e7d0aa595..b5e8b2ac6 100644 --- a/lib-portal/src/components/formFields/appointmentPicker/AppointmentListForDate.tsx +++ b/lib-portal/src/components/formFields/appointmentPicker/AppointmentListForDate.tsx @@ -63,6 +63,7 @@ export interface AppointmentListProps<T extends Appointment> { field: ReturnType<typeof useBaseField<T | null>>; appointments: T[]; onAppointmentSelected?: (d: T) => unknown; + isAppointmentEqual?: (apt1: T, apt2: T) => boolean; label: string; } export function AppointmentListForDate<T extends Appointment>({ @@ -70,6 +71,7 @@ export function AppointmentListForDate<T extends Appointment>({ field, appointments, onAppointmentSelected, + isAppointmentEqual = (apt1, apt2) => apt1 === apt2, label, }: AppointmentListProps<T>) { const theme = useTheme(); @@ -102,7 +104,8 @@ export function AppointmentListForDate<T extends Appointment>({ sx={{ marginBottom: "16px", gap: "8px", padding: 0 }} > {appointments.map((apt) => { - const isSelected = field.input.value === apt; + const isSelected = + !!field.input.value && isAppointmentEqual(field.input.value, apt); return ( <ListItem sx={{ padding: 0, minHeight: 0 }} diff --git a/lib-portal/src/components/formFields/appointmentPicker/AppointmentPickerField.tsx b/lib-portal/src/components/formFields/appointmentPicker/AppointmentPickerField.tsx index fff1379e3..64c088bea 100644 --- a/lib-portal/src/components/formFields/appointmentPicker/AppointmentPickerField.tsx +++ b/lib-portal/src/components/formFields/appointmentPicker/AppointmentPickerField.tsx @@ -55,6 +55,7 @@ export interface AppointmentPickerFieldProps<T extends Appointment> active?: boolean; monthAppointments: T[]; onAppointmentSelected?: (d: T) => unknown; + isAppointmentEqual?: (apt1: T, apt2: T) => boolean; layout?: (props: AppointmentPickerLayoutProps) => ReactNode; appointmentList?: (props: AppointmentListProps<T>) => ReactNode; labels: AppointmentPickerFieldLabels; @@ -68,6 +69,7 @@ export function AppointmentPickerField<T extends Appointment>({ setCurrentMonth, monthAppointments, onAppointmentSelected, + isAppointmentEqual, required, appointmentList: AppointmentListOverride, layout, @@ -135,6 +137,7 @@ export function AppointmentPickerField<T extends Appointment>({ field={field} date={active ? selectedDay : undefined} onAppointmentSelected={onAppointmentSelected} + isAppointmentEqual={isAppointmentEqual} /> {field.helperText != null && ( <FormHelperText component="p" sx={{ my: 1 }}> diff --git a/lib-portal/src/components/formFields/appointmentPicker/labels.ts b/lib-portal/src/components/formFields/appointmentPicker/labels.ts index e5a6a811f..31b61add2 100644 --- a/lib-portal/src/components/formFields/appointmentPicker/labels.ts +++ b/lib-portal/src/components/formFields/appointmentPicker/labels.ts @@ -13,7 +13,7 @@ const dateFormatter = Intl.DateTimeFormat(undefined, { }); export const FIELD_LABELS_DE = { requiredAppointment: "Bitte einen Termin auswählen", - requiredDay: "Bitte ein Tag auswählen", + requiredDay: "Bitte einen Tag auswählen", monthSelection: "Termin Kalendermonat", nextMonth: "zum nächsten Monat", prevMonth: "zum vorherigen Monat", diff --git a/lib-portal/src/components/navigation/NavigationLink.tsx b/lib-portal/src/components/navigation/NavigationLink.tsx index 564d9b682..1aae432e8 100644 --- a/lib-portal/src/components/navigation/NavigationLink.tsx +++ b/lib-portal/src/components/navigation/NavigationLink.tsx @@ -5,6 +5,8 @@ "use client"; +import { Box } from "@mui/joy"; +import { SxProps } from "@mui/joy/styles/types"; // eslint-disable-next-line no-restricted-imports import NextLink from "next/link"; import { ReactNode, Ref, forwardRef } from "react"; @@ -12,12 +14,13 @@ import { ReactNode, Ref, forwardRef } from "react"; import { useNavigation } from "./NavigationContext"; function Navlink( - props: Parameters<typeof NextLink>[0], + props: Omit<Parameters<typeof NextLink>[0], "style"> & { sx?: SxProps }, ref: Ref<HTMLAnchorElement>, ): ReactNode { const { tryNavigate } = useNavigation(); return ( - <NextLink + <Box + component={NextLink} {...props} // Since we only use client-side requests, there is only a small performance advantage for the user when prefetching server components. // By deactivating this, we reduce the load on the Next.js backend and the reverse proxy. diff --git a/lib-portal/src/config/apiMiddlewares.ts b/lib-portal/src/config/apiMiddlewares.ts new file mode 100644 index 000000000..60ea5d3b4 --- /dev/null +++ b/lib-portal/src/config/apiMiddlewares.ts @@ -0,0 +1,14 @@ +/** + * Copyright 2025 cronn GmbH + * SPDX-License-Identifier: Apache-2.0 + */ + +import { Middleware } from "@eshg/base-api"; + +import { clientOnlyMiddleware } from "../api/clientOnlyMiddleware"; +import { errorInterceptionMiddleware } from "../api/errorInterceptionMiddleware"; + +export const apiMiddlewares: Middleware[] = [ + clientOnlyMiddleware, + errorInterceptionMiddleware, +]; diff --git a/packages/base-api/buildscript-gradle.lockfile b/packages/base-api/buildscript-gradle.lockfile new file mode 100644 index 000000000..0d156738b --- /dev/null +++ b/packages/base-api/buildscript-gradle.lockfile @@ -0,0 +1,4 @@ +# This is a Gradle generated file for dependency locking. +# Manual edits can break the build and are not advised. +# This file is expected to be part of source control. +empty=classpath diff --git a/packages/dental-api/buildscript-gradle.lockfile b/packages/dental-api/buildscript-gradle.lockfile new file mode 100644 index 000000000..0d156738b --- /dev/null +++ b/packages/dental-api/buildscript-gradle.lockfile @@ -0,0 +1,4 @@ +# This is a Gradle generated file for dependency locking. +# Manual edits can break the build and are not advised. +# This file is expected to be part of source control. +empty=classpath diff --git a/packages/dental/buildscript-gradle.lockfile b/packages/dental/buildscript-gradle.lockfile new file mode 100644 index 000000000..0d156738b --- /dev/null +++ b/packages/dental/buildscript-gradle.lockfile @@ -0,0 +1,4 @@ +# This is a Gradle generated file for dependency locking. +# Manual edits can break the build and are not advised. +# This file is expected to be part of source control. +empty=classpath diff --git a/packages/dental/eslint.config.js b/packages/dental/eslint.config.js index 4286ef78c..c83d37e34 100644 --- a/packages/dental/eslint.config.js +++ b/packages/dental/eslint.config.js @@ -3,11 +3,6 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import tseslint from "typescript-eslint"; - import { eslintNextConfigs } from "../../config/eslint.next.js"; -export default tseslint.config( - ...eslintNextConfigs.lib, - ...eslintNextConfigs.forbidStyleProp, -); +export default eslintNextConfigs.lib; diff --git a/packages/dental/package.json b/packages/dental/package.json index b4a4b7cad..cae794e74 100644 --- a/packages/dental/package.json +++ b/packages/dental/package.json @@ -41,6 +41,7 @@ "eslint-plugin-unused-imports": "catalog:eslint", "eslint-plugin-promise": "catalog:eslint", "prettier": "catalog:prettier", + "resolve-tspaths": "catalog:common", "tsup": "catalog:common", "typescript": "catalog:common", "typescript-eslint": "catalog:eslint", diff --git a/packages/dental/src/api/createClients.ts b/packages/dental/src/api/createClients.ts new file mode 100644 index 000000000..55e0d44c9 --- /dev/null +++ b/packages/dental/src/api/createClients.ts @@ -0,0 +1,34 @@ +/** + * Copyright 2025 cronn GmbH + * SPDX-License-Identifier: AGPL-3.0-only + */ + +import { + ApprovalRequestApi, + BaseAPI, + ChildApi, + Configuration, + FileApi, + ProcedureApi, + ProgressEntryApi, + ProphylaxisSessionApi, +} from "@eshg/dental-api"; +import { apiMiddlewares } from "@eshg/lib-portal/config/apiMiddlewares"; + +export type DentalClients = ReturnType<typeof createClients>; + +export function createClients(baseUrl: string) { + const configuration = new Configuration({ + basePath: baseUrl, + middleware: apiMiddlewares, + }); + + return { + childApi: new ChildApi(configuration), + prophylaxisSessionApi: new ProphylaxisSessionApi(configuration), + procedureApi: new ProcedureApi(configuration), + progressEntryApi: new ProgressEntryApi(configuration), + fileApi: new FileApi(configuration), + approvalRequestApi: new ApprovalRequestApi(configuration), + } satisfies Record<string, BaseAPI>; +} diff --git a/employee-portal/src/lib/businessModules/dental/api/models/Child.ts b/packages/dental/src/api/models/Child.ts similarity index 74% rename from employee-portal/src/lib/businessModules/dental/api/models/Child.ts rename to packages/dental/src/api/models/Child.ts index f21cbea7f..eb2b1f4f0 100644 --- a/employee-portal/src/lib/businessModules/dental/api/models/Child.ts +++ b/packages/dental/src/api/models/Child.ts @@ -3,16 +3,13 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +import { ApiChild, ApiGender, ApiProcedureStatus } from "@eshg/dental-api"; import { - ApiChild, - ApiGender, - ApiInstitution, - ApiProcedureStatus, -} from "@eshg/dental-api"; + BaseEntity, + mapBaseEntity, +} from "@eshg/lib-employee-portal/api/models/BaseEntity"; -import { BaseEntity, mapBaseEntity } from "@/lib/shared/api/models/BaseEntity"; - -import { mapInstitution } from "./Institution"; +import { Institution, mapInstitution } from "./Institution"; export interface Child extends BaseEntity { readonly firstName: string; @@ -21,7 +18,7 @@ export interface Child extends BaseEntity { readonly dateOfBirth: Date; readonly year: number; readonly groupName: string; - readonly institution: ApiInstitution; + readonly institution: Institution; readonly isClosed: boolean; } diff --git a/employee-portal/src/lib/businessModules/dental/api/models/ChildDetails.ts b/packages/dental/src/api/models/ChildDetails.ts similarity index 61% rename from employee-portal/src/lib/businessModules/dental/api/models/ChildDetails.ts rename to packages/dental/src/api/models/ChildDetails.ts index 5e8bb73f5..6ad3eb8bf 100644 --- a/employee-portal/src/lib/businessModules/dental/api/models/ChildDetails.ts +++ b/packages/dental/src/api/models/ChildDetails.ts @@ -3,24 +3,21 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +import { ApiChildDetails, ApiFluoridationConsent } from "@eshg/dental-api"; import { - ApiChildDetails, - ApiFluoridationConsent, - ApiProcedureStatus, -} from "@eshg/dental-api"; + Versioned, + mapVersioned, +} from "@eshg/lib-employee-portal/api/models/Versioned"; +import { Child, mapChild } from "./Child"; +import { Examination, mapExamination } from "./Examination"; import { AnnualInstitution, Institution, mapAnnualInstitutionDetails, -} from "@/lib/businessModules/dental/api/models/Institution"; -import { mapBaseEntity } from "@/lib/shared/api/models/BaseEntity"; - -import { Child } from "./Child"; -import { Examination, mapExamination } from "./Examination"; +} from "./Institution"; -export interface ChildDetails extends Child { - readonly version: number; +export interface ChildDetails extends Child, Versioned { readonly examinations: Examination[]; readonly institutions: AnnualInstitution[]; readonly currentFluoridationConsent?: ApiFluoridationConsent; @@ -31,18 +28,13 @@ export function mapChildDetails(response: ApiChildDetails): ChildDetails { const institutions = response.institutions.map(mapAnnualInstitutionDetails); return { - ...mapBaseEntity(response), - firstName: response.firstName, - lastName: response.lastName, - gender: response.gender, - dateOfBirth: response.dateOfBirth, - year: response.year, - groupName: response.groupName, - isClosed: response.status == ApiProcedureStatus.Closed, - version: response.version, - institution: getCurrentInstitution(institutions), + ...mapVersioned(response), + ...mapChild({ + ...response, + institution: getCurrentInstitution(institutions), + }), + institutions, examinations: response.examinations.map(mapExamination), - institutions: institutions, currentFluoridationConsent: getCurrentFluoridationConsent( response.fluoridationConsents, ), diff --git a/employee-portal/src/lib/businessModules/dental/api/models/ChildExamination.ts b/packages/dental/src/api/models/ChildExamination.ts similarity index 83% rename from employee-portal/src/lib/businessModules/dental/api/models/ChildExamination.ts rename to packages/dental/src/api/models/ChildExamination.ts index 67f904325..53e76f9fe 100644 --- a/employee-portal/src/lib/businessModules/dental/api/models/ChildExamination.ts +++ b/packages/dental/src/api/models/ChildExamination.ts @@ -7,17 +7,13 @@ import { ApiGender, ApiProphylaxisSessionChildExamination, } from "@eshg/dental-api"; - -import { - ExaminationStatus, - mapToExaminationStatus, -} from "@/lib/businessModules/dental/api/models/ExaminationStatus"; -import { mapOptional } from "@/lib/shared/api/models/utils"; +import { mapOptional } from "@eshg/lib-employee-portal/api/models/utils"; import { ChildExaminationResult, mapChildExaminationResult, } from "./ChildExaminationResult"; +import { ExaminationStatus, mapToExaminationStatus } from "./ExaminationStatus"; export interface ChildExamination { readonly childId: string; diff --git a/employee-portal/src/lib/businessModules/dental/api/models/ChildExaminationResult.ts b/packages/dental/src/api/models/ChildExaminationResult.ts similarity index 73% rename from employee-portal/src/lib/businessModules/dental/api/models/ChildExaminationResult.ts rename to packages/dental/src/api/models/ChildExaminationResult.ts index bf99a73fe..6a5405513 100644 --- a/employee-portal/src/lib/businessModules/dental/api/models/ChildExaminationResult.ts +++ b/packages/dental/src/api/models/ChildExaminationResult.ts @@ -4,15 +4,18 @@ */ import { + ApiAbsenceExaminationResult, ApiExaminationResult, ApiFluoridationExaminationResult, ApiOralHygieneStatus, + ApiReasonForAbsence, ApiScreeningExaminationResult, } from "@eshg/dental-api"; export type ChildExaminationResult = | FluoridationExaminationResult - | ScreeningExaminationResult; + | ScreeningExaminationResult + | AbsenceExaminationResult; export interface FluoridationExaminationResult { readonly fluorideVarnishApplied: boolean; @@ -23,6 +26,10 @@ export interface ScreeningExaminationResult readonly oralHygieneStatus?: ApiOralHygieneStatus; } +export interface AbsenceExaminationResult { + readonly reasonForAbsence?: ApiReasonForAbsence; +} + export function mapChildExaminationResult( response: ApiExaminationResult, ): ChildExaminationResult { @@ -31,6 +38,8 @@ export function mapChildExaminationResult( return mapFluoridationExaminationResult(response); case "ScreeningExaminationResult": return mapScreeningExaminationResult(response); + case "AbsenceExaminationResult": + return mapAbsenceExaminationResult(response); } } @@ -50,3 +59,11 @@ function mapScreeningExaminationResult( oralHygieneStatus: response.oralHygieneStatus, }; } + +function mapAbsenceExaminationResult( + response: ApiAbsenceExaminationResult, +): AbsenceExaminationResult { + return { + reasonForAbsence: response.reasonForAbsence, + }; +} diff --git a/employee-portal/src/lib/businessModules/dental/api/models/ChildSearchResult.ts b/packages/dental/src/api/models/ChildSearchResult.ts similarity index 100% rename from employee-portal/src/lib/businessModules/dental/api/models/ChildSearchResult.ts rename to packages/dental/src/api/models/ChildSearchResult.ts diff --git a/employee-portal/src/lib/businessModules/dental/api/models/Examination.ts b/packages/dental/src/api/models/Examination.ts similarity index 55% rename from employee-portal/src/lib/businessModules/dental/api/models/Examination.ts rename to packages/dental/src/api/models/Examination.ts index 6a47049a9..8905154ce 100644 --- a/employee-portal/src/lib/businessModules/dental/api/models/Examination.ts +++ b/packages/dental/src/api/models/Examination.ts @@ -3,18 +3,22 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ApiExamination, ApiProphylaxisType } from "@eshg/dental-api"; - import { - ExaminationStatus, - mapToExaminationStatus, -} from "@/lib/businessModules/dental/api/models/ExaminationStatus"; -import { BaseEntity } from "@/lib/shared/api/models/BaseEntity"; + ApiDentalExaminationResult, + ApiExamination, + ApiProphylaxisType, +} from "@eshg/dental-api"; +import { BaseEntity } from "@eshg/lib-employee-portal/api/models/BaseEntity"; + +import { ExaminationStatus, mapToExaminationStatus } from "./ExaminationStatus"; export interface Examination extends BaseEntity { readonly dateAndTime: Date; readonly prophylaxisType: ApiProphylaxisType; + readonly screening: boolean; + readonly fluoridation: boolean; readonly note?: string; + readonly result?: ApiDentalExaminationResult; readonly version: number; readonly status: ExaminationStatus; } @@ -24,7 +28,10 @@ export function mapExamination(response: ApiExamination): Examination { ...response, dateAndTime: response.dateAndTime, prophylaxisType: response.prophylaxisType, + screening: response.screening, + fluoridation: response.fluoridation, note: response.note, + result: response.result, status: mapToExaminationStatus(response.result), }; } diff --git a/employee-portal/src/lib/businessModules/dental/api/models/ExaminationStatus.ts b/packages/dental/src/api/models/ExaminationStatus.ts similarity index 100% rename from employee-portal/src/lib/businessModules/dental/api/models/ExaminationStatus.ts rename to packages/dental/src/api/models/ExaminationStatus.ts diff --git a/employee-portal/src/lib/businessModules/dental/api/models/Institution.ts b/packages/dental/src/api/models/Institution.ts similarity index 89% rename from employee-portal/src/lib/businessModules/dental/api/models/Institution.ts rename to packages/dental/src/api/models/Institution.ts index d3d89cd2f..ba6f19881 100644 --- a/employee-portal/src/lib/businessModules/dental/api/models/Institution.ts +++ b/packages/dental/src/api/models/Institution.ts @@ -4,8 +4,10 @@ */ import { ApiAnnualInstitution, ApiInstitution } from "@eshg/dental-api"; - -import { BaseEntity, mapBaseEntity } from "@/lib/shared/api/models/BaseEntity"; +import { + BaseEntity, + mapBaseEntity, +} from "@eshg/lib-employee-portal/api/models/BaseEntity"; export interface Institution extends BaseEntity { readonly name: string; diff --git a/employee-portal/src/lib/businessModules/dental/api/models/ProphylaxisSession.ts b/packages/dental/src/api/models/ProphylaxisSession.ts similarity index 67% rename from employee-portal/src/lib/businessModules/dental/api/models/ProphylaxisSession.ts rename to packages/dental/src/api/models/ProphylaxisSession.ts index 5084c8c5e..a232a6970 100644 --- a/employee-portal/src/lib/businessModules/dental/api/models/ProphylaxisSession.ts +++ b/packages/dental/src/api/models/ProphylaxisSession.ts @@ -8,8 +8,10 @@ import { ApiProphylaxisSession, ApiProphylaxisType, } from "@eshg/dental-api"; - -import { BaseEntity } from "@/lib/shared/api/models/BaseEntity"; +import { + BaseEntity, + mapBaseEntity, +} from "@eshg/lib-employee-portal/api/models/BaseEntity"; import { Institution, mapInstitution } from "./Institution"; @@ -26,7 +28,12 @@ export function mapProphylaxisSession( response: ApiProphylaxisSession, ): ProphylaxisSession { return { - ...response, + ...mapBaseEntity(response), + dateAndTime: response.dateAndTime, institution: mapInstitution(response.institution), + groupName: response.groupName, + type: response.type, + screening: response.screening, + fluoridationVarnish: response.fluoridationVarnish, }; } diff --git a/employee-portal/src/lib/businessModules/dental/api/models/ProphylaxisSessionDetails.ts b/packages/dental/src/api/models/ProphylaxisSessionDetails.ts similarity index 100% rename from employee-portal/src/lib/businessModules/dental/api/models/ProphylaxisSessionDetails.ts rename to packages/dental/src/api/models/ProphylaxisSessionDetails.ts diff --git a/employee-portal/src/lib/businessModules/dental/api/mutations/childApi.ts b/packages/dental/src/api/mutations/childApi.ts similarity index 89% rename from employee-portal/src/lib/businessModules/dental/api/mutations/childApi.ts rename to packages/dental/src/api/mutations/childApi.ts index be49b0e07..5fc2692d7 100644 --- a/employee-portal/src/lib/businessModules/dental/api/mutations/childApi.ts +++ b/packages/dental/src/api/mutations/childApi.ts @@ -13,14 +13,14 @@ import { useHandledMutation } from "@eshg/lib-portal/api/useHandledMutation"; import { useSnackbar } from "@eshg/lib-portal/components/snackbar/SnackbarProvider"; import { useQueryClient } from "@tanstack/react-query"; -import { useChildApi } from "@/lib/businessModules/dental/api/clients"; import { getChildDetailsQuery, getExaminationQuery, -} from "@/lib/businessModules/dental/api/queries/childApi"; +} from "@/api/queries/childApi"; +import { useDentalApi } from "@/shared/DentalProvider"; export function useCreateChild() { - const childApi = useChildApi(); + const { childApi } = useDentalApi(); const snackbar = useSnackbar(); return useHandledMutation({ mutationFn: (request: ApiCreateChildRequest) => @@ -32,7 +32,7 @@ export function useCreateChild() { } export function useUpdateAnnualChild(childId: string) { - const childApi = useChildApi(); + const { childApi } = useDentalApi(); const queryClient = useQueryClient(); const { queryKey } = getChildDetailsQuery(childApi, childId); const snackbar = useSnackbar(); @@ -49,7 +49,7 @@ export function useUpdateAnnualChild(childId: string) { } export function useCloseSchoolYear() { - const childApi = useChildApi(); + const { childApi } = useDentalApi(); const snackbar = useSnackbar(); return useHandledMutation({ mutationFn: () => childApi.closeSchoolYear(), @@ -60,7 +60,7 @@ export function useCloseSchoolYear() { } export function useUpdateExamination(examinationId: string) { - const childApi = useChildApi(); + const { childApi } = useDentalApi(); const snackbar = useSnackbar(); const { queryKey } = getExaminationQuery(childApi, examinationId); const queryClient = useQueryClient(); diff --git a/packages/dental/src/api/mutations/importApi.ts b/packages/dental/src/api/mutations/importApi.ts new file mode 100644 index 000000000..0ce0fdb00 --- /dev/null +++ b/packages/dental/src/api/mutations/importApi.ts @@ -0,0 +1,20 @@ +/** + * Copyright 2025 cronn GmbH + * SPDX-License-Identifier: AGPL-3.0-only + */ + +import { ApiImportStatistics, ImportXlsxRequest } from "@eshg/dental-api"; +import { parseImportResult } from "@eshg/lib-employee-portal/helpers/import"; +import { useHandledMutation } from "@eshg/lib-portal/api/useHandledMutation"; + +import { useDentalApi } from "@/shared/DentalProvider"; + +export function useImportChildren() { + const { childApi } = useDentalApi(); + return useHandledMutation({ + mutationFn: (request: ImportXlsxRequest) => + childApi + .importXlsxRaw(request) + .then(parseImportResult<ApiImportStatistics>), + }); +} diff --git a/employee-portal/src/lib/businessModules/dental/api/mutations/prophylaxisSessionApi.ts b/packages/dental/src/api/mutations/prophylaxisSessionApi.ts similarity index 82% rename from employee-portal/src/lib/businessModules/dental/api/mutations/prophylaxisSessionApi.ts rename to packages/dental/src/api/mutations/prophylaxisSessionApi.ts index 66d5dd877..1d0a2e343 100644 --- a/employee-portal/src/lib/businessModules/dental/api/mutations/prophylaxisSessionApi.ts +++ b/packages/dental/src/api/mutations/prophylaxisSessionApi.ts @@ -12,11 +12,11 @@ import { useHandledMutation } from "@eshg/lib-portal/api/useHandledMutation"; import { useSnackbar } from "@eshg/lib-portal/components/snackbar/SnackbarProvider"; import { useQueryClient } from "@tanstack/react-query"; -import { useProphylaxisSessionApi } from "@/lib/businessModules/dental/api/clients"; -import { getProphylaxisSessionQuery } from "@/lib/businessModules/dental/api/queries/prophylaxisSessionApi"; +import { getProphylaxisSessionQuery } from "@/api/queries/prophylaxisSessionApi"; +import { useDentalApi } from "@/shared/DentalProvider"; export function useCreateProphylaxisSession() { - const prophylaxisSessionApi = useProphylaxisSessionApi(); + const { prophylaxisSessionApi } = useDentalApi(); const snackbar = useSnackbar(); return useHandledMutation({ mutationFn: (request: ApiCreateProphylaxisSessionRequest) => @@ -30,7 +30,7 @@ export function useCreateProphylaxisSession() { export function useUpdateProphylaxisSessionParticipants( prophylaxisSessionId: string, ) { - const prophylaxisSessionApi = useProphylaxisSessionApi(); + const { prophylaxisSessionApi } = useDentalApi(); const queryClient = useQueryClient(); const { queryKey } = getProphylaxisSessionQuery(prophylaxisSessionApi, { prophylaxisSessionId, diff --git a/employee-portal/src/lib/businessModules/dental/api/queries/apiQueryKeys.ts b/packages/dental/src/api/queries/apiQueryKeys.ts similarity index 100% rename from employee-portal/src/lib/businessModules/dental/api/queries/apiQueryKeys.ts rename to packages/dental/src/api/queries/apiQueryKeys.ts diff --git a/employee-portal/src/lib/businessModules/dental/api/queries/childApi.ts b/packages/dental/src/api/queries/childApi.ts similarity index 81% rename from employee-portal/src/lib/businessModules/dental/api/queries/childApi.ts rename to packages/dental/src/api/queries/childApi.ts index 4c94cf4ad..0044ee7d4 100644 --- a/employee-portal/src/lib/businessModules/dental/api/queries/childApi.ts +++ b/packages/dental/src/api/queries/childApi.ts @@ -8,22 +8,22 @@ import { ChildApi, GetChildrenRequest, } from "@eshg/dental-api"; +import { mapPaginatedList } from "@eshg/lib-employee-portal/api/models/PaginatedList"; import { unwrapRawResponse } from "@eshg/lib-portal/api/unwrapRawResponse"; import { isBlankString } from "@eshg/lib-portal/helpers/guards"; import { queryOptions, useQuery } from "@tanstack/react-query"; import { isDefined } from "remeda"; -import { useChildApi } from "@/lib/businessModules/dental/api/clients"; -import { mapChild } from "@/lib/businessModules/dental/api/models/Child"; -import { mapChildDetails } from "@/lib/businessModules/dental/api/models/ChildDetails"; -import { mapChildSearchResult } from "@/lib/businessModules/dental/api/models/ChildSearchResult"; -import { mapExamination } from "@/lib/businessModules/dental/api/models/Examination"; -import { mapPaginatedList } from "@/lib/shared/api/models/PaginatedList"; +import { mapChild } from "@/api/models/Child"; +import { mapChildDetails } from "@/api/models/ChildDetails"; +import { mapChildSearchResult } from "@/api/models/ChildSearchResult"; +import { mapExamination } from "@/api/models/Examination"; +import { useDentalApi } from "@/shared/DentalProvider"; import { childApiQueryKey } from "./apiQueryKeys"; export function useGetChildrenQuery(request: GetChildrenRequest) { - const childApi = useChildApi(); + const { childApi } = useDentalApi(); return queryOptions({ queryKey: childApiQueryKey(["getChildren", request]), @@ -49,7 +49,7 @@ export function getExaminationQuery(childApi: ChildApi, examinationId: string) { } export function useSearchInstitutionGroups(institutionId: string) { - const childApi = useChildApi(); + const { childApi } = useDentalApi(); return useQuery({ queryKey: childApiQueryKey(["getInstitutionGroups", institutionId]), @@ -79,7 +79,7 @@ export function getChildrenByPersonQuery( } export function useSearchChildren(institutionId: string, searchString: string) { - const childApi = useChildApi(); + const { childApi } = useDentalApi(); const enabled = !isBlankString(institutionId) && searchString.length > 2; return useQuery({ queryKey: childApiQueryKey(["searchChildren", institutionId, searchString]), diff --git a/employee-portal/src/lib/businessModules/dental/api/queries/prophylaxisSessionApi.ts b/packages/dental/src/api/queries/prophylaxisSessionApi.ts similarity index 74% rename from employee-portal/src/lib/businessModules/dental/api/queries/prophylaxisSessionApi.ts rename to packages/dental/src/api/queries/prophylaxisSessionApi.ts index 95c6e07be..7966e620b 100644 --- a/employee-portal/src/lib/businessModules/dental/api/queries/prophylaxisSessionApi.ts +++ b/packages/dental/src/api/queries/prophylaxisSessionApi.ts @@ -8,20 +8,20 @@ import { GetProphylaxisSessionsRequest, ProphylaxisSessionApi, } from "@eshg/dental-api"; +import { mapPaginatedList } from "@eshg/lib-employee-portal/api/models/PaginatedList"; import { unwrapRawResponse } from "@eshg/lib-portal/api/unwrapRawResponse"; import { queryOptions, useSuspenseQuery } from "@tanstack/react-query"; -import { useProphylaxisSessionApi } from "@/lib/businessModules/dental/api/clients"; -import { mapProphylaxisSession } from "@/lib/businessModules/dental/api/models/ProphylaxisSession"; -import { mapProphylaxisSessionDetails } from "@/lib/businessModules/dental/api/models/ProphylaxisSessionDetails"; -import { mapPaginatedList } from "@/lib/shared/api/models/PaginatedList"; +import { mapProphylaxisSession } from "@/api/models/ProphylaxisSession"; +import { mapProphylaxisSessionDetails } from "@/api/models/ProphylaxisSessionDetails"; +import { useDentalApi } from "@/shared/DentalProvider"; import { prophylaxisSessionApiQueryKey } from "./apiQueryKeys"; export function useGetProphylaxisSessions( request: GetProphylaxisSessionsRequest, ) { - const prophylaxisSessionApi = useProphylaxisSessionApi(); + const { prophylaxisSessionApi } = useDentalApi(); return useSuspenseQuery({ queryKey: prophylaxisSessionApiQueryKey([ diff --git a/employee-portal/src/lib/businessModules/dental/api/queries/staff.ts b/packages/dental/src/api/queries/staffApi.ts similarity index 80% rename from employee-portal/src/lib/businessModules/dental/api/queries/staff.ts rename to packages/dental/src/api/queries/staffApi.ts index 3bd489db6..413bd5f6e 100644 --- a/employee-portal/src/lib/businessModules/dental/api/queries/staff.ts +++ b/packages/dental/src/api/queries/staffApi.ts @@ -6,8 +6,6 @@ import { ApiGetUsersResponse, ApiUser, UserApi } from "@eshg/base-api"; import { queryOptions } from "@tanstack/react-query"; -import { appointmentStaffApiQueryKey } from "@/lib/businessModules/schoolEntry/api/queries/apiQueryKeys"; - import { staffApiQueryKey } from "./apiQueryKeys"; export function getAllDentistsQuery(userApi: UserApi) { @@ -20,7 +18,7 @@ export function getAllDentistsQuery(userApi: UserApi) { export function getAllDentalAssistantsQuery(userApi: UserApi) { return queryOptions({ - queryKey: appointmentStaffApiQueryKey(["getAllDentalAssistants"]), + queryKey: staffApiQueryKey(["getAllDentalAssistants"]), queryFn: () => userApi.getUsersByGroup("[System] ZFA"), select: mapUsers, }); diff --git a/packages/dental/src/shared/DentalProvider.tsx b/packages/dental/src/shared/DentalProvider.tsx new file mode 100644 index 000000000..020502ebf --- /dev/null +++ b/packages/dental/src/shared/DentalProvider.tsx @@ -0,0 +1,37 @@ +/** + * Copyright 2025 cronn GmbH + * SPDX-License-Identifier: AGPL-3.0-only + */ + +"use client"; + +import { RequiresChildren } from "@eshg/lib-portal/types/react"; +import { createContext, useContext, useState } from "react"; + +import { DentalClients, createClients } from "@/api/createClients"; + +const DentalContext = createContext<DentalClients | null>(null); + +interface DentalProviderProps extends RequiresChildren { + baseUrl: string; +} + +export function DentalProvider(props: DentalProviderProps) { + const [clients] = useState<DentalClients>(() => createClients(props.baseUrl)); + + return ( + <DentalContext.Provider value={clients}> + {props.children} + </DentalContext.Provider> + ); +} + +export function useDentalApi() { + const dentalContext = useContext(DentalContext); + + if (dentalContext === null) { + throw new Error("Missing DentalProvider"); + } + + return dentalContext; +} diff --git a/packages/lib-employee-portal/buildscript-gradle.lockfile b/packages/lib-employee-portal/buildscript-gradle.lockfile new file mode 100644 index 000000000..0d156738b --- /dev/null +++ b/packages/lib-employee-portal/buildscript-gradle.lockfile @@ -0,0 +1,4 @@ +# This is a Gradle generated file for dependency locking. +# Manual edits can break the build and are not advised. +# This file is expected to be part of source control. +empty=classpath diff --git a/packages/lib-employee-portal/eslint.config.js b/packages/lib-employee-portal/eslint.config.js index 4fa057ccd..cdf693271 100644 --- a/packages/lib-employee-portal/eslint.config.js +++ b/packages/lib-employee-portal/eslint.config.js @@ -3,11 +3,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -import tseslint from "typescript-eslint"; - import { eslintNextConfigs } from "../../config/eslint.next.js"; -export default tseslint.config( - ...eslintNextConfigs.lib, - ...eslintNextConfigs.forbidStyleProp, -); +export default eslintNextConfigs.lib; diff --git a/packages/lib-employee-portal/package.json b/packages/lib-employee-portal/package.json index a0c61229b..cb2b05c6f 100644 --- a/packages/lib-employee-portal/package.json +++ b/packages/lib-employee-portal/package.json @@ -40,6 +40,7 @@ "eslint-plugin-unused-imports": "catalog:eslint", "eslint-plugin-promise": "catalog:eslint", "prettier": "catalog:prettier", + "resolve-tspaths": "catalog:common", "tsup": "8.3.5", "typescript": "catalog:common", "typescript-eslint": "catalog:eslint", diff --git a/employee-portal/src/lib/shared/api/models/BaseEntity.ts b/packages/lib-employee-portal/src/api/models/BaseEntity.ts similarity index 78% rename from employee-portal/src/lib/shared/api/models/BaseEntity.ts rename to packages/lib-employee-portal/src/api/models/BaseEntity.ts index 5b408f989..0470884c0 100644 --- a/employee-portal/src/lib/shared/api/models/BaseEntity.ts +++ b/packages/lib-employee-portal/src/api/models/BaseEntity.ts @@ -14,3 +14,7 @@ interface BaseEntityProps { export function mapBaseEntity(response: BaseEntityProps): BaseEntity { return { id: response.id }; } + +export function getId(entity: BaseEntity): string { + return entity.id; +} diff --git a/employee-portal/src/lib/shared/api/models/PaginatedList.ts b/packages/lib-employee-portal/src/api/models/PaginatedList.ts similarity index 100% rename from employee-portal/src/lib/shared/api/models/PaginatedList.ts rename to packages/lib-employee-portal/src/api/models/PaginatedList.ts diff --git a/employee-portal/src/lib/shared/api/models/Versioned.ts b/packages/lib-employee-portal/src/api/models/Versioned.ts similarity index 100% rename from employee-portal/src/lib/shared/api/models/Versioned.ts rename to packages/lib-employee-portal/src/api/models/Versioned.ts diff --git a/employee-portal/src/lib/shared/api/models/import/ImportStatistics.ts b/packages/lib-employee-portal/src/api/models/import/ImportStatistics.ts similarity index 100% rename from employee-portal/src/lib/shared/api/models/import/ImportStatistics.ts rename to packages/lib-employee-portal/src/api/models/import/ImportStatistics.ts diff --git a/employee-portal/src/lib/shared/api/models/utils.ts b/packages/lib-employee-portal/src/api/models/utils.ts similarity index 100% rename from employee-portal/src/lib/shared/api/models/utils.ts rename to packages/lib-employee-portal/src/api/models/utils.ts diff --git a/employee-portal/src/lib/shared/helpers/import.ts b/packages/lib-employee-portal/src/helpers/import.ts similarity index 100% rename from employee-portal/src/lib/shared/helpers/import.ts rename to packages/lib-employee-portal/src/helpers/import.ts diff --git a/packages/measles-protection-api/.gitignore b/packages/measles-protection-api/.gitignore new file mode 100644 index 000000000..0edb02e46 --- /dev/null +++ b/packages/measles-protection-api/.gitignore @@ -0,0 +1,2 @@ +# Generated files +src diff --git a/packages/measles-protection-api/build.gradle b/packages/measles-protection-api/build.gradle new file mode 100644 index 000000000..44e6a899b --- /dev/null +++ b/packages/measles-protection-api/build.gradle @@ -0,0 +1,9 @@ +plugins { + id 'api-package' +} + +def backendDir = rootProject.layout.projectDirectory.dir('backend') + +apiPackage { + inputSpec = backendDir.file('measles-protection/openApi.yaml') +} diff --git a/packages/measles-protection-api/buildscript-gradle.lockfile b/packages/measles-protection-api/buildscript-gradle.lockfile new file mode 100644 index 000000000..0d156738b --- /dev/null +++ b/packages/measles-protection-api/buildscript-gradle.lockfile @@ -0,0 +1,4 @@ +# This is a Gradle generated file for dependency locking. +# Manual edits can break the build and are not advised. +# This file is expected to be part of source control. +empty=classpath diff --git a/packages/measles-protection-api/package.json b/packages/measles-protection-api/package.json new file mode 100644 index 000000000..bab9bfbf8 --- /dev/null +++ b/packages/measles-protection-api/package.json @@ -0,0 +1,10 @@ +{ + "name": "@eshg/measles-protection-api", + "version": "0.0.1", + "type": "module", + "private": true, + "exports": { + "types": "./build/types/src/index.d.ts", + "import": "./build/lib/index.js" + } +} diff --git a/packages/measles-protection-api/tsconfig.json b/packages/measles-protection-api/tsconfig.json new file mode 100644 index 000000000..7fcfda752 --- /dev/null +++ b/packages/measles-protection-api/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "../../config/tsconfig.lib.json" +} diff --git a/packages/measles-protection-api/tsup.config.ts b/packages/measles-protection-api/tsup.config.ts new file mode 100644 index 000000000..5b8cbfe04 --- /dev/null +++ b/packages/measles-protection-api/tsup.config.ts @@ -0,0 +1,8 @@ +/** + * Copyright 2025 cronn GmbH + * SPDX-License-Identifier: AGPL-3.0-only + */ + +import { defineApiConfig } from "../../config/tsup.base"; + +export default defineApiConfig; diff --git a/packages/school-entry-api/.gitignore b/packages/school-entry-api/.gitignore new file mode 100644 index 000000000..0edb02e46 --- /dev/null +++ b/packages/school-entry-api/.gitignore @@ -0,0 +1,2 @@ +# Generated files +src diff --git a/packages/school-entry-api/build.gradle b/packages/school-entry-api/build.gradle new file mode 100644 index 000000000..dd4d45ea2 --- /dev/null +++ b/packages/school-entry-api/build.gradle @@ -0,0 +1,9 @@ +plugins { + id 'api-package' +} + +def backendDir = rootProject.layout.projectDirectory.dir('backend') + +apiPackage { + inputSpec = backendDir.file('school-entry/openApi.yaml') +} diff --git a/packages/school-entry-api/buildscript-gradle.lockfile b/packages/school-entry-api/buildscript-gradle.lockfile new file mode 100644 index 000000000..0d156738b --- /dev/null +++ b/packages/school-entry-api/buildscript-gradle.lockfile @@ -0,0 +1,4 @@ +# This is a Gradle generated file for dependency locking. +# Manual edits can break the build and are not advised. +# This file is expected to be part of source control. +empty=classpath diff --git a/packages/school-entry-api/package.json b/packages/school-entry-api/package.json new file mode 100644 index 000000000..c5d0c04b9 --- /dev/null +++ b/packages/school-entry-api/package.json @@ -0,0 +1,10 @@ +{ + "name": "@eshg/school-entry-api", + "version": "0.0.1", + "type": "module", + "private": true, + "exports": { + "types": "./build/types/src/index.d.ts", + "import": "./build/lib/index.js" + } +} diff --git a/packages/school-entry-api/tsconfig.json b/packages/school-entry-api/tsconfig.json new file mode 100644 index 000000000..7fcfda752 --- /dev/null +++ b/packages/school-entry-api/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "../../config/tsconfig.lib.json" +} diff --git a/packages/school-entry-api/tsup.config.ts b/packages/school-entry-api/tsup.config.ts new file mode 100644 index 000000000..5b8cbfe04 --- /dev/null +++ b/packages/school-entry-api/tsup.config.ts @@ -0,0 +1,8 @@ +/** + * Copyright 2025 cronn GmbH + * SPDX-License-Identifier: AGPL-3.0-only + */ + +import { defineApiConfig } from "../../config/tsup.base"; + +export default defineApiConfig; diff --git a/packages/statistics-api/.gitignore b/packages/statistics-api/.gitignore new file mode 100644 index 000000000..0edb02e46 --- /dev/null +++ b/packages/statistics-api/.gitignore @@ -0,0 +1,2 @@ +# Generated files +src diff --git a/packages/statistics-api/build.gradle b/packages/statistics-api/build.gradle new file mode 100644 index 000000000..aa00df207 --- /dev/null +++ b/packages/statistics-api/build.gradle @@ -0,0 +1,9 @@ +plugins { + id 'api-package' +} + +def backendDir = rootProject.layout.projectDirectory.dir('backend') + +apiPackage { + inputSpec = backendDir.file('statistics/openApi.yaml') +} diff --git a/packages/statistics-api/buildscript-gradle.lockfile b/packages/statistics-api/buildscript-gradle.lockfile new file mode 100644 index 000000000..0d156738b --- /dev/null +++ b/packages/statistics-api/buildscript-gradle.lockfile @@ -0,0 +1,4 @@ +# This is a Gradle generated file for dependency locking. +# Manual edits can break the build and are not advised. +# This file is expected to be part of source control. +empty=classpath diff --git a/packages/statistics-api/package.json b/packages/statistics-api/package.json new file mode 100644 index 000000000..a60b09087 --- /dev/null +++ b/packages/statistics-api/package.json @@ -0,0 +1,10 @@ +{ + "name": "@eshg/statistics-api", + "version": "0.0.1", + "type": "module", + "private": true, + "exports": { + "types": "./build/types/src/index.d.ts", + "import": "./build/lib/index.js" + } +} diff --git a/packages/statistics-api/tsconfig.json b/packages/statistics-api/tsconfig.json new file mode 100644 index 000000000..7fcfda752 --- /dev/null +++ b/packages/statistics-api/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "../../config/tsconfig.lib.json" +} diff --git a/packages/statistics-api/tsup.config.ts b/packages/statistics-api/tsup.config.ts new file mode 100644 index 000000000..5b8cbfe04 --- /dev/null +++ b/packages/statistics-api/tsup.config.ts @@ -0,0 +1,8 @@ +/** + * Copyright 2025 cronn GmbH + * SPDX-License-Identifier: AGPL-3.0-only + */ + +import { defineApiConfig } from "../../config/tsup.base"; + +export default defineApiConfig; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c5c963c32..23a1eb850 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -36,6 +36,9 @@ catalogs: remeda: specifier: 2.19.0 version: 2.19.0 + resolve-tspaths: + specifier: 0.8.23 + version: 0.8.23 server-only: specifier: 0.0.1 version: 0.0.1 @@ -237,7 +240,7 @@ importers: version: 4.1.4(@typescript-eslint/eslint-plugin@8.19.1(@typescript-eslint/parser@8.19.1(eslint@9.18.0)(typescript@5.7.3))(eslint@9.18.0)(typescript@5.7.3))(eslint@9.18.0) next: specifier: catalog:next - version: 14.2.14(@babel/core@7.26.0)(@playwright/test@1.49.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + version: 14.2.14(@playwright/test@1.49.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) prettier: specifier: catalog:prettier version: 3.4.2 @@ -367,7 +370,7 @@ importers: version: 9.1.0(eslint@9.18.0) eslint-plugin-import: specifier: catalog:eslint - version: 2.31.0(@typescript-eslint/parser@8.10.0(eslint@9.18.0)(typescript@5.7.3))(eslint-import-resolver-typescript@3.6.3)(eslint@9.18.0) + version: 2.31.0(@typescript-eslint/parser@8.10.0(eslint@9.18.0)(typescript@5.7.3))(eslint@9.18.0) eslint-plugin-promise: specifier: catalog:eslint version: 7.2.1(eslint@9.18.0) @@ -397,12 +400,21 @@ importers: '@emotion/styled': specifier: catalog:joy version: 11.14.0(@emotion/react@11.14.0(@types/react@18.3.12)(react@18.3.1))(@types/react@18.3.12)(react@18.3.1) + '@eshg/base-api': + specifier: workspace:* + version: link:../packages/base-api '@eshg/citizen-portal-api': specifier: workspace:* version: link:../citizen-portal-api '@eshg/lib-portal': specifier: workspace:* version: link:../lib-portal + '@eshg/measles-protection-api': + specifier: workspace:* + version: link:../packages/measles-protection-api + '@eshg/school-entry-api': + specifier: workspace:* + version: link:../packages/school-entry-api '@fontsource/poppins': specifier: catalog:joy version: 5.1.1 @@ -453,7 +465,7 @@ importers: version: 1.0.0 next: specifier: catalog:next - version: 14.2.14(@babel/core@7.26.0)(@playwright/test@1.49.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + version: 14.2.14(@playwright/test@1.49.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: specifier: catalog:react version: 18.3.1 @@ -568,6 +580,15 @@ importers: '@eshg/employee-portal-api': specifier: workspace:* version: link:../employee-portal-api + '@eshg/measles-protection-api': + specifier: workspace:* + version: link:../packages/measles-protection-api + '@eshg/school-entry-api': + specifier: workspace:* + version: link:../packages/school-entry-api + '@eshg/statistics-api': + specifier: workspace:* + version: link:../packages/statistics-api '@eslint/compat': specifier: catalog:eslint version: 1.2.5(eslint@9.18.0) @@ -638,7 +659,7 @@ importers: dependencies: '@ducanh2912/next-pwa': specifier: 10.2.9 - version: 10.2.9(@types/babel__core@7.20.5)(next@14.2.14(@babel/core@7.26.0)(@playwright/test@1.49.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(webpack@5.92.1) + version: 10.2.9(@types/babel__core@7.20.5)(next@14.2.14(@babel/core@7.25.8)(@playwright/test@1.49.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(webpack@5.92.1) '@emotion/react': specifier: catalog:joy version: 11.14.0(@types/react@18.3.12)(react@18.3.1) @@ -663,6 +684,15 @@ importers: '@eshg/lib-portal': specifier: workspace:* version: link:../lib-portal + '@eshg/measles-protection-api': + specifier: workspace:* + version: link:../packages/measles-protection-api + '@eshg/school-entry-api': + specifier: workspace:* + version: link:../packages/school-entry-api + '@eshg/statistics-api': + specifier: workspace:* + version: link:../packages/statistics-api '@fontsource/poppins': specifier: catalog:joy version: 5.1.1 @@ -737,7 +767,7 @@ importers: version: 34.13.0 next: specifier: catalog:next - version: 14.2.14(@babel/core@7.26.0)(@playwright/test@1.49.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + version: 14.2.14(@babel/core@7.25.8)(@playwright/test@1.49.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: specifier: catalog:react version: 18.3.1 @@ -875,7 +905,7 @@ importers: version: 2.4.6(react@18.3.1) next: specifier: catalog:next - version: 14.2.14(@babel/core@7.26.0)(@playwright/test@1.49.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + version: 14.2.14(@playwright/test@1.49.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: specifier: catalog:react version: 18.3.1 @@ -980,7 +1010,7 @@ importers: version: 2.4.6(react@18.3.1) next: specifier: catalog:next - version: 14.2.14(@babel/core@7.26.0)(@playwright/test@1.49.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + version: 14.2.14(@playwright/test@1.49.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: specifier: catalog:react version: 18.3.1 @@ -1036,6 +1066,9 @@ importers: prettier: specifier: catalog:prettier version: 3.4.2 + resolve-tspaths: + specifier: catalog:common + version: 0.8.23(typescript@5.7.3) tsup: specifier: catalog:common version: 8.3.5(postcss@8.4.38)(tsx@4.19.2)(typescript@5.7.3) @@ -1079,7 +1112,7 @@ importers: version: 2.4.6(react@18.3.1) next: specifier: catalog:next - version: 14.2.14(@babel/core@7.26.0)(@playwright/test@1.49.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + version: 14.2.14(@playwright/test@1.49.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: specifier: catalog:react version: 18.3.1 @@ -1135,6 +1168,9 @@ importers: prettier: specifier: catalog:prettier version: 3.4.2 + resolve-tspaths: + specifier: catalog:common + version: 0.8.23(typescript@5.7.3) tsup: specifier: 8.3.5 version: 8.3.5(postcss@8.4.38)(tsx@4.19.2)(typescript@5.7.3) @@ -1151,6 +1187,12 @@ importers: specifier: catalog:vitest version: 2.1.8(@types/node@22.10.5)(terser@5.36.0) + packages/measles-protection-api: {} + + packages/school-entry-api: {} + + packages/statistics-api: {} + performance-test: dependencies: '@eshg/base-api': @@ -1162,6 +1204,15 @@ importers: '@eshg/employee-portal-api': specifier: workspace:* version: link:../employee-portal-api + '@eshg/measles-protection-api': + specifier: workspace:* + version: link:../packages/measles-protection-api + '@eshg/school-entry-api': + specifier: workspace:* + version: link:../packages/school-entry-api + '@eshg/statistics-api': + specifier: workspace:* + version: link:../packages/statistics-api '@faker-js/faker': specifier: 9.3.0 version: 9.3.0 @@ -3985,6 +4036,10 @@ packages: ansi-align@3.0.1: resolution: {integrity: sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w==} + ansi-colors@4.1.3: + resolution: {integrity: sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==} + engines: {node: '>=6'} + ansi-diff@1.2.0: resolution: {integrity: sha512-BIXwHKpjzghBjcwEV10Y4b17tjHfK4nhEqK3LqyQ3JgcMcjmi3DIevozNgrOpfvBMmrq9dfvrPJSu5/5vNUBQg==} @@ -4437,6 +4492,10 @@ packages: comma-separated-tokens@2.0.3: resolution: {integrity: sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==} + commander@12.1.0: + resolution: {integrity: sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==} + engines: {node: '>=18'} + commander@2.20.3: resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==} @@ -7069,6 +7128,12 @@ packages: resolve-pkg-maps@1.0.0: resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==} + resolve-tspaths@0.8.23: + resolution: {integrity: sha512-VMZPjXnYLHnNHXOmJ9Unkkls08zDc+0LSBUo8Rp+SKzRt8rfD9dMpBudQJ5PNG8Szex/fnwdNKzd7rqipIH/zg==} + hasBin: true + peerDependencies: + typescript: '>=3.0.3' + resolve@1.22.8: resolution: {integrity: sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==} hasBin: true @@ -9928,10 +9993,10 @@ snapshots: '@drauu/core@0.4.2': {} - '@ducanh2912/next-pwa@10.2.9(@types/babel__core@7.20.5)(next@14.2.14(@babel/core@7.26.0)(@playwright/test@1.49.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(webpack@5.92.1)': + '@ducanh2912/next-pwa@10.2.9(@types/babel__core@7.20.5)(next@14.2.14(@babel/core@7.25.8)(@playwright/test@1.49.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(webpack@5.92.1)': dependencies: fast-glob: 3.3.2 - next: 14.2.14(@babel/core@7.26.0)(@playwright/test@1.49.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + next: 14.2.14(@babel/core@7.25.8)(@playwright/test@1.49.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) semver: 7.6.3 webpack: 5.92.1 workbox-build: 7.1.1(@types/babel__core@7.20.5) @@ -12063,6 +12128,8 @@ snapshots: dependencies: string-width: 4.2.3 + ansi-colors@4.1.3: {} + ansi-diff@1.2.0: dependencies: ansi-split: 1.0.1 @@ -12629,6 +12696,8 @@ snapshots: comma-separated-tokens@2.0.3: {} + commander@12.1.0: {} + commander@2.20.3: {} commander@4.1.1: {} @@ -13206,7 +13275,7 @@ snapshots: is-bun-module: 1.1.0 is-glob: 4.0.3 optionalDependencies: - eslint-plugin-import: 2.31.0(@typescript-eslint/parser@8.10.0(eslint@9.18.0)(typescript@5.7.3))(eslint-import-resolver-typescript@3.6.3)(eslint@9.18.0) + eslint-plugin-import: 2.31.0(@typescript-eslint/parser@8.10.0(eslint@9.18.0)(typescript@5.7.3))(eslint@9.18.0) transitivePeerDependencies: - '@typescript-eslint/parser' - eslint-import-resolver-node @@ -13224,6 +13293,16 @@ snapshots: transitivePeerDependencies: - supports-color + eslint-module-utils@2.12.0(@typescript-eslint/parser@8.10.0(eslint@9.18.0)(typescript@5.7.3))(eslint-import-resolver-node@0.3.9)(eslint@9.18.0): + dependencies: + debug: 3.2.7 + optionalDependencies: + '@typescript-eslint/parser': 8.10.0(eslint@9.18.0)(typescript@5.7.3) + eslint: 9.18.0 + eslint-import-resolver-node: 0.3.9 + transitivePeerDependencies: + - supports-color + eslint-module-utils@2.12.0(@typescript-eslint/parser@8.19.1(eslint@9.18.0)(typescript@5.7.3))(eslint-import-resolver-node@0.3.9)(eslint@9.18.0): dependencies: debug: 3.2.7 @@ -13263,6 +13342,35 @@ snapshots: - eslint-import-resolver-webpack - supports-color + eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.10.0(eslint@9.18.0)(typescript@5.7.3))(eslint@9.18.0): + dependencies: + '@rtsao/scc': 1.1.0 + array-includes: 3.1.8 + array.prototype.findlastindex: 1.2.5 + array.prototype.flat: 1.3.2 + array.prototype.flatmap: 1.3.2 + debug: 3.2.7 + doctrine: 2.1.0 + eslint: 9.18.0 + eslint-import-resolver-node: 0.3.9 + eslint-module-utils: 2.12.0(@typescript-eslint/parser@8.10.0(eslint@9.18.0)(typescript@5.7.3))(eslint-import-resolver-node@0.3.9)(eslint@9.18.0) + hasown: 2.0.2 + is-core-module: 2.15.1 + is-glob: 4.0.3 + minimatch: 3.1.2 + object.fromentries: 2.0.8 + object.groupby: 1.0.3 + object.values: 1.2.0 + semver: 6.3.1 + string.prototype.trimend: 1.0.8 + tsconfig-paths: 3.15.0 + optionalDependencies: + '@typescript-eslint/parser': 8.10.0(eslint@9.18.0)(typescript@5.7.3) + transitivePeerDependencies: + - eslint-import-resolver-typescript + - eslint-import-resolver-webpack + - supports-color + eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.19.1(eslint@9.18.0)(typescript@5.7.3))(eslint@9.18.0): dependencies: '@rtsao/scc': 1.1.0 @@ -15045,6 +15153,32 @@ snapshots: netmask@2.0.2: {} + next@14.2.14(@babel/core@7.25.8)(@playwright/test@1.49.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1): + dependencies: + '@next/env': 14.2.14 + '@swc/helpers': 0.5.5 + busboy: 1.6.0 + caniuse-lite: 1.0.30001668 + graceful-fs: 4.2.11 + postcss: 8.4.31 + react: 18.3.1 + react-dom: 18.3.1(react@18.3.1) + styled-jsx: 5.1.1(@babel/core@7.25.8)(react@18.3.1) + optionalDependencies: + '@next/swc-darwin-arm64': 14.2.14 + '@next/swc-darwin-x64': 14.2.14 + '@next/swc-linux-arm64-gnu': 14.2.14 + '@next/swc-linux-arm64-musl': 14.2.14 + '@next/swc-linux-x64-gnu': 14.2.14 + '@next/swc-linux-x64-musl': 14.2.14 + '@next/swc-win32-arm64-msvc': 14.2.14 + '@next/swc-win32-ia32-msvc': 14.2.14 + '@next/swc-win32-x64-msvc': 14.2.14 + '@playwright/test': 1.49.1 + transitivePeerDependencies: + - '@babel/core' + - babel-plugin-macros + next@14.2.14(@babel/core@7.26.0)(@playwright/test@1.49.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: '@next/env': 14.2.14 @@ -15071,6 +15205,32 @@ snapshots: - '@babel/core' - babel-plugin-macros + next@14.2.14(@playwright/test@1.49.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1): + dependencies: + '@next/env': 14.2.14 + '@swc/helpers': 0.5.5 + busboy: 1.6.0 + caniuse-lite: 1.0.30001668 + graceful-fs: 4.2.11 + postcss: 8.4.31 + react: 18.3.1 + react-dom: 18.3.1(react@18.3.1) + styled-jsx: 5.1.1(react@18.3.1) + optionalDependencies: + '@next/swc-darwin-arm64': 14.2.14 + '@next/swc-darwin-x64': 14.2.14 + '@next/swc-linux-arm64-gnu': 14.2.14 + '@next/swc-linux-arm64-musl': 14.2.14 + '@next/swc-linux-x64-gnu': 14.2.14 + '@next/swc-linux-x64-musl': 14.2.14 + '@next/swc-win32-arm64-msvc': 14.2.14 + '@next/swc-win32-ia32-msvc': 14.2.14 + '@next/swc-win32-x64-msvc': 14.2.14 + '@playwright/test': 1.49.1 + transitivePeerDependencies: + - '@babel/core' + - babel-plugin-macros + node-abi@3.65.0: dependencies: semver: 7.6.3 @@ -15886,6 +16046,13 @@ snapshots: resolve-pkg-maps@1.0.0: {} + resolve-tspaths@0.8.23(typescript@5.7.3): + dependencies: + ansi-colors: 4.1.3 + commander: 12.1.0 + fast-glob: 3.3.2 + typescript: 5.7.3 + resolve@1.22.8: dependencies: is-core-module: 2.15.1 @@ -16395,6 +16562,13 @@ snapshots: dependencies: inline-style-parser: 0.2.4 + styled-jsx@5.1.1(@babel/core@7.25.8)(react@18.3.1): + dependencies: + client-only: 0.0.1 + react: 18.3.1 + optionalDependencies: + '@babel/core': 7.25.8 + styled-jsx@5.1.1(@babel/core@7.26.0)(react@18.3.1): dependencies: client-only: 0.0.1 @@ -16402,6 +16576,11 @@ snapshots: optionalDependencies: '@babel/core': 7.26.0 + styled-jsx@5.1.1(react@18.3.1): + dependencies: + client-only: 0.0.1 + react: 18.3.1 + stylis@4.2.0: {} sucrase@3.35.0: diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 9750254c0..097be3666 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -87,3 +87,4 @@ catalogs: "drauu": "0.4.2" "tsup": "8.3.5" "zustand": "5.0.3" + "resolve-tspaths": "0.8.23" -- GitLab