This commit is contained in:
2026-02-21 12:59:15 +03:30
parent 986f852457
commit a636598683
4 changed files with 12 additions and 2 deletions
@@ -72,6 +72,12 @@ export class CreateInvoiceDto {
@IsString() @IsString()
paymentMethod?: string paymentMethod?: string
@IsOptional()
@IsString()
@ApiPropertyOptional()
description?: string;
// @IsArray() // @IsArray()
// @Type(() => IAttachment) // @Type(() => IAttachment)
// @ApiProperty({ type: [IAttachment] }) // @ApiProperty({ type: [IAttachment] })
@@ -96,4 +96,7 @@ export class Invoice extends BaseEntity {
@Property({ type: 'string', nullable: true }) @Property({ type: 'string', nullable: true })
paymentMethod?: string; paymentMethod?: string;
@Property({ type: 'text', nullable: true })
description?: string;
} }
+1 -1
View File
@@ -56,7 +56,7 @@ export class InvoiceController {
@Get('admin/invoice/:id') @Get('admin/invoice/:id')
@UseGuards(AdminAuthGuard) @UseGuards(AdminAuthGuard)
@ApiOperation({ summary: 'Get one invoice by id' }) @ApiOperation({ summary: 'Get one invoice by id (admin)' })
findOneAsAdmin(@Param('id') id: string) { findOneAsAdmin(@Param('id') id: string) {
return this.invoiceService.findOneAsAdmin(id); return this.invoiceService.findOneAsAdmin(id);
} }
+2 -1
View File
@@ -60,7 +60,8 @@ export class InvoiceService {
balance: 0, balance: 0,
attachments: [], attachments: [],
paymentMethod: dto.paymentMethod, paymentMethod: dto.paymentMethod,
invoiceNumber:20 invoiceNumber: 20,
description: dto.description
}); });
em.persist(invoice); em.persist(invoice);