Skip to content

re-introduce exposure type field#13936

Merged
obinna-h-n merged 1 commit into
developmentfrom
13887-exposure-form-redesign
May 18, 2026
Merged

re-introduce exposure type field#13936
obinna-h-n merged 1 commit into
developmentfrom
13887-exposure-form-redesign

Conversation

@obinna-h-n
Copy link
Copy Markdown
Contributor

@obinna-h-n obinna-h-n commented May 18, 2026

…sure type field

Summary by CodeRabbit

  • New Features

    • Exposure form now includes a dedicated "General Information" section for better organization
    • Exposure type options are dynamically filtered based on disease configuration
  • Bug Fixes

    • Exposure descriptions are now required
    • Improved database constraints for data consistency

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 18, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 509f9331-248d-4e82-a7be-1bcc18464502

📥 Commits

Reviewing files that changed from the base of the PR and between 4d01e4f and 1c38c57.

📒 Files selected for processing (8)
  • sormas-api/src/main/java/de/symeda/sormas/api/exposure/ExposureDto.java
  • sormas-api/src/main/java/de/symeda/sormas/api/exposure/ExposureType.java
  • sormas-api/src/main/java/de/symeda/sormas/api/i18n/Captions.java
  • sormas-api/src/main/resources/captions.properties
  • sormas-backend/src/main/java/de/symeda/sormas/backend/exposure/Exposure.java
  • sormas-backend/src/main/resources/sql/sormas_schema.sql
  • sormas-ui/src/main/java/de/symeda/sormas/ui/exposure/ExposureForm.java
  • sormas-ui/src/main/java/de/symeda/sormas/ui/exposure/ExposuresField.java

📝 Walkthrough

Walkthrough

This PR refactors the exposure data model and UI to introduce category-based filtering of exposure types, enforce data validation, and reorganize the form layout. The changes separate general exposure details into a dedicated section, update persistence constraints, and modify the exposure list table to display location and period information instead of setting/address details.

Changes

Exposure Form & Display Redesign

Layer / File(s) Summary
Data Contract & Enum Enhancement
sormas-api/src/main/java/de/symeda/sormas/api/exposure/ExposureDto.java, sormas-api/src/main/java/de/symeda/sormas/api/exposure/ExposureType.java, sormas-api/src/main/java/de/symeda/sormas/api/i18n/Captions.java, sormas-api/src/main/resources/captions.properties
ExposureDto.description now requires @NotNull validation; ExposureType enum refactored with defaultType flag and optional ExposureCategory sets per constant, adding public methods isDefaultType(), getCategories(), and static getValues(Collection<ExposureCategory>) to filter active types by category membership; i18n caption key titleExposuresGeneralSection added for new section title.
Persistence & Schema Migration
sormas-backend/src/main/java/de/symeda/sormas/backend/exposure/Exposure.java, sormas-backend/src/main/resources/sql/sormas_schema.sql
Exposure.exposureType column now enforced with non-null constraint via @Column(nullable = false); schema versions 629–630 document external survey integration change and subsequent fix for corrupt JSON in EXTERNAL_MESSAGES feature configuration.
ExposureForm UI Restructuring & Type Population
sormas-ui/src/main/java/de/symeda/sormas/ui/exposure/ExposureForm.java
General details layout (GENERAL_DETAILS_LAYOUT) separates start/end dates, exposure type, and description from exposure-specific settings; populateExposureTypes() filters ExposureType options by disease configuration categories while preserving legacy record values; setUpRequirements() makes EXPOSURE_TYPE mandatory and EXPOSURE_TYPE_DETAILS conditionally required when type is OTHER; accordion wiring updated so general and exposure details sections display independently; category and setting field requirements refactored to show/require setting field only when category has applicable settings.
ExposuresField Table Display Update
sormas-ui/src/main/java/de/symeda/sormas/ui/exposure/ExposuresField.java
Table columns now display exposure type, location country (from LocationDto.country), and period date (computed from startDate/endDate) instead of exposure setting and formatted address; visible columns adjust based on parent class (CaseDataDto vs. other); generated column headers use country-specific i18n caption for location-country column.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • SORMAS-Foundation/SORMAS-Project#13888: Concurrent exposure-form redesign PR that expands ExposureDto with new fields and collections while this PR adds validation constraints to existing fields.
  • SORMAS-Foundation/SORMAS-Project#13565: Introduces new ExposureType.CHILDCARE_FACILITY and related UI rendering changes that overlap with this PR's refactoring of ExposureType filtering and exposure-type display logic.
  • SORMAS-Foundation/SORMAS-Project#13911: Modifies ExposureForm.java to remove old exposure activity details while this PR introduces the new general-details layout and exposure-type-dependent requirement logic.

Suggested reviewers

  • raulbob
  • KarnaiahPesula

Poem

🐰 A form redesigned, with types now refined,
Categories filter what users will find,
General details in sections so neat,
Location and dates make the table complete!
hops merrily

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 13887-exposure-form-redesign

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@obinna-h-n obinna-h-n merged commit 88b9a71 into development May 18, 2026
1 of 3 checks passed
@obinna-h-n obinna-h-n deleted the 13887-exposure-form-redesign branch May 18, 2026 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant