Skip to content

Commit b7af0bc

Browse files
committed
Add phone option at user and remove extra location at posts
Removed repeated location field at posts Add phone option for phone based social logins
1 parent 4d53f21 commit b7af0bc

25 files changed

+449
-496
lines changed

images/comments_collection.png

-1.07 KB
Loading

images/diagram_model.png

-7.74 KB
Loading

images/feedbacks_collection.png

-1.12 KB
Loading

images/posts_collection.png

9.98 KB
Loading

images/users_collection.png

5.9 KB
Loading

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
"eslint-plugin-import": "^2.20.2",
5151
"eslint-plugin-prettier": "^3.1.2",
5252
"eslint-utils": "^2.0.0",
53-
"husky": "^4.2.3",
5453
"lint-staged": "^10.1.1",
5554
"nock": "^12.0.3",
5655
"nodemon": "^2.0.2",

v2/data_model.json

+146-109
Large diffs are not rendered by default.
599 KB
Binary file not shown.

v2/docs/FightPandemics.xlsx

527 Bytes
Binary file not shown.

v2/docs/FightPandemics_documentation.html

+164-184
Large diffs are not rendered by default.

v2/scripts/JSON_Document/applicationDB/comments.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
"createdAt": ISODate("2016-04-08T15:06:21.595Z"),
44
"updatedAt": ISODate("2016-04-08T15:06:21.595Z"),
55
"author": {
6-
"authorId": ObjectId("507f1f77bcf86cd799439011"),
7-
"authorName": "Lorem",
8-
"authorType": "Lorem",
6+
"id": ObjectId("507f1f77bcf86cd799439011"),
7+
"name": "Lorem",
8+
"type": "Lorem",
99
"location": {
1010
"coordinates": [
1111
35.26,

v2/scripts/JSON_Document/applicationDB/posts.json

+3-14
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
"updatedAt": ISODate("2016-04-08T15:06:21.595Z"),
55
"expireAt": ISODate("2016-04-08T15:06:21.595Z"),
66
"author": {
7-
"authorId": ObjectId("507f1f77bcf86cd799439011"),
8-
"authorName": "Lorem",
9-
"authorType": "Lorem",
7+
"id": ObjectId("507f1f77bcf86cd799439011"),
8+
"name": "Lorem",
9+
"type": "Lorem",
1010
"location": {
1111
"coordinates": [
1212
35.26,
@@ -29,17 +29,6 @@
2929
"types": [
3030
"Groceries/Food"
3131
],
32-
"location": {
33-
"coordinates": [
34-
35.26,
35-
-32.83
36-
],
37-
"type": "Point",
38-
"country": "Lorem",
39-
"city": "Lorem",
40-
"neighborhood": "Lorem",
41-
"address": "Lorem"
42-
},
4332
"language": [
4433
"Lorem"
4534
],

v2/scripts/JSON_Document/applicationDB/users.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"_id": ObjectId("507f1f77bcf86cd799439011"),
44
"updatedAt": ISODate("2016-04-08T15:06:21.595Z"),
55
"authId": "Lorem",
6-
"email": "test_user@fightpandemics.com",
76
"location": {
87
"coordinates": [
98
35.26,
@@ -35,5 +34,6 @@
3534
"playstore": "http://playstore.com/myOrg",
3635
"appstore": "http://appstore.com/myOrg"
3736
},
38-
"language": "Lorem"
37+
"language": "Lorem",
38+
"email": "test_user@fightpandemics.com"
3939
}

v2/scripts/JSON_Schema/applicationDB/comments.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@
2222
"author": {
2323
"type": "object",
2424
"properties": {
25-
"authorId": {
25+
"id": {
2626
"type": "string",
2727
"description": "Foreign key to the user who created the post.",
2828
"pattern": "^[a-fA-F0-9]{24}$"
2929
},
30-
"authorName": {
30+
"name": {
3131
"type": "string"
3232
},
33-
"authorType": {
33+
"type": {
3434
"type": "string"
3535
},
3636
"location": {
@@ -96,9 +96,9 @@
9696
},
9797
"additionalProperties": false,
9898
"required": [
99-
"authorId",
100-
"authorName",
101-
"authorType",
99+
"id",
100+
"name",
101+
"type",
102102
"location"
103103
]
104104
},

v2/scripts/JSON_Schema/applicationDB/posts.json

+8-67
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@
2727
"author": {
2828
"type": "object",
2929
"properties": {
30-
"authorId": {
30+
"id": {
3131
"type": "string",
3232
"description": "Foreign key to the user who created the post.",
3333
"pattern": "^[a-fA-F0-9]{24}$"
3434
},
35-
"authorName": {
35+
"name": {
3636
"type": "string"
3737
},
38-
"authorType": {
38+
"type": {
3939
"type": "string"
4040
},
4141
"location": {
@@ -101,9 +101,9 @@
101101
},
102102
"additionalProperties": false,
103103
"required": [
104-
"authorId",
105-
"authorName",
106-
"authorType",
104+
"id",
105+
"name",
106+
"type",
107107
"location"
108108
]
109109
},
@@ -166,66 +166,6 @@
166166
]
167167
}
168168
},
169-
"location": {
170-
"type": "object",
171-
"properties": {
172-
"coordinates": {
173-
"type": "array",
174-
"additionalItems": true,
175-
"minItems": 2,
176-
"maxItems": 2,
177-
"uniqueItems": false,
178-
"description": "Array with the coordinates, specifying **longitude first** and **latitude second**, as default in the [GeoJSON](https://docs.mongodb.com/manual/reference/geojson/) definition.",
179-
"items": [
180-
{
181-
"type": "number",
182-
"minimum": -180,
183-
"maximum": 180,
184-
"default": 0,
185-
"description": "Location longitude\n",
186-
"id": "lng"
187-
},
188-
{
189-
"type": "number",
190-
"minimum": -90,
191-
"maximum": 90,
192-
"default": 0,
193-
"description": "Location latitude\n",
194-
"id": "lat"
195-
}
196-
]
197-
},
198-
"type": {
199-
"type": "string",
200-
"enum": [
201-
"Point"
202-
],
203-
"description": "Type of the GeoJSON Object.\nPlease refer to the [official documentation](https://docs.mongodb.com/manual/reference/geojson/ ) for more information.\n\n**In our case, the value will always be of the type \"Point\".**"
204-
},
205-
"country": {
206-
"type": "string",
207-
"description": "String holding the country's name.\n"
208-
},
209-
"city": {
210-
"type": "string",
211-
"description": "String holding the city's name."
212-
},
213-
"neighborhood": {
214-
"type": "string",
215-
"description": "String holding the neighborhood's name."
216-
},
217-
"address": {
218-
"type": "string",
219-
"description": "String holding the address (street, number and other details)."
220-
}
221-
},
222-
"additionalProperties": false,
223-
"description": "Location document according to the norms of a [GeoJSON Object](https://docs.mongodb.com/manual/reference/geojson/ ).\nThe fields address, neighborhood, city, state and country are added to store the result of the geoprocessing.",
224-
"required": [
225-
"coordinates",
226-
"type"
227-
]
228-
},
229169
"language": {
230170
"type": "array",
231171
"additionalItems": true,
@@ -265,6 +205,7 @@
265205
"title",
266206
"content",
267207
"objective",
268-
"visibility"
208+
"visibility",
209+
"likes"
269210
]
270211
}

v2/scripts/JSON_Schema/applicationDB/users.json

+33-7
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,6 @@
2424
"type": "string",
2525
"description": "String holding the authentication service id (Auth0).\n\nThis field is a **foreign key to the user in the Auth0 database**, connecting through the user_id field."
2626
},
27-
"email": {
28-
"type": "string",
29-
"description": "User's email validated by a regex pattern.",
30-
"format": "email"
31-
},
3227
"location": {
3328
"type": "object",
3429
"properties": {
@@ -325,11 +320,42 @@
325320
]
326321
}
327322
],
323+
"anyOf": [
324+
{
325+
"id": "emailPK",
326+
"type": "object",
327+
"description": "Case where the user comes from social networks with a registration that uses email. In this case, the email field is required. This case covers the great majority of currently supported social network authentications.",
328+
"properties": {
329+
"email": {
330+
"type": "string",
331+
"description": "User's email validated by a regex pattern.",
332+
"format": "email"
333+
}
334+
},
335+
"additionalProperties": true,
336+
"required": [
337+
"email"
338+
]
339+
},
340+
{
341+
"id": "phonePK",
342+
"type": "object",
343+
"description": "Case where the user comes from social networks with a registration that allows the use of only the phone. In this case, the phone field is required, and the email isn't. \n\nAn example of ocial network that falls into this case is Twitter.",
344+
"properties": {
345+
"phone": {
346+
"type": "string"
347+
}
348+
},
349+
"additionalProperties": false,
350+
"required": [
351+
"phone"
352+
]
353+
}
354+
],
328355
"required": [
329356
"createdAt",
330357
"_id",
331358
"updatedAt",
332-
"authId",
333-
"email"
359+
"authId"
334360
]
335361
}

v2/scripts/MongoDB_Script/applicationDB/comments.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ db.createCollection( "comments",{
2626
"author": {
2727
"bsonType": "object",
2828
"properties": {
29-
"authorId": {
29+
"id": {
3030
"bsonType": "objectId",
3131
"description": "Foreign key to the user who created the post."
3232
},
33-
"authorName": {
33+
"name": {
3434
"bsonType": "string"
3535
},
36-
"authorType": {
36+
"type": {
3737
"bsonType": "string"
3838
},
3939
"location": {
@@ -95,9 +95,9 @@ db.createCollection( "comments",{
9595
},
9696
"additionalProperties": false,
9797
"required": [
98-
"authorId",
99-
"authorName",
100-
"authorType"
98+
"id",
99+
"name",
100+
"type"
101101
]
102102
},
103103
"postId": {

0 commit comments

Comments
 (0)