Add payment categories with emoji icons and image upload support

- Add comprehensive category system: Groceries 🛒, Shopping 🛍️, Travel 🚆, Restaurant 🍽️, Utilities , Fun 🎉
- Create category utility functions with emoji and display name helpers
- Update Payment model and API validation to support categories
- Add category selectors to payment creation and edit forms
- Display category emojis prominently across all UI components:
  - Dashboard recent activities with category icons and names
  - Payment cards showing category in metadata
  - Payment modals and view pages with category information
- Add image upload/removal functionality to payment edit form
- Maintain responsive design and consistent styling across all components

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-09-08 22:29:52 +02:00
parent d22bdf4902
commit e4ee109d8b
11 changed files with 333 additions and 24 deletions

View File

@@ -9,6 +9,7 @@ export interface IPayment {
paidBy: string; // username/nickname of the person who paid
date: Date;
image?: string; // path to uploaded image
category: 'groceries' | 'shopping' | 'travel' | 'restaurant' | 'utilities' | 'fun';
splitMethod: 'equal' | 'full' | 'proportional';
createdBy: string; // username/nickname of the person who created the payment
createdAt?: Date;
@@ -51,6 +52,12 @@ const PaymentSchema = new mongoose.Schema(
type: String,
trim: true
},
category: {
type: String,
required: true,
enum: ['groceries', 'shopping', 'travel', 'restaurant', 'utilities', 'fun'],
default: 'groceries'
},
splitMethod: {
type: String,
required: true,