完善预约详情只读与修改能力

This commit is contained in:
2026-07-02 14:57:02 +08:00
parent 0b2f4b2a7a
commit 3845ee4492
12 changed files with 305 additions and 33 deletions
@@ -53,6 +53,21 @@ describe('available time groups', () => {
expect(groups[0]?.times.map(item => item.value)).toEqual(['10:00'])
})
it('allows callers to exclude the appointment being edited', () => {
const calendar: PlanningCalendar = {
schedules: [{ artistId: 1, date: '2026-06-29', startTime: '10:00', endTime: '11:00', status: 1 }],
appointments: [{ orderItemId: 100, artistId: 1, date: '2026-06-29', startTime: '2026-06-29 10:00:00', endTime: '2026-06-29 11:00:00', status: 1 }]
}
const editableCalendar = {
...calendar,
appointments: calendar.appointments?.filter(item => item.orderItemId !== 100)
}
const groups = buildAvailableTimeGroups(editableCalendar, buildForm())
expect(groups[0]?.times.map(item => item.value)).toEqual(['10:00'])
})
it('returns no slots when the store day is closed', () => {
const calendar: PlanningCalendar = {
daySummaries: [{ date: '2026-06-29', totalCount: 0, dayStatus: 'rest' }],