Mejor gestion de errores para los order

This commit is contained in:
2026-03-26 12:21:28 +01:00
parent a95655a2a6
commit 9d63d23754
5 changed files with 105 additions and 28 deletions

View File

@@ -62,11 +62,14 @@ export type CreateOrderDTO = Pick<
'correlation_id' | 'exchange' | 'routing_key' | 'order_type' | 'payload' | 'webhook_host' | 'webhook_endpoint'
>;
export type UpdateOrderDTO =
type IdOrCorrelationID =
(
{ id: number, correlation_id?: never } |
{ id?: never, correlation_id: string }
)
export type UpdateOrderDTO =
IdOrCorrelationID
&
{
new_status: OrderStatus,
@@ -74,12 +77,20 @@ export type UpdateOrderDTO =
}
export type FinishOrderDTO =
(
{ id: number, correlation_id?: never } |
{ id?: never, correlation_id: string }
)
IdOrCorrelationID
&
{
reason?: string
}
export type ErrorOrderDTO =
IdOrCorrelationID
&
{
status: "failed" | "dlx",
reason: string,
error?: string,
stackTrace?: string
}