mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2026-03-10 17:11:44 +00:00
- GET /guardians/me/allowances: list all children grouped by schedule status - withSchedule: children with configured allowances (flattened response) - withoutSchedule: children without allowances - monthlyTotal: sum of active schedules converted to monthly equivalent - GET /guardians/me/allowances/summary: lightweight endpoint for home page - nextPaymentAt: nearest upcoming payment date - monthlyTotal: monthly equivalent total - PATCH /guardians/me/allowances/:scheduleId: update existing schedule - supports partial updates (amount, frequency, status) - recalculates nextRunAt when frequency or status changes - Added interfaces directory for type definitions - Added response DTOs with flattened junior + schedule data
22 lines
640 B
TypeScript
22 lines
640 B
TypeScript
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
|
|
|
export class AllowanceSummaryResponseDto {
|
|
@ApiPropertyOptional({
|
|
example: '2026-02-01T00:00:00.000Z',
|
|
description: 'The nearest upcoming payment date among all active schedules (null if no active schedules)',
|
|
nullable: true,
|
|
})
|
|
nextPaymentAt!: Date | null;
|
|
|
|
@ApiProperty({
|
|
example: 1600,
|
|
description: 'Total monthly equivalent amount for all active schedules',
|
|
})
|
|
monthlyTotal!: number;
|
|
|
|
constructor(nextPaymentAt: Date | null, monthlyTotal: number) {
|
|
this.nextPaymentAt = nextPaymentAt;
|
|
this.monthlyTotal = monthlyTotal;
|
|
}
|
|
}
|