export interface CacSigninRequest {
  username: string;
  password: string;
}

export interface CacSigninResponse {
  id: number;
  username: string;
  email: string;
  accessToken: string;
  tokenType: string;
}

export interface CacPaymentInitiateRequest {
  app_key: string;
  api_key: string;
  customer_mobile: string;
  currency: string;
  desc?: string;
  vender_ref?: string;
  amount: number;
  company_services_id: number;
}

export interface CacPaymentInitiateResponse {
  description: string;
  /** Numeric id (<=18 digits) kept as a string — it exceeds JS's safe integer range. */
  paymentRequestId: string;
}

export interface CacPaymentConfirmRequest {
  app_key: string;
  api_key: string;
  /**
   * Carried as a string for precision; emitted as a raw JSON number on the wire by
   * `serializeCacRequest` (the bank types this field as `numeric`).
   */
  payment_request_id: string;
  otp: string;
}

export interface CacPaymentConfirmResponse {
  description: string;
  /** Numeric id kept as a string — see CacPaymentInitiateResponse.paymentRequestId. */
  confirmReference: string;
  reference: string;
}

export interface CacGetPaymentByReferenceRequest {
  app_key: string;
  api_key: string;
  reference: string;
}

export interface CacPaymentByReferenceResponse {
  description: string;
  customerName?: string;
  reference: string;
  amount: number;
  transactionDate: string;
  /** Numeric id kept as a string — see CacPaymentInitiateResponse.paymentRequestId. */
  transactionNo: string;
}

export interface CacConfirmResult {
  status: "SUCCEEDED" | "FAILED";
  providerTxnId?: string;
  reference?: string;
  failureCode?: string;
  failureMessage?: string;
  rawResponse: Record<string, unknown>;
}
