Skip to content

Commit

Permalink
Merge pull request #8 from openimis/feature/CM-299
Browse files Browse the repository at this point in the history
CM-299: Adjust displaying calculation rule tasks (exceeding payments) to new approach
  • Loading branch information
malinowskikam authored Sep 5, 2023
2 parents f76ecc2 + 06a70ea commit 5604af2
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from core.models import User
from core.utils import convert_to_python_value
from core.signals import register_service_signal
from invoice.models import Bill
from invoice.services import BillService
from social_protection.models import BeneficiaryStatus
from tasks_management.apps import TasksManagementConfig
Expand Down Expand Up @@ -112,12 +113,14 @@ def _convert_entity_to_bill(
@transaction.atomic
@register_service_signal('calcrule_social_protection.create_task')
def create_task_after_exceeding_limit(cls, convert_results):
business_status = {"code": convert_results['bill_data']['code']}
user = convert_results.pop('user')
TaskService(user).create({
'source': 'calcrule_social_protection',
'entity': None,
'status': Task.Status.RECEIVED,
'executor_action_event': TasksManagementConfig.default_executor_event,
'business_event': CalcruleSocialProtectionConfig.calculate_business_event,
'business_status': business_status,
'data': f"{convert_results}"
})

0 comments on commit 5604af2

Please sign in to comment.