refactor(reporting): read Schedule 9 through Schedule9Service, not the repo (Epic 29: 29.10) - #309
Merged
gpascucci merged 1 commit intoAug 19, 2026
Conversation
…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>
gpascucci
requested review from
Rylan-cgi,
SScholefield,
adityaravi12 and
paulushcgcj
as code owners
August 18, 2026 22:40
gpascucci
deleted the
feat/tech-hardening-29-10-reporting-schedule9-service
branch
August 19, 2026 15:59
paulushcgcj
approved these changes
Aug 19, 2026
paulushcgcj
left a comment
Contributor
There was a problem hiding this comment.
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) { |
Contributor
There was a problem hiding this comment.
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.
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.
Epic 29 architecture cleanup (#306).
ReportServicereached past the service seam intoSchedule9Repositoryfor 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:Schedule9Service.countRecords(millId, year)(a@Transactional(readOnly = true)read that delegates to the repository).ReportServicenow injectsSchedule9Serviceand callsschedule9Service.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.ReportServiceconstructor, which Story 29.1 (#304) also changes (adds a@Qualifierdatasource 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: