ываыв
This commit is contained in:
@@ -7,6 +7,8 @@ export async function registerAdminOrderRoutes(fastify) {
|
||||
const attentionCount = await prisma.order.count({
|
||||
where: {
|
||||
status: 'PENDING_PAYMENT',
|
||||
deliveryType: 'delivery',
|
||||
deliveryFeeLocked: false,
|
||||
},
|
||||
})
|
||||
return { attentionCount }
|
||||
@@ -97,6 +99,11 @@ export async function registerAdminOrderRoutes(fastify) {
|
||||
error: `Нельзя сменить статус ${existing.status} → ${next}`,
|
||||
})
|
||||
}
|
||||
if (next === 'PAID' && existing.deliveryType === 'delivery' && existing.deliveryFeeLocked === false) {
|
||||
return reply.code(409).send({
|
||||
error: 'Сначала подтвердите итоговую стоимость доставки',
|
||||
})
|
||||
}
|
||||
|
||||
const updated = await prisma.order.update({
|
||||
where: { id },
|
||||
|
||||
Reference in New Issue
Block a user