Skip to content

323 Application Load Buffering and Backend Search#331

Open
bodhiYG wants to merge 2 commits into
mainfrom
rf-bg-323-application-load-buffering
Open

323 Application Load Buffering and Backend Search#331
bodhiYG wants to merge 2 commits into
mainfrom
rf-bg-323-application-load-buffering

Conversation

@bodhiYG

@bodhiYG bodhiYG commented Jun 16, 2026

Copy link
Copy Markdown

ℹ️ Issue

Closes

📝 Description

Write a short summary of what you added. Why is it important? Any member of C4C should be able to read this and understand your contribution -- not just your team members.

Briefly list the changes made to the code:

Backend

  1. Added pagination: findAll and findByDisciplines now return a PaginatedResult (data/total/page/limit) instead of full arrays
  2. Added column projection: list endpoints select only the 8 fields the table renders (APPLICATION_LIST_COLUMNS), dropping the bulk of each row
  3. Added a query DTO (ApplicationQueryDto) for page/limit, plus server-side search, statuses, and date-range filters; enabled transform: true on the global validation pipe
  4. Added server-side search across all searchable columns (incl. off-table fields) via a QueryBuilder ILIKE OR-group, with statuses IN (...) and inclusive date bounds
  5. Added DB indexes on email, discipline, appStatus (entity decorators + migration)

Frontend:

  1. API client + types now send/consume the paginated shape and list params (PaginatedResponse, ApplicationListParams).
  2. useApplications refactored to fetch one page server-side: debouncedsearch, discipline/admin-name filters resolved to discipline keys, complete (non-page-limited) filter options exposed
  3. ApplicationTable reduced to a presentational component (client-side search/filter removed)
  4. AdminLanding wires its search/filter state into the hook, uses real page counts, and resets to page 1 on search/filter change

✔️ Verification

What steps did you take to verify your changes work? These should be clear enough for someone to be able to clone the branch and follow the steps themselves.

Tests

  1. Updated backend service/controller specs for the paginated shapes and added findByDisciplines search/filter tests
  2. Updated frontend hook/page tests for the new signatures; trimmed ApplicationTable tests to presentational only

Provide screenshots of any new components, styling changes, or pages.

🏕️ (Optional) Future Work / Notes

Did you notice anything ugly during the course of this ticket? Any bugs, design challenges, or unexpected behavior? Write it down so we can clean it up in a future ticket!

@SamNie2027

SamNie2027 commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

did yarn db:reset-and-seed: Tried a basic search and I get

[Nest] 60072  - 06/17/2026, 8:59:30 PM   ERROR [TypeOrmExceptionFilter] Unhandled QueryFailedError

QueryFailedError: column app.appstatus does not exist
    at PostgresQueryRunner.query (C:\Users\School\Github\proj-bhchp\node_modules\typeorm\src\driver\postgres\PostgresQueryRunner.ts:325:19)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async SelectQueryBuilder.loadRawResults (C:\Users\School\Github\proj-bhchp\node_modules\src\query-builder\SelectQueryBuilder.ts:3868:25)
    at async SelectQueryBuilder.executeEntitiesAndRawResults (C:\Users\School\Github\proj-bhchp\node_modules\src\query-builder\SelectQueryBuilder.ts:3614:26)
    at async SelectQueryBuilder.getManyAndCount (C:\Users\School\Github\proj-bhchp\node_modules\src\query-builder\SelectQueryBuilder.ts:1874:36)
    at async ApplicationsService.findByDisciplines (webpack:///./src/applications/applications.service.ts:551:27)
    at async ApplicationsController.getApplicationsByDisciplines (webpack:///./src/applications/applications.controller.ts:153:12)

Please do more manual testing as I didn't see you mention manual testing in your "verification" section of your PR

@SamNie2027

Copy link
Copy Markdown
Collaborator

Same with the filter

[Nest] 60072  - 06/17/2026, 9:01:33 PM   ERROR [TypeOrmExceptionFilter] Unhandled QueryFailedError
QueryFailedError: column app.proposedstartdate does not exist
    at PostgresQueryRunner.query (C:\Users\School\Github\proj-bhchp\node_modules\typeorm\src\driver\postgres\PostgresQueryRunner.ts:325:19)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async SelectQueryBuilder.loadRawResults (C:\Users\School\Github\proj-bhchp\node_modules\src\query-builder\SelectQueryBuilder.ts:3868:25)
    at async SelectQueryBuilder.executeEntitiesAndRawResults (C:\Users\School\Github\proj-bhchp\node_modules\src\query-builder\SelectQueryBuilder.ts:3614:26)
    at async SelectQueryBuilder.getManyAndCount (C:\Users\School\Github\proj-bhchp\node_modules\src\query-builder\SelectQueryBuilder.ts:1874:36)
    at async ApplicationsService.findByDisciplines (webpack:///./src/applications/applications.service.ts:551:27)
    at async ApplicationsController.getApplicationsByDisciplines (webpack:///./src/applications/applications.controller.ts:153:12)

[Nest] 60072  - 06/17/2026, 9:01:35 PM   DEBUG [JwtStrategy] Validated JWT payload: sub=11abd550-d061-70ce-53ac-3d3a98b94d3e, token_use=id
[Nest] 60072  - 06/17/2026, 9:01:35 PM   ERROR [TypeOrmExceptionFilter] Unhandled QueryFailedError
QueryFailedError: column app.proposedstartdate does not exist
    at PostgresQueryRunner.query (C:\Users\School\Github\proj-bhchp\node_modules\typeorm\src\driver\postgres\PostgresQueryRunner.ts:325:19)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async SelectQueryBuilder.loadRawResults (C:\Users\School\Github\proj-bhchp\node_modules\src\query-builder\SelectQueryBuilder.ts:3868:25)
    at async SelectQueryBuilder.executeEntitiesAndRawResults (C:\Users\School\Github\proj-bhchp\node_modules\src\query-builder\SelectQueryBuilder.ts:3614:26)
    at async SelectQueryBuilder.getManyAndCount (C:\Users\School\Github\proj-bhchp\node_modules\src\query-builder\SelectQueryBuilder.ts:1874:36)
    at async ApplicationsService.findByDisciplines (webpack:///./src/applications/applications.service.ts:551:27)
    at async ApplicationsController.getApplicationsByDisciplines (webpack:///./src/applications/applications.controller.ts:153:12)

[Nest] 60072  - 06/17/2026, 9:01:35 PM   DEBUG [JwtStrategy] Validated JWT payload: sub=11abd550-d061-70ce-53ac-3d3a98b94d3e, token_use=id
[Nest] 60072  - 06/17/2026, 9:01:35 PM   ERROR [TypeOrmExceptionFilter] Unhandled QueryFailedError

QueryFailedError: column app.proposedstartdate does not exist
    at PostgresQueryRunner.query (C:\Users\School\Github\proj-bhchp\node_modules\typeorm\src\driver\postgres\PostgresQueryRunner.ts:325:19)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async SelectQueryBuilder.loadRawResults (C:\Users\School\Github\proj-bhchp\node_modules\src\query-builder\SelectQueryBuilder.ts:3868:25)
    at async SelectQueryBuilder.executeEntitiesAndRawResults (C:\Users\School\Github\proj-bhchp\node_modules\src\query-builder\SelectQueryBuilder.ts:3614:26)
    at async SelectQueryBuilder.getManyAndCount (C:\Users\School\Github\proj-bhchp\node_modules\src\query-builder\SelectQueryBuilder.ts:1874:36)
    at async ApplicationsService.findByDisciplines (webpack:///./src/applications/applications.service.ts:551:27)
    at async ApplicationsController.getApplicationsByDisciplines (webpack:///./src/applications/applications.controller.ts:153:12)


/**
* Applies the optional free-text search and structured filters from the query
* to a list query builder. Search is matched across every searchable

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Adding the structured filters into this is an interesting choice but I guess the structured filters are so specific its fine

@SamNie2027

Copy link
Copy Markdown
Collaborator

Could perhaps explore adding an "Apply" button to the search or using the "Apply" for in the filters instead of the debounce

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.

2 participants