Skip to content

feat: tier modules, GTQ float pricing, and per-subscription billing cycle#20

Merged
pel19072 merged 0 commit intodevelopfrom
feat/tier-billing-modules
Mar 15, 2026
Merged

feat: tier modules, GTQ float pricing, and per-subscription billing cycle#20
pel19072 merged 0 commit intodevelopfrom
feat/tier-billing-modules

Conversation

@pel19072
Copy link
Copy Markdown
Owner

Summary

  • tier.price changed from Integer (USD cents) to Float (GTQ). Migration divides existing values by 100.
  • tier.price_yearly added (Float, nullable) — annual pricing option in GTQ.
  • tier.modules added (JSON, nullable) — controls which sidebar groups a company can access (e.g. ["core", "admin", "management", "automations"]).
  • subscription.billing_cycle added (String, NOT NULL, server_default='MONTHLY') — per-company billing period choice (MONTHLY or YEARLY), independent from the tier's default.
  • TierPublic schema added for the unauthenticated public pricing page endpoint.
  • check_tier_limit() utility added in database_utils/utils/tier_limits.py for hard enforcement of plan usage limits (max_clients, max_products, max_users).
  • Updated all affected Pydantic schemas: TierBase, TierUpdate, TierOut, SubscriptionOut, SubscriptionUpdate, SubscriptionWithTier.

Migration notes

  • tier.price type change uses postgresql_using='price / 100.0' to convert existing integer cent values to GTQ floats.
  • subscription.billing_cycle uses server_default='MONTHLY' so existing rows are populated at the DB level.
  • All other changes are additive (new nullable columns).

Test plan

  • GitHub Actions migration completes successfully on dev DB
  • tier.price existing rows are converted (not truncated to 0)
  • New columns (tier.modules, tier.price_yearly, subscription.billing_cycle) exist in the dev DB
  • TierPublic schema serializes correctly from a Tier ORM object
  • check_tier_limit() raises 402 when count >= limit, passes when limit is None or -1

🤖 Generated with Claude Code

@pel19072 pel19072 merged commit fd1e0b0 into develop Mar 15, 2026
2 checks passed
@pel19072 pel19072 deleted the feat/tier-billing-modules branch April 5, 2026 10:18
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.

1 participant