调整房表生成国籍选项
This commit is contained in:
@@ -425,8 +425,6 @@ export default {
|
||||
vip: 'VIP',
|
||||
nationality: 'Nationality',
|
||||
nationalityPlaceholder: 'Select nationality',
|
||||
nationalityKr: 'KR',
|
||||
nationalityChn: 'CHN',
|
||||
email: 'Email',
|
||||
idType: 'ID Type',
|
||||
idNumber: 'ID Number',
|
||||
@@ -449,7 +447,7 @@ export default {
|
||||
paymentTypeRequired: 'Select payment type.',
|
||||
paymentTypeAllowed: 'Only BTQR or CA are currently allowed.',
|
||||
nationalityRequired: 'Select nationality.',
|
||||
nationalityAllowed: 'Only KR or CHN are currently allowed.',
|
||||
nationalityAllowed: 'Only KR, CN, TH, MM, RS, or TW are currently allowed.',
|
||||
invalidEmail: 'Invalid email.',
|
||||
},
|
||||
errors: {
|
||||
|
||||
@@ -425,8 +425,6 @@ export default {
|
||||
vip: 'VIP',
|
||||
nationality: 'Nationality',
|
||||
nationalityPlaceholder: 'เลือก Nationality',
|
||||
nationalityKr: 'KR',
|
||||
nationalityChn: 'CHN',
|
||||
email: 'Email',
|
||||
idType: 'ID Type',
|
||||
idNumber: 'ID Number',
|
||||
@@ -449,7 +447,7 @@ export default {
|
||||
paymentTypeRequired: 'กรุณาเลือก Payment Type',
|
||||
paymentTypeAllowed: 'รองรับเฉพาะ BTQR หรือ CA ในตอนนี้',
|
||||
nationalityRequired: 'กรุณาเลือก Nationality',
|
||||
nationalityAllowed: 'รองรับเฉพาะ KR หรือ CHN ในตอนนี้',
|
||||
nationalityAllowed: 'รองรับเฉพาะ KR, CN, TH, MM, RS หรือ TW ในตอนนี้',
|
||||
invalidEmail: 'รูปแบบ Email ไม่ถูกต้อง',
|
||||
},
|
||||
errors: {
|
||||
|
||||
@@ -424,8 +424,6 @@ export default {
|
||||
vip: 'VIP',
|
||||
nationality: '国籍(Nationality)',
|
||||
nationalityPlaceholder: '请选择国籍',
|
||||
nationalityKr: 'KR',
|
||||
nationalityChn: 'CHN',
|
||||
email: '邮箱(Email)',
|
||||
idType: '证件类型(ID Type)',
|
||||
idNumber: '证件号码(ID Number)',
|
||||
@@ -448,7 +446,7 @@ export default {
|
||||
paymentTypeRequired: '请选择付款方式。',
|
||||
paymentTypeAllowed: '付款方式当前只允许 BTQR 或 CA。',
|
||||
nationalityRequired: '请选择国籍。',
|
||||
nationalityAllowed: '国籍当前只允许 KR 或 CHN。',
|
||||
nationalityAllowed: '国籍当前只允许 KR、CN、TH、MM、RS 或 TW。',
|
||||
invalidEmail: 'Email 格式不正确。',
|
||||
},
|
||||
errors: {
|
||||
|
||||
@@ -19,7 +19,7 @@ function createInput(): RoomingListGenerationInput {
|
||||
departure: '2026-05-16',
|
||||
roomType: 'DLX',
|
||||
paymentType: 'CA',
|
||||
nationality: 'CHN',
|
||||
nationality: 'CN',
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ describe('roomingListService', () => {
|
||||
expect(formData.get('departure')).toBe('2026-05-16')
|
||||
expect(formData.get('room_type')).toBe('DLX')
|
||||
expect(formData.get('payment_type')).toBe('CA')
|
||||
expect(formData.get('nationality')).toBe('CHN')
|
||||
expect(formData.get('nationality')).toBe('CN')
|
||||
expect(formData.get('title')).toBeNull()
|
||||
expect(formData.get('rate_code')).toBeNull()
|
||||
expect(formData.get('adults')).toBeNull()
|
||||
|
||||
@@ -86,7 +86,7 @@ async function fillRequiredFields(wrapper: ReturnType<typeof mountView>) {
|
||||
)
|
||||
await wrapper.find('[data-testid="rooming-list-people-per-room"]').setValue('2')
|
||||
await wrapper.find('[data-testid="rooming-list-room-type"]').setValue('DLX')
|
||||
await wrapper.find('[data-testid="rooming-list-nationality"]').setValue('CHN')
|
||||
await wrapper.find('[data-testid="rooming-list-nationality"]').setValue('CN')
|
||||
}
|
||||
|
||||
describe('ReservationRoomingListGenerationView', () => {
|
||||
@@ -188,7 +188,7 @@ describe('ReservationRoomingListGenerationView', () => {
|
||||
departure: '',
|
||||
roomType: 'DLX',
|
||||
paymentType: 'BTQR',
|
||||
nationality: 'CHN',
|
||||
nationality: 'CN',
|
||||
})
|
||||
expect(URL.createObjectURL).toHaveBeenCalledWith(expect.any(Blob))
|
||||
expect(HTMLAnchorElement.prototype.click).toHaveBeenCalledOnce()
|
||||
@@ -216,6 +216,27 @@ describe('ReservationRoomingListGenerationView', () => {
|
||||
)
|
||||
})
|
||||
|
||||
it('allows submitting expanded nationality codes when selected', async () => {
|
||||
vi.mocked(generateReservationRoomingListExcel).mockResolvedValue({
|
||||
blob: new Blob(['xlsx-binary'], {
|
||||
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
||||
}),
|
||||
fileName: 'rooming-list-HOTEL-TEST.xlsx',
|
||||
})
|
||||
const wrapper = mountView()
|
||||
await fillRequiredFields(wrapper)
|
||||
await wrapper.find('[data-testid="rooming-list-nationality"]').setValue('TH')
|
||||
|
||||
await wrapper.find('[data-testid="rooming-list-submit"]').trigger('click')
|
||||
await flushPromises()
|
||||
|
||||
expect(generateReservationRoomingListExcel).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
nationality: 'TH',
|
||||
}),
|
||||
)
|
||||
})
|
||||
|
||||
it('submits optional manual stay dates when they are provided', async () => {
|
||||
vi.mocked(generateReservationRoomingListExcel).mockResolvedValue({
|
||||
blob: new Blob(['xlsx-binary'], {
|
||||
|
||||
@@ -222,11 +222,12 @@
|
||||
>
|
||||
{{ t('roomingList.nationalityPlaceholder') }}
|
||||
</option>
|
||||
<option value="KR">
|
||||
{{ t('roomingList.nationalityKr') }}
|
||||
</option>
|
||||
<option value="CHN">
|
||||
{{ t('roomingList.nationalityChn') }}
|
||||
<option
|
||||
v-for="nationality in nationalityOptions"
|
||||
:key="nationality"
|
||||
:value="nationality"
|
||||
>
|
||||
{{ nationality }}
|
||||
</option>
|
||||
</select>
|
||||
<span
|
||||
@@ -329,7 +330,8 @@ interface BackendDetailMessage {
|
||||
}
|
||||
|
||||
const allowedPaymentTypes = new Set(['BTQR', 'CA'])
|
||||
const allowedNationalities = new Set(['KR', 'CHN'])
|
||||
const nationalityOptions = ['KR', 'CN', 'TH', 'MM', 'RS', 'TW']
|
||||
const allowedNationalities = new Set(nationalityOptions)
|
||||
|
||||
const { t, te } = useI18n()
|
||||
const authStore = useAuthStore()
|
||||
|
||||
Reference in New Issue
Block a user