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

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

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

export const partnerIdentification = db
  .type("PartnerIdentification", {
    partnerId: db.uuid({ optional: true }),
    type: db.string({ optional: true }),
    value: db.string({ optional: true }),
    validFrom: db.date({ optional: true }),
    validTo: db.date({ optional: true }),
  })
  .permission(unsafeAllowAllTypePermission)
  .gqlPermission(unsafeAllowAllGqlPermission);

export const item = db
  .type("Item", {
    unitId: db.uuid({ optional: true }),
    status: db.string({ optional: true }),
    name: db.string({ optional: true }),
    sku: 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 unit = db
  .type("Unit", {
    categoryId: db.uuid({ optional: true }),
    symbol: db.string({ optional: true }),
    isActive: db.bool({ optional: true }),
  })
  .permission(unsafeAllowAllTypePermission)
  .gqlPermission(unsafeAllowAllGqlPermission);
