Files
tehran_taj/apps/api/src/modules/admin-orders/update-status.dto.ts
T

27 lines
722 B
TypeScript

import { IsBoolean, IsEnum, IsOptional, IsString } from 'class-validator';
import { OrderStatus } from '@prisma/client';
/**
* Body of legacy `POST single/order-sts/edit`.
*
* Legacy posted the whole timeline row back, so it carried `status`, an optional
* `note`, and `remove: true` when the operator was deleting a status instead of
* setting one. The order id travelled on the row as `order_id`/`orderId`.
*/
export class UpdateOrderStatusDto {
@IsString()
orderId!: string;
@IsEnum(OrderStatus)
status!: OrderStatus;
@IsOptional()
@IsString()
note?: string;
/** legacy: row.remove = true -> delete this status event rather than add one */
@IsOptional()
@IsBoolean()
remove?: boolean;
}