add purge to canceled and failed enrollment
This commit is contained in:
@@ -61,6 +61,8 @@ Org = TypedDict('Org', {'org_id': str, 'name': str})
|
||||
|
||||
CreatedBy = TypedDict('CreatedBy', {'id': str, 'name': str})
|
||||
|
||||
Seat = TypedDict('Seat', {'id': str, 'sk': str})
|
||||
|
||||
DeduplicationWindow = TypedDict('DeduplicationWindow', {'offset_days': int})
|
||||
|
||||
Subscription = TypedDict(
|
||||
@@ -100,6 +102,11 @@ class SubscriptionFrozenError(Exception):
|
||||
super().__init__('Subscription is frozen')
|
||||
|
||||
|
||||
class SeatNotFoundError(Exception):
|
||||
def __init__(self, msg: str | dict):
|
||||
super().__init__('Seat required')
|
||||
|
||||
|
||||
def enroll(
|
||||
enrollment: Enrollment,
|
||||
*,
|
||||
@@ -108,6 +115,7 @@ def enroll(
|
||||
subscription: Subscription | None = None,
|
||||
created_by: CreatedBy | None = None,
|
||||
scheduled_at: datetime | None = None,
|
||||
seat: Seat | None = None,
|
||||
linked_entities: frozenset[LinkedEntity] = frozenset(),
|
||||
deduplication_window: DeduplicationWindow | None = None,
|
||||
persistence_layer: DynamoDBPersistenceLayer,
|
||||
@@ -138,6 +146,8 @@ def enroll(
|
||||
'sk': 'CANCEL_POLICY',
|
||||
'created_at': now_,
|
||||
}
|
||||
#
|
||||
| ({'seat': seat} if seat else {})
|
||||
)
|
||||
|
||||
# Relationships between this enrollment and its related entities
|
||||
|
||||
Reference in New Issue
Block a user