Describe the Bug
While exploring the API codebase, I noticed there are a few TODO comments left in the PriceModule (apps/api/src/modules/Price.ts) regarding the removal of any casts when creating/updating a Price object.
Specifically around these lines when parsing the input:
currency_options: (input.currency_options as any) ?? null
tiers: (input.tiers as any) ?? null
validatedUpdate as Partial<PriceType>
To Reproduce
N/A - This is a codebase typing/tech-debt issue rather than a runtime bug.
Expected Behavior
We should strictly type these properties (likely by aligning the CreatePriceInput schema with the PriceType interface) so that we can remove the any and Partial casting, allowing the TypeScript compiler to properly enforce type safety here.
Actual Behavior
Currently, type safety is bypassed in these instances via manual type casting.
Environment
- OS: Linux
- Node.js Version: 20.x
- Browser: N/A
- Zoneless Version/Commit: main branch
Logs
N/A
Checklist
Describe the Bug
While exploring the API codebase, I noticed there are a few
TODOcomments left in thePriceModule(apps/api/src/modules/Price.ts) regarding the removal ofanycasts when creating/updating a Price object.Specifically around these lines when parsing the input:
currency_options: (input.currency_options as any) ?? nulltiers: (input.tiers as any) ?? nullvalidatedUpdate as Partial<PriceType>To Reproduce
N/A - This is a codebase typing/tech-debt issue rather than a runtime bug.
Expected Behavior
We should strictly type these properties (likely by aligning the
CreatePriceInputschema with thePriceTypeinterface) so that we can remove theanyandPartialcasting, allowing the TypeScript compiler to properly enforce type safety here.Actual Behavior
Currently, type safety is bypassed in these instances via manual type casting.
Environment
Logs
N/A
Checklist