Room
회의실 API
회의실 목록 조회, 예약 가능 시간 확인, 예약까지 모두 처리할 수 있습니다. 예약 전에 available()로 빈 슬롯을 먼저 확인하는 것이 좋습니다.
List Rooms
날짜별 회의실 목록과 각 슬롯의 예약 가능 여부를 조회합니다. date를 생략하면 오늘 날짜를 기준으로 조회합니다.
const rooms = await client.room.list()
Options
await client.room.list({
date: '2025-01-15', // defaults to today
room: 'A1', // filter by room code
})
Response
interface RoomCard {
itemId: number
name: string
capacity: number
availablePeriod: { start: string; end: string }
description: string
timeSlots: Array<{
time: string // 'HH:mm'
available: boolean
}>
}
Check Availability
특정 회의실의 날짜별 예약 가능 시간 슬롯을 조회합니다. roomId는 아래 Room Codes 표의 숫자 ID입니다.
const slots = await client.room.available(17, '2025-01-15')
const openSlots = slots.filter((s) => s.available)
console.log(`${openSlots.length} slots available`)
Reserve
슬롯은 30분 단위이며 연속된 시간만 예약할 수 있습니다. 최대 8슬롯(4시간)까지 가능합니다.
await client.room.reserve({
roomId: 17,
date: '2025-01-15',
slots: ['14:00', '14:30', '15:00'], // consecutive, max 8
title: '팀 회의',
attendees: 3, // optional, defaults to 1
notes: '비고', // optional
})
Get
기존 예약의 상세 정보를 조회합니다. rentId는 /mypage/itemRent/view.do?rentId=... URL에서 확인할 수 있습니다.
const reservation = await client.room.get(18718)
Response
interface RoomReservationDetail {
rentId: number
itemId: number
title: string
date: string // 'YYYY-MM-DD'
startTime: string // 'HH:mm'
endTime: string // 'HH:mm'
attendees: number
notes: string
status: 'confirmed' | 'cancelled' | 'unknown'
statusCode: string // 'RS001' (confirmed), 'RS002' (cancelled), etc.
}
Update
SW마에스트로 웹에는 UI가 없지만, 내부 update.do 엔드포인트로 예약을 수정할 수 있습니다. 전달한 필드만 변경되고 나머지는 기존 값이 유지됩니다. 내부적으로 먼저 room.get()을 호출해 현재 상태를 읽어오고, 변경분을 합쳐 한 번의 POST로 전송합니다.
// 제목·메모만 변경
await client.room.update(18718, {
title: '팀 회의',
notes: '회고 포함',
})
// 시간대 변경 (slots을 전달하면 rentBgnde/rentEndde/time[]/chkData_가 모두 재구성됨)
await client.room.update(18718, {
slots: ['22:00', '22:30', '23:00'],
})
// 다른 방으로 이동
await client.room.update(18718, {
roomId: ROOM_IDS['A6'],
date: '2025-02-01',
slots: ['14:00', '14:30'],
})
Options
interface RoomUpdateOptions {
title?: string
roomId?: number
date?: string // 'YYYY-MM-DD'
slots?: string[] // must be consecutive, max 8
attendees?: number
notes?: string
}
Cancel
예약을 취소합니다. 내부적으로 receiptStatCd를 RS002로 바꾸는 update.do 호출입니다.
await client.room.cancel(18718)
Room Codes
| Code | Room ID | Name |
|---|---|---|
| A1 | 17 | 스페이스 A1 |
| A2 | 18 | 스페이스 A2 |
| A3 | 19 | 스페이스 A3 |
| A4 | 20 | 스페이스 A4 |
| A5 | 21 | 스페이스 A5 |
| A6 | 22 | 스페이스 A6 |
| A7 | 23 | 스페이스 A7 |
| A8 | 24 | 스페이스 A8 |
ROOM_IDS constant로도 접근 가능합니다:
import { ROOM_IDS } from 'opensoma'
const roomId = ROOM_IDS['A1'] // 17