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

import { IVariable } from 'app/entities/variable/variable.model';
import { IVariableCategory } from 'app/entities/variable-category/variable-category.model';
import { IVariableScope } from 'app/entities/variable-scope/variable-scope.model';
import { IPeriod } from 'app/entities/period/period.model';
import { IUnit } from 'app/entities/unit/unit.model';
import { IOrganization } from 'app/entities/organization/organization.model';

import { DataSourceType } from 'app/entities/enumerations/data-source-type.model';

export interface IInventory extends IResilientEntity {
  unit?: Pick<IUnit, 'id' | 'symbol'> | null;
  owner?: Pick<IOrganization, 'id' | 'name'> | null;
  variableClassCode?: string | null;
  variableClassName?: string | null;
  variable?: Pick<IVariable, 'id' | 'name'> | null;
  period?: Pick<IPeriod, 'id' | 'name'> | null;
  value?: number | null;
  stringValue?: string | null;
}

export type NewInventory = Omit<IInventory, 'id'> & { id: null };

export type SearchInventory = Omit<
								IInventory, 
								// Remove unwanted properties for search
								'id' | 'variable' | 'period' | 'owner'>  
								&
								// Add specific properties for search
								{ 
									id?: number | null;
									variableId?: number | null;
									variableNameOrCode?: string | null;
									periodId?: number | null;
									ownerId?: number | null;
                  categoryId?: number | null;
                  scopeId?: number | null;
								};
