export enum DealStatus {
    CREATED = 0,
    AWAITING_ACCEPTANCE = 1,
    PACKAGING = 2,
    AWAITING_SHIPMENT = 3,
    AWAITING_PAYMENT = 4,
    COMPLETED = 5,
    CANCELLED = 6,
}

export const getDealStatusByName = (name: string): DealStatus => {
    return DealStatus[name as keyof typeof DealStatus];
}
export const DealStatusDictionary = {
    [DealStatus.CREATED]: "Создан",
    [DealStatus.AWAITING_ACCEPTANCE]: "Ожидает приемки",
    [DealStatus.PACKAGING]: "Упаковка",
    [DealStatus.AWAITING_SHIPMENT]: "Ожидает отгрузки",
    [DealStatus.AWAITING_PAYMENT]: "Ожидает оплаты",
    [DealStatus.COMPLETED]: "Завершена",
    [DealStatus.CANCELLED]: "Отменена",
}
export type DealStatusType = {
    id: number,
    name: string
}
export const DealStatuses: DealStatusType[] = Object.entries(DealStatusDictionary).map(([key, value]) => {
    return {id: parseInt(key), name: value}
});