Repository navigation
Expand file tree
/
Copy pathQueueSystem.ts
More file actions
74 lines (62 loc) · 2.2 KB
/
Copy pathQueueSystem.ts
File metadata and controls
74 lines (62 loc) · 2.2 KB
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
import { SchemaDefinition } from '@sozialhelden/simpl-schema';
import BooleanField from './BooleanField.js';
import { getGrabBarsSchemaDefinition, GrabBars } from './GrabBars.js';
import { getInteractableSchemaDefinition, Interactable } from './Interactable.js';
import getPrefixedSchemaDefinition from './lib/getPrefixedSchemaDefinition.js';
export const QueueSystemInteractions = ['enqueue', 'skipQueue', 'wait', 'leaveQueue', 'arrive', 'checkIn', 'checkOut', 'getTicket', 'getOnesTurn'] as const;
export type QueueSystemInteraction = typeof QueueSystemInteractions[number];
export const QueueSystemInteractionsSet = new Set(QueueSystemInteractions);
/**
* Describes a system that encourages or forces people to queue up.
*/
export interface QueueSystem extends Interactable<QueueSystemInteraction> {
/**
* `true` if the queueing uses rails / cattle bars, `false` if not.
*/
usesCattleBars?: boolean;
/**
* `true` if the queueing uses tickets (usually numbered), `false` if not.
*/
needsTickets?: boolean;
/**
* `true` if you can skip the queue with a disability, `false` if not.
*/
canSkipQueueWithDisability?: boolean;
/**
* Number of seats that can be used by people while waiting in the queue.
*/
numberOfSeats?: number;
/**
* Number of queue server points.
*/
numberOfQueueServerPoints?: number;
/**
* `true` if the queueing system announces the next person in line visually, `false` if not.
*/
hasVisualAnnouncements?: boolean;
/**
* Grab bars inside the queueing system, if applicable.
*/
grabBars?: GrabBars;
}
export const getQueueSystemSchemaDefinition: () => SchemaDefinition = () => ({
isAccessibleWithWheelchair: BooleanField,
usesCattleBars: BooleanField,
needsTickets: BooleanField,
hasVisualAnnouncements: BooleanField,
...getPrefixedSchemaDefinition('grabBars', getGrabBarsSchemaDefinition()),
ticketEquipmentId: {
type: String,
optional: true,
},
canSkipQueueWithDisability: BooleanField,
numberOfSeats: {
type: 'SimpleSchema.Integer',
optional: true,
},
numberOfQueueServerPoints: {
type: 'SimpleSchema.Integer',
optional: true,
},
...getInteractableSchemaDefinition(QueueSystemInteractionsSet),
});