import { IModuleClient } from "@erp/core";
import i18next from "i18next";
import enResources from "../common/locales/en.json";
import esResources from "../common/locales/es.json";
import { InvoiceRoutes } from "./routes";

const MODULE_NAME = "invoices";
const MODULE_VERSION = "1.0.0";

const InvoicesModule: IModuleClient = {
  metadata: {
    name: MODULE_NAME,
    version: MODULE_VERSION,
    route: "/invoices",
    dependencies: ["contacts"],
  },
  routes: () => {
    i18next.addResourceBundle("en", MODULE_NAME, enResources, true, true);
    i18next.addResourceBundle("es", MODULE_NAME, esResources, true, true);
    return InvoiceRoutes();
  },
};

export default InvoicesModule;
