2026-02-12 20:31:04 +03:30
|
|
|
import { ApiProperty, PartialType } from '@nestjs/swagger'
|
2026-02-16 20:51:34 +03:30
|
|
|
import { ArrayMinSize, IsNumber, IsOptional, IsString } from 'class-validator'
|
|
|
|
|
import { CreateSalesInvoiceItemDto } from '../../sales-invoice-items/dto/create-sales-invoice-item.dto'
|
2025-12-09 13:59:07 +03:30
|
|
|
|
|
|
|
|
export class CreateSalesInvoiceDto {
|
|
|
|
|
@IsString()
|
2026-02-12 20:31:04 +03:30
|
|
|
@ApiProperty()
|
2025-12-09 13:59:07 +03:30
|
|
|
code: string
|
|
|
|
|
|
|
|
|
|
@IsNumber()
|
2026-02-16 20:51:34 +03:30
|
|
|
@ApiProperty({ required: true, default: 0 })
|
2026-02-12 20:31:04 +03:30
|
|
|
total_amount: number
|
2025-12-09 13:59:07 +03:30
|
|
|
|
|
|
|
|
@IsOptional()
|
2026-02-12 20:31:04 +03:30
|
|
|
@IsString()
|
|
|
|
|
@ApiProperty({ required: false })
|
|
|
|
|
customer_id?: string
|
2026-02-16 20:51:34 +03:30
|
|
|
|
|
|
|
|
@ApiProperty()
|
|
|
|
|
@ArrayMinSize(1)
|
|
|
|
|
items: CreateSalesInvoiceItemDto[]
|
2025-12-09 13:59:07 +03:30
|
|
|
}
|
2026-02-12 20:31:04 +03:30
|
|
|
|
|
|
|
|
export class UpdateSalesInvoiceDto extends PartialType(CreateSalesInvoiceDto) {}
|