Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: UHF-10877: Fix race conditions with integration by removing direct upload to ATV #1535

Draft
wants to merge 2 commits into
base: dev
Choose a base branch
from
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ public function handleApplicationUploadViaIntegration(
try {
$headers = [];

// Get status from updated document.
$headers['X-Case-Status'] = $updatedDocumentFromAtv->getStatus();

// We set the data source for integration to be used in controlling
Expand Down
4 changes: 2 additions & 2 deletions tools/http/ATV.http
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Get single document by transaction_id
GET {{atvUrl}}/v1/documents/?
transaction_id={{transaction_id}}
transaction_id={{transactionId}}
Accept-Encoding: utf8
X-Api-Key: {{atvApiKey}}

Expand All @@ -19,7 +19,7 @@ GET {{atvUrl}}/v1/documents/?
user_id={{user_id}}&
type={{type}}&
service_name=AvustushakemusIntegraatio&
transaction_id={{transaction_id}}
transaction_id={{transactionId}}
Accept-Encoding: utf8
X-Api-Key: {{atvApiKey}}

Expand Down
50 changes: 50 additions & 0 deletions tools/http/Integraatio.http
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
### Create Event via integration API
POST {{integraatioUrl}}/createEvent
Authorization: Basic {{integraatioBasicToken}}
Content-Type: application/json

{
"caseId": "{{transactionId}}",
"eventType": "EVENT_INFO",
"eventCode": 0,
"eventSource": "Avustusten kasittelyjarjestelma",
"eventDescription": "Puhakka Tero;09 310 36070;[email protected]",
"eventDescription_SV": null,
"eventDescription_EN": null,
"timeUpdated": null,
"timeCreated": "{{$isoTimestamp}}",
"eventTarget": null,
"eventID": "{{$random.uuid}}"
}

### Create Status Update via integration API
POST {{integraatioUrl}}/updateCitizenCaseStatus
Authorization: Basic {{integraatioBasicToken}}
Content-Type: application/json

{
"caseId": "{{transactionId}}",
"citizenCaseStatus" : "PROCESSING",
"eventType" : "STATUS_UPDATE",
"eventCode" : 0,
"eventSource" : "Avustusten kasittelyjarjestelma",
"timeUpdated" : null,
"timeCreated": "{{$isoTimestamp}}"
}

### Create Message via integration API
POST {{integraatioUrl}}/createConversationMessage
Authorization: Basic {{integraatioBasicToken}}
Content-Type: application/json

{
"caseId": "{{transactionId}}",
"messageId" : "{{$random.uuid}}",
"body" : "Lorem ipsum dolor sit amet, consectetur adipiscing elit",
"sentBy" : "Avustusten kasittelyjarjestelma",
"sendDateTime" :"{{$isoTimestamp}}"
}

###


8 changes: 8 additions & 0 deletions tools/http/http-client.env.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"dev": {
"atvUrl": "https://atv-api-hki-kanslia-atv-test.agw.arodevtest.hel.fi",
"transactionId": "LOCALYRTTI12-068-0000647",
"document_id": "28753685-24b8-4542-b1c1-cc70ff9f9fbc",
"integraatioUrl": "https://avustus-integration-test.agw.arodevtest.hel.fi"
}
}