feat: add pagination to get bookings endpoints [v2] (#21173)

* feat: add pagination to get bookings endpoints [v2]

* add decorators for pagination

* fix: ensure correct values

* code review comment

* fixup! code review comment
This commit is contained in:
Morgan authored and GitHub committed 2025-05-12 10:09:56 +02:00
1 parent 1277f5e9f7
commit 77054d92df
10 files changed
+242 -13

No files matched your search

+65 -1
View File
@@ -1689,6 +1689,7 @@
"description": "The number of items to return",
"example": 10,
"schema": {
"default": 100,
"type": "number"
}
},
@@ -1699,6 +1700,7 @@
"description": "The number of items to skip",
"example": 0,
"schema": {
"default": 0,
"type": "number"
}
},
@@ -5603,6 +5605,7 @@
"description": "The number of items to return",
"example": 10,
"schema": {
"default": 100,
"type": "number"
}
},
@@ -5613,6 +5616,7 @@
"description": "The number of items to skip",
"example": 0,
"schema": {
"default": 0,
"type": "number"
}
}
@@ -6978,6 +6982,7 @@
"description": "The number of items to return",
"example": 10,
"schema": {
"default": 100,
"type": "number"
}
},
@@ -6988,6 +6993,7 @@
"description": "The number of items to skip",
"example": 0,
"schema": {
"default": 0,
"type": "number"
}
},
@@ -24137,6 +24143,60 @@
"data"
]
},
"PaginationMetaDto": {
"type": "object",
"properties": {
"totalItems": {
"type": "number",
"minimum": 0,
"description": "The total number of items available across all pages, matching the query criteria.",
"example": 123
},
"remainingItems": {
"type": "number",
"minimum": 0,
"description": "The number of items remaining to be fetched *after* the current page. Calculated as: `totalItems - (skip + itemsPerPage)`.",
"example": 103
},
"itemsPerPage": {
"type": "number",
"minimum": 1,
"description": "The maximum number of items requested per page.",
"example": 10
},
"currentPage": {
"type": "number",
"minimum": 1,
"description": "The current page number being returned.",
"example": 2
},
"totalPages": {
"type": "number",
"minimum": 0,
"description": "The total number of pages available.",
"example": 13
},
"hasNextPage": {
"type": "boolean",
"description": "Indicates if there is a subsequent page available after the current one.",
"example": true
},
"hasPreviousPage": {
"type": "boolean",
"description": "Indicates if there is a preceding page available before the current one.",
"example": true
}
},
"required": [
"totalItems",
"remainingItems",
"itemsPerPage",
"currentPage",
"totalPages",
"hasNextPage",
"hasPreviousPage"
]
},
"GetBookingsOutput_2024_08_13": {
"type": "object",
"properties": {
@@ -24168,13 +24228,17 @@
},
"description": "Array of booking data, which can contain either BookingOutput objects or RecurringBookingOutput objects"
},
"pagination": {
"$ref": "#/components/schemas/PaginationMetaDto"
},
"error": {
"type": "object"
}
},
"required": [
"status",
"data"
"data",
"pagination"
]
},
"RescheduleBookingInput_2024_08_13": {