import { defineRoutes } from "@sirou/core";

export const routes = defineRoutes({
  // Root and Layouts
  root: {
    path: "/",
    guards: ["auth"],
    meta: { requiresAuth: true },
  },
  "(tabs)": {
    path: "/(tabs)",
    guards: ["auth"],
    meta: { requiresAuth: true },
  },
  // Tabs
  "(tabs)/index": {
    path: "/(tabs)/index",
    guards: ["auth"],
    meta: { requiresAuth: true },
  },
  "(tabs)/payments": {
    path: "/(tabs)/payments",
    guards: ["auth"],
    meta: { requiresAuth: true },
  },
  "(tabs)/scan": {
    path: "/(tabs)/scan",
    guards: ["auth"],
    meta: { requiresAuth: true },
  },
  "(tabs)/proforma": {
    path: "/(tabs)/proforma",
    guards: ["auth"],
    meta: { requiresAuth: true },
  },
  "(tabs)/invoices": {
    path: "/(tabs)/invoices",
    guards: ["auth"],
    meta: { requiresAuth: true },
  },

  history: {
    path: "/history",
    guards: ["auth"],
    meta: { requiresAuth: true },
  },
  help: {
    path: "/help",
    guards: ["auth"],
    meta: { requiresAuth: true, title: "Help & Support" },
  },
  faq: {
    path: "/faq",
    guards: ["auth"],
    meta: { requiresAuth: true, title: "FAQ" },
  },
  privacy: {
    path: "/privacy",
    guards: ["auth"],
    meta: { requiresAuth: true, title: "Privacy Policy" },
  },
  terms: {
    path: "/terms",
    guards: ["auth"],
    meta: { requiresAuth: true, title: "Terms of Service" },
  },
  // Stacks
  "proforma/[id]": {
    path: "/proforma/:id",
    params: { id: "string" },
    guards: ["auth"],
    meta: { requiresAuth: true },
  },
  "proforma": {
    path: "/proforma",
    guards: ["auth"],
    meta: { requiresAuth: true, title: "Proforma" },
  },
  "proforma/create": {
    path: "/proforma/create",
    guards: ["auth"],
    meta: { requiresAuth: true },
  },
  "proforma/edit": {
    path: "/proforma/edit",
    params: { id: "string" },
    guards: ["auth"],
    meta: { requiresAuth: true },
  },
  "proforma-requests/create": {
    path: "/proforma-requests/create",
    guards: ["auth"],
    meta: { requiresAuth: true, title: "Create Proforma Request" },
  },
  "proforma-requests/[id]": {
    path: "/proforma-requests/:id",
    params: { id: "string" },
    guards: ["auth"],
    meta: { requiresAuth: true, title: "Proforma Request" },
  },
  "payments/[id]": {
    path: "/payments/:id",
    params: { id: "string" },
    guards: ["auth"],
    meta: { requiresAuth: true },
  },
  "payment-requests/[id]": {
    path: "/payment-requests/:id",
    params: { id: "string" },
    guards: ["auth"],
    meta: { requiresAuth: true },
  },
  "payment-requests/create": {
    path: "/payment-requests/create",
    guards: ["auth"],
    meta: { requiresAuth: true },
  },
  "payment-requests/edit": {
    path: "/payment-requests/edit",
    params: { id: "string" },
    guards: ["auth"],
    meta: { requiresAuth: true },
  },
  "customers/create": {
    path: "/customers/create",
    guards: ["auth"],
    meta: { requiresAuth: true },
  },
  "customers/edit": {
    path: "/customers/edit",
    params: { id: "string" },
    guards: ["auth"],
    meta: { requiresAuth: true },
  },
  "customers/[id]": {
    path: "/customers/:id",
    params: { id: "string" },
    guards: ["auth"],
    meta: { requiresAuth: true },
  },
  "payments/create": {
    path: "/payments/create",
    guards: ["auth"],
    meta: { requiresAuth: true, title: "Create Payment" },
  },
  "invoices/index": {
    path: "/invoices/index",
    guards: ["auth"],
    meta: { requiresAuth: true, title: "Invoices" },
  },
  "invoices/[id]": {
    path: "/invoices/:id",
    params: { id: "string" },
    guards: ["auth"],
    meta: { requiresAuth: true },
  },
  "invoices/create": {
    path: "/invoices/create",
    guards: ["auth"],
    meta: { requiresAuth: true },
  },
  "invoices/edit": {
    path: "/invoices/edit",
    params: { id: "string" },
    guards: ["auth"],
    meta: { requiresAuth: true },
  },
  "news/index": {
    path: "/news/index",
    guards: ["auth"],
    meta: { requiresAuth: true, title: "News" },
  },
  "news/[id]": {
    path: "/news/:id",
    params: { id: "string" },
    guards: ["auth"],
    meta: { requiresAuth: true },
  },
  "notifications/index": {
    path: "/notifications/index",
    guards: ["auth"],
    meta: { requiresAuth: true },
  },
  "notifications/settings": {
    path: "/notifications/settings",
    guards: ["auth"],
    meta: { requiresAuth: true },
  },
  "reports/index": {
    path: "/reports/index",
    guards: ["auth"],
    meta: { requiresAuth: true },
  },
  "documents/index": {
    path: "/documents/index",
    guards: ["auth"],
    meta: { requiresAuth: true },
  },
  profile: {
    path: "/profile",
    guards: ["auth"],
    meta: { requiresAuth: true },
  },
  "edit-profile": {
    path: "/edit-profile",
    guards: ["auth"],
    meta: { requiresAuth: true, title: "Edit Profile" },
  },
  "change-pin": {
    path: "/change-pin",
    guards: ["auth"],
    meta: { requiresAuth: true, title: "Change PIN" },
  },
  settings: {
    path: "/settings",
    guards: ["auth"],
    meta: { requiresAuth: true },
  },
  "sms-scan": {
    path: "/sms-scan",
    guards: ["auth"],
    meta: { requiresAuth: true },
  },
  "verify-payment": {
    path: "/verify-payment",
    guards: ["auth"],
    meta: { requiresAuth: true, title: "Verify Payment" },
  },
  "verify-payment-result": {
    path: "/verify-payment-result",
    guards: ["auth"],
    meta: { requiresAuth: true, title: "Verification Result" },
  },
  company: {
    path: "/company",
    guards: ["auth"],
    meta: { requiresAuth: true, title: "Company" },
  },
  "company-details": {
    path: "/company/details",
    guards: ["auth"],
    meta: { requiresAuth: true, title: "Company details" },
  },
  "company/edit": {
    path: "/company/edit",
    guards: ["auth"],
    meta: { requiresAuth: true, title: "Edit Company" },
  },
  "team/index": {
    path: "/team",
    guards: ["auth"],
    meta: { requiresAuth: true, title: "Team" },
  },
  "team/[id]/details": {
    path: "/team/:id/details",
    params: { id: "string" },
    guards: ["auth"],
    meta: { requiresAuth: true, title: "Team Member Details" },
  },
  "team/create": {
    path: "/team/create",
    guards: ["auth"],
    meta: { requiresAuth: true, title: "Add Team Member" },
  },
  "declarations/index": {
    path: "/declarations/index",
    guards: ["auth"],
    meta: { requiresAuth: true, title: "Declarations" },
  },
  "declarations/create": {
    path: "/declarations/create",
    guards: ["auth"],
    meta: { requiresAuth: true, title: "Create Declaration" },
  },
  "declarations/scan": {
    path: "/declarations/scan",
    guards: ["auth"],
    meta: { requiresAuth: true, title: "Scan Declaration" },
  },
  "declarations/edit": {
    path: "/declarations/edit",
    params: { id: "string" },
    guards: ["auth"],
    meta: { requiresAuth: true, title: "Edit Declaration" },
  },
  "declarations/[id]": {
    path: "/declarations/:id",
    params: { id: "string" },
    guards: ["auth"],
    meta: { requiresAuth: true, title: "Declaration Details" },
  },
  // Public
  login: {
    path: "/login",
    guards: ["guest"],
    meta: { requiresAuth: false, guestOnly: true },
  },
  otp: {
    path: "/otp",
    params: { phone: "string", verificationId: "string" },
    guards: ["guest"],
    meta: { requiresAuth: false, guestOnly: true },
  },
  register: {
    path: "/register",
    guards: ["guest"],
    meta: { requiresAuth: false, guestOnly: true },
  },
  "set-pin": {
    path: "/set-pin",
    guards: ["auth"],
    meta: { requiresAuth: true },
  },
  "pin-lock": {
    path: "/pin-lock",
    guards: ["auth"],
    meta: { requiresAuth: true },
  },
  "forgot-pin": {
    path: "/forgot-pin",
    guards: ["auth"],
    meta: { requiresAuth: true },
  },
  "forgot-pin-verify": {
    path: "/forgot-pin-verify",
    params: { phone: "string", verificationId: "string" },
    guards: ["auth"],
    meta: { requiresAuth: true },
  },
});

export type AppRoutes = typeof routes;
