All files / app/src/features/measure/lib get-measure-characteristic-fields.ts

4.08% Statements 2/49
100% Branches 0/0
0% Functions 0/1
4.08% Lines 2/49

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 521x     1x                                                                                                
import { TFunction } from '@/shared/@types'
import { displayPriceValues, MeasureFilterAtomType, normalizeMultipleFilterValue } from '@/features/measure'
 
export const getMeasureCharacteristicFields = (t: TFunction, data?: MeasureFilterAtomType) => {
  return [
    {
      value: data?.client?.value,
      label: t('accounting-object:Client'),
    },
    {
      value: data?.contract?.value,
      label: t('accounting-object:Contract'),
    },
    {
      value: data?.warehouse?.value,
      label: t('accounting-object:Warehouse'),
    },
    {
      value: data?.batch?.value,
      label: t('accounting-object:Lot'),
    },
    {
      value: normalizeMultipleFilterValue(data?.status?.value),
      label: t('accounting-object:Status'),
    },
    {
      value: normalizeMultipleFilterValue(data?.state?.value),
      label: t('accounting-object:State'),
    },
    {
      value: data?.inPackage ? t('In Package') : t('Not in package'),
      label: t('In Package or Not in package'),
    },
    {
      value: normalizeMultipleFilterValue(data?.manufacturer?.value),
      label: t('accounting-object:Manufacturer'),
    },
    {
      value: normalizeMultipleFilterValue(data?.rack?.value),
      label: t('accounting-object:Rack'),
    },
    {
      value: normalizeMultipleFilterValue(data?.row?.value),
      label: t('accounting-object:Row'),
    },
    {
      value: displayPriceValues(t, data?.price?.value || []),
      label: t('Price without VAT per piece'),
    },
  ]
}