-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtesting_json_for_react.js
165 lines (156 loc) · 3.18 KB
/
testing_json_for_react.js
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
const account = {
id: "2345673712678366XYZ",
role: "admin",
name: "Bára",
surname: "Macháčková",
username: "",
password: "",
students: ["2345673712678366ABC", "2345673712678366DEF", "2345673712678366GHI", "2345673712678366JKL"],
}
const account = {
id: "2345673712678366ABFDSA",
role: "parent",
name: "Tomáš",
surname: "Hron",
username: "",
password: "",
phone: "(+420) 734 788 454"
}
const account = {
id: "2345673712678366ABC",
role: "student",
name: "Tomáš",
surname: "Hron",
lectures: ["2345673712678366H1", "2345673712678366H2"],
plan: ["present simple", "present continuous", "past simple", "past continuous"],
legalRepresentative: "2345673712678366ABFDSA",
totalLectures: ["2345673712678366H1", "2345673712678366H2"],
lecturePrice: 300,
homework: [
{ name: "words1", checked: false },
{ name: "words2", checked: false },
{ name: "words3", checked: true },
{ name: "words4", checked: false },
{ name: "words5", checked: true },
]
}
const lecture = {
id: "2345673712678366H1",
student: "2345673712678366ABC",
date: 1123456,
plan: "revision of present simple",
document?: ["path", "path"],
status: "done",
paid: true,
checkPayment: true,
checked: true,
price: 300 // při dokončení lekce se cena připíše z ceny žáka
}
const lecture = {
id: "2345673712678366H2",
student: "2345673712678366ABC",
date: 654321,
plan: "past simple",
document?: [],
status: "inprogress",
paid: false,
checkPayment: false,
checked: false
price: 300 // při dokončení lekce se cena připíše z ceny žáka
}
# výběr studenta č.2 -> students["2345673712678366DEF"]
# lectureDays jsou čísla, kvůli lehčí filtraci dnu přes cyklus
# document?: --> volitelný atribut
"""
const days = ["Monday", "Thuesday", "Wednesday", ""]
"""
// Mongo database structure
const accountSchema = {
role: {
type: String,
required: true
},
name: {
type: String,
required: true
},
surname: {
type: String,
required: true
},
username: {
type: String,
required: true,
unique: true
},
password: {
type: String,
required: true
},
students: {
type: [String],
default: []
},
phone: {
type: String,
default: ""
},
lectures: {
type: [String],
default: []
},
legalRepresentative: {
type: String,
default: ""
},
totalLectures: {
type: [String],
default: []
},
lecturePrice: {
type: Number,
default: 0
},
homework: {
type: [{
type: String,
checked: Boolean
}],
default: []
},
}
const lectureSchema = {
student: {
type: String,
required: true
},
date: {
type: Date,
required: true
},
plan: {
type: String,
default: ""
},
status: {
type: String,
default: "in-progress"
},
paid: {
type: Boolean,
default: false
},
checkPayment: {
type: Boolean,
default: false
},
checked: {
type: Boolean,
default: false
},
price: {
type: Number, // při dokončení lekce se cena připíše z ceny žáka
required: true
}
document?: [String],
}