From dbf19856c4882961fa4f82bf0318b1b6a4196aaf Mon Sep 17 00:00:00 2001 From: Phil Schneider Date: Tue, 13 Aug 2024 12:57:30 +0200 Subject: [PATCH] docs: add sql scripts to query application checklist data (#925) Reviewed-By: Norbert Truchsess --- scripts/sql/GetApplicationChecklistForBpn.sql | 32 ++++++++++++++++++ .../sql/GetRegistrationProcessStepsByBpn.sql | 33 +++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 scripts/sql/GetApplicationChecklistForBpn.sql create mode 100644 scripts/sql/GetRegistrationProcessStepsByBpn.sql diff --git a/scripts/sql/GetApplicationChecklistForBpn.sql b/scripts/sql/GetApplicationChecklistForBpn.sql new file mode 100644 index 0000000000..b9a943f78f --- /dev/null +++ b/scripts/sql/GetApplicationChecklistForBpn.sql @@ -0,0 +1,32 @@ +--------------------------------------------------------------- +-- Copyright (c) 2024 Contributors to the Eclipse Foundation +-- +-- See the NOTICE file(s) distributed with this work for additional +-- information regarding copyright ownership. +-- +-- This program and the accompanying materials are made available under the +-- terms of the Apache License, Version 2.0 which is available at +-- https://www.apache.org/licenses/LICENSE-2.0. +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +-- WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +-- License for the specific language governing permissions and limitations +-- under the License. +-- +-- SPDX-License-Identifier: Apache-2.0 +--------------------------------------------------------------- + +SELECT application_id, act.label, date_created, date_last_changed, acs.label, comment +FROM portal.application_checklist as ac +JOIN portal.application_checklist_types as act ON act.id = ac.application_checklist_entry_type_id +JOIN portal.application_checklist_statuses as acs ON acs.id = ac.application_checklist_entry_status_id +WHERE application_id in ( + SELECT id + FROM portal.company_applications + WHERE company_id in ( + SELECT id + FROM portal.companies + WHERE business_partner_number = 'BPNL0000000TESTE' + ) +) \ No newline at end of file diff --git a/scripts/sql/GetRegistrationProcessStepsByBpn.sql b/scripts/sql/GetRegistrationProcessStepsByBpn.sql new file mode 100644 index 0000000000..f1f9be2a77 --- /dev/null +++ b/scripts/sql/GetRegistrationProcessStepsByBpn.sql @@ -0,0 +1,33 @@ +--------------------------------------------------------------- +-- Copyright (c) 2024 Contributors to the Eclipse Foundation +-- +-- See the NOTICE file(s) distributed with this work for additional +-- information regarding copyright ownership. +-- +-- This program and the accompanying materials are made available under the +-- terms of the Apache License, Version 2.0 which is available at +-- https://www.apache.org/licenses/LICENSE-2.0. +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +-- WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +-- License for the specific language governing permissions and limitations +-- under the License. +-- +-- SPDX-License-Identifier: Apache-2.0 +--------------------------------------------------------------- + +SELECT ps.id, pst.label, pss.label, date_created, date_last_changed, process_id, message +FROM portal.process_steps as ps +JOIN portal.process_step_types as pst ON pst.id = ps.process_step_type_id +JOIN portal.process_step_statuses as pss ON pss.id = ps.process_step_status_id +WHERE ps.process_id in ( + SELECT checklist_process_id + FROM portal.company_applications + WHERE company_id in ( + SELECT id + FROM portal.companies + WHERE business_partner_number = 'BPNL0000000TESTE' + ) +) +order by date_created desc \ No newline at end of file