Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

close #166 support promotion, tax, adjustments in payouts #167

Merged

Conversation

theachoem
Copy link
Collaborator

@theachoem theachoem commented Jun 11, 2024

I. Why?

In previous payout implementations, we disabled payouts when the order had promotions, adjustments, taxes, etc. This PR is intended to support them.

To support all types of adjustments, we need to understand who is running those adjustments to calculate the correct commission and exact money that merchant expect for each of their products. We want to automate the process as much as possible.

Example:

  • When the promotion is run by the merchant:
    If the item is 50$ with 10% promotion run by the merchant, user will pay 45$. We can safely send that 45$ to the merchant since 45$ is what merchant expect.
  • In another case when the promotion is run by the store (us):
    If the item is 50$ with 10% promotion run by the store, user will also pay 45$, but the merchant expected 50$. In this case, we can only send 45$ to the merchant and record the remaining $5 as an outstanding balance, which we (the store) will cover. After recorded, we can clear this amount later.

II. Table Design

This is the database designed to support the above use cases & records all financial data.

How payout is setup?
payout - how to setup
How payout is generated?
payout - how payout is generated_

III. Test with use cases

1. Use case #1

payout - usecase 1

2. Use case #2

payout - usecase 2

3. Use case #3

payout - usecase 3

4. Use case #4

payout - usecase 4

5. Use case #5

payout - usecase 5

6. Use case #6

payout - usecase 6

Related PR (UI for this changes):

@theachoem theachoem self-assigned this Jun 11, 2024
@theachoem theachoem added the enhancement New feature or request label Jun 11, 2024
@theachoem theachoem added this to the Payout Integration milestone Jun 11, 2024
@theachoem theachoem linked an issue Jun 11, 2024 that may be closed by this pull request
1 task
@theachoem theachoem force-pushed the 166-support-promotion-adjustments-tax-in-payouts branch 5 times, most recently from b024ee5 to 4bc53b0 Compare June 12, 2024 10:46
@theachoem theachoem added the documentation Improvements or additions to documentation label Jun 12, 2024
@theachoem theachoem changed the title close #166 support promotion adjustments tax in payouts close #166 support promotion, adjustments, tax in payouts Jun 12, 2024
@theachoem theachoem changed the title close #166 support promotion, adjustments, tax in payouts close #166 support promotion, tax, adjustments in payouts Jun 12, 2024
@theachoem theachoem requested a review from channainfo June 12, 2024 13:41
@theachoem theachoem force-pushed the 166-support-promotion-adjustments-tax-in-payouts branch 12 times, most recently from c57f58a to db897d9 Compare June 13, 2024 15:09
@theachoem theachoem changed the title close #166 support promotion, tax, adjustments in payouts WIP #166 support promotion, tax, adjustments in payouts Jun 14, 2024
@theachoem theachoem force-pushed the 166-support-promotion-adjustments-tax-in-payouts branch 2 times, most recently from 8c44daf to f57a281 Compare July 17, 2024 17:26
@theachoem theachoem changed the title WIP #166 support promotion, tax, adjustments in payouts close #166 support promotion, tax, adjustments in payouts Jul 17, 2024
@theachoem theachoem force-pushed the 166-support-promotion-adjustments-tax-in-payouts branch 12 times, most recently from d4c02b1 to 61a40f1 Compare July 20, 2024 10:02
@theachoem theachoem force-pushed the 166-support-promotion-adjustments-tax-in-payouts branch from 61a40f1 to 09277d8 Compare July 20, 2024 10:49
@channainfo channainfo merged commit 8d2819a into develop Jul 20, 2024
2 checks passed
@theachoem theachoem deleted the 166-support-promotion-adjustments-tax-in-payouts branch July 24, 2024 04:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support promotion, adjustment, tax for payout
2 participants