Skip to content

Instantly share code, notes, and snippets.

@kristinaluxgroup
Last active March 15, 2018 05:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kristinaluxgroup/a271b621fc3d2b7540f1d35935db49eb to your computer and use it in GitHub Desktop.
Save kristinaluxgroup/a271b621fc3d2b7540f1d35935db49eb to your computer and use it in GitHub Desktop.
Proposal: Same promo - different discount for new and existing customers
Same promo - different discount for new and existing customers
Proposal 1
Promo setup:
1. We create a promo code - AMEX_SINGAPORE with a BIN range 111111-222222
2. We create two other promo codes
AMEX_SINGAPORE_1 - to be used for existing customers - discount $100, same range
AMEX_SINGAPORE_2 - to be used for new customers - discount $200, same range
Scenario:
1. A customer with a credit card issued from AMEX Singapore goes to LE and types a promo code AMEX_SINGAPORE
2. A GET request is sent to the promo-svc (getCodeByName)
3. Promo-svc is getting the code from the db and checks if there is a range attached to it.
4. If there is a range, promo service makes a request to svc-order to get the purchases for the customer id (/api/orders?customer_id=ed9e3ef4-969f-4f08-ba4c-89878b7d5590)
5. The promo service now knows if the customer is new or existing
6. If it's an existing customer, promo service queries for AMEX_SINGAPORE_1 and returns the info for that info to LE
7. If it's a new customer, promo service queries AMEX_SINGAPORE_2 and returns the info for that info to LE
Proposal 2
Promo setup:
1. There are new fields to the promo code
- has_different_values_for_existing_vs_new_customer_discounts - true/false
- promo_value_new_customers - integer
- promo_value_existing_customers - integer
Scenario:
1. A customer types the promo, CP asks promo service for data
2. Promo service checks if has_different_values_for_existing_vs_new_customer_discounts
3. If it is true it should query order service for the type of customer (new/existing)
4. I will return to CP only one promo value (promo_value_new_customers or promo_value_existing_customers)
@nguyenchr
Copy link

Promo setup:

  1. We create a promo code - AMEX_SINGAPORE with a BIN range 111111-222222
  2. AMEX_SINGAPORE has two new fields existing_customer_discount and new_customer_discount

Scenario:

  1. A customer with a credit card issued from AMEX Singapore goes to LE and types a promo code AMEX_SINGAPORE
  2. A GET request is sent to the promo-svc (getCodeByName)
  3. Promo-svc is getting the code from the db and checks if there are values set for existing_customer_discount and new_customer_discount.
  4. If there are values, promo service makes a request to svc-order to get the purchases for the customer id (/api/orders?customer_id=ed9e3ef4-969f-4f08-ba4c-89878b7d5590)
  5. The promo service now knows if the customer is new or existing
  6. If it's an existing customer, promo service returns the value for existing_customer_discount
  7. If it's a new customer, promo service returns the value for new_customer_discount

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment