Skip to content

Commit f2348a2

Browse files
authored
Transaction fixes and test adjustments (#110)
* feat: transaction fixes and test adjustments * lint * fix: CI * fix: enabled payment canceled transaction
1 parent 50d328d commit f2348a2

File tree

10 files changed

+820
-808
lines changed

10 files changed

+820
-808
lines changed

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212

1313
- uses: actions/setup-node@v1
1414
with:
15-
node-version: 16.x
15+
node-version: ">=22.12.0"
1616

1717
- name: Install Redocly CLI
1818
run: npm i @redocly/cli@latest

openapi.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"info": {
44
"title": "Unit OpenAPI specifications",
55
"description": "An OpenAPI specifications for unit-sdk clients",
6-
"version": "0.2.1"
6+
"version": "0.2.3"
77
},
88
"servers": [
99
{

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"bundle": "redocly bundle openapi.json -o dist/bundledSchema.json",
44
"fix-java-file-get-requests": "ts-node ./scripts/java/fixFileRelatedGetRequests.ts",
55
"add-version-header-to-java": "ts-node ./scripts/java/addVersionHeaderToApiClient.ts",
6-
"generate-java": "rm -rf ./dist/java-sdk && npm run bundle && npx mkdirp dist/java-sdk/src/test/java/unit/java/sdk && cp -a ./unit/e2e_tests/java/. ./dist/java-sdk/src/test/java/unit/java/sdk && openapi-generator-cli generate -g java -i ./dist/bundledSchema.json -o ./dist/java-sdk -p hideGenerationTimestamp=true -p packageName=unit.java.sdk -p modelPackage=unit.java.sdk.model -p apiPackage=unit.java.sdk.api --library native -p useJakartaEe=true --openapi-normalizer REFACTOR_ALLOF_WITH_PROPERTIES_ONLY=true && npm run fix-java-file-get-requests -- --path=./dist/java-sdk/src/main/java/unit/java/sdk/api/UnitApi.java && npm run add-version-header-to-java -- --path=./dist/java-sdk/src/main/java/unit/java/sdk/ApiClient.java",
6+
"generate-java": "rm -rf ./dist/java-sdk && npm run bundle && npx mkdirp dist/java-sdk/src/test/java/unit/java/sdk && cp -a ./unit/e2e_tests/java/. ./dist/java-sdk/src/test/java/unit/java/sdk && openapi-generator-cli generate -g java -i ./dist/bundledSchema.json -o ./dist/java-sdk -p hideGenerationTimestamp=true -p packageName=unit.java.sdk -p modelPackage=unit.java.sdk.model -p apiPackage=unit.java.sdk.api --library native -p useJakartaEe=true --openapi-normalizer REFACTOR_ALLOF_WITH_PROPERTIES_ONLY=true && rm -rf ./dist/java-sdk/src/test/java/unit/java/sdk/api && rm -rf ./dist/java-sdk/src/test/java/unit/java/sdk/model && npm run fix-java-file-get-requests -- --path=./dist/java-sdk/src/main/java/unit/java/sdk/api/UnitApi.java && npm run add-version-header-to-java -- --path=./dist/java-sdk/src/main/java/unit/java/sdk/ApiClient.java",
77
"generate-ruby": "rm -rf ./dist/ruby-sdk && npm run bundle && openapi-generator-cli generate -g ruby -i ./dist/bundledSchema.json -o ./dist/ruby-sdk -p gemName=unit_openapi_ruby_sdk && rm -rf ./dist/ruby-sdk/spec && npx mkdirp dist/ruby-sdk/spec && cp -a ./unit/e2e_tests/ruby/spec ./dist/ruby-sdk",
88
"generate-node": "rm -rf ./dist/node-sdk && npm run bundle && openapi-generator-cli generate -g typescript-axios -i ./dist/bundledSchema.json -o ./dist/node-sdk",
99
"generate-python": "rm -rf ./dist/python-sdk && npm run bundle && openapi-generator-cli generate -i ./dist/bundledSchema.json -g python -o ./dist/python-sdk -p packageName=unit_openapi_python_sdk",

schemas/application/application.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@
203203
},
204204
"percentage": {
205205
"type": "integer",
206-
"minimum": 0,
206+
"minimum": 25,
207207
"maximum": 100
208208
},
209209
"evaluationFlags": {

schemas/relationships.json

Lines changed: 39 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -328,20 +328,18 @@
328328
"title": "Authorization Request Relationship",
329329
"properties": {
330330
"data": {
331-
"type": "array",
332-
"items": {
333-
"type": "object",
334-
"properties": {
335-
"type": {
336-
"type": "string",
337-
"default": "authorizationRequest"
338-
},
339-
"id": {
340-
"$ref": "./types.json#/components/schemas/Identifier"
341-
}
331+
"type": "object",
332+
"properties": {
333+
"type": {
334+
"type": "string",
335+
"default": "authorizationRequest"
342336
},
343-
"additionalProperties": false
344-
}
337+
"id": {
338+
"$ref": "./types.json#/components/schemas/Identifier"
339+
}
340+
},
341+
"required": ["type", "id"],
342+
"additionalProperties": false
345343
}
346344
},
347345
"additionalProperties": false
@@ -356,20 +354,18 @@
356354
"title": "Authorization Relationship",
357355
"properties": {
358356
"data": {
359-
"type": "array",
360-
"items": {
361-
"type": "object",
362-
"properties": {
363-
"type": {
364-
"type": "string",
365-
"default": "authorization"
366-
},
367-
"id": {
368-
"$ref": "./types.json#/components/schemas/Identifier"
369-
}
357+
"type": "object",
358+
"properties": {
359+
"type": {
360+
"type": "string",
361+
"default": "authorization"
370362
},
371-
"additionalProperties": false
372-
}
363+
"id": {
364+
"$ref": "./types.json#/components/schemas/Identifier"
365+
}
366+
},
367+
"required": ["type", "id"],
368+
"additionalProperties": false
373369
}
374370
},
375371
"additionalProperties": false
@@ -858,25 +854,30 @@
858854
},
859855
"RelatedTransactionRelationship": {
860856
"type": "object",
861-
"title": "Related Transaction Relationship",
862857
"properties": {
863-
"data": {
858+
"relatedTransaction": {
864859
"type": "object",
860+
"title": "Related Transaction Relationship",
865861
"properties": {
866-
"type": {
867-
"type": "string",
868-
"default": "transaction"
869-
},
870-
"id": {
871-
"$ref": "./types.json#/components/schemas/Identifier"
862+
"data": {
863+
"type": "object",
864+
"properties": {
865+
"type": {
866+
"type": "string",
867+
"default": "transaction"
868+
},
869+
"id": {
870+
"$ref": "./types.json#/components/schemas/Identifier"
871+
}
872+
},
873+
"required": ["type", "id"],
874+
"additionalProperties": false
872875
}
873876
},
874-
"required": ["type", "id"],
877+
"required": ["data"],
875878
"additionalProperties": false
876879
}
877-
},
878-
"required": ["data"],
879-
"additionalProperties": false
880+
}
880881
},
881882
"DisputedTransactionRelationship": {
882883
"type": "object",

schemas/transaction/transaction.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1462,7 +1462,7 @@
14621462
"additionalProperties": false
14631463
},
14641464
"relationships": {
1465-
"$ref": "#/components/schemas/CardReversalTransactionRelationships"
1465+
"$ref": "#/components/schemas/CardTransactionRelationships"
14661466
}
14671467
},
14681468
"additionalProperties": false,
@@ -2789,7 +2789,8 @@
27892789
"returnedCheckPaymentTransaction",
27902790
"cardReversalTransaction",
27912791
"feeReversalTransaction",
2792-
"pushToCardReversalTransaction"
2792+
"pushToCardReversalTransaction",
2793+
"paymentCanceledTransaction"
27932794
]
27942795
}
27952796
},
@@ -2829,7 +2830,8 @@
28292830
"returnedCheckPaymentTransaction": "#/components/schemas/ReturnedCheckPaymentTransaction",
28302831
"cardReversalTransaction": "#/components/schemas/CardReversalTransaction",
28312832
"feeReversalTransaction": "#/components/schemas/FeeReversalTransaction",
2832-
"pushToCardReversalTransaction": "#/components/schemas/PushToCardReversalTransaction"
2833+
"pushToCardReversalTransaction": "#/components/schemas/PushToCardReversalTransaction",
2834+
"paymentCanceledTransaction": "#/components/schemas/PaymentCanceledTransaction"
28332835
}
28342836
}
28352837
}

schemas/transaction/transactionPaths.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@
2020
"accountId": {
2121
"type": "string"
2222
},
23+
"accountIds": {
24+
"type": "array",
25+
"items": {
26+
"type": "string"
27+
}
28+
},
2329
"customerId": {
2430
"type": "string"
2531
},

0 commit comments

Comments
 (0)