import { ACCOUNT_PAYABLE_RECOGNIZED } from "../lib/contracts";
import type { AccountingEvent, Schema } from "../lib/types";
import type { Company } from "./moduleMocks";

export const baseCompany = {
  id: "company-1",
  status: "ACTIVE",
  legalName: "Test Corp",
  baseCurrencyId: "currency-1",
  taxId: null,
  registrationNumber: null,
  street: "123 Main St",
  city: "New York",
  state: "NY",
  postalCode: "10001",
  country: "US",
  createdAt: new Date("2024-01-01T00:00:00.000Z"),
  updatedAt: null,
} as const satisfies Company;

export const baseAccountingEvent = {
  id: "accounting-event-1",
  companyId: "company-1",
  eventKind: ACCOUNT_PAYABLE_RECOGNIZED,
  schemaVersion: "1",
  occurredAt: new Date("2026-01-15T00:00:00Z"),
  payloadJson: JSON.stringify({
    source: {
      documentType: "ACCOUNT_PAYABLE_DOCUMENT",
      documentId: "account-payable-document-1",
      documentNumber: "AP-10000001",
    },
    documentType: "INVOICE",
    supplierId: "supplier-1",
    documentDate: "2026-01-10",
    accountingDate: "2026-01-15",
    dueSchedule: [{ dueDate: "2026-02-15", amount: "1200.00" }],
    currencyId: "currency-1",
    currencyCode: "USD",
    totalAmount: "1200.00",
    payableAccountId: "account-payable-control",
    lines: [],
    distributions: [],
  }),
  createdAt: new Date("2026-01-15T00:00:00Z"),
  updatedAt: new Date("2026-01-15T00:00:00Z"),
} satisfies AccountingEvent<Schema>;
