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

import { IUnit } from 'app/entities/unit/unit.model';

export interface IUnitConverter extends IResilientEntity {
  name?: string | null;
  description?: string | null;
  convertionFormula?: string | null;
  fromUnit?: Pick<IUnit, 'id' | 'name' | 'unitType'> | null;
  toUnit?: Pick<IUnit, 'id' | 'name' | 'unitType'> | null;
}

export type NewUnitConverter = Omit<IUnitConverter, 'id'> & { id: null };

export type SearchUnitConverter = Omit<
								IUnitConverter, 
								// Remove unwanted properties for search
								'id' | 'convertionFormula' | 'fromUnit' | 'toUnit' | 'version'>  
								&
								// Add specific properties for search
								{ 
									id?: number | null;
									name?: string | null;
									description?: string | null;
									fromUnitId?: number | null;
									toUnitId?: number | null;
								};
