/
types.ts
81 lines (73 loc) · 1.81 KB
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
export type RoomReservationStatus = 'pending' | 'confirmed' | 'cancelled'
export type RoomReservation = {
id: string
creatorUserId: string | null
userIds: string[]
status: RoomReservationStatus
office: string
roomId: string
startDate: Date
endDate: Date
createdAt: Date
updatedAt: Date
}
export type RoomReservationRequest = {
userIds: string[]
roomId: string
date: string
timeSlot: string
}
export type RoomReservationUpdateRequest = Pick<RoomReservation, 'status'>
export type RoomDisplayDevice = {
id: string
confirmedAt: Date
confirmedByUserId: string
office: string
roomId: string
createdAt: Date
updatedAt: Date
}
export type RoomDisplayData = {
deviceId: string
confirmed: boolean
roomId: string | null
roomName: string | null
workingHours: Array<string> | null
office: string | null
timezone: string | null
current: RoomReservation | null
upcoming: RoomReservation[]
usersById: Record<string, { fullName: string; avatar: string }>
}
// TODO: make it enum
export const RoomBookingModes: Record<string, string> = {
AnyRoom: 'Any Room Available',
SpecificRoom: 'Specific Room',
}
// TODO: move it to client helpers/components
export const RoomBookingTabHeaders = {
[RoomBookingModes.AnyRoom]: ['Book Any Room Available', 'Any Room'],
[RoomBookingModes.SpecificRoom]: ['Book Specific Room', 'Specific Room'],
}
export type OfficeRoomCompact = {
id: string
name: string
officeId: string
}
export type RoomReservationAdminDashboardStats = {
reservationsToday: number
reservationsTotal: number
anonymouseReservationsPercent: number
bookersToday: number
bookersTotal: number
reservationsByDate: {
date: string
total: number
}[]
topBookers: {
userId: string
fullName: string
avatar: string | null
reservations: number
}[]
}