Add date and createdBy filters to sales payments functionality
- Introduced new filters `date` and `createdBy` in the `ListSalesPaymentsFilters` and `ListSalesPaymentsQuery` types to enhance querying capabilities. - Updated the `SalesPaymentsRepository` to handle filtering based on the new fields. - Enhanced the `SalesPaymentsService` to process the new filters and ensure proper date handling. - Added unit tests to validate the integration of the new filters in the service layer. - Updated DTOs to include validation for the new fields, ensuring correct data formats in API requests.
This commit is contained in:
@@ -316,6 +316,12 @@ export class SalesPaymentsRepository {
|
||||
parts.push(search);
|
||||
}
|
||||
}
|
||||
if (filters.date !== undefined) {
|
||||
parts.push(eq(salesPayments.date, filters.date));
|
||||
}
|
||||
if (filters.createdBy) {
|
||||
parts.push(eq(salesPayments.createdBy, filters.createdBy));
|
||||
}
|
||||
if (parts.length === 0) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user