Skip to content

Addcommentair - #196

Open
Nomena4 wants to merge 55 commits into
hei-teacher:preprodfrom
Bradon614:addcommentair
Open

Addcommentair#196
Nomena4 wants to merge 55 commits into
hei-teacher:preprodfrom
Bradon614:addcommentair

Conversation

@Nomena4

@Nomena4 Nomena4 commented Jul 22, 2026

Copy link
Copy Markdown

No description provided.

haja171106 and others added 30 commits June 17, 2026 13:45
* 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>
#9)

* refactor: rename createDailyExecution overload to createDailyExecutionWithRedirectAttributes

* chore: format code
nyamyjese and others added 25 commits July 7, 2026 14:52
* 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.
)

Avoid try-catch in CalendarController by resolving remaining days in ContractService.
* 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
@Tom-1747
Tom-1747 deleted the addcommentair branch July 25, 2026 10:02
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.

8 participants