Skip to content

Commit

Permalink
ORV2-1346 (#670)
Browse files Browse the repository at this point in the history
Co-authored-by: praju-aot <[email protected]>
Co-authored-by: gchauhan-aot <[email protected]>
  • Loading branch information
3 people authored Oct 5, 2023
1 parent c184f33 commit 1c55ac2
Show file tree
Hide file tree
Showing 165 changed files with 6,137 additions and 2,246 deletions.
2 changes: 2 additions & 0 deletions backend/dops/src/enum/template-name.enum.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export enum TemplateName {
PERMIT_TROS = 'PERMIT_TROS',
PAYMENT_RECEIPT = 'PAYMENT_RECEIPT',
PERMIT_TROS_VOID = 'PERMIT_TROS_VOID',
PERMIT_TROS_REVOKED = 'PERMIT_TROS_REVOKED',
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export enum ApplicationStatus {
UNDER_REVIEW = 'UNDER_REVIEW',
WAITING_APPROVAL = 'WAITING_APPROVAL',
WAITING_PAYMENT = 'WAITING_PAYMENT',
PAYMENT_COMPLETE = 'PAYMENT_COMPLETE',
ISSUED = 'ISSUED',
SUPERSEDED = 'SUPERSEDED',
REVOKED = 'REVOKED',
Expand Down
3 changes: 3 additions & 0 deletions backend/vehicles/src/common/enum/payment-method-type.enum.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export enum PaymentMethodType {
WEB = '1',
}
2 changes: 2 additions & 0 deletions backend/vehicles/src/common/enum/template-name.enum.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export enum TemplateName {
PERMIT_TROS = 'PERMIT_TROS',
PAYMENT_RECEIPT = 'PAYMENT_RECEIPT',
PERMIT_TROS_VOID = 'PERMIT_TROS_VOID',
PERMIT_TROS_REVOKED = 'PERMIT_TROS_REVOKED',
}
9 changes: 9 additions & 0 deletions backend/vehicles/src/common/enum/transaction-type.enum.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export enum TransactionType {
PURCHASE = 'P',
REFUND = 'R',
ZERO_AMOUNT = 'Z',
VOID_REFUND = 'VR',
VOID_PURHCASE = 'VC',
PRE_AUTH = 'PA',
PRE_AUTH_COMPLETION = 'PAC',
}
6 changes: 0 additions & 6 deletions backend/vehicles/src/common/interface/receipt.interface.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
import { AutoMap } from '@automapper/classes';
import { ApiProperty } from '@nestjs/swagger';
import {
IsNumber,
IsOptional,
IsPositive,
IsString,
Length,
Max,
Min,
} from 'class-validator';

export class PaymentGatewayTransactionDto {
@AutoMap()
@ApiProperty({
example: '10000148',
description:
'Bambora-assigned eight-digit unique id number used to identify an individual transaction.',
})
@IsOptional()
@IsString()
pgTransactionId: string;

@AutoMap()
@ApiProperty({
example: '1',
description:
'Represents the approval result of a transaction. 0 = Transaction refused, 1 = Transaction approved',
})
@IsOptional()
@IsNumber()
@IsPositive()
pgApproved: number;

@AutoMap()
@ApiProperty({
example: 'TEST',
description:
'Represents the auth code of a transaction. If the transaction is approved this parameter will contain a unique bank-issued code.',
})
@IsOptional()
@IsString()
@Length(1, 32)
pgAuthCode: string;

@AutoMap()
@ApiProperty({
example: 'VI',
description: 'Represents the type of card used in the transaction.',
})
@IsOptional()
@IsString()
@Length(1, 2)
pgCardType: string;

@AutoMap()
@ApiProperty({
example: '6/23/2023 10:57:28 PM',
description:
'Represents the date and time that the transaction was processed.',
})
@IsOptional()
@IsString()
pgTransactionDate: string;

@AutoMap()
@ApiProperty({
example: '1',
description: 'Represents the card cvd match status.',
})
@IsOptional()
@IsNumber()
@IsPositive()
@Min(1)
@Max(6)
pgCvdId: number;

@AutoMap()
@ApiProperty({
example: 'CC',
description: 'Represents the payment method of a transaction.',
})
@IsOptional()
@IsString()
@Length(1, 2)
pgPaymentMethod: string;

@AutoMap()
@ApiProperty({
example: 111,
description:
'References a detailed approved/declined transaction response message.',
})
@IsOptional()
@IsNumber()
@IsPositive()
pgMessageId: number;

@AutoMap()
@ApiProperty({
example: 'Approved',
description:
'Represents basic approved/declined message for a transaction.',
})
@IsOptional()
@IsString()
@Length(1, 100)
pgMessageText: string;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { AutoMap } from '@automapper/classes';
import { ApiProperty } from '@nestjs/swagger';
import { IsNumber, IsNumberString, IsPositive } from 'class-validator';

export class CreateApplicationTransactionDto {
@AutoMap()
@ApiProperty({
description: 'Application/Permit Id.',
example: '1',
})
@IsNumberString()
applicationId: string;

@AutoMap()
@ApiProperty({
example: '30.00',
description: 'Represents the amount of the transaction.',
})
@IsNumber()
@IsPositive()
transactionAmount: number;
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,134 +1,41 @@
import { AutoMap } from '@automapper/classes';
import { ApiProperty } from '@nestjs/swagger';
import { IsNumber, IsString, MaxLength } from 'class-validator';

export class CreateTransactionDto {
// @AutoMap()
// @ApiProperty({
// example: '1',
// description: 'Unique identifier for the transaction metadata.',
// })
// transactionId: number;

@AutoMap()
@ApiProperty({
example: 'P',
description:
'Represents the original value sent to indicate the type of transaction to perform (i.e. P, R, VP, VR, PA, PAC, Q).',
})
@IsString()
@MaxLength(3)
transactionType: string;

@AutoMap()
@ApiProperty({
example: 'T-1687586193681',
description: 'Represents the auth code of a transaction.',
})
@IsString()
transactionOrderNumber: string;

@AutoMap()
@ApiProperty({
example: '10000148',
description:
'Bambora-assigned eight-digit unique id number used to identify an individual transaction.',
})
@IsNumber()
providerTransactionId: number;

@AutoMap()
@ApiProperty({
example: '30.00',
description: 'Represents the amount of the transaction.',
})
@IsNumber()
transactionAmount: number;

@AutoMap()
@ApiProperty({
example: '1',
description:
'Represents the approval result of a transaction. 0 = Transaction refused, 1 = Transaction approved',
})
@IsNumber()
approved: number;
import { ArrayMinSize, IsArray, IsEnum, ValidateNested } from 'class-validator';
import { TransactionType } from '../../../../common/enum/transaction-type.enum';
import { PaymentMethodType } from '../../../../common/enum/payment-method-type.enum';
import { CreateApplicationTransactionDto } from './create-application-transaction.dto';
import { Type } from 'class-transformer';
import { PaymentGatewayTransactionDto } from '../common/payment-gateway-transaction.dto';

export class CreateTransactionDto extends PaymentGatewayTransactionDto {
@AutoMap()
@ApiProperty({
example: 'TEST',
enum: TransactionType,
example: TransactionType.PURCHASE,
description:
'Represents the auth code of a transaction. If the transaction is approved this parameter will contain a unique bank-issued code.',
'Represents the original value sent to indicate the type of transaction to perform.',
})
@IsString()
authCode: string;
@IsEnum(TransactionType)
transactionTypeId: TransactionType;

@AutoMap()
@ApiProperty({
example: 'VI',
description: 'Represents the type of card used in the transaction.',
})
@IsString()
cardType: string;

@AutoMap()
@ApiProperty({
example: '6/23/2023 10:57:28 PM',
description:
'Represents the date and time that the transaction was processed.',
})
@IsString()
transactionDate: string;

@AutoMap()
@ApiProperty({
example: '1',
description: 'Represents the card cvd match status.',
})
@IsNumber()
cvdId: number;

@AutoMap()
@ApiProperty({
example: 'CC',
description: 'Represents the payment method of a transaction.',
})
@IsString()
paymentMethod: string;

@AutoMap()
@ApiProperty({
example: 1,
enum: PaymentMethodType,
example: PaymentMethodType.WEB,
description: 'The identifier of the user selected payment method.',
})
@IsNumber()
paymentMethodId: number;

@AutoMap()
@ApiProperty({
example: '111',
description:
'References a detailed approved/declined transaction response message.',
})
@IsString()
messageId: string;
@IsEnum(PaymentMethodType)
paymentMethodId: PaymentMethodType;

@AutoMap()
@ApiProperty({
example: 'Approved',
description:
'Represents basic approved/declined message for a transaction.',
description: 'The transaction details specific to application/permit.',
required: true,
type: [CreateApplicationTransactionDto],
})
@IsString()
messageText: string;

// @AutoMap()
// @ApiProperty({
// description: 'Application Ids.',
// isArray: true,
// type: String,
// example: ['1', '2'],
// })
// @IsNumberString({}, { each: true })
// applicationIds: string[];
@IsArray()
@ValidateNested({ each: true })
@ArrayMinSize(1)
@Type(() => CreateApplicationTransactionDto)
applicationDetails: CreateApplicationTransactionDto[];
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { PaymentGatewayTransactionDto } from '../common/payment-gateway-transaction.dto';

export class UpdatePaymentGatewayTransactionDto extends PaymentGatewayTransactionDto {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { CreateApplicationTransactionDto } from '../request/create-application-transaction.dto';

export class ReadApplicationTransactionDto extends CreateApplicationTransactionDto {}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { AutoMap } from '@automapper/classes';
import { PaymentGatewayTransactionDto } from '../common/payment-gateway-transaction.dto';
import { ApiProperty } from '@nestjs/swagger';

export class ReadPaymentGatewayTransactionDto extends PaymentGatewayTransactionDto {
@AutoMap()
@ApiProperty({
example: '1',
description: 'Unique identifier for the transaction metadata.',
})
transactionId: string;
}
Loading

0 comments on commit 1c55ac2

Please sign in to comment.