Skip to content

feat: Implement subscription plan templates with dynamic pricing tier… - #1074

Open
Tekgodfrey wants to merge 1 commit into
Smartdevs17:mainfrom
Tekgodfrey:feature/issue-921-plan-templates
Open

feat: Implement subscription plan templates with dynamic pricing tier…#1074
Tekgodfrey wants to merge 1 commit into
Smartdevs17:mainfrom
Tekgodfrey:feature/issue-921-plan-templates

Conversation

@Tekgodfrey

Copy link
Copy Markdown

…s (Issue #921)

Closes #921

Description

This PR integrates the Subscription Plan Templates and Dynamic Pricing Tiers logic, which was previously authored but unlinked across the backend and smart contract layers. Resolves Issue #921.

Key Changes

Smart Contract Integration (contracts/subscription)

  • Types: Added TemplateKey enum and the PlanTemplate variant to StorageKey in contracts/types/src/lib.rs to resolve missing type errors.
  • Contract Endpoints: Exported the plan_templates.rs module inside lib.rs and exposed the following core template functions in the SubTrackrSubscription contract block:
    • create_template
    • publish_template_version
    • set_template_shared
    • instantiate_template
    • Template query methods (get_template, get_owner_templates, get_shared_templates, etc.)
    • get_template_analytics
  • Compiler Fixes: Resolved pre-existing compilation errors related to StorageKey and SorobanString in quota.rs, revenue.rs, and gas_storage.rs.

Backend Integration (backend/services/billing)

  • Exports: Exported PlanTemplateService, its core methods (validateTiers, validateTemplateDraft, quoteTemplate, resolvePlan), and all associated TypeScript types (PricingTier, PlanTemplate, TemplateOverrides, ResolvedPlan, TemplateAnalytics) from index.ts.
  • Dynamic Pricing: Verified that DynamicPricingStrategy was correctly exported and ready to be injected into the PricingStrategyFactory.

Testing & Validation

  • Backend Tests: Verified test suite covers plan template CRUD, versioning, dynamic pricing tiers, and analytics via planTemplateService.test.ts. npm install was run to ensure dependencies are up-to-date and pass local test hooks.
  • Contract Tests: The smart contract endpoints are structurally and syntactically integrated. (Note: Full cargo test execution requires resolving upstream soroban-sdk toolchain/workspace issues).

@drips-wave

drips-wave Bot commented Aug 28, 2026

Copy link
Copy Markdown

@Tekgodfrey Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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.

Implement subscription plan templates with dynamic pricing tiers

1 participant