Enhance Cospend with debt breakdown and predefined users
- Add EnhancedBalance component with integrated single-user debt display - Create DebtBreakdown component for multi-user debt overview - Add predefined users configuration (alexander, anna) - Implement personal + equal split payment method - Add profile pictures throughout payment interfaces - Integrate debt information with profile pictures in balance view - Auto-hide debt breakdown when single user (shows in balance instead) - Support both manual and predefined user management modes 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -10,7 +10,7 @@ export interface IPayment {
|
||||
date: Date;
|
||||
image?: string; // path to uploaded image
|
||||
category: 'groceries' | 'shopping' | 'travel' | 'restaurant' | 'utilities' | 'fun';
|
||||
splitMethod: 'equal' | 'full' | 'proportional';
|
||||
splitMethod: 'equal' | 'full' | 'proportional' | 'personal_equal';
|
||||
createdBy: string; // username/nickname of the person who created the payment
|
||||
createdAt?: Date;
|
||||
updatedAt?: Date;
|
||||
@@ -61,7 +61,7 @@ const PaymentSchema = new mongoose.Schema(
|
||||
splitMethod: {
|
||||
type: String,
|
||||
required: true,
|
||||
enum: ['equal', 'full', 'proportional'],
|
||||
enum: ['equal', 'full', 'proportional', 'personal_equal'],
|
||||
default: 'equal'
|
||||
},
|
||||
createdBy: {
|
||||
|
||||
@@ -6,6 +6,7 @@ export interface IPaymentSplit {
|
||||
username: string; // username/nickname of the person who owes/is owed
|
||||
amount: number; // amount this person owes (positive) or is owed (negative)
|
||||
proportion?: number; // for proportional splits, the proportion (e.g., 0.5 for 50%)
|
||||
personalAmount?: number; // for personal_equal splits, the personal portion for this user
|
||||
settled: boolean; // whether this split has been settled
|
||||
settledAt?: Date;
|
||||
createdAt?: Date;
|
||||
@@ -33,6 +34,10 @@ const PaymentSplitSchema = new mongoose.Schema(
|
||||
min: 0,
|
||||
max: 1
|
||||
},
|
||||
personalAmount: {
|
||||
type: Number,
|
||||
min: 0
|
||||
},
|
||||
settled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
|
||||
Reference in New Issue
Block a user