import type { Request, Response } from "express";
import status from "../constants/status.js";
import { PaymentMode } from "../constants/payment.mode.js"
import { InvoiceLanguages } from "../constants/languages.js";

export class CommonController {
  getStatus = (_req: Request, res: Response): void => {
    try {
      res.status(200).json(status);
    } catch (error) {
      const message = error instanceof Error ? error.message : "Failed to fetch status";
      res.status(500).json({ message });
    }
  };

  getPaymentModes = (_req: Request, res: Response): void => {
    try {
      res.status(200).json({ success: true, PaymentMode });
    } catch (error) {
      const message = error instanceof Error ? error.message : "Failed to fetch payment modes";
      res.status(500).json({ message });
    }
  };

  getInvoiceLanguages = (_req: Request, res: Response): void => {
    try {
      res.status(200).json({ success: true, InvoiceLanguages });
    } catch (error) {
      const message = error instanceof Error ? error.message : "Failed to fetch invoice languages";
      res.status(500).json({ message });
    }
  };
}
