Skip to content

Add houses - #2

Open
Mihilih wants to merge 2 commits into
feature/loginfrom
feature/houses
Open

Mihilih wants to merge 2 commits into
feature/loginfrom
feature/houses

Conversation

@Mihilih

@Mihilih Mihilih commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator

Overview

Adds houses: creating one, inviting roommates, joining, and leaving. This covers onboarding steps 3a–5 and the house settings screen.

Changes Made

  • POST /houses creates a house with the creator as owner, optionally invites roommates by NetID, and generates an invite code like LOFT-4827.
  • GET / PATCH /houses/:houseId reads and edits house settings. Any member can edit.
  • POST /houses/:houseId/invites and DELETE /houses/:houseId/invites/:inviteId add and revoke NetID invites.
  • POST /houses/:houseId/invite-code (owner only) replaces the invite code.
  • POST /houses/join joins a house by code. POST /invites/:id/accept and /decline respond to invites.
  • DELETE /houses/:houseId/members/me leaves a house, and DELETE /houses/:houseId/members/:userId (owner only) removes someone. When the owner leaves, the longest-standing member becomes owner. When the last member leaves, the house is deleted.
  • requireHouseMember and requireHouseOwner middleware. Anyone outside a house gets 404 on its routes, so house IDs can't be probed.
  • Each person can be in one house at a time (otherwise 409).
  • The README and Postman collection are updated.

Test Coverage

  • npm test: all 23 tests pass (11 of them new), run against a real Postgres database. They cover creating a house, one-house-per-person, NetID and date validation, invites (accept, decline, revoke), joining by code, rotating the code, owner-only actions, non-member access, and leaving (ownership transfer and house deletion).
  • Postman: running the collection goes through the whole flow with two users: 16 requests, 22 checks passing.

Next Steps

  • Chores and the shopping list are on mvp-features and will come as separate PRs. Each one adds its own cleanup to the leave-house step.

Related PRs or Issues

  • Depends on [1/2] Add login and profile. Once that's merged, change this PR's base to main.

- POST /houses: create a house (creator is owner), invite roommates by NetID,
  generate an invite code like LOFT-4827
- GET/PATCH /houses/:houseId: house details and settings
- Invites: add by NetID, revoke, accept, decline; owner can rotate the code
- POST /houses/join: join by invite code
- Leave or remove a member: ownership passes to the longest-standing member,
  the last one out deletes the house
- requireHouseMember / requireHouseOwner middleware; non-members get 404
- One house per person for now
- Tests, Postman collection and README updated
@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 90f59288-75a4-4069-bbcf-f269ba59f948
Commits

Reviewing files that changed from the base of the PR and between 09d0220 and f750b1c.

Files selected for processing: 11

  • docs/roomie.postman_collection.json
  • src/app.ts
  • src/houses/houseController.ts
  • src/houses/houseRouter.ts
  • src/houses/houseService.ts
  • src/houses/houses.schema.ts
  • src/middleware/authentication.ts
  • src/types/express/index.d.ts
  • src/utils/dates.ts
  • src/utils/inviteCode.ts
  • test/houses.test.ts
Pre-merge checks: Passed 1 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Title check Pending This assessment has not completed. The check will be retried on the next pre-merge check run.
Passed Passed checks: 1 passed

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@Mihilih
Mihilih marked this pull request as ready for review October 20, 2026 00:40
@Mihilih
Mihilih changed the base branch from main to feature/login October 20, 2026 00:41
@Mihilih Mihilih changed the title [Roomie Backend][2/2] Add houses Add houses Nov 11, 2026
@Mihilih
Mihilih added this pull request to stack #6 November 11, 2026 22:28
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