forked from AdaGold/video-store-api
-
Notifications
You must be signed in to change notification settings - Fork 13
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
Jillian & Jade's EXTREME VIDEO EXPRESS (it's the 90s) API!!!!!11!!!!1! kewl. #3
Open
JBoshart
wants to merge
102
commits into
Ada-C5:master
Choose a base branch
from
JBoshart:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,904
−162
Open
Changes from 2 commits
Commits
Show all changes
102 commits
Select commit
Hold shift + click to select a range
b10191e
Wrote pseudocode for routes.
jadevance 7e69068
Added in Massive
jadevance f80ff64
added db and db/setup dirs, added scripts for setups in the package.j…
JBoshart fe3633f
omg it works
jadevance 3f994c9
added high level routes for customers, movies and rentals
jadevance bbec298
Added tasks folder with load schema functionality
jadevance 448164b
Pushing broken code so we can work on it tonight: Most of the work do…
JBoshart a46f4b2
Changed some things?
jadevance e0611b6
merge conflicts
jadevance bb8ed63
Seed.js is now working.
JBoshart df311ed
Added schema for rentals database.
JBoshart cf69655
Added ERD to git.
JBoshart 9aa4d2b
added setup for the database in app.js
jadevance e929b92
added a models folder as well as model function to find all customers
jadevance cc7ebf3
wrote a method in the video controller to find all customers in the d…
jadevance de5b757
forgot to reference the model in the controller. Fixed that. Renamed …
jadevance 944c7a9
resolved merge conflict.
JBoshart 38d4c13
Added module.exports to app
jadevance e4ff73c
required massive and cleaned up errors
jadevance 22e7117
Fixed a syntax error that broke everything
jadevance fca5fdd
Switching drivers. Working on getting JSON response.
JBoshart 4117137
endpoint customers is now serving up customer data in JSON
jadevance 1dc233a
renamed video.js to customers.js to split out the functionality of cu…
jadevance a1f4b7f
Organizational changes only.
JBoshart 7e73318
Merge branch 'master' of github.com:JBoshart/VideoStoreAPI
JBoshart 22c9cc3
More org changes.
JBoshart e704d83
Added functionality for sorting customers
jadevance 59ed614
managing merge conflicts
jadevance dd0eabe
Customers can be sorted now and the return is JSON data. yay
jadevance dc60de7
Set h1 for funsies.
JBoshart 3ff63c7
Merge branch 'master' of github.com:JBoshart/VideoStoreAPI
JBoshart ef395bf
Made models and controllers for rentals and videos.
JBoshart dacb023
added seed data for rentals database, and adjusted seeding code.
JBoshart 2b4eeda
broke out routes for clarity (and because express had callback issues…
jadevance b259277
Merge branch 'master' of github.com:JBoshart/VideoStoreAPI
jadevance 65ab567
work in rentals model and controller.
JBoshart e18f050
fixed routing where it was nested one level too deep (/customers/cust…
jadevance 75164a2
Merge branch 'master' of github.com:JBoshart/VideoStoreAPI
jadevance ef2faa5
Working on Rentals.find in controller.
JBoshart 3c56b1f
routes
jadevance a2faf4f
still. with. rentals. find. :(
JBoshart 8ca4618
merge conflicts manages in app.js and rentals controller
jadevance b87aea8
Merge branch 'master' of github.com:JBoshart/VideoStoreAPI
jadevance 2970cb0
Completed the find_current rentals funciton in model and contorller. …
JBoshart e41e909
friday changes, honestly do not remember what was changed
jadevance 8a017c0
added istanbul and managed a merge conflict with rentals routes
jadevance f74c963
Added more seed data inorder to test sorting function of rentals hist…
JBoshart 4da9636
Merge branch 'master' of github.com:JBoshart/VideoStoreAPI
JBoshart 37ab377
Added null seeds for checkin and modified the models sql query to ret…
jadevance 0241bc0
Added coverage to the gitignore file
jadevance c80b182
resolving errors that occured when coverage/ was not in our git ignore.
JBoshart c7c524c
Trying to resolved merge
JBoshart 4162e25
Added node modules to the .gitignore
jadevance 23a8b4d
video_current now returns the customers who currently have a particul…
JBoshart ee69dd8
Merge branch 'master' of github.com:JBoshart/VideoStoreAPI
JBoshart 3ae103b
Wrote a function, route and model method for finding the rental histo…
jadevance 857b62b
Wrote functionality for funding a list of customers who have currentl…
jadevance f450b9b
Worked on adding checkout functionality to our video store. Routing n…
jadevance fd2f0c5
debugging code, have the first two pieces of checkout working but the…
jadevance 61d640f
Created a constructor function to test checkout rentals
jadevance a155863
Fixed date and time
jadevance de7a513
Worked on rentals checkin function.
JBoshart 7221273
Debugging work on checking process.
JBoshart 85797a9
Checkin function is now working
JBoshart 1a25dd2
Fixed error handling to display json rather than render a view for er…
jadevance 34aa7a5
Merge branch 'master' of github.com:JBoshart/VideoStoreAPI
jadevance 76fcb75
Wrote error handling for customers, cleaned up unused code
jadevance b5cb520
added video error handling
jadevance 1fcd557
Working on overdue rentals.
JBoshart 9fc2fc3
Merge branch 'master' of github.com:JBoshart/VideoStoreAPI
JBoshart b715f0f
Wrote tests for the videos controller (renamed from movies for clarit…
jadevance 92a93db
Added tests for customers controller.
jadevance 070171c
Wrote some tests for the rentals controller
jadevance d537234
Merging tests with local
JBoshart 72dfb1b
overdue function for rentals is now working.
JBoshart 21fc575
Added model specs and cleaned up error responses in the controllers
jadevance 33fe746
Made rentals#overdue tests, as well as model spec directory.
JBoshart cf20434
isolated the failing test and it is currently x and commented out in …
jadevance 45c0130
Managing merge conflicts, commented out tests that do not currently work
jadevance 33e1b27
Fixed failing test, endpoint had a typo
jadevance c5bc420
writing model tests for customers
jadevance b08e506
Added in package.json command to clean up test coverage reports
jadevance f54b3b2
Added new testing command to package.json.
JBoshart db2982b
Added tests to the rental models spec for find_current and find_history.
JBoshart 6995b8f
Added tests to rentals model spec for .overdue.
JBoshart d08365a
Added tests to rentals model spec for .video_current.
JBoshart 3ae0f78
Added tests to rentals model spec for .video_current, more will need …
JBoshart 83e3f06
Wrote a sorting function for rentals to return JSON data sorted by name
jadevance 345ad66
Merge branch 'master' of github.com:JBoshart/VideoStoreAPI
JBoshart d451759
added notes to remind us to address checkout date
jadevance c0506d2
Merge branch 'master' of github.com:JBoshart/VideoStoreAPI
jadevance 9b7606e
Handled checkout date logic for sorting
jadevance d55204e
More tests in progress.
JBoshart 9f7da07
Merge branch 'master' of github.com:JBoshart/VideoStoreAPI
JBoshart d808692
Sorting tests for find_video_history
JBoshart dd5593c
Wrote tests for video model. I think we should write some tests for .…
JBoshart 4f0e70e
error handling tests for models controllers is now in place and at 91…
JBoshart dfdf543
customers spec is now testing at 94% coverage.
JBoshart a373466
wrote tests for rentals to handle error handling
jadevance fae25cf
cleaning up the files
jadevance 34d7557
Removed views that were not being used. Added Api Documentation.
JBoshart ceba217
Merge branch 'master' of github.com:JBoshart/VideoStoreAPI
JBoshart File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
0 info it worked if it ends with ok | ||
1 verbose cli [ '/usr/local/Cellar/node/6.2.1/bin/node', | ||
1 verbose cli '/usr/local/bin/npm', | ||
1 verbose cli 'run', | ||
1 verbose cli 'db:reset' ] | ||
2 info using [email protected] | ||
3 info using [email protected] | ||
4 verbose run-script [ 'predb:reset', 'db:reset', 'postdb:reset' ] | ||
5 info lifecycle [email protected]~predb:reset: [email protected] | ||
6 silly lifecycle [email protected]~predb:reset: no script for predb:reset, continuing | ||
7 info lifecycle [email protected]~db:reset: [email protected] | ||
8 verbose lifecycle [email protected]~db:reset: unsafe-perm in lifecycle true | ||
9 verbose lifecycle [email protected]~db:reset: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Users/jillianboshart/C5/projects/VideoStoreAPI/node_modules/.bin:/usr/local/Cellar/node/6.2.1/bin:/user/jillianboshart/bin:/usr/local/bin:/Users/jillianboshart/.rvm/gems/ruby-2.3.1/bin:/Users/jillianboshart/.rvm/gems/ruby-2.3.1@global/bin:/Users/jillianboshart/.rvm/rubies/ruby-2.3.1/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/user/jillianboshart/bin:/Users/jillianboshart/.rvm/gems/ruby-2.3.1/bin:/Users/jillianboshart/.rvm/gems/ruby-2.3.1@global/bin:/Users/jillianboshart/.rvm/rubies/ruby-2.3.1/bin:/Users/jillianboshart/.rvm/bin:/Users/jillianboshart/.rvm/bin:/Users/jillianboshart/.rvm/bin | ||
10 verbose lifecycle [email protected]~db:reset: CWD: /Users/jillianboshart/C5/projects/VideoStoreAPI | ||
11 silly lifecycle [email protected]~db:reset: Args: [ '-c', | ||
11 silly lifecycle 'npm run db:drop; npm run db:create; npm run db:schema; npm run db:seed' ] | ||
12 silly lifecycle [email protected]~db:reset: Returned: code: 1 signal: null | ||
13 info lifecycle [email protected]~db:reset: Failed to exec db:reset script | ||
14 verbose stack Error: [email protected] db:reset: `npm run db:drop; npm run db:create; npm run db:schema; npm run db:seed` | ||
14 verbose stack Exit status 1 | ||
14 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:245:16) | ||
14 verbose stack at emitTwo (events.js:106:13) | ||
14 verbose stack at EventEmitter.emit (events.js:191:7) | ||
14 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:24:14) | ||
14 verbose stack at emitTwo (events.js:106:13) | ||
14 verbose stack at ChildProcess.emit (events.js:191:7) | ||
14 verbose stack at maybeClose (internal/child_process.js:852:16) | ||
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5) | ||
15 verbose pkgid [email protected] | ||
16 verbose cwd /Users/jillianboshart/C5/projects/VideoStoreAPI | ||
17 error Darwin 15.5.0 | ||
18 error argv "/usr/local/Cellar/node/6.2.1/bin/node" "/usr/local/bin/npm" "run" "db:reset" | ||
19 error node v6.2.1 | ||
20 error npm v3.9.3 | ||
21 error code ELIFECYCLE | ||
22 error [email protected] db:reset: `npm run db:drop; npm run db:create; npm run db:schema; npm run db:seed` | ||
22 error Exit status 1 | ||
23 error Failed at the [email protected] db:reset script 'npm run db:drop; npm run db:create; npm run db:schema; npm run db:seed'. | ||
23 error Make sure you have the latest version of node.js and npm installed. | ||
23 error If you do, this is most likely a problem with the video-store-api package, | ||
23 error not with npm itself. | ||
23 error Tell the author that this fails on your system: | ||
23 error npm run db:drop; npm run db:create; npm run db:schema; npm run db:seed | ||
23 error You can get information on how to open an issue for this project with: | ||
23 error npm bugs video-store-api | ||
23 error Or if that isn't available, you can get their info via: | ||
23 error npm owner ls video-store-api | ||
23 error There is likely additional logging output above. | ||
24 verbose exit [ 1, true ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
var massive = require('massive') | ||
var connectionString = "postgres://localhost/extreme_video_express" | ||
var db = massive.connectSync({connectionString : connectionString}) | ||
|
||
var video_data = require("../db/seeds/videos.json") | ||
var cust_data = require("../db/seeds/customers.json") | ||
|
||
var video_records = video_data.length | ||
var cust_records = cust_data.length | ||
|
||
// This will count the number of records and tell us if the seeding has completed | ||
// function checkFinish() { | ||
// db.videos.count(function(err, res1) { | ||
// console.log("videos in db: ", res1) | ||
// if (res1 >= video_records) { | ||
// console.log("Yay! I'm done with videos!") | ||
// db.customers.count(function(err, res2) { | ||
// console.log("customers in db: ", res2) | ||
// if (res2 >= cust_records) { | ||
// console.log("Yay! I'm done with customers!") | ||
// process.exit() | ||
// } | ||
// }) | ||
// } | ||
// }) | ||
// } | ||
|
||
var check1 = function checkVideo() { | ||
db.videos.count(function(err, res) { | ||
console.log("videos in db: ", res) | ||
if (res >= video_records) { | ||
console.log("Yay! I'm done with videos!") | ||
return true; | ||
} | ||
}) | ||
} | ||
|
||
var check2 = function checkCust() { | ||
db.customers.count(function(err, res) { | ||
console.log("customers in db: ", res) | ||
if (res >= cust_records) { | ||
console.log("Yay! I'm done with customers!") | ||
return true; | ||
} | ||
}) | ||
} | ||
|
||
var make = function(){ | ||
for (var record of video_data) { | ||
db.videos.save(record, function(err, res) { | ||
console.log("saved: ", JSON.stringify(res)) | ||
check1() | ||
}) | ||
} | ||
|
||
for (var record of cust_data) { | ||
db.customers.save(record, function(err, res) { | ||
console.log("saved: ", JSON.stringify(res)) | ||
check2() | ||
}) | ||
} | ||
|
||
if ((check1() === true) && (check2() === true)) { | ||
process.exit() | ||
} | ||
} | ||
|
||
make() |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
yay SQL!