Skip to content

Commit 118fa08

Browse files
committed
feat: 결제 내역 상품 응답에 donation_allowed 필드 추가
1 parent c11c834 commit 118fa08

3 files changed

Lines changed: 11 additions & 2 deletions

File tree

‎app/shop/order/serializers/dto.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class Meta:
2222

2323
class SimpleProductDto(serializers.ModelSerializer):
2424
class Meta:
25-
fields = ("id", "name", "price", "image")
25+
fields = ("id", "name", "price", "image", "donation_allowed")
2626
model = Product
2727

2828

‎app/shop/order/test/serializers_test.py‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ def test_order_product_relation_dto_scancode_url_for_ticket_category(ticket_prod
2121
"name": ticket_product.name,
2222
"price": ticket_product.price,
2323
"image": None,
24+
"donation_allowed": False,
2425
},
2526
"is_ticket": True,
2627
"options": [],
@@ -43,7 +44,13 @@ def test_order_product_relation_dto_scancode_url_none_for_non_ticket_category(cu
4344
opr = OrderProductRelation.objects.create(order=order, product=product, price=product.price)
4445
assert OrderProductRelationDto(instance=opr).data == {
4546
"id": str(opr.id),
46-
"product": {"id": str(product.id), "name": product.name, "price": product.price, "image": None},
47+
"product": {
48+
"id": str(product.id),
49+
"name": product.name,
50+
"price": product.price,
51+
"image": None,
52+
"donation_allowed": False,
53+
},
4754
"is_ticket": False,
4855
"options": [],
4956
"status": opr.status,
@@ -95,6 +102,7 @@ def test_order_dto_includes_scancode_url_and_nested_payload(ticket_product, orde
95102
"name": ticket_product.name,
96103
"price": ticket_product.price,
97104
"image": None,
105+
"donation_allowed": False,
98106
},
99107
"is_ticket": True,
100108
"options": [],

‎app/shop/test/e2e_purchase_flow_test.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@ def test_cart_get_reflects_added_products_for_e2e_setup(customer_client, custome
294294
"name": "파이콘 티셔츠",
295295
"price": 25000,
296296
"image": None,
297+
"donation_allowed": False,
297298
},
298299
"is_ticket": False,
299300
"options": [

0 commit comments

Comments
 (0)