Done ticket GEPAFINBE-194
This commit is contained in:
@@ -14,7 +14,6 @@ isPecServiceEnabled = false
|
||||
#default_System_Receiver_Email=antonio.manca@bflows.net
|
||||
gepafin_email=rinaldo.bonazzo@bflows.net
|
||||
rinaldo_email=rinaldo.bonazzo@bflows.net
|
||||
carlo_email=test@test.test
|
||||
default.hub.uuid=p4lk3bcx1RStqTaIVVbXs
|
||||
|
||||
#Login to Odessa, Appointment Creation, Upload document Configuration
|
||||
|
||||
@@ -13,7 +13,6 @@ isPecServiceEnabled = false
|
||||
#default_System_Receiver_Email=test@test.test
|
||||
gepafin_email=test@test.test
|
||||
rinaldo_email=test@test.test
|
||||
carlo_email=test@test.test
|
||||
default.hub.uuid=p4lk3bcx1RStqTaIVVbXs
|
||||
|
||||
appointment.base.url=https://demo.galileonetwork.it/gateway/rest
|
||||
|
||||
@@ -20,7 +20,6 @@ isPecServiceEnabled = true
|
||||
#default_System_Receiver_Email=m.gaudino@gepafin.it,f.marinelli@gepafin.it
|
||||
gepafin_email=bandi@pec.gepafin.it
|
||||
rinaldo_email=rinaldo.bonazzo@bflows.net
|
||||
carlo_email=carlo.mancosu@bflows.net
|
||||
default.hub.uuid=p4lk3bcx1RStqTaIVVbXs
|
||||
# TEST DEPLOY Configuration
|
||||
|
||||
|
||||
@@ -11,7 +11,6 @@ isPecServiceEnabled = false
|
||||
#default_System_Receiver_Email=test@test.test
|
||||
gepafin_email=test@test.test
|
||||
rinaldo_email=test@test.test
|
||||
carlo_email=test@test.test
|
||||
default.hub.uuid=p4lk3bcx1RStqTaIVVbXs
|
||||
|
||||
appointment.base.url=https://demo.galileonetwork.it/gateway/rest
|
||||
|
||||
@@ -2675,4 +2675,9 @@
|
||||
</insert>
|
||||
</changeSet>
|
||||
|
||||
<changeSet id="25-03-2025_NK_160730" author="Nisha Kashyap">
|
||||
<sqlFile dbms="postgresql"
|
||||
path="db/dump/create_application_view.sql"/>
|
||||
</changeSet>
|
||||
|
||||
</databaseChangeLog>
|
||||
|
||||
@@ -13,10 +13,13 @@
|
||||
BEGIN
|
||||
-- Loop through all tables in the schema that have the 'updated_date' column
|
||||
FOR r IN (
|
||||
SELECT table_name
|
||||
FROM information_schema.columns
|
||||
WHERE column_name = 'updated_date'
|
||||
AND table_schema = 'gepafin_schema'
|
||||
SELECT c.table_name
|
||||
FROM information_schema.columns c
|
||||
JOIN information_schema.tables t
|
||||
ON c.table_name = t.table_name AND c.table_schema = t.table_schema
|
||||
WHERE c.column_name = 'updated_date'
|
||||
AND c.table_schema = 'gepafin_schema'
|
||||
AND t.table_type = 'BASE TABLE' -- Excludes views
|
||||
)
|
||||
LOOP
|
||||
EXECUTE format(
|
||||
@@ -30,10 +33,13 @@
|
||||
|
||||
-- Loop through all tables in the schema that have the 'created_date' column
|
||||
FOR r IN (
|
||||
SELECT table_name
|
||||
FROM information_schema.columns
|
||||
WHERE column_name = 'created_date'
|
||||
AND table_schema = 'gepafin_schema'
|
||||
SELECT c.table_name
|
||||
FROM information_schema.columns c
|
||||
JOIN information_schema.tables t
|
||||
ON c.table_name = t.table_name AND c.table_schema = t.table_schema
|
||||
WHERE c.column_name = 'created_date'
|
||||
AND c.table_schema = 'gepafin_schema'
|
||||
AND t.table_type = 'BASE TABLE' -- Excludes views
|
||||
)
|
||||
LOOP
|
||||
EXECUTE format(
|
||||
|
||||
81
src/main/resources/db/dump/create_application_view.sql
Normal file
81
src/main/resources/db/dump/create_application_view.sql
Normal file
@@ -0,0 +1,81 @@
|
||||
CREATE OR REPLACE VIEW application_view AS
|
||||
|
||||
SELECT
|
||||
a.id,
|
||||
a.status,
|
||||
a.submission_date,
|
||||
a.comments,
|
||||
a.amount_requested,
|
||||
a.amount_accepted,
|
||||
a.date_accepted,
|
||||
a.date_rejected,
|
||||
a.is_deleted,
|
||||
a.hub_id,
|
||||
a.user_id,
|
||||
a.evaluation_version AS evaluation_version,
|
||||
a.updated_date AS modified_date,
|
||||
a.created_date AS created_date,
|
||||
|
||||
|
||||
|
||||
-- Call Details
|
||||
a.call_id AS call_id,
|
||||
cl.name AS call_title,
|
||||
cl.end_date AS call_end_date,
|
||||
cl.end_time AS call_end_time,
|
||||
|
||||
-- Company Details
|
||||
a.COMPANY_ID AS company_id,
|
||||
c.company_name AS company_name,
|
||||
|
||||
-- Protocol Details
|
||||
p.protocol_number AS protocol_number,
|
||||
|
||||
|
||||
-- Assigned User Details from ASSIGNED_APPLICATION and GEPPAFIN_USER
|
||||
COALESCE(aa.user_id, NULL) AS assigned_user_id,
|
||||
COALESCE(
|
||||
NULLIF(
|
||||
TRIM(CONCAT(
|
||||
COALESCE(u.first_name, ''), ' ',
|
||||
COALESCE(u.last_name, '')
|
||||
)),
|
||||
''
|
||||
),
|
||||
''
|
||||
) AS assigned_user_name,
|
||||
|
||||
-- User with Company Details (From Application's User)
|
||||
COALESCE(uwc.id, NULL) AS user_with_company_id
|
||||
|
||||
|
||||
FROM gepafin_schema.APPLICATION a
|
||||
|
||||
-- Join Call Entity
|
||||
LEFT JOIN gepafin_schema.CALL cl
|
||||
ON a.CALL_ID = cl.id
|
||||
|
||||
-- Join Company Entity (Ensuring it is not deleted)
|
||||
LEFT JOIN gepafin_schema.COMPANY c
|
||||
ON a.COMPANY_ID = c.id
|
||||
|
||||
-- Join Protocol Entity
|
||||
LEFT JOIN gepafin_schema.PROTOCOL p
|
||||
ON a.PROTOCOL_NUMBER = p.id
|
||||
|
||||
-- Join Assigned Application Entity (Ensuring it is not deleted)
|
||||
LEFT JOIN gepafin_schema.assigned_applications aa
|
||||
ON a.id = aa.APPLICATION_ID
|
||||
AND (aa.IS_DELETED IS FALSE OR aa.IS_DELETED IS NULL)
|
||||
|
||||
-- Join User Entity (Get First & Last Name Combined)
|
||||
LEFT JOIN gepafin_schema.GEPAFIN_USER u
|
||||
ON aa.user_id = u.id
|
||||
|
||||
-- Get User With Company ID (From Application's User & Company)
|
||||
LEFT JOIN gepafin_schema.USER_WITH_COMPANY uwc
|
||||
ON a.user_id = uwc.user_id
|
||||
AND a.COMPANY_ID = uwc.company_id
|
||||
AND uwc.is_deleted = FALSE -- Ensuring the user is active
|
||||
|
||||
WHERE a.IS_DELETED IS FALSE OR a.IS_DELETED IS NULL;
|
||||
Reference in New Issue
Block a user