Skip to content

Endpoint and Data Model Documentation

gumityolcu edited this page Nov 7, 2018 · 19 revisions

This document explains the current situation regarding our data models and endpoints. The document will be updated with changes over time.

1. Data Models

1.1. User

1.1.1. Fields

1.1.1.1 E-mail

  • Name : email
  • Type : String
  • Required : True
  • Unique : True

1.1.1.2. First name

  • Name : firstName
  • Type : String
  • Required : True
  • Unique : False

1.1.1.3. Last name

  • Name : lastName
  • Type : String
  • Required : True
  • Unique : False

1.1.1.4. Password

  • Name : password
  • Type : String
  • Required : True
  • Unique : False Comments:Password is hashed before saving or comparing

1.1.2. CRUD Endpoints

  • 1.1.2.1. Create : POST /api/auth/signup
  • 1.1.2.2. Read : GET /api/users/:id (THIS IS NOT YET MERGED TO MASTER!)
  • 1.1.2.3. Update : Not implemented
  • 1.1.2.4. Delete : Not implemented

1.2. Event

1.2.1. Fields

1.2.1.1 Name

  • Name : name
  • Type : String
  • Required : True
  • Unique : False

1.2.1.2. Price

  • Name : price
  • Type : Number
  • Required : True
  • Unique : False

1.2.1.3. Description

  • Name : description
  • Type : String
  • Required : True
  • Unique : False

1.2.1.4. Date

  • Name : date
  • Type : MongoDB date
  • Required : True
  • Unique : False

1.2.1.5. Owner

  • Name : owner
  • Type : String(Mongo object ID)
  • Required : True
  • Unique : False

1.2.1.6. Artists

  • Name : artists
  • Type : Array of strings
  • Required : False
  • Unique : False

1.2.1.7. Users that will attend

  • Name : willAttendUser
  • Type : Array of Mongo object IDs
  • Required : False
  • Unique : False

1.2.1.8. Users that may attend

  • Name : maybeAttendUser
  • Type : Array of Mongo object IDs
  • Required : False
  • Unique : False

1.2.1.9. Users that will/did not attend

  • Name : notAttendUser
  • Type : Array of Mongo object IDs
  • Required : False
  • Unique : False

1.2.1.10. Users that did attend

  • Name : attendedUser
  • Type : Array of Mongo object IDs
  • Required : False
  • Unique : False

1.2.1.11. Blocked users

  • Name : blockedUsers
  • Type : Array of Mongo object IDs
  • Required : False
  • Unique : False

1.2.2. CRUD Endpoints

  • 1.2.2.1. Create : POST /api/events
  • 1.2.2.2. Read : GET /api/events/:id or GET /api/events/getEventbyOwner/:id
  • 1.2.2.3. Update : GET /api/events/:id
  • 1.2.2.4. Delete : DELETE /api/events/:id (THIS IS NOT YET MERGED TO MASTER!)
2. Endpoints
Clone this wiki locally