Addcommentair - #196
Open
Nomena4 wants to merge 55 commits into
Open
Conversation
* chore: update README * chore: update README * chore: update README * chore: update README * feat(front): add toastify notifications * feat: implement daily execution tracking with contract duration validation and worker insertion script * feat: add debug logging to contract remaining days calculation and update contract selection logic --------- Co-authored-by: SalomiaZK <salomia.razakarivony@gmail.com> Co-authored-by: Tsantanny <163389718+Tsantanny@users.noreply.github.com>
…ning contract days (#2) * feat: add configurable late-entry threshold with visual alert and accountant email notification when a time entry is submitted within the configured number of days before the deadline * feat: implement app settings with database migrations and low contract days notification service * feat: add daily-execution.html template with dynamic mission input form * feat: implement email notification service for workers with low remaining contract days --------- Co-authored-by: Yoan <yoandiny14@gmail.com>
* feat: add permanent alert * feat: modify alert design * chore: format the code
* feat: move low-contract-days threshold from DB/UI to env var * feat: read low-contract-days threshold from env var instead of DB * feat: remove settings nav link * test: add low-contract-days threshold to test env conf * docs: add ASA_LOW_CONTRACT_DAYS_THRESHOLD env var
* chore: update README * chore: update README * chore: update README * chore: update README * feat(front): add toastify notifications * feat: implement daily execution tracking with contract duration validation and worker insertion script * feat: add debug logging to contract remaining days calculation and update contract selection logic --------- Co-authored-by: SalomiaZK <salomia.razakarivony@gmail.com> Co-authored-by: Tsantanny <163389718+Tsantanny@users.noreply.github.com>
…ning contract days (#2) * feat: add configurable late-entry threshold with visual alert and accountant email notification when a time entry is submitted within the configured number of days before the deadline * feat: implement app settings with database migrations and low contract days notification service * feat: add daily-execution.html template with dynamic mission input form * feat: implement email notification service for workers with low remaining contract days --------- Co-authored-by: Yoan <yoandiny14@gmail.com>
* feat: add permanent alert * feat: modify alert design * chore: format the code
* refactor: remove YoTechMailer and AppSettingsService, restore origin mail dependencies * clean: replace System.out.println with log.debug in ContractService * refactor: revert to original BucketComponent, removing BucketPort and S3BucketComponent * fix: resolve date locale parsing issues and SQL test migration constraints, clean unused variables * test: add unit tests for LowRemainingDaysAlertService to meet Jacoco 80% coverage threshold * style: apply google-java-format formatting to modified files
…cutionController.java Co-authored-by: SalomiaZK <salomia.razakarivony@gmail.com>
…hContractMapper.java Co-authored-by: SalomiaZK <salomia.razakarivony@gmail.com>
* fix: address code review feedback * format --------- Co-authored-by: yoandiny <63061998+yoandiny@users.noreply.github.com> Co-authored-by: Yoan <yoandiny14@gmail.com>
* fix: address code review feedback * format * Removed SMTP variable from ReadMe --------- Co-authored-by: nyamyjese <hei.jese.2@gmail.com>
…threshold variable
#9) * refactor: rename createDailyExecution overload to createDailyExecutionWithRedirectAttributes * chore: format code
…ilable method name (#11)
* refactor: merge duplicate low remaining days alert services * refactor: return boolean from checkAndAlert instead of exposing threshold getter * fix(controller): remove redundant remaining days validation in DailyExecutionController --------- Co-authored-by: haja171106 <hei.haja.2@gmail.com>
#14) * feat: implement ContractService to calculate remaining worker contract days and track execution status * deleted empty line * format * feat: implement ContractService to manage work contracts and remaining days calculation
…ice.java Co-authored-by: SalomiaZK <salomia.razakarivony@gmail.com>
#17) * refactor: move low-days-alert logic from controller to ContractService * chore: format code
* refactor: merge duplicate low remaining days alert services * refactor: return boolean from checkAndAlert instead of exposing threshold getter * fix(controller): remove redundant remaining days validation in DailyExecutionController * refactor: address review comments on alert logging and formatting * chore: format * fix: resolve a bug in LowRemainingDaysAlertService --------- Co-authored-by: haja171106 <hei.haja.2@gmail.com> Co-authored-by: yoandiny <63061998+yoandiny@users.noreply.github.com>
* fix: address code review feedback on daily execution flow * refactor: merge contract days check and alert into a single method * refactor: merge contract days check and alert into a single method
* refactor(contract): throw when no active contract and share remaining-days logic Reuse getActiveContractOrThrow instead of returning null, and extract computeRemainingDays so alert checks no longer re-fetch the same contract. Co-authored-by: Cursor <cursoragent@cursor.com> * fix(calendar): keep rendering when worker has no active contract Catch the new IllegalStateException from ContractService so the calendar page can still show the existing null-remainingDays banner. Co-authored-by: Cursor <cursoragent@cursor.com> * refactor(alert): move remaining-days check and alert into LowRemainingDaysAlertService Merge the contract availability check with alert message building in the alert service, and update controllers to call it directly. Co-authored-by: Cursor <cursoragent@cursor.com> * test(alert): cover remaining-days check and alert message cases Verify throws for missing/exhausted contracts and message/empty results around the low-days threshold. Co-authored-by: Cursor <cursoragent@cursor.com> * code format --------- Co-authored-by: Cursor <cursoragent@cursor.com>
) * feat(alert): send low remaining days email asynchronously via event Publish LowRemainingDaysAlertRequested instead of calling Mailer in the request path, matching the invoice mailing pattern. Co-authored-by: Cursor <cursoragent@cursor.com> * format code --------- Co-authored-by: Cursor <cursoragent@cursor.com>
Rename overloads to getRemainingDaysOnActiveContract and getRemainingDaysForContract.
* test: load daily-execution IT worker contract from SQL fixture Replace programmatic JContract setup with a Flyway test migration. * fix(test): isolate daily-execution SQL contract from year queries Set end_instant on the fixture and use a distinct date for the concurrent IT to avoid shared-DB collisions.
Active contract already implies available days, so the guard is redundant.
Inline checkAndAlert into checkRemainingDaysAndBuildAlertMessage; email stays async via event.
* fix: change remainingDays type from long to double * refactor: use double for remainingDays in LowRemainingDaysAlertService * feat: add DaysFormatter utility for remaining days display * refactor: use DaysFormatter in LowRemainingDaysAlertService * refactor: format remaining days in LowRemainingDaysAlertRequestedService * refactor: use DaysFormatter in calendar template
#34) * refactor: move date/calendar logic from ContractService to CalendarService * fix: remove unnecessary and truncating long cast in isBelowThreshold call
#35) * refactor: move isBelowThreshold from LowRemainingDaysAlertService to ContractService * fix(test): make WorkerServiceIT resilient to test data pollution from CalendarServiceIT
…in CalendarControlle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.