Enhance pagination and ordering capabilities in API responses
- Updated pagination-response and read-write-controllers documentation to include `orderBy` and `orderType` parameters for sorting results. - Introduced new `order-clause` module to handle ordering logic, including validation for order types and columns. - Enhanced `PaginationQueryDto` to support ordering fields in API requests. - Updated various repository and service classes to implement ordering in database queries. - Added unit tests for new ordering functionality and ensured existing tests cover the updated behavior. - Refactored related DTOs to include user and code relations for better data representation in responses.
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
import type {
|
||||
CodeRelation,
|
||||
DefaultRelation,
|
||||
UserRelation,
|
||||
} from '../../../common/http/response';
|
||||
import { DateTime } from '../../../common/value-objects/date-time/date-time';
|
||||
import { Decimal } from '../../../common/value-objects/decimal/decimal';
|
||||
import { Status } from '../../../common/value-objects/status/status';
|
||||
@@ -5,6 +10,7 @@ import { Status } from '../../../common/value-objects/status/status';
|
||||
export type PackingSlipLine = {
|
||||
readonly id: string;
|
||||
readonly productId: string;
|
||||
readonly product: DefaultRelation | null;
|
||||
readonly quantity: Decimal;
|
||||
readonly price: Decimal;
|
||||
};
|
||||
@@ -26,6 +32,10 @@ export type PackingSlip = {
|
||||
readonly updatedAt: DateTime;
|
||||
readonly createdBy: string;
|
||||
readonly updatedBy: string;
|
||||
readonly salesOrder: CodeRelation | null;
|
||||
readonly customer: DefaultRelation | null;
|
||||
readonly createdByUser: UserRelation;
|
||||
readonly updatedByUser: UserRelation;
|
||||
};
|
||||
|
||||
export type PackingSlipLineInput = {
|
||||
@@ -69,6 +79,8 @@ export type ListPackingSlipsFilters = {
|
||||
readonly customerId?: string;
|
||||
readonly salesOrderId?: string;
|
||||
readonly search?: string;
|
||||
readonly orderBy?: string;
|
||||
readonly orderType?: string;
|
||||
readonly limit: number;
|
||||
readonly offset: number;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user