add user id to order

This commit is contained in:
2025-07-23 01:05:21 -03:00
parent 896e0f1054
commit edecbce356
7 changed files with 41 additions and 113 deletions

View File

@@ -1,27 +0,0 @@
from aws_lambda_powertools.utilities.typing import LambdaContext
from layercake.dynamodb import DynamoDBPersistenceLayer, PartitionKey
import events.assign_tenant_cnpj as app
def test_assign_tenant_cnpj(
dynamodb_seeds,
dynamodb_persistence_layer: DynamoDBPersistenceLayer,
lambda_context: LambdaContext,
):
event = {
'detail': {
'new_image': {
'id': '9omWNKymwU5U4aeun6mWzZ',
'cnpj': '15608435000190',
'email': 'sergio@somosbeta.com.br',
}
}
}
assert app.lambda_handler(event, lambda_context) # type: ignore
r = dynamodb_persistence_layer.collection.query(
PartitionKey('9omWNKymwU5U4aeun6mWzZ')
)
assert 2 == len(r['items'])

View File

@@ -14,15 +14,15 @@ def test_remove_slots_if_canceled(
'new_image': {
'id': '9omWNKymwU5U4aeun6mWzZ',
'status': 'CANCELED',
'tenant': 'cJtK9SsnJhKPyxESe7g3DG',
'tenant_id': 'cJtK9SsnJhKPyxESe7g3DG',
}
}
}
assert app.lambda_handler(event, lambda_context) # type: ignore
result = dynamodb_persistence_layer.collection.query(
r = dynamodb_persistence_layer.collection.query(
PartitionKey('vacancies#cJtK9SsnJhKPyxESe7g3DG')
)
assert len(result['items']) == 0
assert len(r['items']) == 0