feat(api-gateway): add Swagger, admin endpoints, and scheduler

- Add Swagger/OpenAPI documentation at /docs endpoint
- Add admin module for system-wide API key management
- Add scheduler for monthly credit reset and usage cleanup
- Add Docker Compose entry for Mac Mini deployment
- Document all endpoints with descriptions and examples
This commit is contained in:
Till-JS 2026-01-29 18:03:16 +01:00
parent 4b322f59b1
commit fc0ed636fc
21 changed files with 1059 additions and 1 deletions

View file

@ -1,7 +1,14 @@
import { IsOptional, IsString, IsDateString, IsInt, Min, Max } from 'class-validator';
import { Transform } from 'class-transformer';
import { ApiPropertyOptional } from '@nestjs/swagger';
export class UsageQueryDto {
@ApiPropertyOptional({
description: 'Number of days to query (1-365)',
minimum: 1,
maximum: 365,
default: 30,
})
@IsOptional()
@Transform(({ value }) => parseInt(value, 10))
@IsInt()
@ -9,14 +16,26 @@ export class UsageQueryDto {
@Max(365)
days?: number = 30;
@ApiPropertyOptional({
description: 'Start date for custom range (ISO 8601)',
example: '2025-01-01',
})
@IsOptional()
@IsDateString()
startDate?: string;
@ApiPropertyOptional({
description: 'End date for custom range (ISO 8601)',
example: '2025-01-31',
})
@IsOptional()
@IsDateString()
endDate?: string;
@ApiPropertyOptional({
description: 'Filter by endpoint',
example: 'search',
})
@IsOptional()
@IsString()
endpoint?: string;