-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Parent Issue
Part of #96 — Add promotional discount code feature to checkout flow
Service
Proto / gRPC definitions (shared across services)
Scope
PlaceOrderRequest Update
Add a discount_code field to PlaceOrderRequest so the frontend can pass the user's coupon code to the Checkout service:
message PlaceOrderRequest {
string user_id = 1;
string user_currency = 2;
Address address = 3;
string email = 5;
CreditCardInfo credit_card = 6;
string discount_code = 7; // NEW: promotional discount code
}OrderResult Update
Add discount details to OrderResult so the frontend and email service can display them:
message OrderResult {
string order_id = 1;
string shipping_tracking_id = 2;
Money shipping_cost = 3;
Address shipping_address = 4;
repeated OrderItem items = 5;
DiscountDetail discount = 6; // NEW: applied discount info
}
// NEW message
message DiscountDetail {
string code = 1; // e.g. "SAVE10"
string description = 2; // e.g. "10% off entire order"
Money discount_amount = 3; // amount saved
}Code Generation
- Regenerate gRPC stubs for all affected languages:
- Go (checkout service)
- TypeScript (frontend)
- Node.js (payment service, if proto is used directly)
- Ensure backward compatibility — new fields are optional so existing clients continue to work
Acceptance Criteria
-
PlaceOrderRequestincludesdiscount_codefield -
OrderResultincludesDiscountDetailmessage -
DiscountDetailmessage defined withcode,description, anddiscount_amount - gRPC stubs regenerated for Go, TypeScript, and Node.js
- Existing services compile and pass tests without changes (backward compatible)
- Proto linting passes (if configured)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels