Skip to content

Commit

Permalink
style 🎯
Browse files Browse the repository at this point in the history
  • Loading branch information
pavlo-mk committed Oct 30, 2024
1 parent 52e40b7 commit 39f3a99
Showing 1 changed file with 50 additions and 33 deletions.
83 changes: 50 additions & 33 deletions src/hct_mis_api/apps/payment/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
MaxLengthValidator,
MaxValueValidator,
MinLengthValidator,
MinValueValidator, ProhibitNullCharactersValidator,
MinValueValidator,
ProhibitNullCharactersValidator,
)
from django.db import models
from django.db.models import (
Expand Down Expand Up @@ -65,7 +66,12 @@
Scope,
)
from hct_mis_api.apps.core.mixins import LimitBusinessAreaModelMixin
from hct_mis_api.apps.core.models import BusinessArea, FileTemp, FlexibleAttribute, StorageFile
from hct_mis_api.apps.core.models import (
BusinessArea,
FileTemp,
FlexibleAttribute,
StorageFile,
)
from hct_mis_api.apps.geo.models import Area, Country
from hct_mis_api.apps.household.models import FEMALE, MALE, Individual
from hct_mis_api.apps.payment.delivery_mechanisms import DeliveryMechanismChoices
Expand All @@ -76,14 +82,18 @@
from hct_mis_api.apps.utils.models import (
AdminUrlMixin,
ConcurrencyModel,
InternalDataFieldModel,
MergedManager,
MergeStatusModel,
PendingManager,
SignatureMixin,
TimeStampedUUIDModel,
UnicefIdentifiedModel, InternalDataFieldModel,
UnicefIdentifiedModel,
)
from hct_mis_api.apps.utils.validators import (
DoubleSpaceValidator,
StartEndSpaceValidator,
)
from hct_mis_api.apps.utils.validators import DoubleSpaceValidator, StartEndSpaceValidator

if TYPE_CHECKING:
from hct_mis_api.apps.account.models import User
Expand Down Expand Up @@ -432,7 +442,14 @@ def delivery_mechanism(self) -> Optional[str]:
return self.payment_plan.delivery_mechanisms.first().delivery_mechanism


class PaymentPlan(ConcurrencyModel, SoftDeletableModel, GenericPaymentPlan, UnicefIdentifiedModel, AdminUrlMixin, InternalDataFieldModel):
class PaymentPlan(
ConcurrencyModel,
SoftDeletableModel,
GenericPaymentPlan,
UnicefIdentifiedModel,
AdminUrlMixin,
InternalDataFieldModel,
):
TP_MIGRATION_MAPPING = {
# tp.field: payment_plan.field
# if value has internal_data__ will story in json
Expand Down Expand Up @@ -466,34 +483,34 @@ class PaymentPlan(ConcurrencyModel, SoftDeletableModel, GenericPaymentPlan, Unic
# ACTIVITY_LOG_MAPPING from TP
# TODO: merge it with exists
ACTIVITY_LOG_MAPPING_TP = create_mapping_dict(
[
"name",
"created_by",
"change_date",
"changed_by",
"finalized_at",
"finalized_by",
"status",
"child_male_count",
"child_female_count",
"adult_male_count",
"adult_female_count",
"total_households_count",
"total_individuals_count",
"program",
"targeting_criteria_string",
"sent_to_datahub",
"steficon_rule",
"exclusion_reason",
"excluded_ids",
],
{
"steficon_rule": "additional_formula",
"steficon_applied_date": "additional_formula_applied_date",
"vulnerability_score_min": "score_min",
"vulnerability_score_max": "score_max",
},
)
[
"name",
"created_by",
"change_date",
"changed_by",
"finalized_at",
"finalized_by",
"status",
"child_male_count",
"child_female_count",
"adult_male_count",
"adult_female_count",
"total_households_count",
"total_individuals_count",
"program",
"targeting_criteria_string",
"sent_to_datahub",
"steficon_rule",
"exclusion_reason",
"excluded_ids",
],
{
"steficon_rule": "additional_formula",
"steficon_applied_date": "additional_formula_applied_date",
"vulnerability_score_min": "score_min",
"vulnerability_score_max": "score_max",
},
)

ACTIVITY_LOG_MAPPING = create_mapping_dict(
[
Expand Down

0 comments on commit 39f3a99

Please sign in to comment.