Skip to content

Commit 1e65907

Browse files
committed
CCM-11343: update filter rules
1 parent 1dfd3d9 commit 1e65907

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

infrastructure/terraform/modules/backend-api/pipes_pipe_template_table_events.tf

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,15 @@ resource "aws_pipes_pipe" "template_table_events" {
3636
eventName = ["INSERT", "MODIFY"]
3737
},
3838
{
39-
# Allow LETTER templates only when proofingEnabled is true
39+
# Allow LETTER templates only when proofingEnabled and valid status
4040
dynamodb = {
4141
NewImage = {
4242
templateType = {
4343
S = ["LETTER"]
4444
}
45+
templateStatus = {
46+
S = ["PROOF_AVAILABLE", "SUBMITTED", "DELETED"]
47+
}
4548
proofingEnabled = {
4649
BOOL = [true]
4750
}

tests/test-team/template-mgmt-api-tests/create-letter-template.api.spec.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ test.describe('POST /v1/letter-template', () => {
102102
letterType: 'x0',
103103
name: templateData.name,
104104
owner: user1.userId,
105+
proofingEnabled: true,
105106
templateStatus: 'PENDING_VALIDATION',
106107
templateType: templateData.templateType,
107108
updatedAt: expect.stringMatching(isoDateRegExp),
@@ -183,6 +184,7 @@ test.describe('POST /v1/letter-template', () => {
183184
letterType: 'x0',
184185
name: templateData.name,
185186
owner: user1.userId,
187+
proofingEnabled: true,
186188
templateStatus: 'PENDING_VALIDATION',
187189
templateType: templateData.templateType,
188190
updatedAt: expect.stringMatching(isoDateRegExp),
@@ -259,6 +261,7 @@ test.describe('POST /v1/letter-template', () => {
259261
letterType: 'x0',
260262
name: templateData.name,
261263
owner: user6.userId,
264+
proofingEnabled: false,
262265
templateStatus: 'PENDING_VALIDATION',
263266
templateType: templateData.templateType,
264267
updatedAt: expect.stringMatching(isoDateRegExp),

0 commit comments

Comments
 (0)