From e51e5a51a1bca70ba14522c7a43873e657c3452f Mon Sep 17 00:00:00 2001 From: Firman Ramdhani <33869609+firmanramdhani@users.noreply.github.com> Date: Tue, 2 Jul 2024 16:42:16 +0700 Subject: [PATCH 1/2] feat: init module report --- src/app.module.ts | 15 +++++++++++++++ .../report-bookmark/report-bookmark.module.ts | 8 ++++++++ .../reports/report-export/report-export.module.ts | 8 ++++++++ src/modules/reports/report/report.module.ts | 8 ++++++++ 4 files changed, 39 insertions(+) create mode 100644 src/modules/reports/report-bookmark/report-bookmark.module.ts create mode 100644 src/modules/reports/report-export/report-export.module.ts create mode 100644 src/modules/reports/report/report.module.ts diff --git a/src/app.module.ts b/src/app.module.ts index f430b37..23ff848 100644 --- a/src/app.module.ts +++ b/src/app.module.ts @@ -43,6 +43,12 @@ import { ItemRateModule } from './modules/item-related/item-rate/item-rate.modul import { ItemRateModel } from './modules/item-related/item-rate/data/models/item-rate.model'; import { GoogleCalendarModule } from './modules/configuration/google-calendar/google-calendar.module'; +import { ReportModule } from './modules/reports/report/report.module'; +import { ReportBookmarkModule } from './modules/reports/report-bookmark/report-bookmark.module'; +import { ReportExportModule } from './modules/reports/report-export/report-export.module'; +import { ReportBookmarkModel } from './modules/reports/shared/models/report-bookmark.model'; +import { ExportReportHistoryModel } from './modules/reports/shared/models/export-report-history.model'; + @Module({ imports: [ ApmModule.register(), @@ -72,6 +78,10 @@ import { GoogleCalendarModule } from './modules/configuration/google-calendar/go UserModel, VipCategoryModel, VipCodeModel, + + // report + ReportBookmarkModel, + ExportReportHistoryModel, ], synchronize: false, }), @@ -104,6 +114,11 @@ import { GoogleCalendarModule } from './modules/configuration/google-calendar/go // session SeasonTypeModule, SeasonPeriodModule, + + // report + ReportModule, + ReportBookmarkModule, + ReportExportModule, ], controllers: [], providers: [ diff --git a/src/modules/reports/report-bookmark/report-bookmark.module.ts b/src/modules/reports/report-bookmark/report-bookmark.module.ts new file mode 100644 index 0000000..d7c0fc7 --- /dev/null +++ b/src/modules/reports/report-bookmark/report-bookmark.module.ts @@ -0,0 +1,8 @@ +import { Module } from '@nestjs/common'; + +@Module({ + imports: [], + controllers: [], + providers: [], +}) +export class ReportBookmarkModule {} diff --git a/src/modules/reports/report-export/report-export.module.ts b/src/modules/reports/report-export/report-export.module.ts new file mode 100644 index 0000000..47fd493 --- /dev/null +++ b/src/modules/reports/report-export/report-export.module.ts @@ -0,0 +1,8 @@ +import { Module } from '@nestjs/common'; + +@Module({ + imports: [], + controllers: [], + providers: [], +}) +export class ReportExportModule {} diff --git a/src/modules/reports/report/report.module.ts b/src/modules/reports/report/report.module.ts new file mode 100644 index 0000000..6d8ca42 --- /dev/null +++ b/src/modules/reports/report/report.module.ts @@ -0,0 +1,8 @@ +import { Module } from '@nestjs/common'; + +@Module({ + imports: [], + controllers: [], + providers: [], +}) +export class ReportModule {} From f62dc15075976f9e5eec4a405e5ccd43534983c4 Mon Sep 17 00:00:00 2001 From: Firman Ramdhani <33869609+firmanramdhani@users.noreply.github.com> Date: Tue, 2 Jul 2024 17:09:07 +0700 Subject: [PATCH 2/2] feat: setup router report --- .../strings/constants/module.constants.ts | 4 +++ .../report-bookmark.controller.ts | 35 +++++++++++++++++++ .../report-bookmark/report-bookmark.module.ts | 6 ++-- .../report-bookmark.service.ts | 4 +++ .../report-export/report-export.controller.ts | 35 +++++++++++++++++++ .../report-export/report-export.module.ts | 6 ++-- .../report-export/report-export.service.ts | 4 +++ .../reports/report/report.controller.ts | 20 +++++++++++ src/modules/reports/report/report.module.ts | 6 ++-- src/modules/reports/report/report.service.ts | 4 +++ 10 files changed, 118 insertions(+), 6 deletions(-) create mode 100644 src/modules/reports/report-bookmark/report-bookmark.controller.ts create mode 100644 src/modules/reports/report-bookmark/report-bookmark.service.ts create mode 100644 src/modules/reports/report-export/report-export.controller.ts create mode 100644 src/modules/reports/report-export/report-export.service.ts create mode 100644 src/modules/reports/report/report.controller.ts create mode 100644 src/modules/reports/report/report.service.ts diff --git a/src/core/strings/constants/module.constants.ts b/src/core/strings/constants/module.constants.ts index ccc5889..f777ac3 100644 --- a/src/core/strings/constants/module.constants.ts +++ b/src/core/strings/constants/module.constants.ts @@ -12,4 +12,8 @@ export enum MODULE_NAME { USER_PRIVILEGE_CONFIGURATION = 'user-privilege-configurations', VIP_CATEGORY = 'vip-categories', VIP_CODE = 'vip-codes', + + REPORT = 'report', + REPORT_BOOKMARK = 'report-bookmark', + REPORT_EXPORT = 'report-export', } diff --git a/src/modules/reports/report-bookmark/report-bookmark.controller.ts b/src/modules/reports/report-bookmark/report-bookmark.controller.ts new file mode 100644 index 0000000..7f30778 --- /dev/null +++ b/src/modules/reports/report-bookmark/report-bookmark.controller.ts @@ -0,0 +1,35 @@ +import { Controller, Delete, Get, Post, Put } from '@nestjs/common'; +import { ApiBearerAuth, ApiTags } from '@nestjs/swagger'; +import { Public } from 'src/core/guards'; +import { MODULE_NAME } from 'src/core/strings/constants/module.constants'; + +@ApiTags(`${MODULE_NAME.REPORT_BOOKMARK.split('-').join(' ')}`) +@Controller(`v1/${MODULE_NAME.REPORT_BOOKMARK}`) +@Public(false) +@ApiBearerAuth('JWT') +export class ReportBookmarkController { + @Post() + async create() { + return; + } + + @Get() + async getAll() { + return; + } + + @Put('applied') + async applied() { + return; + } + + @Put('unapplied') + async unapplied() { + return; + } + + @Delete(':id') + async delete() { + return; + } +} diff --git a/src/modules/reports/report-bookmark/report-bookmark.module.ts b/src/modules/reports/report-bookmark/report-bookmark.module.ts index d7c0fc7..4a3a2a8 100644 --- a/src/modules/reports/report-bookmark/report-bookmark.module.ts +++ b/src/modules/reports/report-bookmark/report-bookmark.module.ts @@ -1,8 +1,10 @@ import { Module } from '@nestjs/common'; +import { ReportBookmarkController } from './report-bookmark.controller'; +import { ReportBookmarkService } from './report-bookmark.service'; @Module({ imports: [], - controllers: [], - providers: [], + controllers: [ReportBookmarkController], + providers: [ReportBookmarkService], }) export class ReportBookmarkModule {} diff --git a/src/modules/reports/report-bookmark/report-bookmark.service.ts b/src/modules/reports/report-bookmark/report-bookmark.service.ts new file mode 100644 index 0000000..54923f2 --- /dev/null +++ b/src/modules/reports/report-bookmark/report-bookmark.service.ts @@ -0,0 +1,4 @@ +import { Injectable } from '@nestjs/common'; + +@Injectable() +export class ReportBookmarkService {} diff --git a/src/modules/reports/report-export/report-export.controller.ts b/src/modules/reports/report-export/report-export.controller.ts new file mode 100644 index 0000000..ab7b428 --- /dev/null +++ b/src/modules/reports/report-export/report-export.controller.ts @@ -0,0 +1,35 @@ +import { Controller, Delete, Get, Post, Put } from '@nestjs/common'; +import { ApiBearerAuth, ApiTags } from '@nestjs/swagger'; +import { Public } from 'src/core/guards'; +import { MODULE_NAME } from 'src/core/strings/constants/module.constants'; + +@ApiTags(`${MODULE_NAME.REPORT_EXPORT.split('-').join(' ')}`) +@Controller(`v1/${MODULE_NAME.REPORT_EXPORT}`) +@Public(false) +@ApiBearerAuth('JWT') +export class ReportExportController { + @Post() + async create() { + return; + } + + @Get() + async getAll() { + return; + } + + @Delete(':id') + async delete() { + return; + } + + @Get('processing') + async getAllProcessing() { + return; + } + + @Get('filename-history') + async getListHistoryFileName() { + return; + } +} diff --git a/src/modules/reports/report-export/report-export.module.ts b/src/modules/reports/report-export/report-export.module.ts index 47fd493..bbd3269 100644 --- a/src/modules/reports/report-export/report-export.module.ts +++ b/src/modules/reports/report-export/report-export.module.ts @@ -1,8 +1,10 @@ import { Module } from '@nestjs/common'; +import { ReportExportController } from './report-export.controller'; +import { ReportExportService } from './report-export.service'; @Module({ imports: [], - controllers: [], - providers: [], + controllers: [ReportExportController], + providers: [ReportExportService], }) export class ReportExportModule {} diff --git a/src/modules/reports/report-export/report-export.service.ts b/src/modules/reports/report-export/report-export.service.ts new file mode 100644 index 0000000..7af3f29 --- /dev/null +++ b/src/modules/reports/report-export/report-export.service.ts @@ -0,0 +1,4 @@ +import { Injectable } from '@nestjs/common'; + +@Injectable() +export class ReportExportService {} diff --git a/src/modules/reports/report/report.controller.ts b/src/modules/reports/report/report.controller.ts new file mode 100644 index 0000000..c420a09 --- /dev/null +++ b/src/modules/reports/report/report.controller.ts @@ -0,0 +1,20 @@ +import { Controller, Get, Post } from '@nestjs/common'; +import { ApiBearerAuth, ApiTags } from '@nestjs/swagger'; +import { Public } from 'src/core/guards'; +import { MODULE_NAME } from 'src/core/strings/constants/module.constants'; + +@ApiTags(`${MODULE_NAME.REPORT.split('-').join(' ')}`) +@Controller(`v1/${MODULE_NAME.REPORT}`) +@Public(false) +@ApiBearerAuth('JWT') +export class ReportController { + @Get('config') + async getReportConfig() { + return; + } + + @Post('data') + async getReportData() { + return; + } +} diff --git a/src/modules/reports/report/report.module.ts b/src/modules/reports/report/report.module.ts index 6d8ca42..b624fe0 100644 --- a/src/modules/reports/report/report.module.ts +++ b/src/modules/reports/report/report.module.ts @@ -1,8 +1,10 @@ import { Module } from '@nestjs/common'; +import { ReportController } from './report.controller'; +import { ReportService } from './report.service'; @Module({ imports: [], - controllers: [], - providers: [], + controllers: [ReportController], + providers: [ReportService], }) export class ReportModule {} diff --git a/src/modules/reports/report/report.service.ts b/src/modules/reports/report/report.service.ts new file mode 100644 index 0000000..989bd98 --- /dev/null +++ b/src/modules/reports/report/report.service.ts @@ -0,0 +1,4 @@ +import { Injectable } from '@nestjs/common'; + +@Injectable() +export class ReportService {}