调整Rooming List付款方式选项
This commit is contained in:
@@ -416,6 +416,7 @@ export default {
|
||||
adults: 'Adults',
|
||||
children: 'Children',
|
||||
paymentType: 'Payment Type',
|
||||
paymentTypeBtqr: 'BTQR',
|
||||
paymentTypeCa: 'CA',
|
||||
vip: 'VIP',
|
||||
nationality: 'Nationality',
|
||||
@@ -442,7 +443,7 @@ export default {
|
||||
departureAfterArrival: 'Departure must be later than arrival.',
|
||||
roomTypeRequired: 'Enter room type.',
|
||||
paymentTypeRequired: 'Select payment type.',
|
||||
paymentTypeAllowed: 'Only CA is currently allowed.',
|
||||
paymentTypeAllowed: 'Only BTQR or CA are currently allowed.',
|
||||
nationalityRequired: 'Select nationality.',
|
||||
nationalityAllowed: 'Only KR or CHN are currently allowed.',
|
||||
invalidEmail: 'Invalid email.',
|
||||
|
||||
@@ -416,6 +416,7 @@ export default {
|
||||
adults: 'Adults',
|
||||
children: 'Children',
|
||||
paymentType: 'Payment Type',
|
||||
paymentTypeBtqr: 'BTQR',
|
||||
paymentTypeCa: 'CA',
|
||||
vip: 'VIP',
|
||||
nationality: 'Nationality',
|
||||
@@ -442,7 +443,7 @@ export default {
|
||||
departureAfterArrival: 'Departure ต้องอยู่หลัง Arrival',
|
||||
roomTypeRequired: 'กรุณากรอก Room Type',
|
||||
paymentTypeRequired: 'กรุณาเลือก Payment Type',
|
||||
paymentTypeAllowed: 'รองรับเฉพาะ CA ในตอนนี้',
|
||||
paymentTypeAllowed: 'รองรับเฉพาะ BTQR หรือ CA ในตอนนี้',
|
||||
nationalityRequired: 'กรุณาเลือก Nationality',
|
||||
nationalityAllowed: 'รองรับเฉพาะ KR หรือ CHN ในตอนนี้',
|
||||
invalidEmail: 'รูปแบบ Email ไม่ถูกต้อง',
|
||||
|
||||
@@ -415,6 +415,7 @@ export default {
|
||||
adults: '成人数(Adults)',
|
||||
children: '儿童数(Children)',
|
||||
paymentType: '付款方式(Payment Type)',
|
||||
paymentTypeBtqr: 'BTQR',
|
||||
paymentTypeCa: 'CA',
|
||||
vip: 'VIP',
|
||||
nationality: '国籍(Nationality)',
|
||||
@@ -441,7 +442,7 @@ export default {
|
||||
departureAfterArrival: '离店日期必须晚于入住日期。',
|
||||
roomTypeRequired: '请填写房型。',
|
||||
paymentTypeRequired: '请选择付款方式。',
|
||||
paymentTypeAllowed: '付款方式当前只允许 CA。',
|
||||
paymentTypeAllowed: '付款方式当前只允许 BTQR 或 CA。',
|
||||
nationalityRequired: '请选择国籍。',
|
||||
nationalityAllowed: '国籍当前只允许 KR 或 CHN。',
|
||||
invalidEmail: 'Email 格式不正确。',
|
||||
|
||||
@@ -168,7 +168,7 @@ describe('ReservationRoomingListGenerationView', () => {
|
||||
hotelId: 'HOTEL-TEST',
|
||||
peoplePerRoom: 2,
|
||||
roomType: 'DLX',
|
||||
paymentType: 'CA',
|
||||
paymentType: 'BTQR',
|
||||
nationality: 'CHN',
|
||||
})
|
||||
expect(URL.createObjectURL).toHaveBeenCalledWith(expect.any(Blob))
|
||||
@@ -176,6 +176,27 @@ describe('ReservationRoomingListGenerationView', () => {
|
||||
expect(wrapper.text()).toContain('rooming-list-HOTEL-TEST.xlsx')
|
||||
})
|
||||
|
||||
it('allows submitting CA payment type 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-payment-type"]').setValue('CA')
|
||||
|
||||
await wrapper.find('[data-testid="rooming-list-submit"]').trigger('click')
|
||||
await flushPromises()
|
||||
|
||||
expect(generateReservationRoomingListExcel).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
paymentType: 'CA',
|
||||
}),
|
||||
)
|
||||
})
|
||||
|
||||
it('does not submit the same source file again while generation is pending', async () => {
|
||||
let resolveGeneration!: (value: { blob: Blob; fileName: string }) => void
|
||||
vi.mocked(generateReservationRoomingListExcel).mockImplementation(
|
||||
|
||||
@@ -141,6 +141,9 @@
|
||||
:class="validationClass('paymentType')"
|
||||
v-bind="validationAria('paymentType')"
|
||||
>
|
||||
<option value="BTQR">
|
||||
{{ t('roomingList.paymentTypeBtqr') }}
|
||||
</option>
|
||||
<option value="CA">
|
||||
{{ t('roomingList.paymentTypeCa') }}
|
||||
</option>
|
||||
@@ -265,7 +268,7 @@ type RoomingListFieldKey =
|
||||
| 'paymentType'
|
||||
| 'nationality'
|
||||
|
||||
const allowedPaymentTypes = new Set(['CA'])
|
||||
const allowedPaymentTypes = new Set(['BTQR', 'CA'])
|
||||
const allowedNationalities = new Set(['KR', 'CHN'])
|
||||
|
||||
const { t, te } = useI18n()
|
||||
@@ -275,7 +278,7 @@ const form = reactive({
|
||||
file: null as File | null,
|
||||
peoplePerRoom: '',
|
||||
roomType: '',
|
||||
paymentType: 'CA',
|
||||
paymentType: 'BTQR',
|
||||
nationality: '',
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user