-
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/invoices/
Description
ManageHub needs an Invoices module to maintain a permanent financial record for every successful payment on the platform. Each invoice is linked to a specific payment, booking, and member, and carries a human-readable invoice number that can be referenced in emails and PDF documents. This issue covers the foundational setup — the entity, enums, module, and bare service/controller stubs.
All monetary values must be stored in kobo as integers alongside a derived Naira value for convenience in display and PDF generation. The synchronize: true flag handles schema changes automatically.
Acceptance Criteria
- An
Invoiceentity is created atbackend/src/invoices/entities/invoice.entity.tswith the following fields:id— UUID, primary key, auto-generatedinvoiceNumber— string, unique — human-readable identifier (e.g.MH-INV-20260318-0001)amountKobo— integer, requiredamountNaira— decimal/float, required (derived fromamountKobo / 100)status— enum:PAID,PENDING— defaultPENDINGpaidAt— timestamp, nullableuserId— UUID, foreign key referencingusersbookingId— UUID, foreign key referencingbookingspaymentId— UUID, foreign key referencingpayments, nullableuser—@ManyToOnerelation toUserentitybooking—@ManyToOnerelation toBookingentitypayment—@ManyToOnerelation toPaymententity, nullablecreatedAt/updatedAt— auto timestamps
- An
InvoiceStatusenum is created atbackend/src/invoices/enums/invoice-status.enum.ts - An
InvoicesModuleis created atbackend/src/invoices/invoices.module.tswithTypeOrmModule.forFeature([Invoice])registered - An
InvoicesServicestub is created atbackend/src/invoices/providers/invoices.service.ts - An
InvoicesControllerstub is created atbackend/src/invoices/invoices.controller.tswith the@Controller('invoices')decorator -
InvoicesModuleis imported intobackend/src/app.module.ts -
npx tsc --noEmitpasses with no errors
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomers