add enroll later and now

This commit is contained in:
2025-12-08 15:57:53 -03:00
parent 0600ad7da1
commit 1ff2634bc0
11 changed files with 537 additions and 320 deletions

View File

@@ -1,5 +1,8 @@
import json
from http import HTTPMethod, HTTPStatus
import pprint
from http import HTTPMethod
from layercake.dynamodb import DynamoDBPersistenceLayer, PartitionKey
from ...conftest import HttpApiProxy, LambdaContext
@@ -7,6 +10,7 @@ from ...conftest import HttpApiProxy, LambdaContext
def test_enroll(
app,
seeds,
dynamodb_persistence_layer: DynamoDBPersistenceLayer,
http_api_proxy: HttpApiProxy,
lambda_context: LambdaContext,
):
@@ -18,9 +22,10 @@ def test_enroll(
'org_id': '2a8963fc-4694-4fe2-953a-316d1b10f1f5',
'enrollments': [
{
'id': '44ff9ac1-a7cd-447b-a284-53cdc5929d7f',
'user': {
'id': '15bacf02-1535-4bee-9022-19d106fd7518',
'name': 'Sérgio R Siqueira',
'name': 'Eddie Vedder',
'email': 'sergio@somosbeta.com.br',
'cpf': '07879819908',
},
@@ -33,6 +38,7 @@ def test_enroll(
'scheduled_for': '2028-01-01',
},
{
'id': 'd0349bbe-cef3-44f7-b20e-3cb4476ab4c5',
'user': {
'id': '15bacf02-1535-4bee-9022-19d106fd7518',
'name': 'Sérgio R Siqueira',
@@ -45,6 +51,9 @@ def test_enroll(
'access_period': '360',
'unit_price': '99',
},
'deduplication_window': {
'offset_days': '45',
},
},
],
},
@@ -52,4 +61,11 @@ def test_enroll(
lambda_context,
)
print(r)
body = json.loads(r['body'])
pprint.pp(body)
enrolled = dynamodb_persistence_layer.collection.query(
PartitionKey('d0349bbe-cef3-44f7-b20e-3cb4476ab4c5')
)
pprint.pp(enrolled)

View File

@@ -30,8 +30,8 @@ def test_add_user(
'cpf': '40245650016',
},
'org': {
'name': 'Branco do Brasil',
'cnpj': '00000000000191',
'name': 'pytest',
'cnpj': '04978826000180',
},
},
),