-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
620e97d
commit 585eaf5
Showing
9 changed files
with
117 additions
and
113 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,37 +1,37 @@ | ||
version: "3.9" | ||
|
||
services: | ||
redis: | ||
image: redis:7.0-alpine | ||
container_name: expenses-redis-test | ||
restart: always | ||
expenses: | ||
build: . | ||
command: sh -c "yarn install && yarn test" | ||
container_name: expenses-test | ||
depends_on: | ||
- postgres | ||
- redis | ||
env_file: ./.env.test | ||
ports: | ||
- 6379:6379 | ||
command: redis-server --save 20 1 --loglevel warning | ||
- $PORT:$PORT | ||
volumes: | ||
- ./.redis:/data | ||
- .:/app | ||
working_dir: /app | ||
|
||
postgres: | ||
image: postgres:14-alpine | ||
container_name: express-postgres-test | ||
environment: | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_DB: expenses-test | ||
volumes: | ||
- ./.postgres:/var/lib/postgresql/data | ||
POSTGRES_PASSWORD: postgres | ||
image: postgres:14-alpine | ||
ports: | ||
- 5432:5432 | ||
|
||
expenses: | ||
build: . | ||
container_name: expenses-test | ||
working_dir: /app | ||
env_file: ./.env.test | ||
volumes: | ||
- .:/app | ||
- ./.postgres:/var/lib/postgresql/data | ||
|
||
redis: | ||
command: redis-server --save 20 1 --loglevel warning | ||
container_name: expenses-redis-test | ||
image: redis:7.0-alpine | ||
ports: | ||
- $PORT:$PORT | ||
depends_on: | ||
- postgres | ||
- redis | ||
command: sh -c "yarn install && yarn test" | ||
- 6379:6379 | ||
restart: always | ||
volumes: | ||
- ./.redis:/data | ||
|
||
version: "3.9" |
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,37 +1,37 @@ | ||
version: "3.9" | ||
|
||
services: | ||
redis: | ||
image: redis:7.0-alpine | ||
container_name: expenses-redis | ||
restart: always | ||
expenses: | ||
build: . | ||
command: sh -c "yarn dev" | ||
container_name: expenses-backend | ||
depends_on: | ||
- postgres | ||
- redis | ||
env_file: ./.env | ||
ports: | ||
- 6379:6379 | ||
command: redis-server --save 20 1 --loglevel warning | ||
- $PORT:$PORT | ||
volumes: | ||
- ./.redis:/data | ||
- .:/app | ||
working_dir: /app | ||
|
||
postgres: | ||
image: postgres:14-alpine | ||
container_name: expenses-postgres | ||
environment: | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_DB: expenses | ||
volumes: | ||
- ./.postgres:/var/lib/postgresql/data | ||
POSTGRES_PASSWORD: postgres | ||
image: postgres:14-alpine | ||
ports: | ||
- 5432:5432 | ||
|
||
expenses: | ||
build: . | ||
container_name: expenses-backend | ||
working_dir: /app | ||
env_file: ./.env | ||
volumes: | ||
- .:/app | ||
- ./.postgres:/var/lib/postgresql/data | ||
|
||
redis: | ||
command: redis-server --save 20 1 --loglevel warning | ||
container_name: expenses-redis | ||
image: redis:7.0-alpine | ||
ports: | ||
- $PORT:$PORT | ||
depends_on: | ||
- postgres | ||
- redis | ||
command: sh -c "yarn dev" | ||
- 6379:6379 | ||
restart: always | ||
volumes: | ||
- ./.redis:/data | ||
|
||
version: "3.9" |
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,17 @@ | ||
{ | ||
"roots": ["<rootDir>"], | ||
"globalSetup": "./test/globalSetup.ts", | ||
"transform": { | ||
"^.+\\.ts?$": "ts-jest" | ||
}, | ||
"testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.ts?$", | ||
"moduleFileExtensions": ["ts", "js", "json", "node"], | ||
"moduleNameMapper": { | ||
"^services/(.*)$": "<rootDir>/src/services/$1", | ||
"^routes/(.*)$": "<rootDir>/src/routes/$1", | ||
"^enums/(.*)$": "<rootDir>/src/enums/$1", | ||
"^models/(.*)$": "<rootDir>/src/models/$1", | ||
"^src/(.*)$": "<rootDir>/src/$1" | ||
}, | ||
"testEnvironment": "node" | ||
} |
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 |
---|---|---|
@@ -1,44 +1,44 @@ | ||
export namespace ApiError { | ||
export enum Auth { | ||
GENERIC = 1000, | ||
EXPIRED_TOKEN, | ||
BAD_AUTH, | ||
UNAUTHORIZED, | ||
BAD_EMAIL_FORMAT, | ||
NEED_BE_LOGGED_IN, | ||
EXPIRED_TOKEN = 1001, | ||
BAD_AUTH = 1002, | ||
UNAUTHORIZED = 1003, | ||
BAD_EMAIL_FORMAT = 1004, | ||
NEED_BE_LOGGED_IN = 1005, | ||
} | ||
|
||
export enum Server { | ||
GENERIC = 2000, | ||
TOO_FEW_PARAMS, | ||
PARAMS_REQUIRED, | ||
NOT_FOUND, | ||
TOO_FEW_PARAMS = 2001, | ||
PARAMS_REQUIRED = 2002, | ||
NOT_FOUND = 2003, | ||
} | ||
|
||
export enum User { | ||
GENERIC = 3000, | ||
USER_DOES_NOT_EXIST, | ||
WRONG_PASSWORD, | ||
PASSWORD_TOO_SHORT, | ||
USER_ALREADY_EXISTS, | ||
USER_DOES_NOT_EXIST = 3001, | ||
WRONG_PASSWORD = 3002, | ||
PASSWORD_TOO_SHORT = 3003, | ||
USER_ALREADY_EXISTS = 3004, | ||
} | ||
|
||
export enum Transaction { | ||
GENERIC = 4000, | ||
TRANSACTION_NOT_EXIST, | ||
TRANSACTION_AND_CATEGORY_NOT_SAME_TYPE, | ||
TRANSACTION_AND_GOAL_NOT_SAME_CURENCY, | ||
TRANSACTION_AND_GOAL_NOT_SAME_TYPE, | ||
TRANSACTION_NOT_EXIST = 4001, | ||
TRANSACTION_AND_CATEGORY_NOT_SAME_TYPE = 4002, | ||
TRANSACTION_AND_GOAL_NOT_SAME_CURENCY = 4003, | ||
TRANSACTION_AND_GOAL_NOT_SAME_TYPE = 4004, | ||
} | ||
|
||
export enum Category { | ||
GENERIC = 5000, | ||
CATEGORY_NOT_EXIST, | ||
CANNOT_DELETE_CATEGORY_TRASACTIONS, | ||
CATEGORY_NOT_EXIST = 5001, | ||
CANNOT_DELETE_CATEGORY_TRASACTIONS = 5002, | ||
} | ||
|
||
export enum FinancialGoal { | ||
GENERIC = 6000, | ||
FINANCIAL_GOAL_NOT_EXIST, | ||
FINANCIAL_GOAL_NOT_EXIST = 6001, | ||
} | ||
} |
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
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