From 78868a8c3c49a57b1aafcaf802aa52cd6716d632 Mon Sep 17 00:00:00 2001 From: Jessica McInchak Date: Wed, 31 Jan 2024 11:13:36 +0100 Subject: [PATCH] update conditions for sessions ready to be sanitised --- .../webhooks/service/sanitiseApplicationData/operations.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/api.planx.uk/modules/webhooks/service/sanitiseApplicationData/operations.ts b/api.planx.uk/modules/webhooks/service/sanitiseApplicationData/operations.ts index 8e1af46be2..9bd6b8b7ab 100644 --- a/api.planx.uk/modules/webhooks/service/sanitiseApplicationData/operations.ts +++ b/api.planx.uk/modules/webhooks/service/sanitiseApplicationData/operations.ts @@ -68,8 +68,12 @@ export const getExpiredSessionIds = async (): Promise => { query GetExpiredSessionIds($retentionPeriod: timestamptz) { lowcal_sessions( where: { - submitted_at: { _lt: $retentionPeriod } sanitised_at: { _is_null: true } + _or: [ + { deleted_at: { _lt: $retentionPeriod } } + { submitted_at: { _lt: $retentionPeriod } } + { locked_at: { _lt: $retentionPeriod } } + ] } ) { id @@ -123,6 +127,7 @@ export const sanitiseLowcalSessions: Operation = async () => { _or: [ { deleted_at: { _lt: $retentionPeriod } } { submitted_at: { _lt: $retentionPeriod } } + { locked_at: { _lt: $retentionPeriod } } ] } ) {