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

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

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(unsafeAllowAllTypePermission)
  .gqlPermission(unsafeAllowAllGqlPermission);

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

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

export const currency = db
  .type("Currency", {
    code: db.string({ optional: true }),
    isActive: db.bool({ optional: true }),
  })
  .permission(unsafeAllowAllTypePermission)
  .gqlPermission(unsafeAllowAllGqlPermission);

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