Update from task 22461441-e0ef-4fe2-9c6d-42b6e38d3f0f - #2
Conversation
Reviewer's GuideRefines pricing utilities to support monthly/yearly Stripe price IDs and richer feature-limit helpers, exports typed Drizzle models from the DB schema, and adds production deployment and readiness documentation plus Vercel configuration scaffolding. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- In
checkFeatureLimitandgetRemainingUsage, treating a missing feature (undefined) as "no access" in one case (returnsfalse) and "unlimited" in the other (returns-1) is inconsistent and could be confusing—consider aligning the semantics or explicitly documenting the intended behavior. - The new
vercel.jsonfile underglyph-saas/webis empty in this PR; either populate it with the intended Vercel configuration or remove it to avoid confusion and accidental overrides.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `checkFeatureLimit` and `getRemainingUsage`, treating a missing feature (`undefined`) as "no access" in one case (returns `false`) and "unlimited" in the other (returns `-1`) is inconsistent and could be confusing—consider aligning the semantics or explicitly documenting the intended behavior.
- The new `vercel.json` file under `glyph-saas/web` is empty in this PR; either populate it with the intended Vercel configuration or remove it to avoid confusion and accidental overrides.
## Individual Comments
### Comment 1
<location path="glyph-saas/api/src/utils/pricing.ts" line_range="124" />
<code_context>
+): number {
+ const limit = PRICING_TIERS[tier].features[feature] as number | undefined;
+
+ if (limit === undefined || limit === -1) {
+ return -1; // Unlimited
+ }
</code_context>
<issue_to_address>
**issue:** Treating an undefined feature limit as unlimited may be misleading.
In `getRemainingUsage`, `limit === undefined` returns `-1` ("Unlimited"). For a feature not present on a tier, this is misleading and may be interpreted as fully allowed. Consider returning a distinct "not applicable" value instead (e.g. `0`, `null`, `NaN`, or a union type) or aligning this behavior with `checkFeatureLimit`'s handling of undefined limits.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| ): number { | ||
| const limit = PRICING_TIERS[tier].features[feature] as number | undefined; | ||
|
|
||
| if (limit === undefined || limit === -1) { |
There was a problem hiding this comment.
issue: Treating an undefined feature limit as unlimited may be misleading.
In getRemainingUsage, limit === undefined returns -1 ("Unlimited"). For a feature not present on a tier, this is misleading and may be interpreted as fully allowed. Consider returning a distinct "not applicable" value instead (e.g. 0, null, NaN, or a union type) or aligning this behavior with checkFeatureLimit's handling of undefined limits.
This PR was created by qwen-chat coder for task 22461441-e0ef-4fe2-9c6d-42b6e38d3f0f.
Summary by Sourcery
Update pricing utilities to support more robust feature limit handling and add deployment and production readiness documentation for the SaaS app.
New Features:
Enhancements:
Documentation: