Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/typings/transfers/capitalGrant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@

import { Amount } from "./amount";
import { CapitalBalance } from "./capitalBalance";
import { Counterparty } from "./counterparty";
import { Fee } from "./fee";
import { GrantCounterparty } from "./grantCounterparty";
import { Repayment } from "./repayment";


export class CapitalGrant {
"amount"?: Amount | null;
"balances": CapitalBalance;
"counterparty"?: Counterparty | null;
"counterparty"?: GrantCounterparty | null;
"fee"?: Fee | null;
/**
* The identifier of the grant account used for the grant.
Expand Down Expand Up @@ -57,7 +57,7 @@ export class CapitalGrant {
{
"name": "counterparty",
"baseName": "counterparty",
"type": "Counterparty | null",
"type": "GrantCounterparty | null",
"format": ""
},
{
Expand Down
6 changes: 3 additions & 3 deletions src/typings/transfers/capitalGrantInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
* Do not edit this class manually.
*/

import { Counterparty } from "./counterparty";
import { GrantInfoCounterparty } from "./grantInfoCounterparty";


export class CapitalGrantInfo {
"counterparty"?: Counterparty | null;
"counterparty"?: GrantInfoCounterparty | null;
/**
* The identifier of the grant account used for the grant.
*/
Expand All @@ -29,7 +29,7 @@ export class CapitalGrantInfo {
{
"name": "counterparty",
"baseName": "counterparty",
"type": "Counterparty | null",
"type": "GrantInfoCounterparty | null",
"format": ""
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
*/


export class Counterparty {
export class GrantCounterparty {
/**
* The identifier of the receiving account holder. The payout will default to the primary balance account of this account holder if no `balanceAccountId` is provided.
* The identifier of the receiving account holder.
*/
"accountHolderId"?: string;
/**
Expand Down Expand Up @@ -47,7 +47,7 @@ export class Counterparty {
} ];

static getAttributeTypeMap() {
return Counterparty.attributeTypeMap;
return GrantCounterparty.attributeTypeMap;
}

public constructor() {
Expand Down
46 changes: 46 additions & 0 deletions src/typings/transfers/grantInfoCounterparty.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* The version of the OpenAPI document: v4
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit this class manually.
*/


export class GrantInfoCounterparty {
/**
* The identifier of the balance account that belongs to the receiving account holder.
*/
"balanceAccountId"?: string;
/**
* The identifier of the transfer instrument that belongs to the legal entity of the account holder.
*/
"transferInstrumentId"?: string;

static readonly discriminator: string | undefined = undefined;

static readonly mapping: {[index: string]: string} | undefined = undefined;

static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [
{
"name": "balanceAccountId",
"baseName": "balanceAccountId",
"type": "string",
"format": ""
},
{
"name": "transferInstrumentId",
"baseName": "transferInstrumentId",
"type": "string",
"format": ""
} ];

static getAttributeTypeMap() {
return GrantInfoCounterparty.attributeTypeMap;
}

public constructor() {
}
}

60 changes: 60 additions & 0 deletions src/typings/transfers/interchangeData.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*
* The version of the OpenAPI document: v4
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit this class manually.
*/

import { Amount } from "./amount";


export class InterchangeData {
"interchangeAmount"?: Amount | null;
/**
* A 3-character alphanumeric code assigned by Visa that identifies the specific interchange reimbursement program a transaction qualified for. The code is assigned based on the card type, entry mode, and security data provided.
*/
"interchangeRateIndicator"?: string;
/**
* The type of events data. Possible values: - **interchangeData**: information about the interchange fee applied to a transaction.
*/
"type": InterchangeData.TypeEnum;

static readonly discriminator: string | undefined = undefined;

static readonly mapping: {[index: string]: string} | undefined = undefined;

static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [
{
"name": "interchangeAmount",
"baseName": "interchangeAmount",
"type": "Amount | null",
"format": ""
},
{
"name": "interchangeRateIndicator",
"baseName": "interchangeRateIndicator",
"type": "string",
"format": ""
},
{
"name": "type",
"baseName": "type",
"type": "InterchangeData.TypeEnum",
"format": ""
} ];

static getAttributeTypeMap() {
return InterchangeData.attributeTypeMap;
}

public constructor() {
}
}

export namespace InterchangeData {
export enum TypeEnum {
InterchangeData = 'interchangeData'
}
}
4 changes: 3 additions & 1 deletion src/typings/transfers/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export * from "./capitalGrants"
export * from "./card"
export * from "./cardIdentification"
export * from "./confirmationTrackingData"
export * from "./counterparty"
export * from "./counterpartyInfoV3"
export * from "./counterpartyV3"
export * from "./dKLocalAccountIdentification"
Expand All @@ -31,9 +30,12 @@ export * from "./externalReason"
export * from "./fee"
export * from "./findTransfersResponse"
export * from "./fundingInstrument"
export * from "./grantCounterparty"
export * from "./grantInfoCounterparty"
export * from "./hKLocalAccountIdentification"
export * from "./hULocalAccountIdentification"
export * from "./ibanAccountIdentification"
export * from "./interchangeData"
export * from "./internalCategoryData"
export * from "./internalReviewTrackingData"
export * from "./invalidField"
Expand Down
1 change: 1 addition & 0 deletions src/typings/transfers/modification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ export namespace Modification {
Failed = 'failed',
Fee = 'fee',
FeePending = 'feePending',
InterchangeAdjusted = 'interchangeAdjusted',
InternalTransfer = 'internalTransfer',
InternalTransferPending = 'internalTransferPending',
InvoiceDeduction = 'invoiceDeduction',
Expand Down
9 changes: 7 additions & 2 deletions src/typings/transfers/objectSerializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import { CapitalGrants } from "./capitalGrants";
import { Card } from "./card";
import { CardIdentification } from "./cardIdentification";
import { ConfirmationTrackingData } from "./confirmationTrackingData";
import { Counterparty } from "./counterparty";
import { CounterpartyInfoV3 } from "./counterpartyInfoV3";
import { CounterpartyV3 } from "./counterpartyV3";
import { DKLocalAccountIdentification } from "./dKLocalAccountIdentification";
Expand All @@ -33,9 +32,12 @@ import { ExternalReason } from "./externalReason";
import { Fee } from "./fee";
import { FindTransfersResponse } from "./findTransfersResponse";
import { FundingInstrument } from "./fundingInstrument";
import { GrantCounterparty } from "./grantCounterparty";
import { GrantInfoCounterparty } from "./grantInfoCounterparty";
import { HKLocalAccountIdentification } from "./hKLocalAccountIdentification";
import { HULocalAccountIdentification } from "./hULocalAccountIdentification";
import { IbanAccountIdentification } from "./ibanAccountIdentification";
import { InterchangeData } from "./interchangeData";
import { InternalCategoryData } from "./internalCategoryData";
import { InternalReviewTrackingData } from "./internalReviewTrackingData";
import { InvalidField } from "./invalidField";
Expand Down Expand Up @@ -127,6 +129,7 @@ let enumsMap: Set<string> = new Set<string>([
"HKLocalAccountIdentification.TypeEnum",
"HULocalAccountIdentification.TypeEnum",
"IbanAccountIdentification.TypeEnum",
"InterchangeData.TypeEnum",
"InternalCategoryData.TypeEnum",
"InternalReviewTrackingData.ReasonEnum",
"InternalReviewTrackingData.StatusEnum",
Expand Down Expand Up @@ -208,7 +211,6 @@ let typeMap: {[index: string]: any} = {
"Card": Card,
"CardIdentification": CardIdentification,
"ConfirmationTrackingData": ConfirmationTrackingData,
"Counterparty": Counterparty,
"CounterpartyInfoV3": CounterpartyInfoV3,
"CounterpartyV3": CounterpartyV3,
"DKLocalAccountIdentification": DKLocalAccountIdentification,
Expand All @@ -219,9 +221,12 @@ let typeMap: {[index: string]: any} = {
"Fee": Fee,
"FindTransfersResponse": FindTransfersResponse,
"FundingInstrument": FundingInstrument,
"GrantCounterparty": GrantCounterparty,
"GrantInfoCounterparty": GrantInfoCounterparty,
"HKLocalAccountIdentification": HKLocalAccountIdentification,
"HULocalAccountIdentification": HULocalAccountIdentification,
"IbanAccountIdentification": IbanAccountIdentification,
"InterchangeData": InterchangeData,
"InternalCategoryData": InternalCategoryData,
"InternalReviewTrackingData": InternalReviewTrackingData,
"InvalidField": InvalidField,
Expand Down
1 change: 1 addition & 0 deletions src/typings/transfers/transfer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,7 @@ export namespace Transfer {
Failed = 'failed',
Fee = 'fee',
FeePending = 'feePending',
InterchangeAdjusted = 'interchangeAdjusted',
InternalTransfer = 'internalTransfer',
InternalTransferPending = 'internalTransferPending',
InvoiceDeduction = 'invoiceDeduction',
Expand Down
1 change: 1 addition & 0 deletions src/typings/transfers/transferData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,7 @@ export namespace TransferData {
Failed = 'failed',
Fee = 'fee',
FeePending = 'feePending',
InterchangeAdjusted = 'interchangeAdjusted',
InternalTransfer = 'internalTransfer',
InternalTransferPending = 'internalTransferPending',
InvoiceDeduction = 'invoiceDeduction',
Expand Down
2 changes: 2 additions & 0 deletions src/typings/transfers/transferEvent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ export namespace TransferEvent {
Failed = 'failed',
Fee = 'fee',
FeePending = 'feePending',
InterchangeAdjusted = 'interchangeAdjusted',
InternalTransfer = 'internalTransfer',
InternalTransferPending = 'internalTransferPending',
InvoiceDeduction = 'invoiceDeduction',
Expand Down Expand Up @@ -356,6 +357,7 @@ export namespace TransferEvent {
}
export enum TypeEnum {
Accounting = 'accounting',
Tracing = 'tracing',
Tracking = 'tracking'
}
}
3 changes: 2 additions & 1 deletion src/typings/transfers/transferEventEventsDataInner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* Do not edit this class manually.
*/

import { InterchangeData } from "./interchangeData";
import { IssuingTransactionData } from "./issuingTransactionData";
import { MerchantPurchaseData } from "./merchantPurchaseData";

Expand All @@ -16,7 +17,7 @@ import { MerchantPurchaseData } from "./merchantPurchaseData";
* Type
* @export
*/
export type TransferEventEventsDataInner = IssuingTransactionData | MerchantPurchaseData;
export type TransferEventEventsDataInner = InterchangeData | IssuingTransactionData | MerchantPurchaseData;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The discriminated union TransferEventEventsDataInner will not be deserialized correctly because the mapping in TransferEventEventsDataInnerClass is missing. The ObjectSerializer relies on this mapping to resolve the correct type based on the type discriminator property.

Without the mapping, the serializer will fail to find the concrete class for values like 'interchangeData', 'issuingTransactionData', or 'merchantPurchaseData' because these values don't match the class names (InterchangeData, IssuingTransactionData, MerchantPurchaseData) in the typeMap.

This seems to be a general issue with the code generator for all discriminated unions.

To fix this, TransferEventEventsDataInnerClass should have a mapping property defined, like this:

export class TransferEventEventsDataInnerClass {
    
    static readonly discriminator: string = "type";

    static readonly mapping: {[index: string]: string} | undefined = {
        "interchangeData": "InterchangeData",
        "issuingTransactionData": "IssuingTransactionData",
        "merchantPurchaseData": "MerchantPurchaseData",
    };
}

This is a critical issue that will cause runtime errors during deserialization.


/**
* @type TransferEventEventsDataInnerClass
Expand Down