parent
7af426c262
commit
3ecf3404df
@ -1,10 +1,19 @@ |
||||
import { Injectable } from '@nestjs/common'; |
||||
import { Inject, Injectable } from '@nestjs/common'; |
||||
import { QueryParamsDto, QueryResponseDto } from './calendar.dto'; |
||||
import { DbClient } from 'src/db'; |
||||
|
||||
@Injectable() |
||||
export class CalendarService { |
||||
constructor( |
||||
@Inject('dbClient') |
||||
private readonly dbClient: DbClient, |
||||
) {} |
||||
|
||||
async getAvailableSlots(queryParamsDto: QueryParamsDto) { |
||||
console.log(queryParamsDto); |
||||
return Promise.resolve([new QueryResponseDto(1, new Date())]); |
||||
const rows = await this.dbClient.getAvailableSlots(queryParamsDto); |
||||
return rows.map( |
||||
(row) => |
||||
new QueryResponseDto(parseInt(row.count, 10), new Date(row.start_date)), |
||||
); |
||||
} |
||||
} |
||||
|
@ -0,0 +1,15 @@ |
||||
export enum ProductType { |
||||
SolarPanels = 'SolarPanels', |
||||
Heatpumps = 'Heatpumps', |
||||
} |
||||
|
||||
export enum Language { |
||||
German = 'German', |
||||
English = 'English', |
||||
} |
||||
|
||||
export enum CustomerRating { |
||||
Gold = 'Gold', |
||||
Silver = 'Silver', |
||||
Bronze = 'Bronze', |
||||
} |
Loading…
Reference in new issue