Closed Chun-Cheng closed 3 months ago
intervals
item_id
/^[a-fA-F0-9]{24}$/
start_datetime
/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})$/
end_datetime
response
if intervals is false:
false
available_quantity
example:
{ "available_quantity": 5 }
if intervals is true:
true
{ "intervals": [ { "start_datetime": "2024-05-01T13:00", "end_datetime": "2024-05-02T12:00", "available_quantity": 20 }, { "start_datetime": "2024-05-02T13:00", "end_datetime": "2024-05-03T12:00", "available_quantity": 5 }, ] }
error_code
message
{ "error_code": "R_ID_NOT_FOUND", "message": "Item ID not found" }
合併 /routes/reserve/get_interval_item_availability.js(各時段物品能否預約)及 /routes/reserve/get_integral_item_availability.js(整體時段物品能否預約)
URB-34 GET `/item_available_time` : 查詢特定時段物品可預約數量
輸入與輸出
intervals
(query) 是否切分成各時段進行回傳 string, optional(false by dafault) format: true/false example: falseitem_id
(query) 物品 _id string, required format: Object ID/^[a-fA-F0-9]{24}$/
example: "652038af1b2271aa002c0a09"start_datetime
(query) 查詢起始時間 string, optional format:/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})$/
example: "2024-04-29T13:00"end_datetime
(query) 查詢結束時間string, optional
format:
/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})$/
example: "2024-04-29T17:00"
response
if intervals is
false
:available_quantity
: integer, 可預約數量example:
if intervals is
true
:intervals
: Array, 各時段可否預約資料start_datetime
: string, 時段開始時間 format:/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})$/
end_datetime
: string, 時段結束時間 format:/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})$/
available_quantity
: integer, 可預約數量example:
error_code
: string, 錯誤代碼message
: string, 提示訊息example:
檔案
資料集
備註
合併 /routes/reserve/get_interval_item_availability.js(各時段物品能否預約)及 /routes/reserve/get_integral_item_availability.js(整體時段物品能否預約)