munch-ease-backend/backend-spec.md
2025-11-02 21:33:23 +11:00

1.7 KiB

Backend Specification: Final Polish

1. Current State & Objective

The multi-tenancy migration is functionally complete and successful. The backend has been refactored to a robust, household-scoped system with JWT-based authentication. The legacy persons model has been purged, and data isolation is enforced.

The objective is to complete the final remaining tasks to officially close out the project.

2. Final Tasks

This checklist represents all remaining work.

  • 1. Implement "Copy Invite Link" API:

    • Objective: Modify the invitation creation logic to support a "copy link" UX on the frontend, instead of sending an email.
    • File: api/households.py
    • Action: The existing POST /api/v1/households/{householdSlug}/invitations endpoint should be modified. Instead of returning a simple 201 Created, it must create the invitation token and return a JSON object containing the full, shareable URL.
    • Example Response:
      {
        "invite_link": "https://app.example.com/invitations/accept?token=a1b2c3d4e5f6..."
      }
      
  • 2. Final Codebase Sweep:

    • Objective: Perform a final search for and remove any dead code, comments, or variables related to the old system.
    • Action: Search the entire codebase for the following keywords: legacy, old, previous, workaround, fallback, person.
    • Outcome: Any remaining artifacts from the migration are pruned, leaving the codebase in a clean, maintainable state for future development.
  • 3. Mark Project as Complete:

    • Objective: Once the above tasks are done, this document is complete.
    • Action: Check this box and archive this specification.