-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#167730747 Creating of trip requests #40
base: stage
Are you sure you want to change the base?
Conversation
…eate-trips-167730747
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[1] @OlawaleJoseph Nice job, please see the screenshot. display a relevant message if the type of body is not application/json
Also update your PR under task to be completed, You have done all of those you described as task to be completed.
Also I see that it is only a requester that can make a travel request. So what if a manager wants to travel ? A manager is also under somebody. Or I'm i not getting something right ?
@zanio Thanks for the response. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well done!
What does this PR do?
Enables users to create requests one-way, return, multi-city trip request
Description of Task to be completed?
How should this be manually tested?
git clone this repo using the command
git clone git@github.com:andela/firestar-backend.git
cd to the project
checkout to the branch using the command
git checkout ft-create-trips-167730747
create a
.env
file and set PORT,JWT_SECRET and DB variables as specified in the .env.example file.Run the command
npm install
in the terminal.Open a terminal and run
npm test
.Open a terminal and run
npm run migrate:dev
andnpm run seed:dev
Open Postman, make a post request to
localhost:port>/api/v1/auth/login
, with any of the belowin the request body.
{email: abc123@gmail.com}
{email: requester1@gmail.com}
{email: requester2@gmail.com}
{email: requester3@gmail.com}
http:localhost:<port>/api/v1/requests
with the token obtained above in the request header asauthorization
=Bearer <token obtained>
{ trip: { destinationLocationId: 2, departureLocationId: 1, accommodationId: 2, departureDate: '2020/10/10 18:00' }, reason: 'Business', departmentId: 2, tripType: 'oneWay', }
{ initialTrip: { destinationLocationId: 2, departureLocationId: 1, accommodationId: 2, departureDate: '2020/10/10 18:00' }, returnTrip: { destinationLocationId: 1, departureLocationId: 2, departureDate: '2020/10/11 18:00' }, reason: 'Business', departmentId: 2, tripType: 'return', }
{ trips: [ { destinationLocationId: 2, departureLocationId: 1, accommodationId: 2, departureDate: '2020/10/10 18:00' }, { destinationLocationId: 1, departureLocationId: 2, departureDate: '2020/10/11 18:00' } ], reason: 'Business', departmentId: 2, tripType: 'multiCity', }
Any background context you want to provide?
oneWay
,return
,multiCity
.YYYY-MM-DD hh:mm:ss
orYYYY/MM/DD hh:mm:ss
What are the relevant pivotal tracker stories?
#167730747
#167730748
#167730749
Screenshots (if appropriate)
Questions:
N/A