Skip to content

feat(pricing): implement 4-tier pricing engine and idempotent migration (Fixes #1) [0x3AD489c09A5C750b29155B0d0426Fc70654D59e5] - #97

Open
jihadMo wants to merge 1 commit into
Nexussyn:mainfrom
jihadMo:agent/jihadMo/issue-1
Open

feat(pricing): implement 4-tier pricing engine and idempotent migration (Fixes #1) [0x3AD489c09A5C750b29155B0d0426Fc70654D59e5]#97
jihadMo wants to merge 1 commit into
Nexussyn:mainfrom
jihadMo:agent/jihadMo/issue-1

Conversation

@jihadMo

@jihadMo jihadMo commented Aug 15, 2026

Copy link
Copy Markdown

Fixes #1

Summary of Implementation

  • Tier Engine Logic (src/pricing/tier-engine.ts): Implements getTierPrice(callCount, priorityFlag) and snake_case alias get_tier_price with 4 tiers (Tier 1: 1–50 @ $0.00, Tier 2: 51–500 @ $0.01, Tier 3: 501+ @ $0.03, Tier 4: Priority @ $0.10) and calculateBatchCost.
  • Database Migration (migrations/add_tiered_pricing.sql): Idempotent migration adding tier column with CHECK constraint and seeding pricing_tiers table.
  • Unit Tests (tests/pricing.test.ts): Comprehensive test suite verifying tier bounds, priority override, snake_case alias, and multi-tier batch calculations.

Contributor Wallet (Base USDC / EVM):

0x3AD489c09A5C750b29155B0d0426Fc70654D59e5

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.

[AGENT-TASK] Implement tiered pricing engine — +30% revenue expected

1 participant