-
Notifications
You must be signed in to change notification settings - Fork 134
Open
Labels
good first issueGood for newcomersGood for newcomers
Description
Location: backend/src/payments/
Description
Members need to view their own payment history, and admins need visibility into all payments across the platform. Like the bookings endpoints, the same GET /payments endpoint should serve both roles — returning only the requesting member's payments for a USER role, and all payments for admin roles.
Acceptance Criteria
-
GET /paymentsreturns a paginated list of payments- Supports query params:
page(default1),limit(default10),status(optional, filters byPaymentStatus) - If the requesting user's role is
ADMIN,SUPER_ADMIN, orSTAFF— returns all payments across all members - If the requesting user's role is
USER— returns only that user's own payments - Each payment includes the
bookinganduserrelations - Response shape:
{ success: true, data: Payment[], meta: { total, page, limit, totalPages } }
- Supports query params:
-
GET /payments/:idreturns a single payment by UUID- Members can only access their own payments — throws
ForbiddenExceptionif the payment does not belong to them - Throws
NotFoundExceptionif the payment does not exist - Includes the
bookinganduserrelations - Response shape:
{ success: true, data: Payment }
- Members can only access their own payments — throws
- Both endpoints use
@GetCurrentUser('id')and@GetCurrentUser('role')to determine scope -
npx tsc --noEmitpasses with no errors
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomers