All files / app/src/entities/accounting-object-import/lib types.ts

100% Statements 16/16
100% Branches 4/4
100% Functions 0/0
100% Lines 16/16

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 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153                                                                                                                                                                                                      1x 1x 1x 1x     1x 1x 1x   1x 1x 1x 1x 1x 1x 1x     1x 1x                                                                  
import { AccountObjectType, AccountingType, AffiliationType } from '@/entities/accounting-object'
import { WareHouseContract } from '@/entities/warehouse-contract'
import { Currency } from '@/entities/currency'
import { BaseEntity, FileModelWithPrivate, HydraError, Nullable } from '@/shared/@types'
import { Batch } from '@/entities/batch'
import { FileModel } from '@tmk/ui-kit'
import {
  NomenclatureConnection,
  NomenclatureDiameter,
  NomenclatureSide,
  NomenclatureStrengthGroup,
  NomenclatureManufacturer,
} from '@/entities/nomenclature'
import { Document } from '@/entities/documents'
import { ManufacturerCompany } from '@/entities/manufacturer-company'
import { PreservationLubricant } from '@/entities/preservation-lubricant'
import { LockPriceEnum, MuftFask, MuftType } from '@/entities/pipe'
 
export interface AccountingObjectImport extends BaseEntity {
  accountingType: AccountingType
  accountingObjectType: AccountObjectType
  contract?: WareHouseContract
  pricePerItem?: number
  currency?: Currency
  batch?: Batch
  connection?: NomenclatureConnection
  diameter?: NomenclatureDiameter
  side?: NomenclatureSide
  strengthGroup?: NomenclatureStrengthGroup
  makeUpLengthLoss?: number
  manufacturer?: Manufacturer
  affiliation?: AffiliationType
  links?: Link[]
  documents?: FileModel[]
  file: FileModel
  initiator?: string
}
 
export interface Import extends BaseEntity {
  status?: ImportStatusEnum
  date?: string
  objectType?: AccountObjectType
  accountingType?: Nullable<AccountingType>
  accountingObjectType?: Nullable<AccountObjectType>
  successCount?: number
  errorCount?: number
  file?: FileModel
  initiator?: Nullable<string>
  connection?: Nullable<NomenclatureConnection>
  diameter?: Nullable<NomenclatureDiameter>
  side?: Nullable<NomenclatureSide>
  strengthGroup?: Nullable<NomenclatureStrengthGroup>
  manufacturer?: Nullable<NomenclatureManufacturer>
}
 
export interface ImportSingle extends Import {
  warehouseContract?: WareHouseContract
  price?: Nullable<number>
  contract?: Nullable<WareHouseContract>
  makeUpLengthLoss: Nullable<number>
  makeUpLengthLossNotation: Nullable<MakeUpLengthLossNotationEnum>
  affiliation: Nullable<string>
  batch?: Nullable<Batch>
  links?: Link[]
  documents?: (Document | FileModelWithPrivate)[]
  packageLabelType: Nullable<LabelTypeEnum>
  pipeLabelType: Nullable<LabelTypeEnum>
  violation?: XlsxError[]
  manufacturerCompany?: ManufacturerCompany
  preservationLubricant?: PreservationLubricant
  dateApplication?: string
  muftType?: Nullable<MuftType>
  muftFask?: Nullable<ImportFask>
  muftOuterDiameter?: Nullable<number>
  preservationLubricantDate?: string
 
  //Цена за Штуку
  priceItem?: Nullable<number>
  //Цена за Метр
  priceMeter?: Nullable<number>
  //Цена за Тонну
  priceTon?: Nullable<number>
  //Основная цена
  lockPrice?: Nullable<LockPriceEnum>
  priceCurrency?: Nullable<Currency>
}
 
export interface Initiator {
  '@id': string
  displayName: string
}
 
type ImportFask = MuftFask | 'none'
 
export interface Link extends BaseEntity {
  name: string
  link: string
}
 
export enum ImportStatusEnum {
  SUCCESS = 'success',
  ERROR = 'error',
  WAIT_IMPORT = 'waiting-import',
}
 
export enum MakeUpLengthLossNotationEnum {
  ММ = 'мм',
  M = 'm',
}
export enum LabelTypeEnum {
  RFID = 'rfid',
  NFC = 'nfc',
  QR = 'qr',
  DATAMATRIX = 'data-matrix',
  BARCODE = 'barcode',
  DPM = 'dpm',
}
 
export enum PackageLabelTypeEnum {
  RFID = 'rfid',
}
 
export interface XlsxError {
  propertyPath: string
  message: string
  payload: {
    xlsxErrorGroup: string
    File?: string
  }
}
export interface ErrorItem {
  message: string
  paths: string[]
}
export interface GroupedError {
  xlsxErrorGroup: string
  errors: ErrorItem[]
}
 
export interface HydraErrorWithImportErrors extends HydraError {
  violations?: XlsxError[]
}
 
export interface Manufacturer extends BaseEntity {
  manufacturerCompany?: NomenclatureManufacturer
}
 
export interface OperationDeleteImport {
  id?: string
  accountingObjectImport?: string
  accountingObjects?: string[]
}