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

fix(parental-leave): Refactor Sync - VMST #14436

Merged
merged 29 commits into from
May 16, 2024
Merged

Conversation

veronikasif
Copy link
Member

@veronikasif veronikasif commented Apr 10, 2024

[TS-336] Refactor Sync - VMST

Screenshots / Gifs

image

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • Formatting passes locally with my changes
  • I have rebased against main before asking for a review

Summary by CodeRabbit

  • New Features

    • Added a new days field to application information.
    • Introduced setVMSTPeriods action for managing VMST periods.
  • Enhancements

    • Simplified labels in review screens for better readability.
    • Improved validation process for periods synced from VMST.
  • Bug Fixes

    • Removed unnecessary checks for the shouldNotCall parameter.
    • Updated event handling to use consistent event references.
  • User Interface

    • Updated labels in the review and period components for clarity.
  • Documentation

    • Added new message keys for period-related notifications.
  • Internal Improvements

    • Refactored logic for managing and synchronizing periods.
    • Updated GraphQL queries to include new fields and remove outdated parameters.

Copy link
Contributor

coderabbitai bot commented Apr 10, 2024

Walkthrough

The changes focus on enhancing period handling and synchronization in the Parental Leave application. Updates include removing the shouldNotCall parameter, adding a days field to models, and introducing methods for setting and restructuring VMST periods. UI components and constants have been updated for smoother data processing and validation.

Changes

Files Change Summary
libs/api/domains/directorate-of-labour/.../directorate-of-labour.resolver.ts
libs/application/template-api-modules/.../parental-leave.service.ts
Removed shouldNotCall check in getApplicationInformation method, added setVMSTPeriods method.
libs/api/domains/directorate-of-labour/.../applicationInformationPeriod.model.ts
libs/application/templates/parental-leave/.../constants.ts
Added days field to ApplicationInformationPeriod class, updated events in constants.
libs/application/templates/parental-leave/.../Periods.tsx
libs/application/templates/parental-leave/.../Review/review-groups/Periods.tsx
Updated DataValue component's label to period.title.
libs/application/templates/parental-leave/.../index.tsx Replaced shouldNotCall with skip: !shouldCall in variables object.
libs/application/templates/parental-leave/.../fields/components/Timeline/Panel.tsx Added necessary imports for UI components.
libs/application/templates/parental-leave/.../fields/components/Timeline/Timeline.tsx Added paid property to TimelinePeriod interface.
libs/application/templates/parental-leave/.../forms/EditsRequireAction.ts Updated event values to use DefaultEvents constants.
libs/application/templates/parental-leave/.../graphql/queries.ts Removed shouldNotCall parameter, added new fields to response.
libs/application/templates/parental-leave/.../lib/ParentalLeaveTemplate.ts Added new functions to parentalLeaveUtils and ApiModuleActions.
libs/application/templates/parental-leave/.../lib/answerValidationSections/validateLatestPeriodValidationSection.ts Added condition to stop checking VMST synced periods.
libs/application/templates/parental-leave/.../lib/messages.ts Added new message keys for various statuses.
libs/application/templates/parental-leave/.../lib/parentalLeaveTemplateUtils.ts Added new function for processing VMST periods.
libs/application/templates/parental-leave/.../lib/parentalLeaveUtils.spec.ts Minor formatting change in test case.
libs/application/templates/parental-leave/.../lib/parentalLeaveUtils.ts Updated logic and added properties to functions.
libs/application/templates/parental-leave/.../types.ts Added new fields to interfaces.
libs/clients/vmst/.../clientConfig.yaml Added new field under the Application component.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@datadog-island-is
Copy link

Datadog Report

All test runs ee2d066 🔗

4 Total Test Services: 0 Failed, 4 Passed

Test Services
Service Name Failed Known Flaky New Flaky Passed Skipped Wall Time Test Service View
application-system-api 0 0 0 111 2 1m 14.9s Link
application-template-api-modules 0 0 0 107 0 1m 8.07s Link
application-templates-parental-leave 0 0 0 155 0 15.82s Link
application-ui-shell 0 0 0 74 0 42.79s Link

Copy link

codecov bot commented Apr 10, 2024

Codecov Report

Attention: Patch coverage is 37.28814% with 37 lines in your changes are missing coverage. Please review.

Project coverage is 36.93%. Comparing base (ea63179) to head (bb9f367).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #14436      +/-   ##
==========================================
+ Coverage   36.92%   36.93%   +0.01%     
==========================================
  Files        6322     6322              
  Lines      128754   128732      -22     
  Branches    36738    36754      +16     
==========================================
+ Hits        47536    47552      +16     
+ Misses      81218    81180      -38     
Flag Coverage Δ
api 3.48% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...lication/templates/parental-leave/src/constants.ts 100.00% <100.00%> (ø)
...mployersAndPeriodsReview/review-groups/Periods.tsx 0.00% <ø> (ø)
...arental-leave/src/fields/PeriodsRepeater/index.tsx 0.00% <ø> (ø)
...-leave/src/fields/Review/review-groups/Periods.tsx 0.00% <ø> (ø)
...-leave/src/fields/components/Timeline/Timeline.tsx 0.00% <ø> (ø)
...tes/parental-leave/src/forms/EditsRequireAction.ts 0.00% <ø> (ø)
...on/templates/parental-leave/src/graphql/queries.ts 0.00% <ø> (ø)
...ation/templates/parental-leave/src/lib/messages.ts 100.00% <ø> (ø)
...nSections/validateLatestPeriodValidationSection.ts 90.16% <50.00%> (-1.37%) ⬇️
...es/parental-leave/src/lib/ParentalLeaveTemplate.ts 60.12% <84.61%> (+0.66%) ⬆️
... and 4 more

... and 6 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ea63179...bb9f367. Read the comment docs.

@datadog-island-is
Copy link

datadog-island-is bot commented Apr 30, 2024

Datadog Report

All test runs 3de9927 🔗

5 Total Test Services: 0 Failed, 5 Passed
🔻 Test Sessions change in coverage: 1 decreased (-0.04%), 1 increased (+0.26%), 9 no change

Test Services
Service Name Failed Known Flaky New Flaky Passed Skipped Total Time Code Coverage Change Test Service View
api 0 0 0 4 0 4.34s 1 no change Link
application-system-api 0 0 0 111 2 3m 36.66s 1 decreased (-0.04%) Link
application-template-api-modules 0 0 0 109 0 2m 37.71s 1 no change Link
application-templates-parental-leave 0 0 0 93 62 50.62s 1 increased (+0.26%) Link
application-ui-shell 0 0 0 74 0 1m 20.67s 1 no change Link

🔻 Code Coverage Decreases vs Default Branch (1)

  • application-system-api - jest 37.69% (-0.04%) - Details

@veronikasif veronikasif marked this pull request as ready for review May 14, 2024 15:36
@veronikasif veronikasif requested a review from a team as a code owner May 14, 2024 15:36
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 7

Review Details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits Files that changed from the base of the PR and between f8d77bf and f7fdaad.
Files selected for processing (19)
  • libs/api/domains/directorate-of-labour/src/lib/directorate-of-labour.resolver.ts (1 hunks)
  • libs/api/domains/directorate-of-labour/src/models/applicationInformationPeriod.model.ts (1 hunks)
  • libs/application/template-api-modules/src/lib/modules/templates/parental-leave/parental-leave.service.ts (1 hunks)
  • libs/application/templates/parental-leave/src/constants.ts (3 hunks)
  • libs/application/templates/parental-leave/src/fields/EditOrAddEmployersAndPeriodsReview/review-groups/Periods.tsx (1 hunks)
  • libs/application/templates/parental-leave/src/fields/PeriodsRepeater/index.tsx (2 hunks)
  • libs/application/templates/parental-leave/src/fields/Review/review-groups/Periods.tsx (1 hunks)
  • libs/application/templates/parental-leave/src/fields/components/Timeline/Panel.tsx (3 hunks)
  • libs/application/templates/parental-leave/src/fields/components/Timeline/Timeline.tsx (1 hunks)
  • libs/application/templates/parental-leave/src/forms/EditsRequireAction.ts (2 hunks)
  • libs/application/templates/parental-leave/src/graphql/queries.ts (2 hunks)
  • libs/application/templates/parental-leave/src/lib/ParentalLeaveTemplate.ts (15 hunks)
  • libs/application/templates/parental-leave/src/lib/answerValidationSections/validateLatestPeriodValidationSection.ts (1 hunks)
  • libs/application/templates/parental-leave/src/lib/messages.ts (2 hunks)
  • libs/application/templates/parental-leave/src/lib/parentalLeaveTemplateUtils.ts (2 hunks)
  • libs/application/templates/parental-leave/src/lib/parentalLeaveUtils.spec.ts (1 hunks)
  • libs/application/templates/parental-leave/src/lib/parentalLeaveUtils.ts (6 hunks)
  • libs/application/templates/parental-leave/src/types.ts (2 hunks)
  • libs/clients/vmst/src/clientConfig.yaml (1 hunks)
Files skipped from review due to trivial changes (3)
  • libs/application/templates/parental-leave/src/fields/EditOrAddEmployersAndPeriodsReview/review-groups/Periods.tsx
  • libs/application/templates/parental-leave/src/fields/Review/review-groups/Periods.tsx
  • libs/application/templates/parental-leave/src/lib/parentalLeaveUtils.spec.ts
Additional Context Used
Path-based Instructions (16)
libs/api/domains/directorate-of-labour/src/models/applicationInformationPeriod.model.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/parental-leave/src/graphql/queries.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/parental-leave/src/fields/components/Timeline/Timeline.tsx (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/parental-leave/src/forms/EditsRequireAction.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/parental-leave/src/types.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/parental-leave/src/fields/components/Timeline/Panel.tsx (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/parental-leave/src/lib/answerValidationSections/validateLatestPeriodValidationSection.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/parental-leave/src/lib/parentalLeaveTemplateUtils.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/api/domains/directorate-of-labour/src/lib/directorate-of-labour.resolver.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/parental-leave/src/constants.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/parental-leave/src/fields/PeriodsRepeater/index.tsx (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/clients/vmst/src/clientConfig.yaml (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/template-api-modules/src/lib/modules/templates/parental-leave/parental-leave.service.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/parental-leave/src/lib/parentalLeaveUtils.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/parental-leave/src/lib/ParentalLeaveTemplate.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/parental-leave/src/lib/messages.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
Additional comments not posted (39)
libs/application/templates/parental-leave/src/graphql/queries.ts (1)

46-47: Ensure the new fields days and approved are handled correctly in the resolver.

Verify that the resolver for the GetApplicationInformation query correctly handles the new days and approved fields.

libs/application/templates/parental-leave/src/forms/EditsRequireAction.ts (1)

7-7: Good use of DefaultEvents for consistency.

Using DefaultEvents improves consistency and maintainability.

libs/application/templates/parental-leave/src/fields/components/Timeline/Panel.tsx (2)

4-4: Good addition of the Tooltip component for better user experience.

The addition of the Tooltip component enhances the user experience by providing additional context.


54-110: Ensure the new period state handling logic is thoroughly tested.

Verify that the new logic for handling different period states (deletable, paid, in progress) is thoroughly tested to ensure correct behavior.

libs/application/templates/parental-leave/src/lib/answerValidationSections/validateLatestPeriodValidationSection.ts (1)

160-164: Ensure the new condition for VMST-synced periods is thoroughly tested.

Verify that the new condition to stop checking periods synced from VMST is thoroughly tested to ensure correct behavior.

libs/application/templates/parental-leave/src/lib/parentalLeaveTemplateUtils.ts (1)

97-142: Ensure the new restructureVMSTPeriods function is thoroughly tested.

Verify that the new restructureVMSTPeriods function is thoroughly tested to ensure it correctly restructures VMST periods.

libs/api/domains/directorate-of-labour/src/lib/directorate-of-labour.resolver.ts (11)

Line range hint 14-21: The getApplicationInformation method looks good and follows the expected logic.


Line range hint 23-30: The getParentalLeavesEntitlements method looks good and follows the expected logic.


Line range hint 32-37: The getParentalLeaves method looks good and follows the expected logic.


Line range hint 39-46: The getParentalLeavesEstimatedPaymentPlan method looks good and follows the expected logic.


Line range hint 48-55: The getParentalLeavesApplicationPaymentPlan method looks good and follows the expected logic.


Line range hint 57-63: The getParentalLeavesPeriodEndDate method looks good and follows the expected logic.


Line range hint 65-71: The getParentalLeavesPeriodLength method looks good and follows the expected logic.


Line range hint 73-77: The getUnions method looks good and follows the expected logic.


Line range hint 79-83: The getPensionFunds method looks good and follows the expected logic.


Line range hint 85-89: The getPrivatePensionFunds method looks good and follows the expected logic.


Line range hint 91-95: The getPregnancyStatus method looks good and follows the expected logic.

libs/application/templates/parental-leave/src/constants.ts (3)

Line range hint 33-36: The removal of the MODIFY event from PLEvents looks good and aligns with the refactoring objectives.


Line range hint 38-45: The removal of the MODIFY event type from Events looks good and aligns with the refactoring objectives.


69-69: The addition of the setVMSTPeriods action to ApiModuleActions looks good and aligns with the new functionality.

libs/application/templates/parental-leave/src/fields/PeriodsRepeater/index.tsx (2)

74-74: The change to use skip: !shouldCall in the useQuery call simplifies the logic and looks good.


88-88: The addition of the ESLint comment to the useEffect dependency array is appropriate and looks good.

libs/clients/vmst/src/clientConfig.yaml (1)

436-437: The addition of the days field to the ApplicationPeriod schema looks good and aligns with the new functionality.

libs/application/templates/parental-leave/src/lib/parentalLeaveUtils.ts (4)

160-177: Ensure paid and approved fields are correctly handled.

Verify that the paid and approved fields are correctly used in the rest of the codebase where formatPeriods is called.


573-577: Ensure VMSTPeriods is correctly integrated and used.

Verify that the VMSTPeriods field is correctly used in the rest of the codebase where getApplicationExternalData is called.

Also applies to: 588-588


1571-1573: Ensure daysToUse, paid, and approved fields are correctly handled.

Verify that the daysToUse, paid, and approved fields are correctly used in the rest of the codebase where synchronizeVMSTPeriods is called.

Verification successful

Ensure daysToUse, paid, and approved fields are correctly handled.

The synchronizeVMSTPeriods function includes the daysToUse, paid, and approved fields in the period object. These fields are used within the function to determine the synchronization logic for periods.

  • daysToUse: This field is directly assigned from period.days.
  • paid: This field is directly assigned from period.paid and is used in conditional checks to determine if the period should be added to newPeriods.
  • approved: This field is directly assigned from period.approved and is used in conditional checks to determine if synchronization is necessary.

The fields are correctly handled within the synchronizeVMSTPeriods function.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify usage of `daysToUse`, `paid`, and `approved` fields in the codebase.

# Test: Search for the usage of `synchronizeVMSTPeriods` function. Expect: Correct handling of `daysToUse`, `paid`, and `approved` fields.
rg --type typescript 'synchronizeVMSTPeriods'

Length of output: 80



Script:

#!/bin/bash
# Description: Verify usage of `daysToUse`, `paid`, and `approved` fields in the codebase.

# Test: Search for the usage of `synchronizeVMSTPeriods` function. Expect: Correct handling of `daysToUse`, `paid`, and `approved` fields.
rg --type ts 'synchronizeVMSTPeriods'

Length of output: 361



Script:

#!/bin/bash
# Description: Extract relevant lines from `PeriodsRepeater/index.tsx` to verify handling of `daysToUse`, `paid`, and `approved` fields.

# Test: Extract lines around the usage of `synchronizeVMSTPeriods` function.
rg --type ts -A 10 -B 10 'synchronizeVMSTPeriods' libs/application/templates/parental-leave/src/fields/PeriodsRepeater/index.tsx

Length of output: 1319



Script:

#!/bin/bash
# Description: Extract the implementation of `synchronizeVMSTPeriods` to verify handling of `daysToUse`, `paid`, and `approved` fields.

# Test: Extract the implementation of `synchronizeVMSTPeriods` function.
ast-grep --lang ts --pattern $'export const synchronizeVMSTPeriods = ($_$) => {
  $$$
}' libs/application/templates/parental-leave/src/lib/parentalLeaveUtils.ts

Length of output: 161



Script:

#!/bin/bash
# Description: Extract the implementation of `synchronizeVMSTPeriods` to verify handling of `daysToUse`, `paid`, and `approved` fields.

# Test: Extract the implementation of `synchronizeVMSTPeriods` function.
ast-grep --lang ts --pattern 'export const synchronizeVMSTPeriods = ($$$) => { $$$ }' libs/application/templates/parental-leave/src/lib/parentalLeaveUtils.ts

Length of output: 15040


1646-1648: Ensure synchronization logic correctly handles new fields.

Verify that the synchronization logic correctly handles the new paid and approved fields.

Verification successful

Synchronization logic correctly handles paid and approved fields

The synchronizeVMSTPeriods function in libs/application/templates/parental-leave/src/lib/parentalLeaveUtils.ts includes logic to handle the paid and approved fields. The function creates objects that include these fields and uses them in conditional checks to determine how periods are synchronized.

  • The paid field is included in the object created for each period.
  • The approved field is also included in the object created for each period.
  • The function contains logic that uses the paid field to decide whether to push the period object into the newPeriods array.

Thus, the synchronization logic appears to correctly handle the new paid and approved fields.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify synchronization logic for `paid` and `approved` fields.

# Test: Search for the synchronization logic in `synchronizeVMSTPeriods` function. Expect: Correct handling of `paid` and `approved` fields.
rg --type typescript 'synchronizeVMSTPeriods'

Length of output: 80



Script:

#!/bin/bash
# Description: Verify synchronization logic for `paid` and `approved` fields.

# Test: Search for the synchronization logic in `synchronizeVMSTPeriods` function. Expect: Correct handling of `paid` and `approved` fields.
rg 'synchronizeVMSTPeriods' --glob '*.ts'

# If the function is found, display its implementation.
if rg -q 'synchronizeVMSTPeriods' --glob '*.ts'; then
  rg 'synchronizeVMSTPeriods' --glob '*.ts' -A 20
fi

Length of output: 2545



Script:

#!/bin/bash
# Description: Verify synchronization logic for `paid` and `approved` fields.

# Test: Search for the synchronization logic in `synchronizeVMSTPeriods` function. Expect: Correct handling of `paid` and `approved` fields.
rg 'synchronizeVMSTPeriods' --glob '*.ts'

# If the function is found, display its implementation.
if rg -q 'synchronizeVMSTPeriods' --glob '*.ts'; then
  rg 'synchronizeVMSTPeriods' --glob '*.ts' -A 50
fi

Length of output: 5710

libs/application/templates/parental-leave/src/lib/ParentalLeaveTemplate.ts (9)

569-575: The addition of the setVMSTPeriods action in the onExit array of the VINNUMALASTOFNUN_APPROVAL state looks good.


873-879: The addition of the setVMSTPeriods action in the onExit array of the APPROVED state looks good.


1055-1060: The addition of the setVMSTPeriods action in the onExit array of the EMPLOYER_WAITING_TO_ASSIGN_FOR_EDITS state looks good.


1112-1117: The addition of the setVMSTPeriods action in the onExit array of the EMPLOYER_APPROVE_EDITS state looks good.


1212-1217: The addition of the setVMSTPeriods action in the onExit array of the EMPLOYER_EDITS_ACTION state looks good.


1306-1317: The addition of the setVMSTPeriods action in the onExit array of the VINNUMALASTOFNUN_APPROVE_EDITS state looks good.


1386-1391: The addition of the setVMSTPeriods action in the onExit array of the VINNUMALASTOFNUN_EDITS_ACTION state looks good.


944-944: The addition of the setVMSTPeriods action in the entry array of the EDIT_OR_ADD_EMPLOYERS_AND_PERIODS state looks good.


2098-2114: The setVMSTPeriods action function is correctly implemented to copy VMST periods to the application's periods. Ensure that the restructureVMSTPeriods utility function is thoroughly tested.

libs/application/templates/parental-leave/src/lib/messages.ts (3)

915-919: New message definition for deleting a period looks good.


920-929: New message definitions for paid periods and periods in progress look good.


1931-1935: New message definition for VMST periods looks good.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review Details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits Files that changed from the base of the PR and between f7fdaad and 5205fcd.
Files selected for processing (1)
  • libs/application/template-api-modules/src/lib/modules/templates/parental-leave/parental-leave.service.ts (2 hunks)
Files skipped from review as they are similar to previous changes (1)
  • libs/application/template-api-modules/src/lib/modules/templates/parental-leave/parental-leave.service.ts

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review Details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits Files that changed from the base of the PR and between 5205fcd and cd405f6.
Files selected for processing (2)
  • libs/application/templates/parental-leave/src/constants.ts (3 hunks)
  • libs/application/templates/parental-leave/src/lib/ParentalLeaveTemplate.ts (12 hunks)
Files skipped from review as they are similar to previous changes (2)
  • libs/application/templates/parental-leave/src/constants.ts
  • libs/application/templates/parental-leave/src/lib/ParentalLeaveTemplate.ts

Copy link
Member

@karenbjorg karenbjorg left a comment

Choose a reason for hiding this comment

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

great job!

@veronikasif veronikasif added the deprecated:automerge (Disabled) Merge this PR as soon as all checks pass label May 16, 2024
@kodiakhq kodiakhq bot merged commit 9cb6e91 into main May 16, 2024
40 checks passed
@kodiakhq kodiakhq bot deleted the feat/parental-leave-sync-vmst branch May 16, 2024 16:15
jonnigs pushed a commit that referenced this pull request May 17, 2024
* Small change after merge main

* Changed MODIFY event to EDIT and added tiggerEvent to validateApplication in EDIT_OR_ADD_EMPLOYERS_AND_PERIODS

* Removed shouldNotCall from getApplicationInformation query, use skip instead

* [UUFV-415] Refactor Sync - VMST

* Removed unused comments and made some changes

* Fix SummaryTimeline label

* Fixed merge conflict - 2

* Updated sync - use days from VMST and removed comments

* Changes requested by coderabbitai

* Updated setVMSTPeriods action so it only updates periods in specific states

---------

Co-authored-by: karenbjorg <[email protected]>
jonnigs pushed a commit that referenced this pull request May 17, 2024
* Small change after merge main

* Changed MODIFY event to EDIT and added tiggerEvent to validateApplication in EDIT_OR_ADD_EMPLOYERS_AND_PERIODS

* Removed shouldNotCall from getApplicationInformation query, use skip instead

* [UUFV-415] Refactor Sync - VMST

* Removed unused comments and made some changes

* Fix SummaryTimeline label

* Fixed merge conflict - 2

* Updated sync - use days from VMST and removed comments

* Changes requested by coderabbitai

* Updated setVMSTPeriods action so it only updates periods in specific states

---------

Co-authored-by: karenbjorg <[email protected]>
Ballioli pushed a commit that referenced this pull request May 17, 2024
* Small change after merge main

* Changed MODIFY event to EDIT and added tiggerEvent to validateApplication in EDIT_OR_ADD_EMPLOYERS_AND_PERIODS

* Removed shouldNotCall from getApplicationInformation query, use skip instead

* [UUFV-415] Refactor Sync - VMST

* Removed unused comments and made some changes

* Fix SummaryTimeline label

* Fixed merge conflict - 2

* Updated sync - use days from VMST and removed comments

* Changes requested by coderabbitai

* Updated setVMSTPeriods action so it only updates periods in specific states

---------

Co-authored-by: karenbjorg <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deprecated:automerge (Disabled) Merge this PR as soon as all checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants