Files
salvato.newfreeplanet/src/model/Products.ts
2024-01-30 14:00:48 +01:00

280 lines
5.3 KiB
TypeScript
Executable File

import { IUserFields, IUserShort } from './UserStore'
export interface IProductInfo {
_id?: any
code?: string,
name?: string,
description?: string,
department?: string,
idCatProds?: string[],
idSubCatProds?: string[],
catprods?: ICatProd[],
subcatprods?: ISubCatProd[],
color?: string,
size?: string,
weight?: number,
unit: number,
stars?: number,
date?: Date,
icon?: string,
img?: string
ingredienti?: string,
valori_nutrizionali?: string,
}
export interface IProduct {
_id?: any
active?: boolean
idProductInfo?: string,
productInfo: IProductInfo,
idProducer?: string,
idProvider?: string,
idStorehouses?: string[],
idGasordine?: string,
idScontisticas?: string[],
scontisticas: IScontistica[],
producer?: IProducer,
storehouses: IStorehouse[],
gasordine: IGasordine | null,
provider?: IProvider,
price: number,
after_price?: string,
quantityAvailable?: number,
bookableAvailableQty?: number,
QuantitaOrdinateInAttesa?: number,
QuantitaPrenotateInAttesa?: number,
note?: string
stockQty: number, // UPDATING
stockBloccatiQty: number, // UPDATING
bookedQtyOrdered: number // UPDATING
bookedQtyConfirmed: number // UPDATING
qtyToReachForGas: number
maxbookableGASQty: number
bookedGASQtyOrdered: number // UPDATING
bookedGASQtyConfirmed: number // UPDATING
bookableGASBloccatiQty: number // UPDATING
minBuyQty: number
minStepQty: number
maxBookableSinglePersQty: number
canBeShipped?: boolean
canBeBuyOnline?: boolean
}
export interface IBaseOrder {
order: IOrder
}
export interface IOrder {
_id?: any
idapp?: string
userId?: string
status?: number
idProduct?: string
idStorehouse?: string
idGasordine?: string
TotalPriceProduct: number
TotalPriceProductCalc: number
price: number
after_price?: string
quantity: number
quantitypreordered: number
product?: IProduct
storehouse?: IStorehouse
gasordine?: IGasordine
date_created?: Date
date_checkout?: Date
date_payment?: Date
date_shipping?: Date
date_delivered?: Date
notes?: string
modify_at?: Date
}
export interface IProductsState {
products: IProduct[]
cart: ICart
orders: IOrderCart[]
catprods: ICatProd[]
catprods_gas: ICatProd[]
subcatprods: ISubCatProd[]
productInfos: IProductInfo[]
userActive: IUserShort
}
export interface IProducer {
_id?: any
idapp?: string
name?: string,
description?: string,
referent?: string,
username?: string,
region?: string,
city?: string,
img?: string,
website?: string,
}
export interface IDepartment {
_id?: any
idapp?: string
name?: string,
username?: string,
}
export interface ICategory {
_id?: any
name: string,
img?: string,
}
export interface ICatProd {
_id?: any
name: string,
img?: string,
icon?: string,
color?: string,
}
export interface ICatAI {
_id?: any
name: string,
img?: string,
icon?: string,
color?: string,
}
export interface IQueryAI {
_id?: any
name: string,
img?: string,
icon?: string,
color?: string,
}
export interface ISubCatProd {
_id?: any
idCatProd: string
name: string
img?: string
icon?: string
color?: string
}
export interface IStorehouse {
_id?: any
idapp?: string
name?: string,
username?: string,
groupname?: string,
description?: string,
referent?: string,
address?: string,
city?: string,
region?: string,
img?: string,
website?: string,
email_html_header?: string,
email_html_footer?: string,
email_html_makeorder?: string,
email_html_GAS_makeorder?: string,
email_html_order_confirmed?: string,
email_html_GAS_order_confirmed?: string,
email_html_order_consegnato?: string,
email_html_GAS_order_consegnato?: string,
}
export interface IProvider {
_id?: any
idapp?: string
name?: string,
description?: string,
referent?: string,
address?: string,
city?: string,
region?: string,
img?: string,
website?: string,
}
export interface IGasordine {
_id?: any
idapp?: string
active: boolean
name?: string,
description?: string,
referent?: string,
city?: string,
img?: string,
dataora_chiusura_ordini?: Date,
data_arrivo_merce?: Date,
dataora_ritiro?: Date,
}
export interface IScontistica {
_id?: any
idapp?: string
code?: string,
description?: string,
qta: number,
perc_sconto: number,
price: number,
comulativo: boolean,
}
export interface ICart {
_id?: any
idapp?: string
userId?: string
totalQty?: number
totalPrice?: number
totalPriceCalc?: number
department?: string
items?: IBaseOrder[]
note?: string
modify_at?: Date
}
export interface IOrderCart {
_id?: any
idapp?: string
numorder: number
numord_pers: number
userId: string
user: IUserFields | null,
totalQty: number
totalPrice: number
totalPriceCalc: number
department?: string
items?: IBaseOrder[]
nameSurname?: string
status: number
modify_at?: Date
confermato: boolean
date_confermato?: Date
consegnato: boolean
date_consegnato?: Date
pagato: boolean
date_pagato?: Date
spedito: boolean
date_spedito?: Date
ricevuto: boolean
date_ricevuto?: Date
created_at?: Date
note: string
note_per_gestore: string
note_per_admin: string
}
export interface IShareWithUs {
_id?: any
idapp?: string
userId?: string
description: string
numshared?: number
rating?: number
}