mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-26 18:42:49 +00:00
Merge pull request #1134 from Tria-plc/freight_feature/usermanagement
add metadata to ignore audit logging in payment events
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { Injectable, Logger } from "@nestjs/common";
|
import { Injectable, Logger, SetMetadata } from "@nestjs/common";
|
||||||
import { Nack, RabbitSubscribe } from "@golevelup/nestjs-rabbitmq";
|
import { Nack, RabbitSubscribe } from "@golevelup/nestjs-rabbitmq";
|
||||||
import { Public } from "@edr/api-common";
|
import { Public } from "@edr/api-common";
|
||||||
import {
|
import {
|
||||||
@@ -14,6 +14,11 @@ import { PaymentService as PaymentSvc } from "./payment.service";
|
|||||||
|
|
||||||
const FREIGHT_QUEUE = PAYMENT_QUEUES[PaymentService.FREIGHT];
|
const FREIGHT_QUEUE = PAYMENT_QUEUES[PaymentService.FREIGHT];
|
||||||
|
|
||||||
|
// @tria-plc/auditlog's global ClientLoggerInterceptor (present in deployed builds)
|
||||||
|
// crashes on non-HTTP contexts (`originalUrl.split` on a RabbitMQ message) and the
|
||||||
|
// resulting requeue storm blocks payment.succeeded forever. Its IgnoreLoggerAudit
|
||||||
|
// decorator is just this metadata key — set it directly so we don't need the package.
|
||||||
|
@SetMetadata("ignoreAuditLogger", true)
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class PaymentEventsConsumer {
|
export class PaymentEventsConsumer {
|
||||||
private readonly logger = new Logger(PaymentEventsConsumer.name);
|
private readonly logger = new Logger(PaymentEventsConsumer.name);
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Injectable, Logger } from '@nestjs/common';
|
import { Injectable, Logger, SetMetadata } from '@nestjs/common';
|
||||||
import { ModuleRef } from '@nestjs/core';
|
import { ModuleRef } from '@nestjs/core';
|
||||||
import { Nack, RabbitSubscribe } from '@golevelup/nestjs-rabbitmq';
|
import { Nack, RabbitSubscribe } from '@golevelup/nestjs-rabbitmq';
|
||||||
import { IsPublic } from '@tria-plc/api-common/modules/auth/decorators/public.decorator';
|
import { IsPublic } from '@tria-plc/api-common/modules/auth/decorators/public.decorator';
|
||||||
@@ -15,6 +15,11 @@ import { PaymentsService } from './payments.service';
|
|||||||
|
|
||||||
const PASSENGER_QUEUE = PAYMENT_QUEUES[PaymentService.PASSENGER];
|
const PASSENGER_QUEUE = PAYMENT_QUEUES[PaymentService.PASSENGER];
|
||||||
|
|
||||||
|
// @tria-plc/auditlog's global ClientLoggerInterceptor (present in deployed builds)
|
||||||
|
// crashes on non-HTTP contexts (`originalUrl.split` on a RabbitMQ message) and the
|
||||||
|
// resulting requeue storm blocks payment.succeeded forever. Its IgnoreLoggerAudit
|
||||||
|
// decorator is just this metadata key — set it directly so we don't need the package.
|
||||||
|
@SetMetadata('ignoreAuditLogger', true)
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class PaymentEventsConsumer {
|
export class PaymentEventsConsumer {
|
||||||
private readonly logger = new Logger(PaymentEventsConsumer.name);
|
private readonly logger = new Logger(PaymentEventsConsumer.name);
|
||||||
|
|||||||
@@ -169,13 +169,13 @@ export class CbeBillService {
|
|||||||
async pay(dto: CbePaymentRequestDto): Promise<CbePaymentResponseDto> {
|
async pay(dto: CbePaymentRequestDto): Promise<CbePaymentResponseDto> {
|
||||||
this.assertEnabled();
|
this.assertEnabled();
|
||||||
|
|
||||||
this.logger.log({
|
// this.logger.log({
|
||||||
msg: "cbe.payment.request",
|
// msg: "cbe.payment.request",
|
||||||
billId: dto.Bill_Id,
|
// billId: dto.Bill_Id,
|
||||||
endToEndTxnId: dto.End_To_End_Txn_Id,
|
// endToEndTxnId: dto.End_To_End_Txn_Id,
|
||||||
cbeTxnRef: dto.Cbe_Txn_Ref,
|
// cbeTxnRef: dto.Cbe_Txn_Ref,
|
||||||
request: dto,
|
// request: dto,
|
||||||
});
|
// });
|
||||||
|
|
||||||
// §6.5 idempotency on CBE's per-attempt id, in order.
|
// §6.5 idempotency on CBE's per-attempt id, in order.
|
||||||
const prior = await this.cbeBillRepository.findByEndToEndTxnId(
|
const prior = await this.cbeBillRepository.findByEndToEndTxnId(
|
||||||
|
|||||||
Reference in New Issue
Block a user