Implement an endpoint which will return a paginated list of tax lots,as document in #171 . Pagination will utilize an offset key paradigm, which exposes the "LIMIT" and "OFFSET" sql functionality through optional query parameters of the same names. When either query parameter is omitted, the application will fall back to default values. "Limit" will also have a maximum value that will be invoked if users request a number higher than this value. The returned object will return pagination metadata.
Acceptance Criteria
generate zod schemas and types
[x] npm run generate
create a tax lot controller that
[x] accepts a request for a paginated list of tax lots
[x] accepts a query parameter for limit and offset
[x] uses a zod validation pipe to ensure the limit and offset parameters are valid
[x] calls a service for additional processing
[x] returns the service result to the user
create a tax lot service that
[x] accepts a limit parameters of type string, defaulting to value '20'
[x] accepts an offset parameter of type string, defaulting to value '0'
[x] uses a zod schema to coerce the parameters to positive integers
If parsing fails, an application specific error should be thrown
the error should be "filtered" into a 400 response
[x] Reduces any 'limit' above 100 down to 100.
[x] calls a repository to access the applicable data
[x] returns an object that complies with the schema document in the open api
create a tax lot repository
[x] accepts a request for limited results of the tax lot table
[x] accepts an offset of type number
[x] accepts a limit of type number
[x] makes a query whose results are in the shape of 'a list of taxLotEntitySchema`
[x] returns the taxLotEntitySchemas
[x] if there is a data retrieval error, throw the nominal error
Description
As part of discussion #97
Implement an endpoint which will return a paginated list of tax lots,as document in #171 . Pagination will utilize an offset key paradigm, which exposes the "LIMIT" and "OFFSET" sql functionality through optional query parameters of the same names. When either query parameter is omitted, the application will fall back to default values. "Limit" will also have a maximum value that will be invoked if users request a number higher than this value. The returned object will return pagination metadata.
Acceptance Criteria
npm run generate
Related
blocked by #171