Skip to content

feat(db): profile service discounts and Stripe catalog on services#43

Closed
achneerov wants to merge 4 commits intodevfrom
feat/42/profile-service-discounts
Closed

feat(db): profile service discounts and Stripe catalog on services#43
achneerov wants to merge 4 commits intodevfrom
feat/42/profile-service-discounts

Conversation

@achneerov
Copy link
Copy Markdown

@achneerov achneerov commented Apr 8, 2026

Closes #42

Overview

Extends the services table with optional Stripe catalog identifiers (stripe_product_id, stripe_default_price_id) so each offering can be tied to a Product and default Price in Stripe.

Adds profile_service_discounts for per-user, per-service admin-granted discounts: stores the Stripe coupon id, optional max_uses, use_count, optional expires_at, and enforces at most one row per user and service. Checkout and subscriptions should apply this coupon alongside line items that use the service’s price.

This uses a coupon-based model instead of storing alternate Stripe price ids per user, which keeps catalog pricing clear and aligns with how Stripe applies discounts.

Testing

Schema-only change. Apply locally with pnpm db:push or generate a migration with pnpm db:generate when you are ready to version database changes.

Screenshots / Screencasts

N/A — no UI changes.

Checklist

  • Code is neat, readable, and works
  • Issue number is linked
  • Branch is linked

Notes

Issue #42 originally described a services_pricing_mapping table with per-user stripe_price_id; this PR implements the same product goal with Stripe coupons plus optional use limits, which fits one-time and subscription flows without replacing catalog prices.

Copy link
Copy Markdown

@RenaudBernier RenaudBernier 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. Thank you for implementing these changes and making the script.

@achneerov achneerov closed this Apr 10, 2026
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