-
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/dashboard/providers/member-dashboard.provider.ts
Description
Members need a personal dashboard summary — a snapshot of their own activity on the platform. This provider computes four headline stats for the member and bundles them with their five most recent bookings and five most recent payments in a single parallel query, so the member dashboard page can load everything in one API call.
Acceptance Criteria
- A
MemberDashboardProviderclass is created atbackend/src/dashboard/providers/member-dashboard.provider.tswith@InjectRepositorydecorators forBooking,Payment, andInvoice - A
getMemberStats(userId: string)method that returns:activeBookings— count of the member's bookings with statusPENDINGorCONFIRMEDtotalSpentKobo— sum ofamountKoboacross the member'sSUCCESSpaymentsinvoiceCount— total count of the member's invoiceslastCheckIn— thecheckedInAttimestamp of the member's most recentWorkspaceLogrecord, ornullif none
- A
getMemberDashboard(userId: string)method that callsgetMemberStats, fetches the member's 5 most recent bookings (withworkspacerelation), and fetches the member's 5 most recentSUCCESSpayments — all viaPromise.all— and returns:{ stats: { activeBookings, totalSpentKobo, invoiceCount, lastCheckIn }, recentBookings: Booking[], recentPayments: Payment[] } -
MemberDashboardProvideris registered inDashboardModule -
npx tsc --noEmitpasses with no errors
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomers