tquoctuan97 / foody-api-nestjs

2 stars 0 forks source link

Add Date Range Filter in API for Retrieving Bill List #15

Closed tquoctuan97 closed 2 months ago

tquoctuan97 commented 2 months ago

Currently, The API api/v1/admin/bills supports filtering by a single date using the parameter billDate. Users have requested the ability to filter by a date range.

Filter by Date Range

To filter by a date range, users can provide the following:

/api/v1/admin/bills?billDateFrom=2024-01-01T00:00:00.000Z&billDateTo=2024-01-31T00:00:00.000Z

Filter by billDateForm only

If users provide only the billDateFrom parameter, the API will return bills created from the specified date to the present.

Filter by billDateTo only

If users provide only the billDateTo parameter, the API will return bills created from the oldest date up to the specified date.

Validation