add cert_expires_at

This commit is contained in:
2025-10-15 15:10:47 -03:00
parent 54c92b3996
commit ffa04d9b15
37 changed files with 371 additions and 230 deletions

View File

@@ -15,7 +15,7 @@ def test_append_cert(
dynamodb_persistence_layer: DynamoDBPersistenceLayer,
lambda_context: LambdaContext,
):
expires_at = now() + timedelta(days=360)
cert_expires_at = now() + timedelta(days=360)
event = {
'detail': {
'new_image': {
@@ -25,9 +25,7 @@ def test_append_cert(
'id': '431',
'name': 'How to Sing Better',
},
'cert': {
'expires_at': expires_at.isoformat(),
},
'cert_expires_at': cert_expires_at.isoformat(),
'user': {
'id': '1234',
'name': 'Tobias Summit',
@@ -41,7 +39,7 @@ def test_append_cert(
assert app.lambda_handler(event, lambda_context) # type: ignore
# The reporting month is the month before the certificate expires
month_start = (expires_at.replace(day=1) - timedelta(days=1)).replace(day=1)
month_start = (cert_expires_at.replace(day=1) - timedelta(days=1)).replace(day=1)
report_sk = 'MONTH#{}#SCHEDULE#SEND_REPORT_EMAIL'.format(
month_start.strftime('%Y-%m')
)
@@ -54,7 +52,7 @@ def test_append_cert(
)
+ SortKey(
sk='MONTH#{}#ENROLLMENT#e45019d8-be7a-4a82-9b37-12a01f0127bb'.format(
expires_at.strftime('%Y-%m')
cert_expires_at.strftime('%Y-%m')
),
rename_key='enrollment',
),