generated from bcgov/quickstart-openshift
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: praju-aot <[email protected]> Co-authored-by: gchauhan-aot <[email protected]>
- Loading branch information
1 parent
c184f33
commit 1c55ac2
Showing
165 changed files
with
6,137 additions
and
2,246 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export enum PaymentMethodType { | ||
WEB = '1', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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', | ||
} |
This file was deleted.
Oops, something went wrong.
109 changes: 109 additions & 0 deletions
109
backend/vehicles/src/modules/payment/dto/common/payment-gateway-transaction.dto.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
22 changes: 22 additions & 0 deletions
22
backend/vehicles/src/modules/payment/dto/request/create-application-transaction.dto.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
18 changes: 0 additions & 18 deletions
18
backend/vehicles/src/modules/payment/dto/request/create-permit-transaction.dto.ts
This file was deleted.
Oops, something went wrong.
141 changes: 24 additions & 117 deletions
141
backend/vehicles/src/modules/payment/dto/request/create-transaction.dto.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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[]; | ||
} |
3 changes: 3 additions & 0 deletions
3
backend/vehicles/src/modules/payment/dto/request/read-payment-gateway-transaction.dto.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 {} |
3 changes: 3 additions & 0 deletions
3
backend/vehicles/src/modules/payment/dto/response/read-application-transaction.dto.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 {} |
8 changes: 0 additions & 8 deletions
8
backend/vehicles/src/modules/payment/dto/response/read-moti-pay-details.dto.ts
This file was deleted.
Oops, something went wrong.
12 changes: 12 additions & 0 deletions
12
backend/vehicles/src/modules/payment/dto/response/read-payment-gateway-transaction.dto.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
Oops, something went wrong.