add desc
This commit is contained in:
@@ -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;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user