import ISummary from '@/core/models/summary';

export interface IPermissionRawResponse {
  poses?: IPosPermissionResponse[];
  complexes?: IComplexPermissionResponse[];
  business_activities?: ICommonPermissionResponse[];
  // Backend currently returns this key in camelCase for non-operator roles.
  businessActivities?: ICommonPermissionResponse[];
}
export interface IPermissionResponse extends IPermissionRawResponse {}

export interface IPermissionRequest {
  poses?: string[];
  complexes?: string[];
  business_activities?: string[];
}

interface ICommonPermissionResponse {
  id: string;
  name: string;
  hasAccess: boolean;
  role?: string | null;
}

interface IComplexPermissionResponse extends ICommonPermissionResponse {
  business_activity: ISummary;
}

interface IPosPermissionResponse extends ICommonPermissionResponse {
  complex: Complex;
}

interface Complex extends ISummary {
  business_activity: ISummary;
}
