Skip to content

feat(service, routes): add SearchProgram with pagination and improve …#79

Merged
agaesh merged 3 commits intomainfrom
fixapi-improving-clarity
Jan 29, 2026
Merged

feat(service, routes): add SearchProgram with pagination and improve …#79
agaesh merged 3 commits intomainfrom
fixapi-improving-clarity

Conversation

@agaesh
Copy link
Owner

@agaesh agaesh commented Jan 29, 2026

Adding Feature Search Programs with pagination

  • Added SearchProgram service method to query ProgramCourse records
  • Supported pagination via top, page, and limit parameters
  • Implemented wildcard search on name and code fields using Sequelize Op.like for programs

Fixing Program endpoints

  • Standardized Program endpoint routes to follow RESTful conventions (GET, POST, PUT, DELETE)
  • Moved delete logic to Controller method instead of handling in router

ProgramController
-Removed unneccesary checking that send responses only if the addprogram is successful that is unnecesary as the it would fall on exception when it fails.

ProgramCourseService - Updated the service method that check existing code. that is redundant and not useful as db enforced tight rules. same code would not be possible as code + level + type should be different

agaes added 3 commits January 29, 2026 22:48
…Program endpoints

- Added SearchProgram service method to query ProgramCourse records
- Supported pagination via `top`, `page`, and `limit` parameters
- Implemented wildcard search on `name` and `code` fields using Sequelize Op.like
- Standardized Program endpoint routes to follow RESTful conventions (GET, POST, PUT, DELETE)
- Ensured consistent response structure across list, create, update, and delete operations
- Moved delete logic to Controller method instead of handling in router
- Removed manual uniqueness check for `code` since database enforces constraint by `level`
- Replaced explicit field mapping with direct `ProgramCourse.create(programData)`
- Simplified controller logic for cleaner and more maintainable code
…ending response

- Simplified add program flow by removing unnecessary `if(addProgram)` check
- Controller now directly returns 201 response with program ID on successful creation
@agaesh agaesh merged commit 4603505 into main Jan 29, 2026
1 check failed
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.

1 participant