import type { InvoiceStatus } from '@prisma/client';

/** Before the ledger: nothing has posted, so the lines may still be edited.
 * Editing one that is in (or has cleared) approval restarts that approval. */
export const PRE_ISSUE_STATUSES: InvoiceStatus[] = ['DRAFT', 'PENDING_APPROVAL', 'APPROVED'];

/** Where the LINES may still be changed. Narrower than PRE_ISSUE on purpose:
 * an APPROVED note has been signed off at those figures, so changing it after
 * the fact would make the signatures describe a document that no longer exists.
 * PRE_ISSUE still governs what may be issued or voided — an approved note is
 * both, it just may not be edited. */
export const EDITABLE_STATUSES: InvoiceStatus[] = ['DRAFT', 'PENDING_APPROVAL'];

/** What a tenant may see — everything from the moment the note was issued.
 * DRAFT and the two approval stages are internal to the back office. */
export const ISSUED_STATUSES: InvoiceStatus[] = ['ISSUED', 'PARTIALLY_PAID', 'PAID', 'VOID'];
