Skip to content

fix(ncert): format DTO contracts and align response types#412

Open
Tuba1809 wants to merge 4 commits into
MRIARC-08:mainfrom
Tuba1809:fix/ncert-dto-contracts
Open

fix(ncert): format DTO contracts and align response types#412
Tuba1809 wants to merge 4 commits into
MRIARC-08:mainfrom
Tuba1809:fix/ncert-dto-contracts

Conversation

@Tuba1809

Copy link
Copy Markdown

Description

Fixes #59

This PR completes the NCERT DTO contract work by applying the remaining formatting fixes and ensuring the response contracts accurately reflect the current controller and service behavior.

Changes

DTO Alignment

  • AcademicClassDTO uses level
  • SubjectDTO uses academicClassId
  • ChapterDTO uses title, order, contentFormat, and contentSource
  • TopicDTO uses title and order

Response Contracts

  • Added ClassesResponseDTO to match the classes endpoint response shape:

    • { classes: AcademicClassDTO[] }
  • Updated ChaptersResponseDTO to match the live getChapters endpoint response:

    • ApiResponseDTO<SubjectDTO>
  • Preserved existing controller-aligned response contracts for subjects, chapters, and topics

Formatting

  • Applied formatting cleanup to ncert.types.ts
  • Improved consistency of type declarations and spacing

Benefits

  • Accurate type contracts matching runtime responses
  • Improved type safety across the NCERT module
  • Better IDE autocomplete and developer experience
  • Reduced risk of API contract mismatches
  • Ready for future OpenAPI/Swagger integration

Testing

  • Type-only changes
  • No runtime behavior modified
  • Existing controller and service implementations remain compatible

Notes

This PR addresses the final review feedback from the previous NCERT DTO contract work by ensuring response types match the actual controller responses and by applying the requested formatting fixes.

@vercel

vercel Bot commented Jun 22, 2026

Copy link
Copy Markdown

@Tuba1809 is attempting to deploy a commit to the Adarsh's projects Team on Vercel.

A member of the Team first needs to authorize it.

@MRIARC-08 MRIARC-08 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

@Tuba1809 This is close and it merges cleanly with current main. TypeScript passes locally, but focused ESLint still fails on Prettier formatting in src/modules/ncert/ncert.types.ts.

Local checks:

  • pnpm exec tsc --noEmit passes.
  • pnpm exec eslint src/modules/ncert/ncert.types.ts fails with 8 Prettier errors.

Please run the repo formatter on that touched file and push the formatting result. No logic rewrite needed from what I checked.

@MRIARC-08 MRIARC-08 added gssoc gssoc level:beginner GSSoC difficulty: beginner type:refactor Refactor related contribution labels Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc gssoc level:beginner GSSoC difficulty: beginner type:refactor Refactor related contribution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Define NCERT module TypeScript types

2 participants