Skip to content

refactor(reporting): read Schedule 9 through Schedule9Service, not the repo (Epic 29: 29.10) - #309

Merged
gpascucci merged 1 commit into
mainfrom
feat/tech-hardening-29-10-reporting-schedule9-service
Aug 19, 2026
Merged

refactor(reporting): read Schedule 9 through Schedule9Service, not the repo (Epic 29: 29.10)#309
gpascucci merged 1 commit into
mainfrom
feat/tech-hardening-29-10-reporting-schedule9-service

Conversation

@gpascucci

@gpascucci gpascucci commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Epic 29 architecture cleanup (#306).

ReportService reached past the service seam into Schedule9Repository for the empty-schedule pre-check (countRecords) — the one place the reporting module coupled to another feature's persistence internals. This routes it through the public service instead:

  • Added Schedule9Service.countRecords(millId, year) (a @Transactional(readOnly = true) read that delegates to the repository).
  • ReportService now injects Schedule9Service and calls schedule9Service.countRecords(...).

Behavior-preserving — same count, same 404-empty (ERR-005) and PDF paths. The Schedule 9 fill itself is unchanged (still the SQL-in-template path).

Verified in WSL Oracle Testcontainers: ReportSchedule9IT (6) + PrintScheduleIT (14) = 20/20 green; compile + checkstyle clean.

⚠️ Rebase note: this touches the ReportService constructor, which Story 29.1 (#304) also changes (adds a @Qualifier datasource param). Whichever merges second needs a trivial constructor-param rebase.

Tracked in ilcr-bmad (docs/epic29-tech-hardening-sweep).

🤖 Generated with Claude Code


Thanks for the PR!

Deployments, as required, will be available below:

Please create PRs in draft mode. Mark as ready to enable:

After merge, new images are deployed in:

…e repo (29.10)

Epic 29 architecture cleanup: ReportService reached past the service seam into
Schedule9Repository for the empty-schedule pre-check. Add a countRecords() read
to Schedule9Service and inject the service into ReportService instead, so the
reporting module depends on schedule9's public service (its seam) rather than
its persistence internals. Behavior-preserving — same count, same 404/PDF paths.

Verified in WSL Oracle Testcontainers: ReportSchedule9IT (6) + PrintScheduleIT
(14) = 20/20 green; compile + checkstyle clean.

Note: touches the ReportService constructor, which Story 29.1 (#304) also
changes — expect a trivial rebase (both add a constructor param) once #304 lands.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@SScholefield SScholefield left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nice work

@Rylan-cgi Rylan-cgi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good!

@gpascucci
gpascucci merged commit ffe467a into main Aug 19, 2026
36 of 42 checks passed
@gpascucci
gpascucci deleted the feat/tech-hardening-29-10-reporting-schedule9-service branch August 19, 2026 15:59

@paulushcgcj paulushcgcj left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This refactor routes the Schedule 9 empty-check through Schedule9Service while keeping the existing query and report behavior intact.
The new seam has a focused read-only transaction boundary and clear documentation, and the existing authorization, integration, and CI coverage still applies.
I did not find any changes needed before merge.

* @return the record count (0 when the schedule is empty)
*/
@Transactional(readOnly = true)
public int countRecords(long millId, int year) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I like that the reporting pre-check now stays behind Schedule9Service instead of exposing the repository directly to ReportService. The new seam has its own read-only transaction boundary and documentation, which makes the dependency direction clearer while keeping the existing count query intact.

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.

4 participants