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

import { IUnitType } from 'app/entities/unit-type/unit-type.model';

export interface IUnit extends IResilientEntity {
  code?: string | null;
  symbol?: string | null;
  name?: string | null;
  description?: string | null;
  convertionRate?: number | null;
  unitType?: Pick<IUnitType, 'id' | 'name'> | null;
}

export type NewUnit = Omit<IUnit, 'id'> & { id: null };

export type SearchUnit = Omit<
								IUnit, 
								// Remove unwanted properties for search
								'id' | 'convertionRate' | 'unitType'>  
								&
								// Add specific properties for search
                {
                  id?: number | null;
                  unitTypeId?: number | null;
                }
