Skip to content

Commit

Permalink
Merge pull request #1109 from eclipse-tractusx/feature/985-notificati…
Browse files Browse the repository at this point in the history
…on-contractagreements

feature(chore):985 Added notification contracts.
  • Loading branch information
ds-mwesener authored Jun 25, 2024
2 parents 9d056f0 + cc331db commit d83eeb5
Showing 1 changed file with 17 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
create or replace view contract_agreement_view as
-- Explicitly define column names for the view
CREATE OR REPLACE VIEW contract_agreement_view (id, contract_agreement_id, type, created) AS
SELECT *
FROM ((SELECT assets_as_built.id, contract_agreement_id, 'ASSET_AS_BUILT' as type, created
FROM assets_as_built
where contract_agreement_id is not null)
UNION ALL
(SELECT assets_as_planned.id, contract_agreement_id, 'ASSET_AS_PLANNED' as type, created
FROM assets_as_planned
where contract_agreement_id is not null)) results
FROM (
(SELECT assets_as_built.id,
contract_agreement_id,
'ASSET_AS_BUILT' AS type,
created
FROM assets_as_built
WHERE contract_agreement_id IS NOT NULL)
UNION ALL
(SELECT assets_as_planned.id,
contract_agreement_id,
'ASSET_AS_PLANNED' AS type,
created
FROM assets_as_planned
WHERE contract_agreement_id IS NOT NULL)
) results
ORDER BY created DESC;

0 comments on commit d83eeb5

Please sign in to comment.