Skip to content

Commit

Permalink
Merge pull request #4424 from unicef/pg_changes
Browse files Browse the repository at this point in the history
pg changes
  • Loading branch information
domdinicola authored Nov 11, 2024
2 parents b25cede + ff471b4 commit c64aa17
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "frontend",
"version": "2.12.3",
"version": "2.13.0",
"private": true,
"type": "module",
"scripts": {
Expand Down
12 changes: 6 additions & 6 deletions src/hct_mis_api/apps/payment/services/payment_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class PaymentInstructionStatus(Enum):

class PaymentInstructionFromDeliveryMechanismPerPaymentPlanSerializer(ReadOnlyModelSerializer):
remote_id = serializers.CharField(source="id")
unicef_id = serializers.CharField(source="payment_plan.unicef_id")
external_code = serializers.CharField(source="payment_plan.unicef_id")
fsp = serializers.SerializerMethodField()
payload = serializers.SerializerMethodField()
extra = serializers.SerializerMethodField()
Expand All @@ -78,24 +78,24 @@ class Meta:
model = DeliveryMechanismPerPaymentPlan
fields = [
"remote_id",
"unicef_id",
"external_code",
"fsp",
"payload",
"extra",
]


class PaymentInstructionFromSplitSerializer(PaymentInstructionFromDeliveryMechanismPerPaymentPlanSerializer):
unicef_id = serializers.SerializerMethodField() # type: ignore
external_code = serializers.SerializerMethodField() # type: ignore

def get_unicef_id(self, obj: Any) -> str:
def get_external_code(self, obj: Any) -> str:
return f"{obj.payment_plan.unicef_id}-{obj.order}"

class Meta:
model = PaymentPlanSplit
fields = [
"remote_id",
"unicef_id",
"external_code",
"fsp",
"payload",
"extra",
Expand Down Expand Up @@ -210,7 +210,7 @@ def get_transferred_status_based_on_delivery_amount() -> str:
@dataclasses.dataclass()
class PaymentInstructionData(FlexibleArgumentsDataclassMixin):
remote_id: str
unicef_id: str
external_code: str
status: str # "DRAFT"
fsp: str
system: int
Expand Down

0 comments on commit c64aa17

Please sign in to comment.