42 行
1.7 KiB
Markdown
42 行
1.7 KiB
Markdown
# 房务详情混合房型逐行出参(Issue #5080)
|
||
|
||
## 背景
|
||
|
||
同一晚存在多个房型时,旧兼容标量会把 `rooms[]` 的首行房型与所有房数相加,导致“标间 1 + 大床房 1”被错误展示为“标间 2”。
|
||
|
||
## 接口
|
||
|
||
`GET /admin/house/orders/{orderId}`
|
||
|
||
## 新增字段
|
||
|
||
`data.itinerary[].expectedRooms[]`:当天逐房型预期房间列表,混合房型展示和业务判断以此字段为准。
|
||
|
||
```json
|
||
{
|
||
"expectedRoom": {
|
||
"roomCategory": null,
|
||
"roomCategoryLabel": null,
|
||
"roomCount": 2
|
||
},
|
||
"expectedRooms": [
|
||
{ "roomCategory": "STANDARD", "roomCategoryLabel": "标间", "roomCount": 1 },
|
||
{ "roomCategory": "KING", "roomCategoryLabel": "大床房", "roomCount": 1 }
|
||
]
|
||
}
|
||
```
|
||
|
||
## 兼容规则
|
||
|
||
- 单一房型:`expectedRoom` 继续返回原标量,`expectedRooms[]` 同时提供逐行数据。
|
||
- 混合房型:`expectedRoom.roomCategory` 与 `roomCategoryLabel` 返回 `null`,防止形成“首房型 × 总房数”的错误含义;`roomCount` 仍为总间数。
|
||
- 未指定房型:房型字段保持 `null`,房数按需求返回。
|
||
- `requirement.current.days[].segments[].candidates[].rooms[]` 仍是候选酒店房型行的权威明细。
|
||
|
||
## 前端适配要求
|
||
|
||
1. 房务详情及“选择酒店”弹窗不得再用 `days[].roomCategory` 或首个酒店 `roomCategory` 表示混合房型。
|
||
2. 标题按 `expectedRooms[]` 渲染,例如“标间 1 间 + 大床房 1 间”。
|
||
3. 候选房型筛选与默认数量应逐条读取 `expectedRooms[]`;不得以首行房型套用总间数。
|
||
4. 兼容后端尚未部署时,可从 `segments[].candidates[0].rooms[]` 读取同等权威明细,但不得猜测列表顺序。
|