// 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 site = db
  .type("Site", {
    companyId: db.uuid({ optional: true }),
    status: db.string({ optional: true }),
  })
  .permission(defaultPermission)
  .gqlPermission(defaultGqlPermission);

export const businessPartner = db
  .type("BusinessPartner", {
    companyId: db.uuid({ optional: true }),
    status: db.string({ optional: true }),
    name: db.string({ optional: true }),
  })
  .permission(defaultPermission)
  .gqlPermission(defaultGqlPermission);

export const partnerRole = db
  .type("PartnerRole", {
    partnerId: db.uuid({ optional: true }),
    role: db.string({ optional: true }),
  })
  .permission(defaultPermission)
  .gqlPermission(defaultGqlPermission);

export const item = db
  .type("Item", {
    companyId: db.uuid({ optional: true }),
    unitId: db.uuid({ optional: true }),
    status: db.string({ optional: true }),
    name: db.string({ optional: true }),
    sku: 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 unit = db
  .type("Unit", {
    categoryId: db.uuid({ optional: true }),
    symbol: db.string({ optional: true }),
    status: db.enum(["ACTIVE", "INACTIVE"] as const, { optional: true }),
  })
  .permission(defaultPermission)
  .gqlPermission(defaultGqlPermission);
