forked from StateVoicesNational/Spoke
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathorganization.js
41 lines (39 loc) · 898 Bytes
/
organization.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
import thinky from "./thinky";
const type = thinky.type;
import { requiredString, timestamp } from "./custom-types";
const Organization = thinky.createModel(
"organization",
type
.object()
.schema({
id: type.string(),
uuid: type.string(),
name: requiredString(),
created_at: timestamp(),
features: type
.string()
.required()
.default(""), // should be JSON
texting_hours_enforced: type
.boolean()
.required()
.default(false),
texting_hours_start: type
.number()
.integer()
.required()
.min(0)
.max(24)
.default(9),
texting_hours_end: type
.number()
.integer()
.required()
.min(0)
.max(24)
.default(21)
})
.allowExtra(false),
{ noAutoCreation: true }
);
export default Organization;