Commit c6028ade authored by Kristel Meikas's avatar Kristel Meikas
Browse files

Merge branch 'develop' into 'master'

Release: merge 'develop' into 'master' created by Kristel Meikas

See merge request teis/payments-service!53
parents cafa0230 b623edf6
# Changelog
## [1.13.0] - 2021-02-07
* added functionality to fill claim definition created_at null values
## [1.12.0] - 2020-12-14
* added functionality to exclude claims without enforcement from getClaims() query via request enforcement flag.
* added functionality to exclude claims without enforcement from getClaims() query via request enforcement flag
## [1.11.0] - 2020-11-27
......
theGroup=ee.sm.ti.teis
theVersion=1.12.0
theVersion=1.13.0
pluginVersion=1.2.0
commonsVersion=1.14.0
officeApiGatewayVersion=1.15.0
--liquibase formatted sql
--changeset enriko:2021-01-29.TEIS-1924.generate-created_at-values_v2 splitStatements:false
create or replace function fill_created_at_value(tableName varchar, idType varchar)
returns void
as $$
declare
createdAt timestamp;
rec record;
begin
select to_timestamp('2020-03-31 08:00:00', 'YYYY-MM-DD HH24:MI:SS') into createdAt;
for rec in execute 'select * from ' || quote_ident(tableName) || ' where created_at is null' LOOP
select createdAt + interval '1 second' into createdAt;
if idType = 'uuid' then
-- RAISE NOTICE 'ID= "%"', rec.id::text;
execute 'update ' || quote_ident(tableName) || ' set created_at = ''' || createdAt || ''' where id=''' || rec.id::text || '''';
execute 'update ' || quote_ident(tableName) || ' set created_by = ''SYSTEM'' where created_by is null and id=''' || rec.id::text || '''';
else
-- RAISE NOTICE 'ID str= "%"', rec.id;
execute 'update ' || quote_ident(tableName) || ' set created_at = ''' || createdAt || ''' where id=''' || rec.id || '''';
execute 'update ' || quote_ident(tableName) || ' set created_by = ''SYSTEM'' where created_by is null and id=''' || rec.id || '''';
end if;
-- RAISE NOTICE 'createdAt "%"', createdAt;
end loop;
end $$
language plpgsql;
select fill_created_at_value('claim_definition', 'uuid');
drop function if exists fill_created_at_value(varchar, varchar);
......@@ -10,7 +10,8 @@ DELETE FROM payment;
DELETE FROM enforcement;
DELETE FROM data_object_reference;
DELETE FROM claim;
DELETE FROM claim_definition WHERE created_by = 'test';
DELETE FROM claim_definition WHERE created_by = 'test' OR
code IN ('CREATE_PAYMENT','CREATE_ANOTHER_PAYMENT','CLAIM_DEFINITION_FOR_TESTS','CREATE_THIRD_PAYMENT');
INSERT INTO claim_definition (id, code, title, bank_accounts, receiver_name, payment_reference, payment_description, data_object_type, path_end, object_status, created_by)
VALUES ('20bffead-a063-467e-a4b1-d55bf53944b5', 'CREATE_PAYMENT', 'Create payment', 'EE123123213453543', 'TEHIK', 'Create payment reference', 'payment description 123', 'OBJECT_TYPE__CLAIM_PAYMENT', null, 'CURRENT', 'test'),
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment