All files / app/src/entities/change-log/lib types.ts

100% Statements 28/28
100% Branches 2/2
100% Functions 0/0
100% Lines 28/28

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                                                                                                                      1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x                     1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x    
import { Link } from '@/entities/accounting-object-import'
import { Pipe } from '@/entities/pipe'
import { BaseEntity } from '@/shared/@types'
import { FileModel } from '@tmk/ui-kit'
import { AcceptanceTransport } from '@/entities/accounting-object'
 
export interface Initiator extends BaseEntity {
  id: string
  name: string
  role: string
}
 
export interface Operation extends BaseEntity {
  operationType: string
  operationName: string
  dateUpdate: string
}
 
export interface NewValue extends BaseEntity {
  id: string
  status?: string
  field?: string
  role?: string
  bush?: number
  well?: number
  manufacturer?: string
  ownership?: string
  transport?: AcceptanceTransport[]
  description?: string
  dateOfInspiration?: string
  files?: FileModel[]
  links?: Link[]
}
 
export interface ChangeLogValues extends BaseEntity {
  id: string
  status?: string
  manufacturer?: string
  ownership?: string
  files?: FileModel[]
  links?: Link[]
}
 
export interface ChangeLogItem extends BaseEntity {
  id: string
  operation: Operation
  dateUpdate: string
  initiator: Initiator
  newValue: NewValue
  oldValue?: Pipe
  action: ChangeLogOperationEnum
  loggedAt: string
  objectId: string
  objectClass: string
  version: 1
  data: Pipe
  lastData: Pipe
}
 
export enum ChangeLogStatusEnum {
  SUCCESS = 'success',
  ARCHIVE = 'archive',
  IMPLEMENTED = 'implemented',
  WAITING = 'waiting',
  DEFECT = 'defect',
  NEW = 'new',
  RESTORED = 'restored',
  RECEIVED = 'received',
  UPDATE = 'update',
  USED = 'used',
  RETURN_TO_OWNER = 'returned_to_owner',
}
 
export interface InitialPipe {
  data: InitialPipeData
  id: string
}
export interface InitialPipeData {
  //documents?:string[]
  links?: Link[]
}
export enum ChangeLogOperationEnum {
  ACTION_PIPE_MASS_EDIT = 'pipe_mass_edit',
  ACTION_OPERATION_MOVEMENT = 'operation_movement',
  ACTION_OPERATION_ACCEPTANCE = 'operation_acceptance',
  ACTION_OPERATION_SHIPMENT = 'operation_shipment',
  ACTION_CREATE = 'create',
  ACTION_UPDATE = 'update',
  ACTIONE_OPERATION_INSPECTION = 'operation_inspection',
  ACTION_REALIZATION = 'operation_sale',
  ACTION_RETURN_TO_OWNER = 'operation_return_to_owner',
  ACTION_RETURN_TO_WAREHOUSE = 'operation_return_to_warehouse',
  ACTION_UNPACK_PACKAGE = 'operation_unpack_package',
  ACTION_PACK_PACKAGE = 'operation_pack_package',
  ACTION_ARCHIVE = 'operation_archive',
  ACTION_REPAIR = 'operation_repair',
  ACTION_REJECTION = 'operation_reject',
}