Enhance sales document flow with new service and related functionalities

- Introduced `SalesDocumentFlowService` to manage the lifecycle of sales documents, including packing slips and invoices.
- Implemented methods for processing orders, generating invoices, and handling packing slips based on order status.
- Updated `SalesOrdersService`, `PackingSlipsService`, and `SalesInvoicesService` to integrate with the new document flow service.
- Added new methods for marking drafts processed and checking if invoices are on sales plans.
- Enhanced existing services and repositories to support new functionalities, including status transitions and related document management.
- Updated DTOs to include new fields for packing slip and invoice IDs in sales order responses.
- Added unit tests for the new service and updated existing tests to cover new functionalities.
This commit is contained in:
shancheas
2026-08-31 09:35:18 +07:00
parent 627aeac4a0
commit afed5ff0f5
24 changed files with 950 additions and 53 deletions
@@ -168,6 +168,13 @@ export class UpdatePackingSlipStatusDto {
@ApiProperty({ enum: PACKING_SLIP_STATUSES })
@IsIn([...PACKING_SLIP_STATUSES])
status!: string;
@ApiPropertyOptional({ type: [SalesLineDto] })
@IsOptional()
@IsArray()
@ValidateNested({ each: true })
@Type(() => SalesLineDto)
products?: SalesLineDto[];
}
export class BulkIdsDto {