fix enroll and reenroll relationship

This commit is contained in:
2025-10-14 18:11:24 -03:00
parent 466ff824dd
commit a7e5a0a528
20 changed files with 125 additions and 89 deletions

View File

@@ -1,4 +1,5 @@
import urllib.parse as parse
from os import rename
from aws_lambda_powertools.event_handler.api_gateway import Router
from layercake.dynamodb import (
@@ -73,16 +74,16 @@ def get_enrollment(id: str):
record = enrollment_layer.collection.get_items(
TransactKey(id)
+ SortKey('0')
+ SortKey('ORG', rename_key='org')
# + SortKey('STARTED', rename_key='started_at', path_spec='started_at')
# + SortKey('COMPLETED', rename_key='completed_at', path_spec='completed_at')
# + SortKey('FAILED', rename_key='failed_at', path_spec='failed_at')
+ SortKey('CANCELED', rename_key='canceled')
+ SortKey('ARCHIVED', rename_key='archived_at', path_spec='archived_at')
# + SortKey('ARCHIVED', rename_key='archived_at', path_spec='archived_at')
+ SortKey('CANCEL_POLICY', rename_key='cancel_policy')
+ SortKey('LOCK', rename_key='lock')
+ SortKey('parent_vacancy', path_spec='vacancy')
+ SortKey('author')
+ SortKey('tenant')
)
events = enrollment_layer.collection.query(KeyPair(id, 'SCHEDULE#'))

View File

@@ -14,7 +14,7 @@ enrollment_layer = DynamoDBPersistenceLayer(ENROLLMENT_TABLE, dynamodb_client)
def download(id: str):
params = {
'Bucket': BUCKET_NAME,
'Key': f'issuedcerts/{id}.pdf',
'Key': f'certs/{id}.pdf',
'ResponseContentDisposition': f'attachment; filename="{id}.pdf"',
}