Skip to content

Implement cancellation policy (issue #56), waitlist with time-boxed offers (issue #55), and reschedule (issue #54) - #164

Merged
afeezorobsco-cyber merged 13 commits into
DocForum:mainfrom
Blessed-Femi:feature/fix-issues-54-57
Oct 27, 2026
Merged

afeezorobsco-cyber merged 13 commits into
DocForum:mainfrom
Blessed-Femi:feature/fix-issues-54-57

Conversation

@Blessed-Femi

@Blessed-Femi Blessed-Femi commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

PR resolves and closes all 4 issues: closes #54, closes #55, closes #56, closes #57. Implements cancellation policy (issue #56), waitlist with time-boxed offers (issue #57), reschedule endpoint (issue #55), and related fixes.

…-boxed offers (issue DocForum#55), and reschedule (issue DocForum#54)

- Add late_cancelled status to AppointmentStatus enum
- Implement cancelAppointment with 2-hour cutoff logic
- Implement rescheduleSlot atomically with new slot claiming and old slot release
- Implement waitlist join/leave/list/accept functionality
- Add WaitlistEntry and WindowTime models to Prisma schema
- Add route handlers for all new endpoints
- Add validation schemas for all new requests
- Fix auth repository to include timeZone field
@drips-wave

drips-wave Bot commented Oct 19, 2026

Copy link
Copy Markdown

@Blessed-Femi Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@afeezorobsco-cyber

Copy link
Copy Markdown
Contributor

@Blessed-Femi Thanks for the PR. It can't be merged yet. To unblock it:

CI is failing. Here's what broke:

Backend (typecheck + test + build):

Integration tests: 16 failed | 102 passed — PrismaClientKnownRequestError: DriverAdapterError: ColumnNotFound (a column your code queries is missing from the migration)
e.g. × GET /appointments/mine → doctor expects 403

Please fix these errors and run the same steps locally before pushing (npm run typecheck && npm test && npm run build, or cargo test for contracts).

Merge conflicts: this branch conflicts with main. Please rebase onto the latest main (git fetch upstream && git rebase upstream/main), resolve the conflicts (often ROADMAP.md, ARCHITECTURE*.md or prisma/schema.prisma), and force-push.

Push to this same branch and CI will re-run. Once it's green and conflict-free, it'll be reviewed for merge.

@afeezorobsco-cyber

Copy link
Copy Markdown
Contributor

@Blessed-Femi Thanks for the update. The malware scan passed, but the backend CI fails at prisma generate:

error P1012: Error validating field `patientProfile` in model `WaitlistEntry`: The relation field `patientProfile` on model `WaitlistEntry` is missing an opposite relation field on the model `PatientProfile`.
error P1012: Error validating field `doctorProfile` in model `WaitlistEntry`: The relation field `doctorProfile` on model `WaitlistEntry` is missing an opposite relation field on the model `DoctorProfile`.

Add the back-relations, waitlistEntries WaitlistEntry[], to both PatientProfile and DoctorProfile in backend/prisma/schema.prisma (npx prisma format does it for you), then run npm run prisma:generate && npm test locally. Also, the branch is behind main and "Allow edits from maintainers" is off, so I can't update it for you. Please rebase onto the latest main when you push the fix.

…-boxed offers (issue DocForum#55), and reschedule (issue DocForum#54)

- Add late_cancelled status to AppointmentStatus enum
- Implement cancelAppointment with 2-hour cutoff logic
- Implement rescheduleSlot atomically with new slot claiming and old slot release
- Implement waitlist join/leave/list/accept functionality
- Add WaitlistEntry and WindowTime models to Prisma schema
- Add route handlers for all new endpoints
- Add validation schemas for all new requests
- Fix auth repository to include timeZone field
@github-actions github-actions Bot added the needs-rebase Has merge conflicts with main; the author needs to rebase label Oct 20, 2026
@github-actions

Copy link
Copy Markdown

@Blessed-Femi This PR now has merge conflicts with main, most likely because #153 (feat(referrals): Phase 3 referral core — creation, accept/decline, cascade, loop guard, admin overrides) was just merged, so it can't be merged until it's rebased:

git fetch upstream            # upstream = https://github.com/DocForum/docforum-core.git
git rebase upstream/main
# resolve the conflicts, re-run the tests, then:
git push --force-with-lease

The usual culprits are shared files like ROADMAP.md and ARCHITECTURE*.md. CI re-runs when you push, and the needs-rebase label is removed automatically once the conflicts are resolved.

Automated message. It won't repeat unless the PR conflicts again after your next push.

@github-actions github-actions Bot removed the needs-rebase Has merge conflicts with main; the author needs to rebase label Oct 20, 2026
@afeezorobsco-cyber

Copy link
Copy Markdown
Contributor

@Blessed-Femi CI is failing on this branch, so it can't be merged yet. The errors from the latest run:

Backend (typecheck + test + build)

Error: Prisma schema validation - (get-dmmf wasm)
error: Error validating field `patientProfile` in model `WaitlistEntry`: The relation field `patientProfile` on model `WaitlistEntry` is missing an opposite relation field on the model `PatientProfile`. Either run `prisma format` or add it manually.
error: Error validating field `doctorProfile` in model `WaitlistEntry`: The relation field `doctorProfile` on model `WaitlistEntry` is missing an opposite relation field on the model `DoctorProfile`. Either run `prisma format` or add it manually.

The new WaitlistEntry relations need back-relation fields on PatientProfile and DoctorProfile. Run npx prisma format in backend/ and commit the result. This branch also doesn't allow maintainer edits, so please merge the latest main in yourself.

Blessed-Femi and others added 3 commits October 20, 2026 15:01
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added the needs-rebase Has merge conflicts with main; the author needs to rebase label Oct 20, 2026
@github-actions

Copy link
Copy Markdown

@Blessed-Femi This PR now has merge conflicts with main, most likely because #140 (feat(auth): password reset flow with single-use, hashed, expiring tokens) was just merged, so it can't be merged until it's rebased:

git fetch upstream            # upstream = https://github.com/DocForum/docforum-core.git
git rebase upstream/main
# resolve the conflicts, re-run the tests, then:
git push --force-with-lease

The usual culprits are shared files like ROADMAP.md and ARCHITECTURE*.md. CI re-runs when you push, and the needs-rebase label is removed automatically once the conflicts are resolved.

Automated message. It won't repeat unless the PR conflicts again after your next push.

@github-actions github-actions Bot removed the needs-rebase Has merge conflicts with main; the author needs to rebase label Oct 21, 2026
@afeezorobsco-cyber

Copy link
Copy Markdown
Contributor

@Blessed-Femi CI is failing on this branch against the latest main, so it can't be merged yet. The errors from the latest run:

Backend (typecheck + test + build)

Error: Prisma schema validation - (get-dmmf wasm)
error: Error validating field `doctorProfile` in model `WaitlistEntry`: The relation field `doctorProfile` on model `WaitlistEntry` is missing an opposite relation field on the model `DoctorProfile`. Either run `prisma format` or add it manually.

WaitlistEntry.doctorProfile still needs a back-relation field on DoctorProfile. Run npx prisma format in backend/ and commit it. Maintainer edits are off on this branch, so you'll need to merge main in yourself.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Blessed-Femi
Blessed-Femi force-pushed the feature/fix-issues-54-57 branch from caaa467 to 55dd27b Compare October 21, 2026 15:24
@github-actions github-actions Bot added the needs-rebase Has merge conflicts with main; the author needs to rebase label Oct 21, 2026
@github-actions

Copy link
Copy Markdown

@Blessed-Femi This PR now has merge conflicts with main, most likely because #157 (feat(patients): guardian and dependent accounts: booking on behalf of a minor) was just merged, so it can't be merged until it's rebased:

git fetch upstream            # upstream = https://github.com/DocForum/docforum-core.git
git rebase upstream/main
# resolve the conflicts, re-run the tests, then:
git push --force-with-lease

The usual culprits are shared docs like ROADMAP.md and ARCHITECTURE*.md. If the conflict is in the ROADMAP.md changelog, move your entry into a new file under changelog.d/ (see changelog.d/README.md) rather than resolving it in place, so it can't conflict again. CI re-runs when you push, and the needs-rebase label is removed automatically once the conflicts are resolved.

Automated message. It won't repeat unless the PR conflicts again after your next push.

@github-actions github-actions Bot removed the needs-rebase Has merge conflicts with main; the author needs to rebase label Oct 21, 2026
@afeezorobsco-cyber

Copy link
Copy Markdown
Contributor

@Blessed-Femi CI is failing on this branch against the latest main, so it can't be merged yet. The errors from the latest run:

Backend (typecheck + test + build)

Error: Prisma schema validation - (get-dmmf wasm)
error: Error validating field `patientProfile` in model `WaitlistEntry`: The relation field `patientProfile` on model `WaitlistEntry` is missing an opposite relation field on the model `PatientProfile`. Either run `prisma format` or add it manually.

WaitlistEntry.patientProfile needs a back-relation field on PatientProfile (for example waitlistEntries WaitlistEntry[]). Run npx prisma format in backend/ and commit the result. Your branch also doesn't allow maintainer edits, so please merge the latest main yourself.

@github-actions github-actions Bot added the needs-rebase Has merge conflicts with main; the author needs to rebase label Oct 22, 2026
@github-actions

Copy link
Copy Markdown

@Blessed-Femi This PR now has merge conflicts with main, most likely because #196 (feat: facility fulfillment proof and patient confirm/dispute workflow) was just merged, so it can't be merged until it's rebased:

git fetch upstream            # upstream = https://github.com/DocForum/docforum-core.git
git rebase upstream/main
# resolve the conflicts, re-run the tests, then:
git push --force-with-lease

The usual culprits are shared docs like ROADMAP.md and ARCHITECTURE*.md. If the conflict is in the ROADMAP.md changelog, move your entry into a new file under changelog.d/ (see changelog.d/README.md) rather than resolving it in place, so it can't conflict again. CI re-runs when you push, and the needs-rebase label is removed automatically once the conflicts are resolved.

Automated message. It won't repeat unless the PR conflicts again after your next push.

@github-actions github-actions Bot removed the needs-rebase Has merge conflicts with main; the author needs to rebase label Oct 23, 2026
@afeezorobsco-cyber

Copy link
Copy Markdown
Contributor

@Blessed-Femi CI is failing on this branch against the latest main, so it can't be merged yet. The errors from the latest run:

Backend (typecheck + test + build)

Error: Prisma schema validation - (get-dmmf wasm)
error: Field "createdAt" is already defined on model "User".
error: Field "updatedAt" is already defined on model "User".

User now defines createdAt and updatedAt twice in backend/prisma/schema.prisma, because main already has them. Delete your copies, then run npx prisma format and npx prisma validate in backend/.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

@afeezorobsco-cyber afeezorobsco-cyber left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sweep: malware scan clean, CI green.

@afeezorobsco-cyber

Copy link
Copy Markdown
Contributor

@Blessed-Femi CI on this PR is green, but it is 20 commits behind main and branch protection requires it to be up to date. "Allow edits from maintainers" is off, so I can't update the branch for you. Please rebase (or merge main) and push. If CI is still green after that, it gets merged in the next sweep.

@afeezorobsco-cyber

Copy link
Copy Markdown
Contributor

@Blessed-Femi Thanks for rebasing. One typecheck error is left. It comes from the new test factories that main gained in #208, combined with this PR's schema change:

tests/factories/index.ts(22,49): error TS2322: Type '{ id?: string; timeZone?: string | undefined; ... }' is not assignable to ...
  Types of property 'timeZone' are incompatible.
    Type 'string | undefined' is not assignable to type 'string'.

Your PR makes DoctorProfile.timeZone required, but the doctor factory in backend/tests/factories/index.ts can pass undefined. Please give the factory a default (e.g. timeZone: overrides.timeZone ?? 'Africa/Lagos', or whatever default your migration uses), run npm run typecheck in backend/, and push.

The waitlist/timezone migration made DoctorProfile.timeZone required with
no DB default, while the factory takes Partial overrides, so an omitted
timeZone produced undefined and broke typecheck after rebasing DocForum#208.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>

@afeezorobsco-cyber afeezorobsco-cyber left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sweep: malware scan clean, CI green.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants