From 5dfcec30c667963442f4e4a6864565bddd67ba92 Mon Sep 17 00:00:00 2001 From: richard483 Date: Wed, 17 Jan 2024 20:33:03 +0700 Subject: [PATCH] updated job controller access guard & 'biaya aplikasi' --- package-lock.json | 4 ++-- package.json | 2 +- src/job/job.controller.ts | 4 ---- src/payment/payment.service.ts | 6 +++++- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9602206..79d9821 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "backend-8tech", - "version": "4.0.8", + "version": "4.0.9", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "backend-8tech", - "version": "4.0.8", + "version": "4.0.9", "license": "UNLICENSED", "dependencies": { "@nestjs/common": "^9.4.3", diff --git a/package.json b/package.json index 044ec31..624b7fd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "backend-8tech", - "version": "4.0.8", + "version": "4.0.9", "description": "", "author": "8tech", "private": true, diff --git a/src/job/job.controller.ts b/src/job/job.controller.ts index 74b1207..c30ff9d 100644 --- a/src/job/job.controller.ts +++ b/src/job/job.controller.ts @@ -59,8 +59,6 @@ export class JobController { @ApiBearerAuth() @ApiParam({ name: 'jobId', type: String }) - @Roles(Role.USER) - @UseGuards(JwtAuthGuard, RoleGuard) @Get('/:jobId') async getjob(@Res() res, @Param() params: any) { const response = await this.jobService.getById(params.jobId); @@ -68,8 +66,6 @@ export class JobController { } @ApiBearerAuth() - @Roles(Role.USER) - @UseGuards(JwtAuthGuard, RoleGuard) @Post('filter') async filter(@Res() res, @Body() data: JobFilterRequest) { const response = await this.jobService.findManyByList(data); diff --git a/src/payment/payment.service.ts b/src/payment/payment.service.ts index d2972a5..e9cf3fd 100644 --- a/src/payment/payment.service.ts +++ b/src/payment/payment.service.ts @@ -22,11 +22,15 @@ export class PaymentService { paymentRequset: PaymentRequestCreateDto, contractId?: string, ): Promise { + const totalAmount: number = Math.ceil( + (100 + Number(`${process.env.BIAYA_APLIKASI}`)) * + (paymentRequset.amount / 100), + ); const xenditPaymentRequest: PaymentRequest = await this.xenditClient.PaymentRequest.createPaymentRequest({ data: { currency: 'IDR', - amount: paymentRequset.amount, + amount: totalAmount, paymentMethod: { type: 'EWALLET', reusability: 'ONE_TIME_USE',