diff --git a/src/report/dto/RequestCreateReportDto.ts b/src/report/dto/RequestCreateReportDto.ts new file mode 100644 index 0000000..062b90c --- /dev/null +++ b/src/report/dto/RequestCreateReportDto.ts @@ -0,0 +1,10 @@ +import { ApiProperty } from "@nestjs/swagger"; +import { IsNumber } from "class-validator"; + +export class RequestCreateReportDto { + @ApiProperty() + @IsNumber() + report_type: number; + + +} \ No newline at end of file diff --git a/src/report/report.controller.spec.ts b/src/report/report.controller.spec.ts new file mode 100644 index 0000000..1f3117c --- /dev/null +++ b/src/report/report.controller.spec.ts @@ -0,0 +1,18 @@ +import { Test, TestingModule } from '@nestjs/testing'; +import { ReportController } from './report.controller'; + +describe('ReportController', () => { + let controller: ReportController; + + beforeEach(async () => { + const module: TestingModule = await Test.createTestingModule({ + controllers: [ReportController], + }).compile(); + + controller = module.get(ReportController); + }); + + it('should be defined', () => { + expect(controller).toBeDefined(); + }); +}); diff --git a/src/report/report.controller.ts b/src/report/report.controller.ts new file mode 100644 index 0000000..f0411cd --- /dev/null +++ b/src/report/report.controller.ts @@ -0,0 +1,9 @@ +import { Controller } from '@nestjs/common'; +import { ReportService } from './report.service'; + +@Controller('report') +export class ReportController { + constructor(private reportService: ReportService) { } + + +} diff --git a/src/report/report.module.ts b/src/report/report.module.ts index be3dccf..3e690d8 100644 --- a/src/report/report.module.ts +++ b/src/report/report.module.ts @@ -1,8 +1,12 @@ import { Module } from '@nestjs/common'; import { TypeOrmModule } from '@nestjs/typeorm'; import { Report } from './report.entity'; +import { ReportController } from './report.controller'; +import { ReportService } from './report.service'; @Module({ imports: [TypeOrmModule.forFeature([Report])], + controllers: [ReportController], + providers: [ReportService], }) export class ReportModule {} diff --git a/src/report/report.service.spec.ts b/src/report/report.service.spec.ts new file mode 100644 index 0000000..27a92b2 --- /dev/null +++ b/src/report/report.service.spec.ts @@ -0,0 +1,18 @@ +import { Test, TestingModule } from '@nestjs/testing'; +import { ReportService } from './report.service'; + +describe('ReportService', () => { + let service: ReportService; + + beforeEach(async () => { + const module: TestingModule = await Test.createTestingModule({ + providers: [ReportService], + }).compile(); + + service = module.get(ReportService); + }); + + it('should be defined', () => { + expect(service).toBeDefined(); + }); +}); diff --git a/src/report/report.service.ts b/src/report/report.service.ts new file mode 100644 index 0000000..ee03852 --- /dev/null +++ b/src/report/report.service.ts @@ -0,0 +1,14 @@ +import { Injectable } from '@nestjs/common'; +import { InjectRepository } from '@nestjs/typeorm'; +import { Repository } from 'typeorm'; +import { Report } from './report.entity'; + +@Injectable() +export class ReportService { + constructor( + @InjectRepository(Report) + private reportRepository: Repository, + + + ) { } +}