fix subscription
This commit is contained in:
@@ -2,7 +2,7 @@ from abc import ABC
|
||||
from dataclasses import dataclass
|
||||
from datetime import timedelta
|
||||
from enum import Enum
|
||||
from typing import NotRequired, TypedDict
|
||||
from typing import TypedDict
|
||||
|
||||
from layercake.dateutils import now, ttl
|
||||
from layercake.dynamodb import DynamoDBPersistenceLayer
|
||||
@@ -31,7 +31,7 @@ Subscription = TypedDict(
|
||||
{
|
||||
'org_id': str,
|
||||
'billing_day': int,
|
||||
'billing_period': NotRequired[str],
|
||||
'billing_period': str,
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
@@ -64,8 +64,8 @@ def lambda_handler(event: EventBridgeEvent, context: LambdaContext) -> bool:
|
||||
'user': user,
|
||||
'order_id': new_image['id'],
|
||||
},
|
||||
) as fp:
|
||||
result = fp.process()
|
||||
) as batch:
|
||||
result = batch.process()
|
||||
logger.debug('Processed courses', result=result)
|
||||
|
||||
return order_layer.update_item(
|
||||
|
||||
@@ -25,7 +25,7 @@ def lambda_handler(event: EventBridgeEvent, context: LambdaContext) -> bool:
|
||||
now_ = now()
|
||||
terms = user_layer.get_item(
|
||||
# Post-migration (users): uncomment the following line
|
||||
# KeyPair(new_image['org_id'], 'METADATA#BILLING_TERMS'),
|
||||
# KeyPair(new_image['org_id'], 'METADATA#SUBSCRIPTION_TERMS'),
|
||||
KeyPair(new_image['org_id'], 'metadata#billing_policy'),
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user