feat(wallets): add isDefault field to wallet model and implement setDefaultWallet functionality

This commit is contained in:
Jose Selesan
2026-06-17 10:15:44 -03:00
parent 798d657869
commit 5671b4a14b
11 changed files with 459 additions and 43 deletions

View File

@@ -149,11 +149,15 @@ export type CreateNonPeriodicExpenseInput = {
description: string;
amount: number;
dueDate: string;
walletId: number;
usdcConversionRate?: number;
};
export type PayExpenseInput = {
amountPayed: number;
paymentDate?: string;
walletId: number;
usdcConversionRate?: number;
};
export type UpdateExpenseInput = {
@@ -327,6 +331,7 @@ export type Wallet = {
name: string;
currency: string;
balance: number;
isDefault: boolean;
createdAt: string;
updatedAt: string;
};
@@ -409,6 +414,10 @@ export function transferWallet(
);
}
export function setDefaultWallet(id: number): Promise<Wallet> {
return mutator<Wallet>(`/api/wallets/${id}/default`, "PUT");
}
export function getWalletMovements(
id: number,
): Promise<WalletMovement[]> {