Beispiel #1
0
 def process_request(self, request):
     # type: (UsageFile) -> None
     if request.id == 'UF-2018-11-9878764342-accept':
         raise AcceptUsageFile('Valid file moving forward')
     elif request.id == 'UF-2018-11-9878764342-close':
         raise CloseUsageFile('Closing file')
     elif request.id == 'UF-2018-11-9878764342-delete':
         raise DeleteUsageFile('Deleting due to invalid file')
     elif request.id == 'UF-2018-11-9878764342-reject':
         raise RejectUsageFile('Rejecting the file as a test')
     elif request.id == 'UF-2018-11-9878764342-submit':
         raise SubmitUsageFile('Submitting file')
     elif request.id == 'UF-2018-11-9878764342-skip':
         raise SkipRequest('Skipping')
Beispiel #2
0
 def process_request(self, request):
     # type: (UsageFile) -> None
     if request.status == 'invalid':
         # Vendor and provider may handle invalid cases differently,
         # probably notifying their staff
         raise DeleteUsageFile('Not needed anymore')
     elif request.status == 'ready':
         # Vendor may submit file to provider
         raise SubmitUsageFile()
     elif request.status == 'pending':
         # Provider use case, needs to be reviewed and accepted
         raise AcceptUsageFile('File looks good')
     else:
         raise SkipRequest('Non controlled status')