// Stub types for cross-module dependencies — used only for codegen.
// At runtime, actual types are injected via defineModule() params.
import { db } from "@tailor-platform/sdk";
import { defaultGqlPermission, defaultPermission } from "../../../shared/modelPermissions";

export const company = db
  .type("Company", {
    status: db.string({ optional: true }),
  })
  .permission(defaultPermission)
  .gqlPermission(defaultGqlPermission);

export const account = db
  .type("Account", {
    code: db.string({ optional: true }),
    name: db.string({ optional: true }),
    classification: db.string({ optional: true }),
    status: db.string({ optional: true }),
    successorAccountId: db.uuid({ optional: true }),
  })
  .permission(defaultPermission)
  .gqlPermission(defaultGqlPermission);

export const accountGroup = db
  .type("AccountGroup", {
    name: db.string({ optional: true }),
    code: db.string({ optional: true }),
  })
  .permission(defaultPermission)
  .gqlPermission(defaultGqlPermission);

export const chartOfAccounts = db
  .type(["ChartOfAccounts", "ChartsOfAccounts"], {
    companyId: db.uuid({ optional: true }),
    status: db.string({ optional: true }),
  })
  .permission(defaultPermission)
  .gqlPermission(defaultGqlPermission);

export const currency = db
  .type("Currency", {
    code: db.string({ optional: true }),
    status: db.enum(["ACTIVE", "INACTIVE"] as const, { optional: true }),
  })
  .permission(defaultPermission)
  .gqlPermission(defaultGqlPermission);

export const user = db
  .type("User", {
    status: db.string({ optional: true }),
  })
  .permission(defaultPermission)
  .gqlPermission(defaultGqlPermission);
