Skip to content

Commit

Permalink
Merge pull request #114 from cloudblue/LITE-31371-add-renew-request-e…
Browse files Browse the repository at this point in the history
…vent

LITE-31371 Add renew request event
  • Loading branch information
jonatrios authored Nov 25, 2024
2 parents 8b3efb5 + 04c09ae commit fb7783a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions connect/eaas/core/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ class EventType:
ASSET_RESUME_REQUEST_PROCESSING = 'asset_resume_request_processing'
ASSET_CANCEL_REQUEST_PROCESSING = 'asset_cancel_request_processing'
ASSET_ADJUSTMENT_REQUEST_PROCESSING = 'asset_adjustment_request_processing'
ASSET_RENEW_REQUEST_PROCESSING = 'asset_renew_request_processing'
ASSET_PURCHASE_REQUEST_VALIDATION = 'asset_purchase_request_validation'
ASSET_CHANGE_REQUEST_VALIDATION = 'asset_change_request_validation'
PRODUCT_ACTION_EXECUTION = 'product_action_execution'
Expand Down
12 changes: 12 additions & 0 deletions tests/connect/eaas/core/test_extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ def process_purchase(self, request):
async def process_change(self, request):
pass

@event(
'asset_renew_request_processing',
statuses=['pending', 'inquiring'],
)
def process_renew(self, request):
pass

assert sorted(MyExtension.get_events(), key=lambda x: x['method']) == [
{
'method': 'process_change',
Expand All @@ -65,6 +72,11 @@ async def process_change(self, request):
'event_type': 'asset_purchase_request_processing',
'statuses': ['pending', 'inquiring'],
},
{
'method': 'process_renew',
'event_type': 'asset_renew_request_processing',
'statuses': ['pending', 'inquiring'],
},
]

assert MyExtension(None, None, None).process_purchase.__name__ == 'process_purchase'
Expand Down

0 comments on commit fb7783a

Please sign in to comment.