import { PreventiveWorkOrdersActive } from "../preventive-work-orders-active.interface";
import { SliderData } from "../slider.interface";
import { DispatchData } from "./dispatch.interface";
import { PurchasePurpose } from "./purchase-purpose.interface";


export interface ObjectRequestLine {
  USER: string;
  LINE: string;
  PRODUCTS: any;
  PURPOSE: PurchasePurpose;
}

export interface ResponseRequestLines{
  error: boolean;
  msg: string;
  response: Array<RequestLines>;
}

export interface ResponseDataRequestLines{
  error: boolean;
  msg: string;
  response: RequestLines;
}

export interface RequestLines {
  LINE_IDLI: number;
  LINE_NUPR: string;
  PROV_NOCO: string;
  LINE_NUOR?: string;
  LINE_ESTA: string;
  LINE_USRE: string;
  LINE_FERE: string;
  LINE_USMO?: string;
  LINE_FEMO?: string;
  SELECTED: Array<DetailsProduct>;
}

export interface DetailsProduct {
  ARSE_IDAS: string;
  ARSE_IDAR: number;
  ARSE_NUPR: string;
  ARSE_IDIN: number;
  ARSE_CANT: number;
  ARSE_PRTO: number;
  ARSE_ESTA: string;
  ARSE_USRE: string;
  ARSE_FERE: string;
  ARSE_USMO?: string;
  ARSE_FEMO?: string;
  INAR_IDIN: number;
  INAR_CODI: string;
  INAR_MODE: string;
  CAMO_COMO: string;
  CAMO_DESC: string;
  INAR_PREC: number;
  INAR_MOMI: number;
  INAR_CARA: string;
  DEAR_IDDE: number;
  DEAR_IMAG: Array<string>;
  DEAR_DESC: string;
  DEAR_CARA?: string;
  DEAR_COWE: number;
  ARTI_IDAR: number;
  ARTI_CODI: string;
  ARTI_NOMB: string;
  FAMI_IDFA: number;
  FAMI_NOMB: string;
  SUBF_IDSU: number;
  SUBF_NOMB: string;
  UNID_IDUN: number;
  UNID_NOMB: string;
  UNID_ACRO?: string;
  CARR_IMAG: Array<SliderData>;
}

export interface ObjectDeleteArtitleByRequestLine {
  USER: string;
  LINE_NUMBER: string;
  ID_SELECTED: string;
  REQUEST_LINE: string;
}

export interface ObjectGetRequest {
  line: string;
  user: string;
  idRequestLine: string;
}

export interface DataProducts {
  NUMERO_ARTI_SELE: string;
  NUMERO_ARTICULO: string;
  NUMERO_PRODUCTO: string;
  MODELO: string;
  CODIGO: string;
  CARACTERISTICAS: string;
  CANTIDAD: string;
  PRECIO_UNITARIO: string;
  PRECIO_TOTAL: string;
  ESTADO: string;
  USUARIO_REGISTRA: string;
  FECHA_REGISTRA: string;
  USUARIO_MODIFICA: string;
  FECHA_MODIFICA: string;
}
export interface ResponseData{
  error: string;
  msg: string;
  response: RequestLines
}

export interface DialogDataGroup {
  dispatch: Array<DispatchData>;
  dataConfig: GroupRequestLine;
  preventiveMaintenance: Array<PreventiveWorkOrdersActive>;
}

export interface GroupRequestLine {
  NUMERO_PROVEEDOR: string;
  PROVEEDOR: string;
  PRECIO_TOTAL: number;
  MONEDA: string;
  FECHA_REGISTRA: string;
  FECHA_MODIFICA: string;
  USUARIO_REGISTRA: string;
  USUARIO_MODIFICA: string;
  DESPACHO: string;
  METODO_PAGO: string;
  // PROPOSITO: string;
  PRODUCTOS: Array<DetailsProduct>;
  // ACTIVIDAD: string;
  PROYECTO: string;
}

export interface OrderDataRequest {
  NUMERO_PROVEEDOR: string;
  PROVEEDOR: string;
  PRECIO_TOTAL: number;
  MONEDA: string;
  DESPACHO: string;
}

export interface ResponseDataOrder {
  error: boolean;
  msg: string;
  response: Array<GetOrderData>;
}

export interface GetOrderData {
  ORCO_NUOR: string;
  PROV_NUPR: string;
  PROV_NOCO: string;
  DESP_NUDE: string;
  DESP_NOMB: string;
  LINE_IDLI: string;
  LINE_DESC: string;
  LINE_IDME: string;
  MEPA_NOMB: string;
  ORCO_COST: string;
  ORCO_MONE: string;
  ORCO_PROP: string;
  ORCO_ACTI: string;
  ORCO_PROY: string;
  ORCO_ESTA: string;
  ORCO_USRE: string;
  ORCO_FERE: string;
  ORCO_USMO: string;
  ORCO_FEMO: string;
}

export interface ResponseDataOrderDetails {
  error: boolean;
  msg: string;
  response: GetOrderDetails;
}

export interface GetOrderDetails {
  ORCO_NUOR: string;
  ORCO_ESTA: string;
  ORCO_USRE: string;
  ORCO_FERE: string;
  ORCO_USMO?: string;
  ORCO_FEMO?: string;
  ORCO_FEAR: string;
  LINE_IDLI: number;
  LINE_OTPR?: number;
  LINE_OTCO?: number;
  DESP_IDDE: number;
  DESP_NODE: string;
  DESP_NOMB: string;
  DESP_APPA: string;
  DESP_APMA: string;
  DESP_LADA: string;
  DESP_TELE: number;
  DESP_CORR: string;
  DESP_CALL: string;
  DESP_NUEX: string;
  DESP_NUIN?: string;
  DESP_COPO: string;
  DESP_LOCA: string;
  DESP_COLO: string;
  DESP_MUNI: string;
  DESP_ENTI: string;
  DESP_PAIS: string;
  DESP_COME?: string;
  PROV_NUPR: string;
  PROV_NOCO: string;
  PROV_NOMB: string;
  PROV_APPA: string;
  PROV_APMA: string;
  PROV_CORR: string;
  PROV_LAD1: string;
  PROV_TEL1: string;
  PROV_LAD2?: string;
  PROV_TEL2?: string;
  PROV_XRFC?: string;
  PROV_XTAX?: string;
  PROV_CRFI: string;
  PROV_TIPO: string;
  PROV_TICO: string;
  PROV_SIWE: string;
  PROV_MEPA: string;
  PROV_CALL: string;
  PROV_NUEX: string;
  PROV_NUIN?: string;
  PROV_COPO: string;
  PROV_COLO: string;
  PROV_MUNI: string;
  PROV_LOCA: string;
  PROV_ENTI: string;
  PROV_PAIS: string;
  ARTI:Array<ArtitleDetailsOrder>;
  HIST:Array<HistoryOrder>;
}

export interface ResponseDataArtitleByRequest {
  error: boolean;
  msg: string;
  response: Array<ArtitleDetailsOrder>;
}

export interface ArtitleDetailsOrder {
  ARSE_IDAS: string;
  ARSE_CANT: number;
  ARSE_PRTO: number;
  ARSE_NUPR: string;
  FAMI_NULI: number;
  FAMI_NOMB: string;
  SUBF_IDSU: number;
  SUBF_NOMB: string;
  ARTI_IDAR: number;
  ARTI_CODI: string;
  ARTI_NOMB: string;
  DEAR_IDDE: number;
  DEAR_IMAG: Array<string>;
  DEAR_DESC: string;
  DEAR_CARA?: string;
  DEAR_COWE: number;
  INAR_IDIN: number;
  INAR_CODI: string;
  INAR_MODE: string;
  INAR_COMO: string;
  INAR_PREC: number;
  INAR_MOMI: number;
  INAR_CARA: string;
  UNID_IDUN: number;
  UNID_NOMB: string;
  UNID_ACRO?: string;
}

export interface ResponseDataHistoryOrder {
  error: boolean;
  msg: string;
  response: Array<HistoryOrder>;
}
export interface ResponseDataLastState {
  error: boolean;
  msg: string;
  response: HistoryOrder;
}

export interface HistoryOrder{
  HIOR_IDHO: number,
  HIOR_ESOR: string,
  HIOR_DESC: string;
  HIOR_EVID: Array<string>;
  HIOR_POEN: number,
  HIOR_USRE: string;
  HIOR_FERE: string;
  HIOR_USMO?: string;
  HIOR_FEMO?: string;

}

export interface RequestOrder { 
  NUMERO_LINEA: string;
  NUMERO_SOLICITUD: string;
  DESPACHO: string;
  USUARIO: string;
}
