Skip to content

Issue #41 — Frontend: Invoice TypeScript Type Definitions #684

@yusuftomilola

Description

@yusuftomilola

Location: frontend/lib/types/invoice.ts

Description

Before any invoice hooks or pages can be built, the TypeScript interfaces for the invoices feature need to be defined. These types represent the invoice records returned by the API and are shared across the invoices list page, the detail page, and any dashboard stats that reference invoice data.

Acceptance Criteria

  • frontend/lib/types/invoice.ts exports:
    • An InvoiceStatus type: "PAID" | "PENDING"
    • An Invoice interface with:
      • id: string
      • invoiceNumber: string
      • amountKobo: number
      • amountNaira: number
      • status: InvoiceStatus
      • paidAt: string | null
      • userId: string
      • bookingId: string
      • paymentId: string | null
      • booking?: Booking (imported from @/lib/types/booking)
      • payment?: Payment (imported from @/lib/types/payment)
      • user?: { id: string; firstname: string; lastname: string; email: string }
      • createdAt: string
      • updatedAt: string
  • Only TypeScript interface and type declarations — no runtime code
  • npx tsc --noEmit passes with no errors

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions