-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: revision module countries core
- Loading branch information
Showing
49 changed files
with
2,999 additions
and
3,147 deletions.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,7 +1,8 @@ | ||
{ | ||
"version": "1.0.0", | ||
"packages": [ | ||
"libs/*", | ||
"modules/**" | ||
], | ||
"version": "1.0.0" | ||
"npmClient": "yarn" | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
node_modules/ | ||
reports/ | ||
lib/ | ||
lib/ | ||
.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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
node_modules/ | ||
reports/ | ||
lib/ | ||
.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 |
---|---|---|
@@ -1,4 +1,28 @@ | ||
import { resolve } from 'path'; | ||
import { config } from 'dotenv'; | ||
|
||
config({ path: resolve(__dirname, '.env') }); | ||
export interface CountryDbEnv { | ||
name: string; | ||
type: string; | ||
storage: string; | ||
} | ||
|
||
export interface CountryEnv { | ||
db: CountryDbEnv; | ||
production: boolean; | ||
} | ||
|
||
export const readEnv = (name: string = '.env'): CountryEnv => { | ||
const path = resolve(process.cwd(), name); | ||
|
||
config({ path }); | ||
|
||
return { | ||
db: { | ||
name: process.env.DB_NAME as string, | ||
type: process.env.DB_TYPE as string, | ||
storage: process.env.DB_STORAGE as string, | ||
}, | ||
production: process.env.NODE_ENV === 'production', | ||
}; | ||
}; |
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,9 +1 @@ | ||
import './env'; | ||
|
||
export const DB = { | ||
NAME: process.env.DB_NAME, | ||
TYPE: process.env.DB_TYPE, | ||
STORAGE: process.env.DB_STORAGE, | ||
}; | ||
|
||
export const PRODUCTION = process.env.NODE_ENV === 'production'; | ||
export * from './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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
node_modules/ | ||
reports/ | ||
lib/ | ||
.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
9 changes: 6 additions & 3 deletions
9
modules/countries/core/src/application/use-cases/create-country/index.ts
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,6 +1,9 @@ | ||
export * from './create-country.error'; | ||
|
||
import { CountryRepositoryImpl } from '@infraestructure/repositories/index'; | ||
import { CreateCountryUseCase } from './create-country.use-case'; | ||
const createCountryUseCase = new CreateCountryUseCase(); | ||
|
||
const repository = new CountryRepositoryImpl(); | ||
const createCountryUseCase = new CreateCountryUseCase(repository); | ||
|
||
export * from './create-country.error'; | ||
export * from './create-country.use-case'; | ||
export { createCountryUseCase }; |
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
5 changes: 4 additions & 1 deletion
5
modules/countries/core/src/application/use-cases/delete-country/index.ts
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,8 @@ | ||
import { CountryRepositoryImpl } from '@infraestructure/repositories/index'; | ||
import { DeleteCountryUseCase } from './delete.use-case'; | ||
|
||
const deleteCountryUseCase = new DeleteCountryUseCase(); | ||
const repository = new CountryRepositoryImpl(); | ||
const deleteCountryUseCase = new DeleteCountryUseCase(repository); | ||
|
||
export * from './delete.use-case'; | ||
export { deleteCountryUseCase }; |
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
5 changes: 4 additions & 1 deletion
5
modules/countries/core/src/application/use-cases/find-country/index.ts
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,8 @@ | ||
import { CountryRepositoryImpl } from '@infraestructure/repositories/index'; | ||
import { FindCountryUseCase } from './find-country.use-case'; | ||
|
||
const findCountryUseCase = new FindCountryUseCase(); | ||
const repository = new CountryRepositoryImpl(); | ||
const findCountryUseCase = new FindCountryUseCase(repository); | ||
|
||
export * from './find-country.use-case'; | ||
export { findCountryUseCase }; |
5 changes: 4 additions & 1 deletion
5
modules/countries/core/src/application/use-cases/list-country/index.ts
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,8 @@ | ||
import { CountryRepositoryImpl } from '@infraestructure/repositories/index'; | ||
import { ListCountryUseCase } from './list-country.use-case'; | ||
|
||
const listCountryUseCase = new ListCountryUseCase(); | ||
const repository = new CountryRepositoryImpl(); | ||
const listCountryUseCase = new ListCountryUseCase(repository); | ||
|
||
export * from './list-country.use-case'; | ||
export { listCountryUseCase }; |
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
8 changes: 6 additions & 2 deletions
8
modules/countries/core/src/application/use-cases/update-country/index.ts
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,6 +1,10 @@ | ||
export * from './update-country.error'; | ||
|
||
import { CountryRepositoryImpl } from '@infraestructure/repositories/index'; | ||
import { UpdateCountryUseCase } from './update-country.use-case'; | ||
const updateCountryUseCase = new UpdateCountryUseCase(); | ||
|
||
const repository = new CountryRepositoryImpl(); | ||
const updateCountryUseCase = new UpdateCountryUseCase(repository); | ||
|
||
export * from './update-country.error'; | ||
export * from './update-country.use-case'; | ||
export { updateCountryUseCase }; |
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,3 +1,2 @@ | ||
export * from './infraestructure'; | ||
export * from './domain'; | ||
export * from './application'; |
12 changes: 7 additions & 5 deletions
12
modules/countries/core/src/infraestructure/database/index.ts
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
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,12 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 2 | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.md] | ||
max_line_length = off | ||
trim_trailing_whitespace = 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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
node_modules/ | ||
reports/ | ||
lib/ | ||
lib/ | ||
.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,7 @@ | ||
{ | ||
"endOfLine": "auto", | ||
"semi": true, | ||
"singleQuote": true, | ||
"tabWidth": 2, | ||
"trailingComma": "es5" | ||
} |
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 @@ | ||
declare module '*.json' { | ||
const value: any; | ||
export default value; | ||
} |
Oops, something went wrong.