实现 Rooming List CP2 字段收口
This commit is contained in:
1 parent
71191a10b0
commit
1236df86cf
24 files changed
+704
-481
No files matched your search
@@ -15,19 +15,9 @@ function createInput(): RoomingListGenerationInput {
|
||||
}),
|
||||
hotelId: 'HOTEL-TEST',
|
||||
peoplePerRoom: 2,
|
||||
arrival: '2026-07-20',
|
||||
departure: '2026-07-22',
|
||||
roomType: 'DLX',
|
||||
title: 'MR',
|
||||
rateCode: 'BAR',
|
||||
adults: 2,
|
||||
children: 0,
|
||||
paymentType: 'BT',
|
||||
vip: 'VIP1',
|
||||
nationality: 'TH',
|
||||
email: 'guest@example.test',
|
||||
idType: 'Passport',
|
||||
idNumber: 'A1234567',
|
||||
paymentType: 'CA',
|
||||
nationality: 'CHN',
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,19 +74,19 @@ describe('roomingListService', () => {
|
||||
expect(formData.get('file')).toBe(input.file)
|
||||
expect(formData.get('hotel_id')).toBe('HOTEL-TEST')
|
||||
expect(formData.get('people_per_room')).toBe('2')
|
||||
expect(formData.get('arrival')).toBe('2026-07-20')
|
||||
expect(formData.get('departure')).toBe('2026-07-22')
|
||||
expect(formData.get('room_type')).toBe('DLX')
|
||||
expect(formData.get('title')).toBe('MR')
|
||||
expect(formData.get('rate_code')).toBe('BAR')
|
||||
expect(formData.get('adults')).toBe('2')
|
||||
expect(formData.get('children')).toBe('0')
|
||||
expect(formData.get('payment_type')).toBe('BT')
|
||||
expect(formData.get('vip')).toBe('VIP1')
|
||||
expect(formData.get('nationality')).toBe('TH')
|
||||
expect(formData.get('email')).toBe('guest@example.test')
|
||||
expect(formData.get('id_type')).toBe('Passport')
|
||||
expect(formData.get('id_number')).toBe('A1234567')
|
||||
expect(formData.get('payment_type')).toBe('CA')
|
||||
expect(formData.get('nationality')).toBe('CHN')
|
||||
expect(formData.get('arrival')).toBeNull()
|
||||
expect(formData.get('departure')).toBeNull()
|
||||
expect(formData.get('title')).toBeNull()
|
||||
expect(formData.get('rate_code')).toBeNull()
|
||||
expect(formData.get('adults')).toBeNull()
|
||||
expect(formData.get('children')).toBeNull()
|
||||
expect(formData.get('vip')).toBeNull()
|
||||
expect(formData.get('email')).toBeNull()
|
||||
expect(formData.get('id_type')).toBeNull()
|
||||
expect(formData.get('id_number')).toBeNull()
|
||||
expect(result.fileName).toBe('rooming-list-HOTEL-TEST-20260718.xlsx')
|
||||
expect(result.blob.type).toBe('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet')
|
||||
})
|
||||
@@ -107,16 +97,8 @@ describe('roomingListService', () => {
|
||||
const result = await generateReservationRoomingListExcel({
|
||||
...createInput(),
|
||||
hotelId: undefined,
|
||||
title: '',
|
||||
rateCode: '',
|
||||
adults: null,
|
||||
children: null,
|
||||
paymentType: '',
|
||||
vip: '',
|
||||
nationality: '',
|
||||
email: '',
|
||||
idType: '',
|
||||
idNumber: '',
|
||||
})
|
||||
|
||||
expect(result.fileName).toBe('rooming-list.xlsx')
|
||||
|
||||
Reference in new issue
Block a user