Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: support options and tables #131

Merged
merged 1 commit into from
Aug 27, 2024
Merged

Conversation

brunopacheco1
Copy link
Collaborator

@brunopacheco1 brunopacheco1 commented Aug 23, 2024

Summary by Sourcery

Enhance the form field processing capabilities by adding support for table values and additional attributes such as privacy, options, and columns. Refactor the RemsApplicationMapper to improve code structure and update the OpenAPI specifications to reflect these changes. Adjust tests to ensure coverage of new features and enhancements.

New Features:

  • Add support for handling table values in form fields, allowing for more complex data structures to be processed and stored.

Enhancements:

  • Refactor the RemsApplicationMapper to use a builder pattern for creating RetrievedApplicationFormField and RetrievedApplicationEvent objects, improving code readability and maintainability.
  • Introduce new methods in RemsApplicationMapper to handle privacy, options, and columns for form fields, enhancing the flexibility of form data processing.

Documentation:

  • Update OpenAPI specifications to include new field attributes such as infoText, maxLength, privacy, options, and tableColumns, providing a more comprehensive API documentation.

Tests:

  • Modify existing tests in RemsApplicationMapperTest to accommodate changes in the RemsApplicationMapper class, ensuring that new features and enhancements are properly tested.

Copy link

sourcery-ai bot commented Aug 23, 2024

Reviewer's Guide by Sourcery

This pull request enhances the RemsApplicationMapper class to support additional features such as options and tables. It also updates the OpenAPI specifications for both REMS and DAAM, and modifies the SaveDraftCommandMapper to handle table values. The changes primarily focus on improving the mapping of form fields and their associated data structures.

File-Level Changes

Change Details Files
Enhanced RemsApplicationMapper to support additional form field features
  • Added support for table values in form fields
  • Implemented mapping for field options
  • Added handling for field columns
  • Included new properties such as infoText, maxLength, and privacy
  • Refactored the toFormField method to handle different field types
  • Updated the constructor to use dependency injection for ObjectMapper
src/main/java/io/github/genomicdatainfrastructure/daam/gateways/RemsApplicationMapper.java
Updated OpenAPI specifications for REMS and DAAM
  • Added new schemas for form field options and table columns
  • Updated existing schemas to include new properties
  • Modified the Field schema to support different value types
  • Added tableValues property to RetrievedApplicationFormField
src/main/openapi/rems.yaml
src/main/openapi/daam.yaml
Modified SaveDraftCommandMapper to handle table values
  • Implemented parsing of table values in form fields
  • Updated the parseFieldValue method to handle different value types
src/main/java/io/github/genomicdatainfrastructure/daam/gateways/SaveDraftCommandMapper.java
Updated RemsApplicationMapperTest to reflect changes in RemsApplicationMapper
  • Modified test setup to include ObjectMapper
  • Updated assertions to match new RetrievedApplicationForm and RetrievedApplicationFormField structures
src/test/java/io/github/genomicdatainfrastructure/daam/gateways/RemsApplicationMapperTest.java

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • Continue your discussion with Sourcery by replying directly to review comments.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @brunopacheco1 - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 2 issues found
  • 🟢 Security: all looks good
  • 🟡 Testing: 3 issues found
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

@brunopacheco1 brunopacheco1 force-pushed the add_support_to_options_and_table branch 3 times, most recently from dbf55ad to 0a6e272 Compare August 23, 2024 21:46
@brunopacheco1 brunopacheco1 force-pushed the add_support_to_options_and_table branch from 0a6e272 to d682004 Compare August 23, 2024 22:03
@nolliia nolliia merged commit a3206c0 into main Aug 27, 2024
3 checks passed
@nolliia nolliia deleted the add_support_to_options_and_table branch August 27, 2024 07:49
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.

3 participants