fix: validate reset+price mutual exclusivity, remove description field#72
Open
autumnbillinginternalapp[bot] wants to merge 1 commit intonextfrom
Open
fix: validate reset+price mutual exclusivity, remove description field#72autumnbillinginternalapp[bot] wants to merge 1 commit intonextfrom
autumnbillinginternalapp[bot] wants to merge 1 commit intonextfrom
Conversation
1. Added validation that planFeature cannot have both top-level 'reset' and 'price' with amount/tiers - these are conflicting billing models. reset = free allocation, price = paid usage. 2. Removed 'description' field from Plan model, builder, transforms, typegen config, and constants. Field is no longer supported.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Comment on lines
426
to
428
There was a problem hiding this comment.
plan.description no longer exists on the Plan type (removed in this PR), this code will fail at runtime
Suggested change
| // description field removed from Plan model |
Prompt To Fix With AI
This is a comment left during a code review.
Path: atmn/src/commands/push/push.ts
Line: 426-428
Comment:
`plan.description` no longer exists on the `Plan` type (removed in this PR), this code will fail at runtime
```suggestion
// description field removed from Plan model
```
How can I resolve this? If you propose a fix, please make it concise.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two atmn fixes (flagged by Ayush):
1. Validate reset + price conflict
A
planFeaturewith bothreset(free allocation) andpricewithamount/tiers(paid) should error — these are conflicting billing models. Added validation inpush/validate.ts.Example that now errors:
2. Remove description field
Removed
descriptionfrom Plan model, builder, all transforms (apiToSdk, sdkToCode, sdkToApi), typegen config, and constants.Files changed: 9 files across validate, models, builders, transforms, typegen, constants, and tests.
Summary by cubic
Enforces a validation that a planFeature cannot have both reset and price, and removes the Plan.description field across the codebase. This prevents conflicting billing models and simplifies the plan schema.
Bug Fixes
Migration
Written for commit f11a389. Summary will update on new commits.
Greptile Summary
Two fixes to the plan configuration system: validation for conflicting billing models and removal of unused description field.
Key Changes:
planFeaturefrom having bothreset(free allocation) andpricewithamount/tiers(paid billing), which are conflicting billing modelsdescriptionfield fromPlanmodel across all layers (models, builders, transforms, typegen, tests)Confidence Score: 2/5
atmn/src/commands/push/push.tsstill referencesplan.descriptionwhich no longer exists on the Plan type. This will cause runtime errors when comparing/normalizing plans. The file has@ts-nocheckwhich prevented TypeScript from catching this.atmn/src/commands/push/push.ts- it contains a reference to the removeddescriptionfield that must be fixedImportant Files Changed
plan.descriptionfield in normalization function, causing runtime errorFlowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Plan Model<br/>planModels.ts] -->|removed description field| B[Builder Functions<br/>builderFunctions.ts] B -->|plan builder| C[User Config<br/>autumn.config.ts] C -->|push command| D[Validation<br/>validate.ts] D -->|NEW: validates reset+price conflict| E{Valid?} E -->|Yes| F[Transform SDK to API<br/>sdkToApi/plan.ts] E -->|No| G[Error: conflicting billing models] F -->|removed description| H[API Call] A -->|removed description| I[Transform API to SDK<br/>apiToSdk/plan.ts] I -->|pull command| C A -->|removed description| J[Code Generator<br/>sdkToCode/plan.ts] J -->|codegen| C K[Type Config<br/>typeConfigs.ts] -->|removed description default| BLast reviewed commit: f11a389
(5/5) You can turn off certain types of comments like style here!