-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRecord.js
More file actions
75 lines (68 loc) · 1.51 KB
/
Copy pathRecord.js
File metadata and controls
75 lines (68 loc) · 1.51 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
75
/** @typedef {'ongoing' | 'resolved' | 'dismissed'} RecordStatus */
/** @typedef {'minor' | 'major' | 'grave'} RecordSeverity */
/** @typedef {'bullying' | 'cheating' | 'disruptive_behavior' | 'fraud' | 'gambling' | 'harassment' | 'improper_uniform' | 'littering' | 'plagiarism' | 'prohibited_items' | 'vandalism' | 'other'} RecordViolation */
/**
* @typedef {{
* occurrences: number,
* id: string,
* student?: import('./Student').Student
* }} RecordComplainanee
*/
/**
* @typedef {{
* id: number | string,
* title: string,
* violation: RecordViolation,
* description: string,
* tags: {
* status: RecordStatus,
* severity: RecordSeverity,
* progress: 0 | 1 | 2 | 3 | 4 | 5
* },
* date: Date
* }} BaseRecordProps
*/
/**
* @typedef {{
* complainants: string[],
* complainees: string[],
* raw: true
* }} RecordRaw
*/
/**
* @typedef {{
* complainants: import('./Student').StudentProps[],
* complainees: RecordComplainanee[],
* raw: false
* }} RecordProcessed
*/
/**
* @typedef {BaseRecordProps & (RecordRaw | RecordProcessed)} RecordProps
*/
class Record {
/**
* @param {RecordProps} props
*/
constructor({
id,
title,
violation,
description,
tags,
date,
complainants,
complainees,
raw = false
}) {
this.id = id;
this.title = title;
this.violation = violation;
this.description = description;
this.tags = tags;
this.date = new Date(date);
this.complainants = complainants;
this.complainees = complainees;
this.raw = raw;
};
};
export default Record;