Merge pull request 'feat: setup api for get label history on bookmark' (#10) from feat/report into development
Reviewed-on: #10pull/13/head
commit
6bb8c928c0
|
@ -11,36 +11,47 @@ import {
|
|||
import { ApiBearerAuth, ApiTags } from '@nestjs/swagger';
|
||||
import { Public } from 'src/core/guards';
|
||||
import { MODULE_NAME } from 'src/core/strings/constants/module.constants';
|
||||
import { GetReportBookmarkDto } from '../shared/dto/report-bookmark.get.dto';
|
||||
import {
|
||||
GetLabelReportBookmarkDto,
|
||||
GetReportBookmarkDto,
|
||||
} from '../shared/dto/report-bookmark.get.dto';
|
||||
import { CreateReportBookmarkDto } from '../shared/dto/report-bookmark.create.dto';
|
||||
import { ReportBookmarkService } from './report-bookmark.service';
|
||||
|
||||
@ApiTags(`${MODULE_NAME.REPORT_BOOKMARK.split('-').join(' ')}`)
|
||||
@Controller(`v1/${MODULE_NAME.REPORT_BOOKMARK}`)
|
||||
@Public(false)
|
||||
@ApiBearerAuth('JWT')
|
||||
export class ReportBookmarkController {
|
||||
constructor(private service: ReportBookmarkService) {}
|
||||
|
||||
@Post()
|
||||
async create(@Body() body: CreateReportBookmarkDto) {
|
||||
return;
|
||||
return await this.service.create(body);
|
||||
}
|
||||
|
||||
@Get()
|
||||
async getAll(@Query() query: GetReportBookmarkDto) {
|
||||
return;
|
||||
return await this.service.getAll(query);
|
||||
}
|
||||
|
||||
@Get('label-history')
|
||||
async getAllLabelHistory(@Query() query: GetLabelReportBookmarkDto) {
|
||||
return await this.service.getAllLabelHistory(query);
|
||||
}
|
||||
|
||||
@Put('applied/:id')
|
||||
async applied(@Param('id') id: string) {
|
||||
return;
|
||||
return await this.service.applied(id);
|
||||
}
|
||||
|
||||
@Put('unapplied/:id')
|
||||
async unapplied(@Param('id') id: string) {
|
||||
return;
|
||||
return await this.service.unapplied(id);
|
||||
}
|
||||
|
||||
@Delete(':id')
|
||||
async delete(@Param('id') id: string) {
|
||||
return;
|
||||
return await this.service.delete(id);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,34 @@
|
|||
import { Injectable } from '@nestjs/common';
|
||||
import { BaseReportService } from '../shared/services/base-report.service';
|
||||
import { CreateReportBookmarkDto } from '../shared/dto/report-bookmark.create.dto';
|
||||
import {
|
||||
GetLabelReportBookmarkDto,
|
||||
GetReportBookmarkDto,
|
||||
} from '../shared/dto/report-bookmark.get.dto';
|
||||
|
||||
@Injectable()
|
||||
export class ReportBookmarkService extends BaseReportService {}
|
||||
export class ReportBookmarkService extends BaseReportService {
|
||||
async create(body: CreateReportBookmarkDto) {
|
||||
return 'you hit API for create report bookmark';
|
||||
}
|
||||
|
||||
async getAll(query: GetReportBookmarkDto) {
|
||||
return 'you hit API for get all report bookmark';
|
||||
}
|
||||
|
||||
async getAllLabelHistory(query: GetLabelReportBookmarkDto) {
|
||||
return 'you hit API for get all label history report bookmark';
|
||||
}
|
||||
|
||||
async applied(id: string) {
|
||||
return 'you hit API for applied report bookmark';
|
||||
}
|
||||
|
||||
async unapplied(id: string) {
|
||||
return 'you hit API for unapplied report bookmark';
|
||||
}
|
||||
|
||||
async delete(id: string) {
|
||||
return 'you hit API for delete report bookmark';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,34 +17,37 @@ import {
|
|||
GetReportExportFileNameDto,
|
||||
GetReportExportProcessingDto,
|
||||
} from '../shared/dto/report-export.get.dto';
|
||||
import { ReportExportService } from './report-export.service';
|
||||
|
||||
@ApiTags(`${MODULE_NAME.REPORT_EXPORT.split('-').join(' ')}`)
|
||||
@Controller(`v1/${MODULE_NAME.REPORT_EXPORT}`)
|
||||
@Public(false)
|
||||
@ApiBearerAuth('JWT')
|
||||
export class ReportExportController {
|
||||
constructor(private service: ReportExportService) {}
|
||||
|
||||
@Post()
|
||||
async create(@Body() body: CreateReportExportDto) {
|
||||
return;
|
||||
return await this.service.create(body);
|
||||
}
|
||||
|
||||
@Get()
|
||||
async getAll(@Query() query: GetReportExportDto) {
|
||||
return;
|
||||
return await this.service.getAll(query);
|
||||
}
|
||||
|
||||
@Delete(':id')
|
||||
async delete(@Param('id') id: string) {
|
||||
return;
|
||||
return await this.service.delete(id);
|
||||
}
|
||||
|
||||
@Get('processing')
|
||||
async getAllProcessing(@Query() query: GetReportExportProcessingDto) {
|
||||
return;
|
||||
return await this.service.getAllProcessing(query);
|
||||
}
|
||||
|
||||
@Get('filename-history')
|
||||
async getListHistoryFileName(@Query() query: GetReportExportFileNameDto) {
|
||||
return;
|
||||
return await this.service.getListHistoryFileName(query);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,31 @@
|
|||
import { Injectable } from '@nestjs/common';
|
||||
import { BaseReportService } from '../shared/services/base-report.service';
|
||||
import { CreateReportExportDto } from '../shared/dto/report-export.create.dto';
|
||||
import {
|
||||
GetReportExportDto,
|
||||
GetReportExportFileNameDto,
|
||||
GetReportExportProcessingDto,
|
||||
} from '../shared/dto/report-export.get.dto';
|
||||
|
||||
@Injectable()
|
||||
export class ReportExportService extends BaseReportService {}
|
||||
export class ReportExportService extends BaseReportService {
|
||||
async create(body: CreateReportExportDto) {
|
||||
return 'you hit API for create report export';
|
||||
}
|
||||
|
||||
async getAll(query: GetReportExportDto) {
|
||||
return 'you hit API for get all report export';
|
||||
}
|
||||
|
||||
async delete(id: string) {
|
||||
return 'you hit API for delete report export';
|
||||
}
|
||||
|
||||
async getAllProcessing(query: GetReportExportProcessingDto) {
|
||||
return 'you hit API for get all processing report export';
|
||||
}
|
||||
|
||||
async getListHistoryFileName(query: GetReportExportFileNameDto) {
|
||||
return 'you hit API for get all file name report export';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,10 +6,10 @@ import { GetReportDataDto } from '../shared/dto/report-data.get.dto';
|
|||
@Injectable()
|
||||
export class ReportService extends BaseReportService {
|
||||
async getReportConfig(query: GetReportConfigDto) {
|
||||
return this.getUser();
|
||||
return 'you hit API for get report config';
|
||||
}
|
||||
|
||||
async getReportData(body: GetReportDataDto) {
|
||||
return this.getUser();
|
||||
return 'you hit API for get report data';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,8 +19,12 @@ export class CreateReportBookmarkDto {
|
|||
@IsBoolean()
|
||||
applied: boolean;
|
||||
|
||||
@ApiProperty({ name: 'type', required: true })
|
||||
@IsBoolean()
|
||||
@ApiProperty({
|
||||
name: 'type',
|
||||
required: true,
|
||||
default: REPORT_BOOKMARK_TYPE.TABLE_CONFIG,
|
||||
})
|
||||
@IsString()
|
||||
type: REPORT_BOOKMARK_TYPE;
|
||||
|
||||
@ApiProperty({
|
||||
|
|
|
@ -21,3 +21,23 @@ export class GetReportBookmarkDto {
|
|||
})
|
||||
types?: REPORT_BOOKMARK_TYPE[];
|
||||
}
|
||||
|
||||
export class GetLabelReportBookmarkDto {
|
||||
@ApiProperty({ type: ['string'], required: false })
|
||||
@Transform((body) => {
|
||||
return Array.isArray(body.value) ? body.value : [body.value];
|
||||
})
|
||||
group_names?: string;
|
||||
|
||||
@ApiProperty({ type: ['string'], required: false })
|
||||
@Transform((body) => {
|
||||
return Array.isArray(body.value) ? body.value : [body.value];
|
||||
})
|
||||
unique_names?: string[];
|
||||
|
||||
@ApiProperty({ type: ['string'], required: false })
|
||||
@Transform((body) => {
|
||||
return Array.isArray(body.value) ? body.value : [body.value];
|
||||
})
|
||||
types?: REPORT_BOOKMARK_TYPE[];
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue