import { OrganizationStatusEnum } from '@spiffy-ai/commerce-api-client';
import { OrganizationConfig } from 'src/application/models/api/organizationConfig';
import { ColorMapping } from 'src/application/models/colorsConfig';
import { FrontendConfig } from 'src/application/models/frontendConfig';

export interface OrgConfigExperiment {
  group?: string;
  groupName?: string;
  name?: string;
  ruleId?: string;
  value?: Record<string, unknown>;
}

export interface OrgConfigFeatureGate {
  groupName?: string;
  name?: string;
  ruleId?: string;
  value?: boolean;
}

export interface Organization {
  id: string;
  displayName: string;
  domain: string;
  shortName: string;
  status: OrganizationStatusEnum;
  createdAt?: string;
  updatedAt?: string;
}

export interface OrganizationSettings {
  org: Organization;
  // this is currently not configured by the backend
  settings: Record<string, unknown>;
}

export interface OrgConfig {
  configs: OrganizationConfig[];
  experiments: OrgConfigExperiment[];
  gates: OrgConfigFeatureGate[];
  org: OrganizationSettings;
  colorsConfig?: ColorMapping;
  frontendConfig?: FrontendConfig;
}
