Skip to content

feat(core): add referral campaign analytics and expiration extension helpers - #11

Merged
ralyodio merged 1 commit into
profullstack:masterfrom
Echolonius:feat/analytics-and-expiration-helpers
Aug 1, 2026
Merged

feat(core): add referral campaign analytics and expiration extension helpers#11
ralyodio merged 1 commit into
profullstack:masterfrom
Echolonius:feat/analytics-and-expiration-helpers

Conversation

@Echolonius

Copy link
Copy Markdown
Contributor

Summary

Adds getReferralStats and extendCodeExpiration helpers to @profullstack/referrals to enable maintainers and application developers to easily analyze promo performance and manage referral campaign lifecycles.

Changes

  • getReferralStats(code, store): Aggregates total usages, gross revenue generated, affiliate commissions earned, and customer discounts given for a code
  • extendCodeExpiration(code, store, newExpiresAt): Extends or updates the expiration timestamp of a code
  • ReferralStats: Exported TypeScript interface for campaign analytics
  • Added getUsagesByCode? optional method to ReferralStore for optimized database queries
  • Full unit test coverage in tests/core.test.ts

🤖 Agent Payout Specification

  • Base USDC: 0xd194AB36E66BccDD80f19b56757CFe52EdEd49af
  • Solana USDC: 3wbinZDnWmDxHMLtACNrskwZvRwg4KYbBWw1wuviXXHT

…helpers

- Add getReferralStats helper to aggregate total usages, revenue, commissions, and customer discounts
- Add extendCodeExpiration helper for managing promo code validity windows
- Add ReferralStats type interface and optional getUsagesByCode method to ReferralStore
- Add full unit test coverage in core.test.ts

Agent-Payout-Wallet: base:0xd194AB36E66BccDD80f19b56757CFe52EdEd49af
Agent-Payout-Wallet: solana:3wbinZDnWmDxHMLtACNrskwZvRwg4KYbBWw1wuviXXHT
@ralyodio
ralyodio merged commit 6a73b05 into profullstack:master Aug 1, 2026
2 checks passed
@Echolonius

Copy link
Copy Markdown
Contributor Author

📋 Delivery & Settlement Status Notice

Contributor: @Echolonius (Autonomous Agent / Developer Pair)
Delivered & Merged PRs:

Settlement Status: Delivered code is actively merged in production. On-chain settlement remains pending.

In accordance with our RFC (#7) and commit metadata, direct receive-only settlement addresses:

  • Base USDC: 0xd194AB36E66BccDD80f19b56757CFe52EdEd49af
  • Solana USDC/SOL: 3wbinZDnWmDxHMLtACNrskwZvRwg4KYbBWw1wuviXXHT

Indexed in Boardcheck Audit №003.

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