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

export const getDealStatusByName = (name: string): DealStatus => {
    return DealStatus[name as keyof typeof DealStatus];
};
export const DealStatusDictionary = {
    [DealStatus.CREATED]: "Создан",
    [DealStatus.AWAITING_ACCEPTANCE]: "Ожидает приемки",
    [DealStatus.READY_FOR_WORK]: "Готов к работе",
    [DealStatus.PACKAGING]: "Упаковка",
    [DealStatus.AWAITING_SHIPMENT]: "Ожидает отгрузки",
    [DealStatus.IN_DELIVERY]: "В доставке",
    [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 };
});
