Skip to content
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

Jv module work #8

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
08a9d5e
Initial commit and created branch for module work
JosephThomasVasquez Dec 4, 2021
82970df
initialized knex config file
JosephThomasVasquez Dec 4, 2021
0bcf73c
Imported connection from EV
JosephThomasVasquez Dec 4, 2021
ea7f136
Setup a connection file for knex to configure the development environ…
JosephThomasVasquez Dec 4, 2021
5693a47
Created suppliers migrations file and config
JosephThomasVasquez Dec 4, 2021
5f41ebd
Created migrations file for the products table
JosephThomasVasquez Dec 4, 2021
a208685
Created migrations file for the categories table
JosephThomasVasquez Dec 4, 2021
be43ea0
Created migrations file for the products_categories table
JosephThomasVasquez Dec 4, 2021
75e7879
Created migrations file for updating product name and adding price
JosephThomasVasquez Dec 4, 2021
07a0e9c
Added seed config to knex and created seeds with seed data for all ta…
JosephThomasVasquez Dec 5, 2021
ba5687b
Added categories.service to handle knex queries for get
JosephThomasVasquez Dec 5, 2021
6ff2ccb
Created products.service to hanbdle querying products list and produc…
JosephThomasVasquez Dec 5, 2021
92b6259
Added middleware to handle invalid fields
JosephThomasVasquez Dec 5, 2021
92c707b
Added hasProperties middleware to handle property error
JosephThomasVasquez Dec 5, 2021
f659b60
Added supplierExists and read and update services for supplier updati…
JosephThomasVasquez Dec 5, 2021
0903bcf
Completed update supplier method for updating supplier in the db
JosephThomasVasquez Dec 5, 2021
1cda1b2
Added delete (destroy) methods for deleting supplier from db in servi…
JosephThomasVasquez Dec 5, 2021
82d113d
Refactored CRUD functions for all controllers and wrapped error handl…
JosephThomasVasquez Dec 6, 2021
a315d1f
Added listOutOfStockCount to handle count query for out of stock prod…
JosephThomasVasquez Dec 6, 2021
f18d795
Added more list query methods and updated service controller and routes
JosephThomasVasquez Dec 6, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .env.sample

This file was deleted.

59 changes: 59 additions & 0 deletions knexfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
// Update with your config settings.
const path = require("path");
const dotenv = require("dotenv").config();
const { DATABASE_URL } = process.env;

module.exports = {
development: {
client: "postgresql",
connection: DATABASE_URL,
migrations: {
directory: path.join(__dirname, "src", "db", "migrations"),
},
seeds: {
directory: path.join(__dirname, "src", "db", "seeds"),
},
},

// test: {
// client: "postgresql",
// pool: { min: 1, max: 5 },
// connection: {
// database: "db_test",
// user: "username_test",
// password: "password_test",
// },
// },

// staging: {
// client: "postgresql",
// connection: {
// database: "my_db",
// user: "username",
// password: "password",
// },
// pool: {
// min: 2,
// max: 10,
// },
// migrations: {
// tableName: "knex_migrations",
// },
// },

// production: {
// client: "postgresql",
// connection: {
// database: "my_db",
// user: "username",
// password: "password",
// },
// pool: {
// min: 2,
// max: 10,
// },
// migrations: {
// tableName: "knex_migrations",
// },
// },
};
Loading