Skip to content
Merged

0.8.0 #167

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion api-dto/files/test-groups-info.dto.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {
IsString, IsInt, IsNumber, Min
IsString, IsInt, IsNumber, Min, IsBoolean, IsOptional
} from 'class-validator';

export class TestGroupsInfoDto {
Expand Down Expand Up @@ -31,4 +31,12 @@ export class TestGroupsInfoDto {
@IsInt()
@Min(0)
lastChange!: number;

@IsBoolean()
@IsOptional()
existsInDatabase?: boolean;

@IsBoolean()
@IsOptional()
hasBookletLogs?: boolean;
}
4 changes: 3 additions & 1 deletion apps/backend/src/app/admin/admin.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { LogoController } from './logo/logo.controller';
import { UnitTagsController } from './unit-tags/unit-tags.controller';
import { UnitNotesController } from './unit-notes/unit-notes.controller';
import { ResourcePackageController } from './resource-packages/resource-package.controller';
import { JournalController } from './workspace/journal.controller';

@Module({
imports: [
Expand All @@ -33,7 +34,8 @@ import { ResourcePackageController } from './resource-packages/resource-package.
LogoController,
UnitTagsController,
UnitNotesController,
ResourcePackageController
ResourcePackageController,
JournalController
],
providers: []
})
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import { ApiProperty } from '@nestjs/swagger';
import {
IsNotEmpty,
IsString,
IsOptional
} from 'class-validator';

/**
* DTO for creating a journal entry
*/
export class CreateJournalEntryDto {
@ApiProperty({
description: 'Type of action performed (e.g., create, update, delete)',
example: 'create'
})
@IsNotEmpty()
@IsString()
action_type: string;

@ApiProperty({
description: 'Type of entity that was affected (e.g., unit, response, file)',
example: 'unit'
})
@IsNotEmpty()
@IsString()
entity_type: string;

@ApiProperty({
description: 'ID of the entity that was affected',
example: '123'
})
@IsNotEmpty()
@IsString()
entity_id: string;

@ApiProperty({
description: 'Additional details about the action in JSON format',
example: '{"method":"POST","url":"/api/units","requestBody":{"name":"Test Unit"}}'
})
@IsOptional()
@IsString()
details?: string;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { ApiProperty } from '@nestjs/swagger';
import { JournalEntry } from '../../../database/entities/journal-entry.entity';

/**
* DTO for paginated journal entries response
*/
export class PaginatedJournalEntriesDto {
@ApiProperty({
description: 'Array of journal entries',
type: JournalEntry,
isArray: true
})
data: JournalEntry[];

@ApiProperty({
description: 'Total number of journal entries',
example: 100
})
total: number;

@ApiProperty({
description: 'Current page number',
example: 1
})
page: number;

@ApiProperty({
description: 'Number of items per page',
example: 20
})
limit: number;
}
Loading