Repository navigation
Refactor: remove dead code, fix stale docstring, tighten server any types - #198
Merged
Merged
Conversation
…ypes - Remove commented-out unused ManyToOne/JoinColumn block on StudentByYear view entity (no inverse-side reference uses it, unlike User.entity.ts's intentionally-kept pattern). - Remove two commented-out disabled export-header columns (approvedAbsCount/sheetName) referencing fields that don't exist on AttReportWithReportMonth. - Remove unused DateInput import/commented filters in student-percent-report.jsx, unused MichlolPopulatedFileParams import in its spec, unused gradeAvg/lessonsCount destructure in michlolPopulatedFile.ts, and a leftover client console.log. - Fix stale YemotHandlerService class docstring: it no longer just "returns a maintenance mode message", it routes manager/seminar/ transportation call flows. - Replace several server-side `any` types with real types where safe (student-percent-report.config.ts's debug field and fetchAttGradeEffect's viewEntity param, student-by-year.config.ts's header thresholds field) verified with `tsc --noEmit`. - DRY: att-report-with-report-month.config.ts's deleteOne now reuses the existing getAttReportService() helper instead of duplicating the BaseEntityService construction. Left @dataui/crud-tied `any` (CrudRequest<any,any>, doAction/ populatePivotData overrides, req.parsed.extra/filter.value) alone: their `any` originates in the nra-server shared submodule's own base class signatures and the crud-request library's types, so narrowing them here isn't safely possible without changing that submodule. All existing tests verified passing before and after (server: 119 suites/ 1155 tests; client: 34 suites/214 tests), plus a clean `tsc --noEmit`. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017mJpVpL5fuvKVhGyMPLeUh
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
No blocking issues were identified; the remaining feedback is a minor typing nit.
Review effort: Lite
Findings: 1
Open (1)
What changed in this PR
Technical-debt cleanup removing dead code, correcting documentation, tightening selected server types, and reusing an existing helper without API changes.
Changes:
- Removed unused code, imports, variables, comments, and logging.
- Updated Yemot service documentation.
- Tightened selected server types and typed absence thresholds.
- Reused the attendance report service helper.
| File | Description |
|---|---|
server/src/yemot-handler.service.ts |
Corrected service documentation |
server/src/reports/michlolPopulatedFile.ts |
Removed unused values |
server/src/reports/__tests__/michlolPopulatedFile.spec.ts |
Removed unused import |
server/src/entity-modules/student-percent-report.config.ts |
Added explicit types |
server/src/entity-modules/student-by-year.config.ts |
Typed threshold headers |
server/src/entity-modules/att-report-with-report-month.config.ts |
Removed dead headers and reused helper |
server/src/db/view-entities/StudentByYear.entity.ts |
Removed dead relation comments |
client/src/entities/student-percent-report.jsx |
Removed dead filters and import |
client/src/components/ApprovedAbsencesUpload/useFileProcessor.js |
Removed leftover logging |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.

Summary
Small, low-risk technical-debt cleanup pass. No API/route/DTO/response-shape changes.
@ManyToOne/@JoinColumnblock onStudentByYearview entity (unlikeUser.entity.ts, nothing references.studentas an inverse-side callback, so it wasn't serving any type-checking purpose); removed two commented-out disabled export-header columns (approvedAbsCount/sheetName) inatt-report-with-report-month.config.tsthat reference fields not present on the view entity; removed a commented-out filter block + its now-unusedDateInputimport instudent-percent-report.jsx; removed unusedMichlolPopulatedFileParamsimport in its spec; removed unusedgradeAvg/lessonsCountdestructure inmichlolPopulatedFile.ts; removed a leftover clientconsole.log.YemotHandlerService's stale class docstring — it said the service "currently returns a maintenance mode message," but that's only one early-exit path; it actually routes to manager-report-status, seminar-attendance, or transportation-report flows.anywith real types where doing so is safe and verified withtsc --noEmit(student-percent-report.config.ts'sdebugfield andfetchAttGradeEffect'sviewEntityparam;student-by-year.config.ts's headerthresholdsfield using the existingAbsenceThresholdtype).att-report-with-report-month.config.ts'sdeleteOnenow reuses the file's existinggetAttReportService()helper instead of duplicating theBaseEntityServiceconstruction inline.Left alone (not safely fixable here)
Most other
anyinserver/src/entity-modules/*.config.ts(CrudRequest<any, any>,doAction/populatePivotDataoverrides,req.parsed.extra/filter.value) is inherited from the sharednra-serversubmodule's own base-class method signatures and from@dataui/crud-request's library types. Narrowing those locally isn't possible without changing the submodule (out of scope per task instructions) or risking behavior changes. Confirmed withtsc --noEmit: forcing stricter types onteacher.config.ts's export-header formatter, for instance, fails to compile becauseBaseEntityModuleOptions.exporterisn't generic over the entity type in the shared lib.Test plan
cd server && yarn test— 119 suites / 1155 tests passed (before and after)cd client && yarn test— 34 suites / 214 tests passed (before and after)cd server && npx tsc --noEmit— clean🤖 Generated with Claude Code
https://claude.ai/code/session_017mJpVpL5fuvKVhGyMPLeUh
Generated by Claude Code