-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #214 from 1AhmedYasser/Connecting-Service-to-an-In…
…tent Connecting Service to Intent
- Loading branch information
Showing
36 changed files
with
1,072 additions
and
974 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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
-- liquibase formatted sql | ||
-- changeset ahmedyasser:1709066018 | ||
ALTER TYPE service_state ADD VALUE 'ready'; |
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,2 @@ | ||
INSERT INTO service_trigger (intent, service, status, author_role, service_name) | ||
VALUES (:intent, :serviceId, :status::trigger_status, :authorRole::author_role, :serviceName) |
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,2 @@ | ||
INSERT INTO service_trigger (intent, service, status, author_role, service_name) | ||
VALUES (:intent, :serviceId, 'deleted'::trigger_status, :authorRole::author_role, :serviceName) |
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,27 @@ | ||
WITH connected_intents AS | ||
(SELECT intent, | ||
service, | ||
service_name, | ||
status, | ||
created | ||
FROM service_trigger | ||
WHERE (intent, | ||
service, | ||
service_name, | ||
created) IN | ||
(SELECT intent, | ||
service, | ||
service_name, | ||
max(created) | ||
FROM service_trigger | ||
GROUP BY intent, | ||
service, | ||
service_name) | ||
AND status in ('pending', | ||
'approved')) | ||
SELECT intent | ||
FROM intent | ||
WHERE intent NOT IN | ||
(SELECT intent | ||
FROM connected_intents) | ||
ORDER BY intent ASC |
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,10 @@ | ||
SELECT intent, | ||
service, | ||
MAX(service_name) AS service_name, | ||
MAX(created) AS requested_at, | ||
MAX(author_role) as author_role | ||
FROM service_trigger | ||
GROUP BY intent, | ||
service | ||
HAVING MAX(status) = 'pending' | ||
AND max("author_role") != 'service_manager'; |
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 @@ | ||
SELECT id, intent, service, service_name, status, author_role, created | ||
FROM service_trigger | ||
WHERE service = :serviceId | ||
AND id = ( | ||
SELECT MAX(id) | ||
FROM service_trigger | ||
WHERE service = :serviceId | ||
) | ||
AND status NOT IN ('deleted', 'declined'); |
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,8 @@ | ||
get_available_intents: | ||
call: http.post | ||
args: | ||
url: "[#SERVICE_TRAINING_RESQL]/get-available-intents" | ||
result: res | ||
|
||
return_result: | ||
return: ${res.response.body} |
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,8 @@ | ||
get_connection_requests: | ||
call: http.post | ||
args: | ||
url: "[#SERVICE_TRAINING_RESQL]/get-requested-service-triggers" | ||
result: res | ||
|
||
return_result: | ||
return: ${res.response.body} |
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,15 @@ | ||
extract_request_data: | ||
assign: | ||
serviceId: ${incoming.body.serviceId} | ||
|
||
check_for_intent_connection: | ||
call: http.post | ||
args: | ||
url: "[#SERVICE_TRAINING_RESQL]/get-service-trigger" | ||
body: | ||
serviceId: ${serviceId} | ||
result: res | ||
|
||
return_result: | ||
status: 200 | ||
return: ${res.response.body[0]} |
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
21 changes: 21 additions & 0 deletions
21
DSL/Ruuter/POST/services/request-service-intent-connection.yml
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,21 @@ | ||
extract_request_data: | ||
assign: | ||
serviceId: ${incoming.body.serviceId} | ||
serviceName: ${incoming.body.serviceName} | ||
intent: ${incoming.body.intent} | ||
|
||
add_connection_request: | ||
call: http.post | ||
args: | ||
url: "[#SERVICE_TRAINING_RESQL]/add-service-trigger" | ||
body: | ||
serviceId: ${serviceId} | ||
intent: ${intent} | ||
status: "pending" | ||
authorRole: "service_manager" | ||
serviceName: ${serviceName} | ||
result: res | ||
|
||
return_result: | ||
status: 200 | ||
return: "Connection request sent successfully" |
23 changes: 23 additions & 0 deletions
23
DSL/Ruuter/POST/services/respond-to-connection-request.yml
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,23 @@ | ||
extract_request_data: | ||
assign: | ||
serviceId: ${incoming.body.serviceId} | ||
serviceName: ${incoming.body.serviceName} | ||
authorRole: ${incoming.body.authorRole} | ||
intent: ${incoming.body.intent} | ||
status: ${incoming.body.status} | ||
|
||
add_connection_request: | ||
call: http.post | ||
args: | ||
url: "[#SERVICE_TRAINING_RESQL]/add-service-trigger" | ||
body: | ||
serviceId: ${serviceId} | ||
intent: ${intent} | ||
status: ${status} | ||
authorRole: ${authorRole} | ||
serviceName: ${serviceName} | ||
result: res | ||
|
||
return_result: | ||
status: 200 | ||
return: "Response to connection request" |
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
Oops, something went wrong.