Skip to content

Conversation

@Danmax
Copy link
Contributor

@Danmax Danmax commented Oct 30, 2025

Action Pack:
Calculate commission based on sale amount, region, and agent tier.

  • Base tiers (by amount, USD):
    < 1,000 → 3%
    1,000–4,999.99 → 5%
    5,000–49,999.99 → 7%
    ≥ 50,000 → 10%

  • Region adders (percentage points):
    NA +5%, EMEA +6%, LATAM +4%, APAC +3%

  • Agent tier adders (percentage points):
    Tier 1 +7%, Tier 2 +4%, Tier 3 +2%, Tier 4 +0%

    ===== Examples =====

calculateCommission(800, 'NA', 1);
-> { commissionRate: 0.15, saleAmount: 800.00, commissionAmount: 120.00, ... }
Explanation: 3% base + 5% NA + 7% Tier1 = 15%

calculateCommission(6000, 'EMEA', 2);
base 7% + EMEA 6% + Tier2 4% = 17%
=> commissionAmount = 6000 * 0.17 = 1020.00

calculateCommission(55000, 'APAC', 4);
base 10% + APAC 3% + Tier4 0% = 13%

@github-actions
Copy link

Valid PR for ActionPack

Thank you for your contribution. This PR complies with the CONTRIBUTING.md.
A maintainer will review this shortly. In the meantime, Happy Hacking!

@SapphicFire SapphicFire self-assigned this Oct 31, 2025
Copy link
Contributor

@SapphicFire SapphicFire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! There are opportunities for these calculations to be based on a decision table using the Decision Table API

@SapphicFire SapphicFire merged commit f8d2a09 into ServiceNowDevProgram:main Oct 31, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants