Skip to content

Admin Invoice Endpoints #43

Description

@codebestia

Background

Cross-merchant invoice visibility for the admin dashboard — as scoped, this is listing and detail only (filter by merchant address and status, paginated; no sort options were requested here, so none are added beyond the implicit createdAt desc ordering).

Proposed Steps

  1. GET /admin/invoices — paginated, filters: merchantAddress (joins merchant.address), status (reuse the existing InvoiceStatus validation from invoice.validation.ts). Default order createdAt desc.
  2. GET /admin/invoices/:id — full invoice detail, unscoped by merchant ownership (unlike the merchant-facing getInvoice, which enforces merchantId match — here there is none, admin sees any invoice).

Acceptance Criteria

  • GET /admin/invoices filters correctly by merchantAddress and status, independently and combined
  • GET /admin/invoices is paginated using the existing DEFAULT_LIMIT/MAX_LIMIT convention
  • GET /admin/invoices/:id returns any invoice regardless of which merchant owns it, 404 if the id doesn't exist
  • No new Prisma models or fields required

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions