修复房表生成日期错误提示国际化

This commit is contained in:
andy
2026-07-24 13:03:46 +07:00
parent eaea8787d9
commit 3c9430ac5f
3 changed files with 202 additions and 8 deletions

View File

@@ -213,6 +213,23 @@ class ReservationRoomingListGenerationControllerTest {
.andExpect(jsonPath("$.details[0]").value("room_type: 必填字段缺失。"));
}
@Test
void shouldRejectEnglishNameSourceWhenManualStayDatesMissing() throws Exception {
String token = loginToken(mockMvc, "rooming-admin", "Admin@123456");
performAuthorized(mockMvc, token, multipart(ENDPOINT)
.file(sourceFileWithEnglishNames())
.param("hotel_id", "HOTEL-TEST")
.param("people_per_room", "2")
.param("room_type", "UG1")
.param("payment_type", "BTQR")
.param("nationality", "CHN"))
.andExpect(status().isBadRequest())
.andExpect(jsonPath("$.error_code").value("ROOMING_LIST_VALIDATION_FAILED"))
.andExpect(jsonPath("$.details[0]").value("arrival: 第二种来源名单样式必须填写入住日期。"))
.andExpect(jsonPath("$.details[1]").value("departure: 第二种来源名单样式必须填写离店日期。"));
}
@Test
void shouldRejectRoomingListGenerationWhenTravelDateFormatInvalid() throws Exception {
String token = loginToken(mockMvc, "rooming-admin", "Admin@123456");