Add salesperson commissions on issued invoices and a cheque register.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-11 01:09:59 +03:30
co-authored by Cursor
parent 535c428270
commit 9a991fc1f1
22 changed files with 1238 additions and 11 deletions
+53
View File
@@ -151,6 +151,18 @@ export class CreateInvoiceDto {
@ValidateNested({ each: true })
@Type(() => InvoiceInstallmentInputDto)
installments?: InvoiceInstallmentInputDto[];
@IsOptional()
@Type(() => Number)
@IsNumber()
@Min(0)
commissionPercent?: number | null;
@IsOptional()
@Type(() => Number)
@IsNumber()
@Min(0)
commissionFixedAmount?: number | null;
}
export class UpdateInvoiceDto {
@@ -225,6 +237,42 @@ export class UpdateInvoiceDto {
@ValidateNested({ each: true })
@Type(() => InvoiceInstallmentInputDto)
installments?: InvoiceInstallmentInputDto[];
@IsOptional()
@Type(() => Number)
@IsNumber()
@Min(0)
commissionPercent?: number | null;
@IsOptional()
@Type(() => Number)
@IsNumber()
@Min(0)
commissionFixedAmount?: number | null;
}
export class ChequeInputDto {
@IsString()
@MinLength(1)
@MaxLength(80)
number!: string;
@IsString()
@MinLength(1)
@MaxLength(120)
bank!: string;
@IsString()
dueDate!: string;
@IsOptional()
@IsIn(['pending', 'cleared', 'bounced'])
status?: 'pending' | 'cleared' | 'bounced';
@IsOptional()
@IsString()
@MaxLength(2000)
notes?: string;
}
export class CreatePaymentDto {
@@ -254,6 +302,11 @@ export class CreatePaymentDto {
@IsOptional()
@IsString()
installmentId?: string | null;
@IsOptional()
@ValidateNested()
@Type(() => ChequeInputDto)
cheque?: ChequeInputDto;
}
export class ListInvoicesQueryDto {