- Add goals feature (models, migrations, API, web pages) - Add reserved/centralized wallet balance service - Add wallet detail page and overview components - Add new UI components (progress, multi-select, FAB) - Remove stray empty -H/-d files from working tree
151 lines
5.7 KiB
TypeScript
Executable File
151 lines
5.7 KiB
TypeScript
Executable File
import { WalletsService } from './wallets.service';
|
|
import { TransactionsService } from '../transactions/transactions.service';
|
|
import { WalletBalanceService } from './wallet-balance.service';
|
|
interface RequestWithUser {
|
|
user: {
|
|
userId: string;
|
|
};
|
|
}
|
|
export declare class WalletsController {
|
|
private readonly wallets;
|
|
private readonly transactions;
|
|
private readonly walletBalance;
|
|
constructor(wallets: WalletsService, transactions: TransactionsService, walletBalance: WalletBalanceService);
|
|
list(req: RequestWithUser): import("@prisma/client").Prisma.PrismaPromise<{
|
|
id: string;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
name: string;
|
|
userId: string;
|
|
kind: string;
|
|
currency: string | null;
|
|
unit: string | null;
|
|
deletedAt: Date | null;
|
|
initialAmount: import("@prisma/client/runtime/library").Decimal | null;
|
|
pricePerUnit: import("@prisma/client/runtime/library").Decimal | null;
|
|
reservedBalance: import("@prisma/client/runtime/library").Decimal;
|
|
}[]>;
|
|
getAllTransactions(req: RequestWithUser): Promise<{
|
|
category: string | null;
|
|
id: string;
|
|
createdAt: Date;
|
|
userId: string;
|
|
amount: import("@prisma/client/runtime/library").Decimal;
|
|
direction: string;
|
|
date: Date;
|
|
memo: string | null;
|
|
walletId: string;
|
|
recurrenceId: string | null;
|
|
}[]>;
|
|
getAllBalances(req: RequestWithUser): Promise<{
|
|
walletId: string;
|
|
kind: string;
|
|
currency: string | undefined;
|
|
unit: string | undefined;
|
|
totalBalance: number;
|
|
reservedBalance: number;
|
|
availableBalance: number;
|
|
totalUnits: number | undefined;
|
|
pricePerUnit: number | undefined;
|
|
totalValue: number | undefined;
|
|
}[]>;
|
|
getOne(req: RequestWithUser, id: string): import("@prisma/client").Prisma.Prisma__WalletClient<{
|
|
id: string;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
name: string;
|
|
userId: string;
|
|
kind: string;
|
|
currency: string | null;
|
|
unit: string | null;
|
|
deletedAt: Date | null;
|
|
initialAmount: import("@prisma/client/runtime/library").Decimal | null;
|
|
pricePerUnit: import("@prisma/client/runtime/library").Decimal | null;
|
|
reservedBalance: import("@prisma/client/runtime/library").Decimal;
|
|
} | null, null, import("@prisma/client/runtime/library").DefaultArgs, import("@prisma/client").Prisma.PrismaClientOptions>;
|
|
create(req: RequestWithUser, body: {
|
|
name: string;
|
|
currency?: string;
|
|
kind?: 'money' | 'asset';
|
|
unit?: string;
|
|
initialAmount?: number;
|
|
pricePerUnit?: number;
|
|
}): import("@prisma/client").Prisma.Prisma__WalletClient<{
|
|
id: string;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
name: string;
|
|
userId: string;
|
|
kind: string;
|
|
currency: string | null;
|
|
unit: string | null;
|
|
deletedAt: Date | null;
|
|
initialAmount: import("@prisma/client/runtime/library").Decimal | null;
|
|
pricePerUnit: import("@prisma/client/runtime/library").Decimal | null;
|
|
reservedBalance: import("@prisma/client/runtime/library").Decimal;
|
|
}, never, import("@prisma/client/runtime/library").DefaultArgs, import("@prisma/client").Prisma.PrismaClientOptions> | {
|
|
error: string;
|
|
};
|
|
update(req: RequestWithUser, id: string, body: {
|
|
name?: string;
|
|
currency?: string;
|
|
kind?: 'money' | 'asset';
|
|
unit?: string;
|
|
initialAmount?: number;
|
|
pricePerUnit?: number;
|
|
}): import("@prisma/client").Prisma.Prisma__WalletClient<{
|
|
id: string;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
name: string;
|
|
userId: string;
|
|
kind: string;
|
|
currency: string | null;
|
|
unit: string | null;
|
|
deletedAt: Date | null;
|
|
initialAmount: import("@prisma/client/runtime/library").Decimal | null;
|
|
pricePerUnit: import("@prisma/client/runtime/library").Decimal | null;
|
|
reservedBalance: import("@prisma/client/runtime/library").Decimal;
|
|
}, never, import("@prisma/client/runtime/library").DefaultArgs, import("@prisma/client").Prisma.PrismaClientOptions>;
|
|
bulkUpdatePrices(req: RequestWithUser, body: {
|
|
updates: Array<{
|
|
walletId: string;
|
|
pricePerUnit: number;
|
|
}>;
|
|
}): Promise<{
|
|
success: boolean;
|
|
updated: number;
|
|
wallets: {
|
|
id: string;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
name: string;
|
|
userId: string;
|
|
kind: string;
|
|
currency: string | null;
|
|
unit: string | null;
|
|
deletedAt: Date | null;
|
|
initialAmount: import("@prisma/client/runtime/library").Decimal | null;
|
|
pricePerUnit: import("@prisma/client/runtime/library").Decimal | null;
|
|
reservedBalance: import("@prisma/client/runtime/library").Decimal;
|
|
}[];
|
|
}> | {
|
|
error: string;
|
|
};
|
|
delete(req: RequestWithUser, id: string): import("@prisma/client").Prisma.Prisma__WalletClient<{
|
|
id: string;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
name: string;
|
|
userId: string;
|
|
kind: string;
|
|
currency: string | null;
|
|
unit: string | null;
|
|
deletedAt: Date | null;
|
|
initialAmount: import("@prisma/client/runtime/library").Decimal | null;
|
|
pricePerUnit: import("@prisma/client/runtime/library").Decimal | null;
|
|
reservedBalance: import("@prisma/client/runtime/library").Decimal;
|
|
}, never, import("@prisma/client/runtime/library").DefaultArgs, import("@prisma/client").Prisma.PrismaClientOptions>;
|
|
}
|
|
export {};
|