Students at lambda school need a place where they can escalate their concerns and receive help. This app allows an admin to manage help desk tickets that come in from Lambda School Students. It also allows students (A 2nd user type) to submit a help desk ticket, categorize it and post it to the help channel.
- /api/register sending to back-end
- https://dev-help-desk.herokuapp.com/api/register
{
"username" : "samm",
"password" : "gamgee"
}
what back-end returns
{
"id": 36,
"username": "young3324",
"password": "*******",
"accessType": "student",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjM2LCJ1c2VybmFtZSI6InlvdW5nMzMyNCIsInVzZXJBY2Nlc3NUeXBlIjoic3R1ZGVudCIsImlhdCI6MTU4MDg2NzcxNCwiZXhwIjoxNTgwOTU0MTE0fQ.Q6Fnw5Xt77kvicG7g20xCLa5Z0-MwKLH0_1TFtq482s"
}
-
/api/login
-
https://dev-help-desk.herokuapp.com/api/login
send to backend
{
"username" : "samm",
"password" : "gamgee"
}
what backend returns
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjQsInVzZXJuYW1lIjoic2FtbSIsInVzZXJBY2Nlc3NUeXBlIjoic3R1ZGVudCIsImlhdCI6MTU4MDc5MTY2MSwiZXhwIjoxNTgwODc4MDYxfQ.ZNacWbT2m9umvZDBnDe6l6j0D7fbfN8exInmyynmM6M",
"accessType": "student",
"userId": 30
}
https://dev-help-desk.herokuapp.com/api/helpers/login input to backend
{
"username" : "samssssssssss11",
"password" : "gamgeesss",
"accessType" : "helper"
}
what backend returns
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjE5LCJ1c2VybmFtZSI6InN1bjc3NzciLCJ1c2VyQWNjZXNzVHlwZSI6ImhlbHBlciIsImlhdCI6MTU4MDg2NzgxNCwiZXhwIjoxNTgwOTU0MjE0fQ.BJ8IkruLAcvi17QGT9sQ2_jAyQSOTJhu3SzVrcjhe8k",
"accessType": "helper",
"userId": 19
}
https://dev-help-desk.herokuapp.com/api/helpers/register input to backend
{
"username" : "samssssssssss11",
"password" : "gamgeesss",
"accessType" : "helper"
}
output from backend
{
"id": 23,
"username": "young6670",
"password": "*******",
"accessType": "helper",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjIzLCJ1c2VybmFtZSI6InlvdW5nNjY3MCIsInVzZXJBY2Nlc3NUeXBlIjoiaGVscGVyIiwiaWF0IjoxNTgwODY3NjE1LCJleHAiOjE1ODA5NTQwMTV9.bL-CYh3w_QiD_1jioh1oDRd1nAIEyXkH0ubNg1FN5Y8"
}
- https://dev-help-desk.herokuapp.com/api/users/:userId/tickets
- example returns:
{
"id": 2,
"username": "james123",
"password": "*********",
"tickets": [
{
"id": 2,
"title": "progress report",
"description": "my progress report is not updating since Jan. 2020",
"ticketCategory": "technical",
"created_at": "2020-02-02 07:34:54",
"user_id": 2,
"resolved": false,
"helper_id": 1
}
]
}
{
"id": 3,
"username": "sunny123",
"password": "*******",
"ticket": {
"id": 3,
"title": "Slack",
"description": "My userid is not working in Slack",
"ticketCategory": "technical",
"created_at": "2020-02-02 07:34:54",
"user_id": 3,
"resolved": false,
"helper_id": 3
},
"reactions": [
{
"id": 1,
"ticket_id": 3,
"created_at": "2020-02-02 07:34:54",
"notes": "I re-created userId and sent an email to student for trial with new password. will wait for confirmation from the student."
},
{
"id": 3,
"ticket_id": 3,
"created_at": "2020-02-02 07:34:54",
"notes": "the student confirmed the userId is working now"
}
]
}
-
https://dev-help-desk.herokuapp.com/api/users/:userId/tickets
-
example returns:
{
"id": 4,
"title": "Slack",
"description": "My userid is not working in Slack",
"ticketCategory": "Other",
"created_at": "2020-02-05 18:12:13",
"tried": "I did make an account but...",
"user_id": 4,
"resolved": false,
"helper_id": null
}
{
"title": "Slack",
"description": "Slack id and password are not working",
"ticketCategory": "technical",
"tried": "I did make an account but..."
}
{
"message": "successfuly deleted..."
}
[
{
id: 1,
username: 'young123',
password: '*******',
accessType: 'student',
tickets: []
},
{
id: 2,
username: 'james123',
password: '*******',
accessType: 'student',
tickets: [
{
id: 2,
title: 'progress report',
description: 'my progress report is not updating since Jan. 2020',
ticketCategory: 'Other',
created_at: '2020-02-05 18:06:04',
tried: 'I restarted the computer',
user_id: 2,
resolved: false,
helper_id: 1
}
]
},
{
id: 3,
username: 'sunny123',
password: '*******',
accessType: 'student',
tickets: [
{
id: 1,
title: 'registration question',
description: 'When is the next registration deadline?',
ticketCategory: 'Track',
created_at: '2020-02-05 18:06:04',
tried: '',
user_id: 3,
resolved: false,
helper_id: 2
},
{
id: 3,
title: 'Slack',
description: 'My userid is not working in Slack',
ticketCategory: 'Equipment',
created_at: '2020-02-05 18:06:04',
tried: 'I did make an account but...',
user_id: 3,
resolved: false,
helper_id: 3
}
]
},
{
id: 4,
username: 'young1122',
password: '*******',
accessType: 'student',
tickets: [
{
id: 4,
title: 'Slack',
description: 'My userid is not working in Slack',
ticketCategory: null,
created_at: '2020-02-05 18:12:13',
tried: 'I did make an account but...',
user_id: 4,
resolved: false,
helper_id: null
}
]
}
];
[
{
id: 1,
title: 'registration question',
description: 'When is the next registration deadline?',
ticketCategory: 'frontOffice',
created_at: '2020-02-04 01:42:22',
tried: '',
user_id: 3,
resolved: 0,
helper_id: 2,
reactions: [
{
id: 2,
ticket_id: 1,
created_at: '2020-02-04 01:42:22',
notes: 'emailed to students with new registration information'
}
]
},
{
id: 2,
title: 'progress report',
description: 'my progress report is not updating since Jan. 2020',
ticketCategory: 'technical',
created_at: '2020-02-04 01:42:22',
tried: 'I restarted the computer',
user_id: 2,
resolved: 0,
helper_id: 1,
reactions: [
{
id: 7,
ticket_id: 2,
created_at: '2020-02-05 19:04:13',
notes: "I'm a new reaction"
}
]
}
];
{
"id": 1,
"title": "registration question",
"description": "When is the next registration deadline?",
"ticketCategory": "frontOffice",
"created_at": "2020-02-04 01:42:22",
"tried": "",
"user_id": 3,
"resolved": false,
"helper_id": 2,
"reactions": [
{
"id": 2,
"ticket_id": 1,
"created_at": "2020-02-04 01:42:22",
"notes": "emailed to students with new registration information"
}
]
}
{
"title": "Slack12",
"description": "My userid is not working in Slack22",
"resolved": true,
"helper_id": 12
}
- https://dev-help-desk.herokuapp.com/api/tickets/:ticketId/reactions input to backend
{
"notes": "I'm a new another reaction"
}
output to client
{
"id": 8,
"ticket_id": 2,
"created_at": "2020-02-05T21:28:45.030Z",
"notes": "I'm a new another reaction"
}
{
"notes": "I did this"
}
output to client
{
"notes": "I did this",
"created_at": "2020-02-05 21:31:19",
"ticket_id": 2
}
output to client
{
"message": "successfuly deleted..."
}
- id: integer (auto-generated number)
- username: string (not nullable, unique)
- password: string (not nullable),
- accessType: enumeration[student] (default to 'student')
- id: integer (auto-generated number)
- username: string (not nullable, unique)
- password: string (not nullable)
- accessType: enumeration [helper, admin] (default to 'helper')
- id: integer (auto-generated number)
- title: string (not nullable, indexed)
- description: string
- ticketCategory: enumeration [Equipment, People, Track,Finances, Other] (default to null)
- created_at: timestamp
- tried: string
- user_id: integer (not nullable, foreign-key pointing to id in 'users' table)
- resolved: boolean (default to false)
- helper_id: integer (foreign-key pointing to id in 'helpers' table)
- id: integer (auto-generated number)
- ticket_id: integer (not nullable, foreign-key pointing to id in 'tickets' table)
- created_at: timestamp
- notes: string