Skip to content

fix: remove extensive use of any type#215

Merged
RUKAYAT-CODER merged 1 commit intorinafcode:mainfrom
sublime247:fix/remove-any-type-usage
Mar 25, 2026
Merged

fix: remove extensive use of any type#215
RUKAYAT-CODER merged 1 commit intorinafcode:mainfrom
sublime247:fix/remove-any-type-usage

Conversation

@sublime247
Copy link
Copy Markdown
Contributor

Close #204

  • Remove all as any casts in payments.service.ts (lines 117, 169, 276)
  • Remove as any cast in auth.service.ts (line 232)
  • Remove any parameter type in auth.service.ts generateTokens method
  • Create proper PaymentProvider, SubscriptionWebhookEvent, RefundWebhookData interfaces
  • Add InvoiceStatus enum to replace inline string union in invoice.entity.ts
  • Fix SubscriptionStatus enum usage (use SubscriptionStatus.ACTIVE instead of string cast)
  • Fix RefundStatus enum usage (use RefundStatus.PROCESSED instead of string cast)
  • Fix cancelAtPeriodEnd column type mismatch in subscription.entity.ts
  • Add proper return types to all service and controller methods
  • Type webhook service with proper Stripe/PayPal payload interfaces
  • Type controller request parameter with AuthenticatedRequest interface
  • Add isEmailVerified field to UpdateUserDto to eliminate cast
  • Remove duplicate SubscriptionInterval enum from DTO (reuse entity enum)
  • Fix JwtStrategy validate method typing and secretOrKey undefined
  • Fix transaction.service.ts strict mode errors (unknown error type)
  • Fix test/setup.ts global type declaration for strict mode
  • Add TransactionService mock to payments.service.spec.ts
  • Enable strict TypeScript configuration in tsconfig.json
  • Update DTOs to use Record<string, unknown> instead of Record<string, any>

Close rinafcode#204

- Remove all `as any` casts in payments.service.ts (lines 117, 169, 276)
- Remove `as any` cast in auth.service.ts (line 232)
- Remove `any` parameter type in auth.service.ts generateTokens method
- Create proper PaymentProvider, SubscriptionWebhookEvent, RefundWebhookData interfaces
- Add InvoiceStatus enum to replace inline string union in invoice.entity.ts
- Fix SubscriptionStatus enum usage (use SubscriptionStatus.ACTIVE instead of string cast)
- Fix RefundStatus enum usage (use RefundStatus.PROCESSED instead of string cast)
- Fix cancelAtPeriodEnd column type mismatch in subscription.entity.ts
- Add proper return types to all service and controller methods
- Type webhook service with proper Stripe/PayPal payload interfaces
- Type controller request parameter with AuthenticatedRequest interface
- Add isEmailVerified field to UpdateUserDto to eliminate cast
- Remove duplicate SubscriptionInterval enum from DTO (reuse entity enum)
- Fix JwtStrategy validate method typing and secretOrKey undefined
- Fix transaction.service.ts strict mode errors (unknown error type)
- Fix test/setup.ts global type declaration for strict mode
- Add TransactionService mock to payments.service.spec.ts
- Enable strict TypeScript configuration in tsconfig.json
- Update DTOs to use Record<string, unknown> instead of Record<string, any>
@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 25, 2026

@sublime247 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@sublime247
Copy link
Copy Markdown
Contributor Author

@RUKAYAT-CODER please review

@RUKAYAT-CODER RUKAYAT-CODER merged commit 41e8ec1 into rinafcode:main Mar 25, 2026
5 of 8 checks passed
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.

Remove Extensive Use of any Type

2 participants