import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'; export class MessageBase { @ApiProperty({ format: 'uuid', description: 'Identify a flow' }) correlationId: string; @ApiProperty({ format: 'uuid', description: 'Identify a request' }) messageId?: string; @ApiProperty({ description: 'Type of message' }) messageType: string; @ApiProperty({ format: 'date-time' }) timestamp: string; @ApiProperty({ format: 'X.Y.Z', description: 'Message Version' }) version: string; @ApiProperty({ description: 'Message payload' }) payload: T; } export class CreateCommand extends MessageBase {} export class CreateReplyCommand extends MessageBase {} export class CreateReplySuccessCommandPayload { @ApiProperty({ format: 'uuid' }) identifier: string; } export class CreateReplySuccessCommand extends MessageBase {} export class CreateReplyErrorCommandPayload { @ApiProperty() errorCode: string; @ApiProperty() errorMessage: string; @ApiPropertyOptional() errorDetails: any; } export class CreateReplyErrorCommand extends MessageBase {} export class UpdateCommand extends MessageBase> {} export class UpdateReplyCommand extends MessageBase {} export class UpdateReplySuccessCommandPayload { @ApiProperty({ format: 'uuid' }) identifier: string; } export class UpdateReplySuccessCommand extends MessageBase {} export class UpdateReplyErrorCommandPayload { @ApiProperty() errorCode: string; @ApiProperty() errorMessage: string; @ApiPropertyOptional() errorDetails: any; } export class UpdateReplyErrorCommand extends MessageBase {}