import { IResilientEntity } from 'app/resilient/resilient-base/resilient-base.model';

import { IVariable } from 'app/entities/variable/variable.model';
import { IPeriod } from 'app/entities/period/period.model';
import { IPeriodVersion } from 'app/entities/period-version/period-version.model';
import { IUnit } from 'app/entities/unit/unit.model';
import { IOrganization } from 'app/entities/organization/organization.model';

export interface IOutputData extends IResilientEntity {
  value?: number | null;
  variable?: Pick<IVariable, 'id' | 'name' | 'code'> | null;
  period?: Pick<IPeriod, 'id' | 'name'> | null;
  periodVersion?: Pick<IPeriodVersion, 'id' | 'name'> | null;
  baseUnit?: Pick<IUnit, 'id' | 'name' | 'symbol'> | null;
  owner?: Pick<IOrganization, 'id' | 'name'> | null;
}

export type NewOutputData = Omit<IOutputData, 'id'> & { id: null };

export type SearchOutputData = Omit<
								IOutputData, 
								// Remove unwanted properties for search
								'id' | 'variable' | 'period' | 'periodVersion' | 'baseUnit' | 'owner'>  
								&
								// Add specific properties for search
								{ 
									id?: number | null;
									variableId?: number | null;
									variableNameOrCode?: string | null;
									periodId?: number | null;
                  periodVersionId?: number | null;
									ownerId?: number | null;
                  variableScopeId?: number | null;
                  variableCategoryId?: number | null;
								};
