Skip to content

Commit

Permalink
refactor: move alert-price
Browse files Browse the repository at this point in the history
  • Loading branch information
MiguelMedeiros committed Feb 5, 2024
1 parent a161801 commit 26464c9
Show file tree
Hide file tree
Showing 14 changed files with 8 additions and 239 deletions.
11 changes: 1 addition & 10 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,4 @@
APPLICATION_PORT=3001
APPLICATION_NAME=Service Prices API
APPLICATION_DESCRIPTION=Murray Rothbot Service Prices API.
APPLICATION_VERSION=1.0.0

POSTGRES_HOST=localhost
POSTGRES_PORT=5432
POSTGRES_USER=murray
POSTGRES_PASSWORD=1q2w3e4r
POSTGRES_DB=service-murray

SERVICE_PRICES_URL=http://localhost:3001
SERVICE_MURRAY_URL=http://localhost:3004
APPLICATION_VERSION=1.0.0
2 changes: 1 addition & 1 deletion src/app.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export class AppController {
constructor(private readonly appService: AppService) {}

@ApiOperation({
summary: 'This is the health check endpoint.',
summary: 'Checks the health and availability of the API service.',
})
@ApiOkResponse({
description: 'The service is healthy.',
Expand Down
15 changes: 0 additions & 15 deletions src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ import { AppController } from './app.controller'
import { AppService } from './app.service'
import { TickerModule } from './domain/ticker/ticker.module'
import { ConvertModule } from './domain/convert/convert.module'
import { AlertPriceModule } from './domain/alert-price/alert-price.module'
import { SequelizeModule } from '@nestjs/sequelize'
import { AlertPrice } from './domain/alert-price/alert-price.model'

@Module({
imports: [
Expand All @@ -18,20 +15,8 @@ import { AlertPrice } from './domain/alert-price/alert-price.model'
load: [config],
}),
ScheduleModule.forRoot(),
SequelizeModule.forRoot({
dialect: 'postgres',
host: process.env.POSTGRES_HOST,
port: parseInt(process.env.POSTGRES_PORT, 10),
username: process.env.POSTGRES_USER,
password: process.env.POSTGRES_PASSWORD,
database: process.env.POSTGRES_DB,
models: [AlertPrice],
autoLoadModels: true,
logging: false,
}),
TickerModule,
ConvertModule,
AlertPriceModule,
],
controllers: [AppController],
providers: [AppService],
Expand Down
6 changes: 3 additions & 3 deletions src/config/swagger.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ export const swaggerConfig = async function conf(app: INestApplication): Promise
.setTitle(cfgService.get<string>('APPLICATION_NAME', ''))
.setDescription(cfgService.get<string>('APPLICATION_DESCRIPTION', ''))
.setVersion(cfgService.get<string>('APPLICATION_VERSION', ''))
.addTag('default', 'Default Routes')
.addTag('Tickers', 'Ticker Routes')
.setExternalDoc('Discord Server', 'https://discord.gg/6BfSApvh')
.addTag('default', 'Essential endpoints for monitoring and checking the APIs status.')
.addTag('Tickers', 'Endpoints for financial information and exchange rates.')
.setExternalDoc('Github Repository', 'https://github.com/Murray-Rothbot/service-prices')
.setLicense('MIT', 'https://opensource.org/licenses/MIT')
.build()

Expand Down
18 changes: 0 additions & 18 deletions src/domain/alert-price/alert-price.controller.ts

This file was deleted.

22 changes: 0 additions & 22 deletions src/domain/alert-price/alert-price.model.ts

This file was deleted.

14 changes: 0 additions & 14 deletions src/domain/alert-price/alert-price.module.ts

This file was deleted.

126 changes: 0 additions & 126 deletions src/domain/alert-price/alert-price.service.ts

This file was deleted.

16 changes: 0 additions & 16 deletions src/domain/alert-price/dto/create-alert-price.dto.ts

This file was deleted.

2 changes: 0 additions & 2 deletions src/domain/alert-price/dto/index.ts

This file was deleted.

8 changes: 0 additions & 8 deletions src/domain/alert-price/dto/list-alert-prices.dto.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/domain/convert/convert.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export class ConvertController {
constructor(private readonly convertService: ConvertService) {}

@ApiOperation({
summary: 'Converts a value from a currency to another.',
summary: ' Converts values between different currencies.',
})
@ApiQuery({
name: 'currency',
Expand Down
4 changes: 2 additions & 2 deletions src/domain/ticker/ticker.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export class TickerController {
constructor(private readonly tickerService: TickerService) {}

@ApiOperation({
summary: 'Get the ticker for a specific pair.',
summary: 'Provides data for a specific currency pair.',
})
@ApiQuery({
name: 'symbol',
Expand All @@ -34,7 +34,7 @@ export class TickerController {
}

@ApiOperation({
summary: 'Get the tickers for a list of pairs.',
summary: 'Returns information on multiple currency pairs.',
})
@ApiQuery({
name: 'symbol',
Expand Down
1 change: 0 additions & 1 deletion src/domain/ticker/ticker.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import {
export class TickerService {
repositories: Array<ITickerRepository>
private readonly logger = new Logger(TickerService.name)
serviceMurrayUrl: string = this.cfgService.get<string>('SERVICE_MURRAY_URL')

constructor(
protected readonly httpService: HttpService,
Expand Down

0 comments on commit 26464c9

Please sign in to comment.