fix(billing): ceil CBE invoice amounts to whole birr

This commit is contained in:
Nathnael
2026-08-06 09:16:01 +00:00
parent eda3a82a6c
commit 23e756e0c7
4 changed files with 77 additions and 5 deletions

View File

@@ -1,8 +1,8 @@
import {
IsEnum,
IsIn,
IsInt,
IsISO8601,
IsNumber,
IsOptional,
IsPositive,
IsString,
@@ -37,7 +37,9 @@ export class PaymentEventDto {
@ApiProperty() @IsString() referenceId!: string;
@ApiProperty() @IsString() merchantOrderId!: string;
@ApiProperty({ enum: ProviderMethod }) @IsEnum(ProviderMethod) provider!: string;
@ApiProperty() @IsInt() @IsPositive() amountMinor!: number;
// Major units, fractional (payment-api stores it as double precision) — an
// invoice of 12345.67 must not be rejected by an integer-only validator.
@ApiProperty() @IsNumber() @IsPositive() amountMinor!: number;
@ApiProperty() @IsString() currency!: string;
@ApiPropertyOptional() @IsOptional() @IsString() providerTxnId?: string;

View File

@@ -1,6 +1,7 @@
import { Injectable, Logger, SetMetadata } from "@nestjs/common";
import { Nack, RabbitSubscribe } from "@golevelup/nestjs-rabbitmq";
import { Public } from "@edr/api-common";
import { IgnoreLoggerAudit } from "@tria-plc/auditlog";
import {
PAYMENT_EVENTS_DLX,
PAYMENT_EVENTS_EXCHANGE,