-
Notifications
You must be signed in to change notification settings - Fork 0
/
Workshop.js
62 lines (60 loc) · 1.49 KB
/
Workshop.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
const mongoose = require('mongoose');
const { Workshop } = require('./Types');
/**
* Mongoose schema defining the Workshop model.
*
* @type {Workshop}
*/
const WorkshopSchema = new mongoose.Schema({
ID: {
type: String,
required: true,
},
ID_craftspeople: String,
shop_name: {
content: String, // From `shop_name_en_translate`
content_orig: String, // From `shop_name`
content_orig_lang: String, // From `shop_name_lang`
content_ar: String, // From `shop_name` if `shop_name_lang` is `ar`
},
shop_owner_name: String,
contact_info: {
phone: String,
email: String,
website: String,
facebook: String,
instagram: String,
twitter: String,
other_social_media: String,
},
year_established: Number,
decade_established: [Number],
craft_discipline_category: [String],
craft_discipline: [String],
craft_discipline_other: [String],
location: {
geo: { lat: Number, lng: Number },
address: {
content: String, // From `shop_address`
content_orig: String,
content_orig_lang: String,
content_ar: String,
},
location_notes: String,
adm1: String,
adm2: String,
adm3: String,
adm4: String,
},
shop_status: String,
produced_here: Boolean,
data_collection_comments: String,
survey_origin: String,
thumb_img_id: String,
images: [String],
consent: Boolean,
object: String,
verified: Boolean
});
module.exports =
mongoose.models.Workshop || mongoose.model('Workshop', WorkshopSchema);