-
Notifications
You must be signed in to change notification settings - Fork 4
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 #115 from rootcodelabs/dev
Pulling changes from ESCLASS-45-Dataset-Groups
- Loading branch information
Showing
7 changed files
with
194 additions
and
79 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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
SELECT validation_criteria | ||
SELECT validation_criteria,num_pages | ||
FROM dataset_group_metadata WHERE id =:id; |
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,5 @@ | ||
UPDATE dataset_group_metadata | ||
SET | ||
validation_status = :validation_status::Validation_Status, | ||
validation_errors = :validation_errors::jsonb | ||
WHERE id = :id; |
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
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
100 changes: 100 additions & 0 deletions
100
DSL/Ruuter.private/DSL/POST/classifier/datasetgroup/update/validation/status.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,100 @@ | ||
declaration: | ||
call: declare | ||
version: 0.1 | ||
description: "Description placeholder for 'STATUS'" | ||
method: post | ||
accepts: json | ||
returns: json | ||
namespace: classifier | ||
allowlist: | ||
body: | ||
- field: dgId | ||
type: string | ||
description: "Body field 'dgId'" | ||
- field: updateType | ||
type: string | ||
description: "Body field 'updateType'" | ||
- field: patchPayload | ||
type: json | ||
description: "Body field 'patchPayload'" | ||
- field: savedFilePath | ||
type: string | ||
description: "Body field 'savedFilePath'" | ||
- field: validationStatus | ||
type: string | ||
description: "Body field 'validationStatus'" | ||
- field: validationErrors | ||
type: array | ||
description: "Body field 'validationErrors'" | ||
|
||
extract_request_data: | ||
assign: | ||
dg_id: ${incoming.body.dgId} | ||
update_type: ${incoming.body.updateType} | ||
patch_payload: ${incoming.body.patchPayload} | ||
save_file_path: ${incoming.body.savedFilePath} | ||
validation_status: ${incoming.body.validationStatus} | ||
validation_errors: ${incoming.body.validationErrors} | ||
next: update_dataset_group_validation | ||
|
||
update_dataset_group_validation: | ||
call: http.post | ||
args: | ||
url: "[#CLASSIFIER_RESQL]/update-dataset-group-validation-data" | ||
body: | ||
id: ${dg_id} | ||
validation_status: ${validation_status} | ||
validation_errors: ${JSON.stringify(validation_errors)} | ||
result: res | ||
next: check_status | ||
|
||
check_status: | ||
switch: | ||
- condition: ${200 <= res.response.statusCodeValue && res.response.statusCodeValue < 300} | ||
next: check_validation_status_type | ||
next: assign_fail_response | ||
|
||
check_validation_status_type: | ||
switch: | ||
- condition: ${validation_status === 'success'} | ||
next: execute_cron_manager | ||
next: assign_success_response | ||
|
||
execute_cron_manager: | ||
call: reflect.mock | ||
args: | ||
url: "[#CLASSIFIER_CRON_MANAGER]/execute/dataset_processing/dataset_processor" | ||
query: | ||
cookie: ${incoming.header.cookie} | ||
dgId: ${dg_id} | ||
updateType: ${update_type} | ||
savedFilePath: ${save_file_path} | ||
patchPayload: ${patchPayload} | ||
result: res | ||
next: assign_success_response | ||
|
||
assign_success_response: | ||
assign: | ||
format_res: { | ||
dgId: '${dg_id}', | ||
operationSuccessful: true, | ||
} | ||
next: return_ok | ||
|
||
assign_fail_response: | ||
assign: | ||
format_res: { | ||
dgId: '${dg_id}', | ||
operationSuccessful: false, | ||
} | ||
next: return_bad_request | ||
|
||
return_ok: | ||
status: 200 | ||
return: ${format_res} | ||
next: end | ||
|
||
return_bad_request: | ||
status: 400 | ||
return: ${format_res} | ||
next: end |
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