Files
tabungin/apps/api/dist/goals/goals.controller.d.ts
Dwindi Ramadhana 6a6e74562c checkpoint: goals feature, wallet balance, and goals/wallet detail UI
- 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
2026-06-17 20:40:00 +07:00

262 lines
9.4 KiB
TypeScript
Executable File

import { GoalsService } from './goals.service';
import { CreateGoalDto } from './dto/create-goal.dto';
import { UpdateGoalDto } from './dto/update-goal.dto';
import { CreateAllocationDto } from './dto/create-allocation.dto';
export declare class GoalsController {
private readonly goalsService;
constructor(goalsService: GoalsService);
create(req: any, createGoalDto: CreateGoalDto): Promise<{
allocations: ({
wallet: {
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;
};
} & {
id: string;
createdAt: Date;
currency: string;
amount: import("@prisma/client/runtime/library").Decimal;
walletId: string;
notes: string | null;
goalId: string;
exchangeRate: import("@prisma/client/runtime/library").Decimal | null;
amountInGoalCurrency: import("@prisma/client/runtime/library").Decimal;
createdBy: string;
})[];
milestones: {
id: string;
targetAmount: import("@prisma/client/runtime/library").Decimal;
percentage: number;
goalId: string;
achievedAt: Date | null;
notifiedAt: Date | null;
}[];
} & {
category: string | null;
id: string;
createdAt: Date;
updatedAt: Date;
status: string;
name: string;
userId: string;
currency: string;
description: string | null;
targetAmount: import("@prisma/client/runtime/library").Decimal;
targetDate: Date | null;
imageUrl: string | null;
teamId: string | null;
currentAmount: import("@prisma/client/runtime/library").Decimal;
completedAt: Date | null;
}>;
findAll(req: any, status?: string): Promise<({
allocations: ({
wallet: {
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;
};
} & {
id: string;
createdAt: Date;
currency: string;
amount: import("@prisma/client/runtime/library").Decimal;
walletId: string;
notes: string | null;
goalId: string;
exchangeRate: import("@prisma/client/runtime/library").Decimal | null;
amountInGoalCurrency: import("@prisma/client/runtime/library").Decimal;
createdBy: string;
})[];
milestones: {
id: string;
targetAmount: import("@prisma/client/runtime/library").Decimal;
percentage: number;
goalId: string;
achievedAt: Date | null;
notifiedAt: Date | null;
}[];
} & {
category: string | null;
id: string;
createdAt: Date;
updatedAt: Date;
status: string;
name: string;
userId: string;
currency: string;
description: string | null;
targetAmount: import("@prisma/client/runtime/library").Decimal;
targetDate: Date | null;
imageUrl: string | null;
teamId: string | null;
currentAmount: import("@prisma/client/runtime/library").Decimal;
completedAt: Date | null;
})[]>;
getStats(req: any): Promise<{
totalGoals: number;
activeGoals: number;
completedGoals: number;
totalTargetAmount: number;
totalCurrentAmount: number;
overallProgress: number;
}>;
findOne(req: any, id: string): Promise<{
allocations: ({
wallet: {
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;
};
} & {
id: string;
createdAt: Date;
currency: string;
amount: import("@prisma/client/runtime/library").Decimal;
walletId: string;
notes: string | null;
goalId: string;
exchangeRate: import("@prisma/client/runtime/library").Decimal | null;
amountInGoalCurrency: import("@prisma/client/runtime/library").Decimal;
createdBy: string;
})[];
milestones: {
id: string;
targetAmount: import("@prisma/client/runtime/library").Decimal;
percentage: number;
goalId: string;
achievedAt: Date | null;
notifiedAt: Date | null;
}[];
} & {
category: string | null;
id: string;
createdAt: Date;
updatedAt: Date;
status: string;
name: string;
userId: string;
currency: string;
description: string | null;
targetAmount: import("@prisma/client/runtime/library").Decimal;
targetDate: Date | null;
imageUrl: string | null;
teamId: string | null;
currentAmount: import("@prisma/client/runtime/library").Decimal;
completedAt: Date | null;
}>;
update(req: any, id: string, updateGoalDto: UpdateGoalDto): Promise<{
allocations: ({
wallet: {
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;
};
} & {
id: string;
createdAt: Date;
currency: string;
amount: import("@prisma/client/runtime/library").Decimal;
walletId: string;
notes: string | null;
goalId: string;
exchangeRate: import("@prisma/client/runtime/library").Decimal | null;
amountInGoalCurrency: import("@prisma/client/runtime/library").Decimal;
createdBy: string;
})[];
milestones: {
id: string;
targetAmount: import("@prisma/client/runtime/library").Decimal;
percentage: number;
goalId: string;
achievedAt: Date | null;
notifiedAt: Date | null;
}[];
} & {
category: string | null;
id: string;
createdAt: Date;
updatedAt: Date;
status: string;
name: string;
userId: string;
currency: string;
description: string | null;
targetAmount: import("@prisma/client/runtime/library").Decimal;
targetDate: Date | null;
imageUrl: string | null;
teamId: string | null;
currentAmount: import("@prisma/client/runtime/library").Decimal;
completedAt: Date | null;
}>;
remove(req: any, id: string): Promise<{
message: string;
}>;
addAllocation(req: any, id: string, createAllocationDto: CreateAllocationDto): Promise<{
wallet: {
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;
};
} & {
id: string;
createdAt: Date;
currency: string;
amount: import("@prisma/client/runtime/library").Decimal;
walletId: string;
notes: string | null;
goalId: string;
exchangeRate: import("@prisma/client/runtime/library").Decimal | null;
amountInGoalCurrency: import("@prisma/client/runtime/library").Decimal;
createdBy: string;
}>;
removeAllocation(req: any, id: string, allocationId: string): Promise<{
message: string;
}>;
}