8000 fix: add category field to TypeScript database type definitions by laminko · Pull Request #16 · laminko/SpendCheck · GitHub
[go: up one dir, main page]

Skip to content

fix: add category field to TypeScript database type definitions - #16

Merged
laminko merged 1 commit into
devfrom
docs/update-readme-v2
Jun 13, 2025
Merged

laminko merged 1 commit into
devfrom
docs/update-readme-v2

Conversation

@laminko
@laminko laminko commented Jun 13, 2025
Copy link
Copy Markdown
Owner

Summary

  • Add missing category field to Database type definitions in supabase.ts
  • Update SpendingEntry interface to make category optional for backward compatibility
  • Add generic typing to supabase client for better type safety

Changes Made

  • Database.Row: Added category: string | null
  • Database.Insert: Added category?: string | null
  • Database.Update: Added category?: string | null
  • SpendingEntry: Updated to category?: string | null
  • Supabase Client: Added generic Database type

Why This Fix Was Needed

The category functionality was working in the UI but had TypeScript type mismatches:

  • Frontend code was using category field but Database types didn't include it
  • This could lead to runtime errors and loss of type safety
  • Category field is now properly typed as nullable to handle legacy entries

Testing

  • ✅ TypeScript compilation passes (npm run typecheck)
  • ✅ End-to-end category functionality verified
  • ✅ Both predefined and custom categories work correctly
  • ✅ Category data persists to database properly

Impact

  • Type Safety: Full IntelliSense and compile-time checking for category operations
  • Backward Compatibility: Handles entries created before category feature
  • Developer Experience: Better autocomplete and error detection

🤖 Generated with Claude Code

- Add category field to Database.Row, Insert, and Update types
- Update SpendingEntry interface to make category optional
- Add generic typing to supabase client for better type safety
- Support legacy entries without category data (nullable field)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@vercel
vercel Bot commented Jun 13, 2025 •
Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
spend-check ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 13, 2025 7:05am

@laminko
laminko merged commit 8e7beba into dev Jun 13, 2025
@laminko
laminko deleted the docs/update-readme-v2 branch June 13, 2025 07:06
laminko added a commit that referenced this pull request Jun 22, 2025
fix: add category field to TypeScript database type definitions

This branch was successfully deployed

1 active deployment
Preview — 0ba48fb6 Deployed Jun 13, 2025 by vercel[bot]
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.

1 participant

0