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