-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:DevCoopBSM/DevCoop-back
- Loading branch information
Showing
68 changed files
with
7,007 additions
and
5,983 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# node_modules | ||
/node_modules | ||
|
||
/migrations | ||
# Database info | ||
.env |
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,4 @@ | ||
{ | ||
"tabWidth": 2, | ||
"useTabs": false | ||
} |
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,16 @@ | ||
const InventoryService = require("../utils/inventory"); | ||
|
||
const startDate = "2023-11-01"; | ||
const endDate = "2023-11-14"; | ||
// 엑셀생성 자료 테스트 | ||
it("1", async () => { | ||
// await InventoryService.createSnapshotForItem(115, 11); | ||
// await InventoryService.createSnapshotForItem(407, 15); | ||
const test = await InventoryService.getCombinedChanges(startDate, endDate); | ||
console.log(test); | ||
}); | ||
|
||
// it("2", async () => { | ||
// const test = await InventoryService.getReceiptChanges(startDate, endDate); | ||
// console.log(test); | ||
// }); |
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,25 @@ | ||
require('dotenv').config(); // 환경 변수 로드 | ||
|
||
module.exports = { | ||
development: { | ||
username: process.env.DB_USER_NAME, | ||
password: process.env.DB_PASSWORD, | ||
database: process.env.DB_NAME, | ||
host: process.env.DB_HOST, | ||
dialect: 'mysql' | ||
}, | ||
test: { | ||
username: process.env.DB_USER_NAME, | ||
password: process.env.DB_PASSWORD, | ||
database: process.env.DB_NAME, | ||
host: process.env.DB_HOST, | ||
dialect: 'mysql' | ||
}, | ||
production: { | ||
username: process.env.DB_USER_NAME, | ||
password: process.env.DB_PASSWORD, | ||
database: process.env.DB_NAME, | ||
host: process.env.DB_HOST, | ||
dialect: 'mysql' | ||
} | ||
} |
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 |
---|---|---|
@@ -1,14 +1,14 @@ | ||
const dotenv = require("dotenv"); | ||
const fs = require('fs'); | ||
dotenv.config(); | ||
|
||
module.exports = { | ||
host: "DevCoop_MySql", | ||
port: 3306, | ||
user: process.env.DB_USER_NAME, | ||
password: process.env.DB_PASSWORD, | ||
database: process.env.DB_NAME, | ||
waitForConnections : true, | ||
connectionLimit: 30, | ||
queueLimit: 0 | ||
host: "DevCoop_MySql", | ||
port: 3306, | ||
user: process.env.DB_USER_NAME, | ||
password: process.env.DB_PASSWORD, | ||
database: process.env.DB_NAME, | ||
waitForConnections : true, | ||
connectionLimit: 30, | ||
queueLimit: 0, | ||
// debug: 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,13 @@ | ||
// jest.config.js | ||
module.exports = { | ||
// ... | ||
moduleNameMapper: { | ||
"@models": "<rootDir>/models", | ||
"@query": "<rootDir>/utils/query", | ||
"@token": "<rootDir>/utils/token", | ||
"@inventory": "<rootDir>/utils/inventory", | ||
"@date": "<rootDir>/utils/date", | ||
// 다른 별칭도 같은 방식으로 추가 | ||
}, | ||
// ... | ||
}; |
This file was deleted.
Oops, something went wrong.
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 @@ | ||
const Sequelize = require('sequelize'); | ||
module.exports = function(sequelize, DataTypes) { | ||
return sequelize.define('DailyInventoryChange', { | ||
change_id: { | ||
autoIncrement: true, | ||
type: DataTypes.INTEGER, | ||
allowNull: false, | ||
primaryKey: true | ||
}, | ||
item_id: { | ||
type: DataTypes.INTEGER, | ||
allowNull: false | ||
}, | ||
item_name: { | ||
type: DataTypes.TEXT, | ||
allowNull: true | ||
}, | ||
change_date: { | ||
type: DataTypes.DATE, | ||
allowNull: false | ||
}, | ||
added_qty: { | ||
type: DataTypes.INTEGER, | ||
allowNull: true | ||
}, | ||
removed_qty: { | ||
type: DataTypes.INTEGER, | ||
allowNull: true | ||
}, | ||
reason: { | ||
type: DataTypes.STRING(100), | ||
allowNull: true | ||
} | ||
}, { | ||
sequelize, | ||
tableName: 'DailyInventoryChange', | ||
timestamps: false, | ||
indexes: [ | ||
{ | ||
name: "PRIMARY", | ||
unique: true, | ||
using: "BTREE", | ||
fields: [ | ||
{ name: "change_id" }, | ||
] | ||
}, | ||
] | ||
}); | ||
}; |
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,32 @@ | ||
const Sequelize = require('sequelize'); | ||
module.exports = function(sequelize, DataTypes) { | ||
return sequelize.define('SequelizeMeta', { | ||
name: { | ||
type: DataTypes.STRING(255), | ||
allowNull: false, | ||
primaryKey: true | ||
} | ||
}, { | ||
sequelize, | ||
tableName: 'SequelizeMeta', | ||
timestamps: false, | ||
indexes: [ | ||
{ | ||
name: "PRIMARY", | ||
unique: true, | ||
using: "BTREE", | ||
fields: [ | ||
{ name: "name" }, | ||
] | ||
}, | ||
{ | ||
name: "name", | ||
unique: true, | ||
using: "BTREE", | ||
fields: [ | ||
{ name: "name" }, | ||
] | ||
}, | ||
] | ||
}); | ||
}; |
Oops, something went wrong.