-
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cancelar tickets no pagados en cron de sync de pagos #272
Conversation
New and removed dependencies detected. Learn more about Socket for GitHub ↗︎
|
@@ -21,7 +21,7 @@ const googleMediaType = { | |||
}, | |||
}; | |||
|
|||
describe("Test email library", () => { | |||
describe("Test email library on Google Import", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Se renombraron nombres de tests repetidos
@@ -674,5 +675,19 @@ export const clearExpiredPurchaseOrders = async ({ | |||
) | |||
.returning(); | |||
|
|||
if (expiredOrders.length > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Los tickets asociados a las ordenes expiradas deben ser cancelados para poder liberar ese stock
@@ -40,6 +40,7 @@ export const scheduled: ExportedHandlerScheduledHandler<ENV> = async ( | |||
const getUnpaidPurchaseOrders = await DB.query.purchaseOrdersSchema.findMany({ | |||
where: (po, { eq, and, isNotNull }) => | |||
and( | |||
eq(po.status, "open"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Solo necesitamos las ordenes que esten "open".
Las "complete" o "expired" no nos deberían interesar
Coverage Report
File Coverage
|
Este PR realiza las siguientes mejoras y correcciones:
Cancela los tickets asociados a órdenes de compra expiradas en el cron de sincronización de pagos:
clearExpiredPurchaseOrders
para cancelar los tickets vinculados a órdenes expiradas.scheduled.test.ts
para verificar que los tickets se cancelen correctamente.Mejora la sincronización de pagos: