diff --git a/src/thirdparty/index.ts b/src/thirdparty/index.ts index b1728e10..bfb04a80 100644 --- a/src/thirdparty/index.ts +++ b/src/thirdparty/index.ts @@ -9,6 +9,7 @@ export namespace Schemas { export type AccountList = components['schemas']['AccountList'] export type Amount = components['schemas']['Amount'] export type AmountType = components['schemas']['AmountType'] + export type AuthenticationType = components['schemas']['AuthenticationType'] export type AuthorizationChannelType = components['schemas']['AuthorizationChannelType'] export type AuthorizationResponseType = components['schemas']['AuthorizationResponseType'] export type AuthorizationsPostRequest = components['schemas']['AuthorizationsPostRequest'] @@ -30,12 +31,15 @@ export namespace Schemas { export type ConsentsPostRequest = components['schemas']['ConsentsPostRequest'] export type ConsentStatusType = components['schemas']['ConsentStatusType'] export type CorrelationId = components['schemas']['CorrelationId'] - export type Currency = components['schemas']['Currency'] export type CredentialChallengeSigned = components['schemas']['CredentialChallengeSigned'] export type CredentialChallengeUnsigned = components['schemas']['CredentialChallengeUnsigned'] export type CredentialType = components['schemas']['CredentialType'] - export type DateTime = components['schemas']['DateTime'] + export type Currency = components['schemas']['Currency'] export type DateOfBirth = components['schemas']['DateOfBirth'] + export type DateTime = components['schemas']['DateTime'] + export type ErrorCode = components['schemas']['ErrorCode'] + export type ErrorDescription = components['schemas']['ErrorDescription'] + export type ErrorInformation = components['schemas']['ErrorInformation'] export type Extension = components['schemas']['Extension'] export type ExtensionKey = components['schemas']['ExtensionKey'] export type ExtensionList = components['schemas']['ExtensionList'] @@ -43,10 +47,10 @@ export namespace Schemas { export type FirstName = components['schemas']['FirstName'] export type FspId = components['schemas']['FspId'] export type GeoCode = components['schemas']['GeoCode'] - export type Integer = components['schemas']['Integer'] export type IlpCondition = components['schemas']['IlpCondition'] export type IlpFulfilment = components['schemas']['IlpFulfilment'] export type IlpPacket = components['schemas']['IlpPacket'] + export type Integer = components['schemas']['Integer'] export type LastName = components['schemas']['LastName'] export type Latitude = components['schemas']['Latitude'] export type Longitude = components['schemas']['Longitude'] @@ -55,12 +59,17 @@ export namespace Schemas { export type Money = components['schemas']['Money'] export type Name = components['schemas']['Name'] export type Note = components['schemas']['Note'] + export type ParticipantsPostRequest = components['schemas']['ParticipantsPostRequest'] export type PartiesTypeIDPutResponse = components['schemas']['PartiesTypeIDPutResponse'] export type Party = components['schemas']['Party'] export type PartyComplexName = components['schemas']['PartyComplexName'] + export type PartyIdentifier = components['schemas']['PartyIdentifier'] export type PartyIdInfo = components['schemas']['PartyIdInfo'] export type PartyIdType = components['schemas']['PartyIdType'] + export type PartyName = components['schemas']['PartyName'] export type PartyPersonalInfo = components['schemas']['PartyPersonalInfo'] + export type PartyResult = components['schemas']['PartyResult'] + export type PartySubIdOrType = components['schemas']['PartySubIdOrType'] export type QuotesIDPutResponse = components['schemas']['QuotesIDPutResponse'] export type Scope = components['schemas']['Scope'] export type SignedCredential = components['schemas']['SignedCredential'] @@ -69,9 +78,11 @@ export namespace Schemas { export type ThirdpartyRequestsTransactionsIDPatchResponse = components['schemas']['ThirdpartyRequestsTransactionsIDPatchResponse'] export type ThirdpartyRequestsTransactionsIDPutResponse = components['schemas']['ThirdpartyRequestsTransactionsIDPutResponse'] export type ThirdpartyRequestsTransactionsPostRequest = components['schemas']['ThirdpartyRequestsTransactionsPostRequest'] + export type TransactionRequestsPostRequest = components['schemas']['TransactionRequestsPostRequest'] export type TransactionRequestState = components['schemas']['TransactionRequestState'] export type TransactionState = components['schemas']['TransactionState'] export type TransactionType = components['schemas']['TransactionType'] export type UnsignedCredential = components['schemas']['UnsignedCredential'] export type VerifiedCredential = components['schemas']['VerifiedCredential'] + } diff --git a/tests/dto/thirdparty.test.ts b/tests/dto/thirdparty.test.ts index 15a24785..9d697257 100644 --- a/tests/dto/thirdparty.test.ts +++ b/tests/dto/thirdparty.test.ts @@ -2,6 +2,7 @@ import { Schemas } from '../../lib/thirdparty' describe('thirdparty', () => { const accountAddress: Schemas.AccountAddress = 'account-address' + const authenticationTypeQRCODE: Schemas.AuthenticationType = 'QRCODE' const currency: Schemas.Currency = 'USD' const name: Schemas.Name = 'name' const account: Schemas.Account = { @@ -21,6 +22,13 @@ describe('thirdparty', () => { const extensionList: Schemas.ExtensionList = { extension: [extension] } + const errorCode: Schemas.ErrorCode = '00001' + const errorDescription: Schemas.ErrorDescription = 'error description' + const errorInformation: Schemas.ErrorInformation = { + errorCode, + errorDescription, + extensionList + } const integer: Schemas.Integer = '1' const correlationId: Schemas.CorrelationId = 'abcd-efgh' const dateTime: Schemas.DateTime = '2021-01-01T00:00:0000' @@ -121,6 +129,15 @@ describe('thirdparty', () => { initiator: 'PAYER', initiatorType: 'CONSUMER', } + const partyResult: Schemas.PartyResult = { + partyId: partyIdInfo, + errorInformation + } + + const partyIdentifier: Schemas.PartyIdentifier = 'abcdef' + const partyName: Schemas.PartyName = 'party-name' + const partySubIdOrType: Schemas.PartySubIdOrType = 'party-sub-id-or-type' + test('Account', () => { expect(account).toBeDefined() }) @@ -258,7 +275,7 @@ describe('thirdparty', () => { } expect(consentsIDPutResponseSigned).toBeDefined() }) - + test('ConsentsIDPutResponseUnsigned', () => { const consentsIDPutResponseUnsigned: Schemas.ConsentsIDPutResponseUnsigned = { requestId: correlationId, @@ -372,12 +389,22 @@ describe('thirdparty', () => { expect(note).toBeDefined() }) + test('ParticipantsPostRequest', () => { + const participantsPostRequest: Schemas.ParticipantsPostRequest = { + requestId: correlationId, + partyList: [partyIdInfo], + currency + } + expect(participantsPostRequest).toBeDefined() + }) + test('PartiesTypeIDPutResponse', () => { const partiesTypeIDPutResponse: Schemas.PartiesTypeIDPutResponse = { party } expect(partiesTypeIDPutResponse).toBeDefined() }) + test('Party', () => { expect(party).toBeDefined() }) @@ -386,6 +413,10 @@ describe('thirdparty', () => { expect(partyComplexName).toBeDefined() }) + test('PartyIdentifier', () => { + expect(partyIdentifier).toBeDefined() + }) + test('PartyIdInfo', () => { expect(partyIdInfo).toBeDefined() }) @@ -394,6 +425,18 @@ describe('thirdparty', () => { expect(partyIdTypeEMAIL).toBeDefined() }) + test('PartyName', () => { + expect(partyName).toBeDefined() + }) + + test('PartyResult', () => { + expect(partyResult).toBeDefined() + }) + + test('PartySubIdOrType', () => { + expect(partySubIdOrType).toBeDefined() + }) + test('PartyPersonalInfo', () => { const partyPersonalInfo: Schemas.PartyPersonalInfo = { complexName: partyComplexName, @@ -424,11 +467,11 @@ describe('thirdparty', () => { test('SignedCredential', () => { expect(signedCredential).toBeDefined() }) - + test('ThirdpartyRequestsTransactionsIDAuthorizationsPostRequest', () => { const thirdpartyRequestsTransactionsIDAuthorizationsPostRequest: Schemas.ThirdpartyRequestsTransactionsIDAuthorizationsPostRequest = { challenge: 'the-challenge', - value: 'signed-challenge', + value: 'signed-challenge', consentId: correlationId, sourceAccountId: accountAddress, status: 'PENDING' @@ -439,7 +482,7 @@ describe('thirdparty', () => { test('ThirdpartyRequestsTransactionsIDAuthorizationsPutResponse', () => { const thirdpartyRequestsTransactionsIDAuthorizationsPutResponse: Schemas.ThirdpartyRequestsTransactionsIDAuthorizationsPutResponse = { challenge: 'the-challenge', - value: 'signed-challenge', + value: 'signed-challenge', consentId: correlationId, sourceAccountId: accountAddress, status: 'VERIFIED' @@ -484,7 +527,23 @@ describe('thirdparty', () => { test('TransactionType', () => { expect(transactionType).toBeDefined() }) - + + test('TransactionRequestsPostRequest', () => { + const transactionRequestsPostRequest: Schemas.TransactionRequestsPostRequest = { + transactionRequestId: correlationId, + payee: party, + payer: partyIdInfo, + amount: money, + transactionType, + note, + geoCode, + authenticationType: authenticationTypeQRCODE, + expiration: dateTime, + extensionList + } + expect(transactionRequestsPostRequest).toBeDefined() + }) + test('UnsignedCredential', () => { expect(unsignedCredential).toBeDefined() })