import type { CustomerStatus, InvoiceStatus, PaymentMethod, Role } from "@/types";

export const APP_NAME = process.env.NEXT_PUBLIC_APP_NAME ?? "Veronet";

export const ROLE_LABELS: Record<Role, string> = {
  admin: "Admin",
  kolektor: "Kolektor",
  teknisi: "Teknisi",
};

export const CUSTOMER_STATUS_LABELS: Record<CustomerStatus, string> = {
  aktif: "Aktif",
  isolir: "Isolir",
  berhenti: "Berhenti",
  gratis: "Gratis",
  pending_pasang: "Belum Pasang",
};

/** Status yang boleh diubah teknisi (selaras dengan backend). */
export const TECHNICIAN_STATUSES: CustomerStatus[] = ["aktif", "isolir", "pending_pasang"];

export const INVOICE_STATUS_LABELS: Record<InvoiceStatus, string> = {
  belum_bayar: "Belum Bayar",
  sebagian: "Sebagian",
  lunas: "Lunas",
  gratis: "Gratis",
  batal: "Batal",
};

export const PAYMENT_METHOD_LABELS: Record<PaymentMethod, string> = {
  tunai: "Tunai",
  transfer: "Transfer",
  potong_pupuk: "Potong Pupuk",
  potong_gaji: "Potong Gaji",
  lainnya: "Lainnya",
};

/** Tanggal kutip yang umum dipakai (dari sheet Excel lama). */
export const COMMON_DUE_DAYS = [1, 5, 10, 15, 20, 25, 30];

/** Singkatan metode untuk sel grid (meniru kebiasaan di Excel lama). */
export const PAYMENT_METHOD_SHORT: Record<PaymentMethod, string> = {
  tunai: "Tunai",
  transfer: "TRF",
  potong_pupuk: "Pupuk",
  potong_gaji: "Gaji",
  lainnya: "Lain",
};
