Commit 9484546a authored by Enriko Käsper's avatar Enriko Käsper
Browse files

Merge branch 'develop' into 'master'

Release: merge 'develop' into 'master' created by Enriko Käsper

See merge request teis/classifiers-service!49
parents 90c9bc9d 4854069b
theGroup=ee.sm.ti.teis
theVersion=1.7.0
commonsVersion=1.7.0
commonApiGatewayVersion=1.7.0
officeApiGatewayVersion=1.7.0
theVersion=1.8.0
commonsVersion=1.8.0
commonApiGatewayVersion=1.8.0
officeApiGatewayVersion=1.8.0
schedulerVersion=1.5.0
pluginVersion=1.0.1
pluginVersion=1.1.1
mapstructVersion=1.3.0.Final
querydslVersion=4.1.3
......@@ -51,13 +51,13 @@ class ClassifierItemsOfficeListenerTest extends ClassifierTestBase {
randomUUID().toString(), List.of(RolePrivilegeCode.TI_MANAGE_CLASSIFIERS.name()));
ShiftClassifierDirectionDto dto = ShiftClassifierDirectionDto.builder()
.direction(ShiftDirection.DOWN)
.id("SUSPENSION_TYPE__WORK_STOPPED").build();
Optional<ClassifierItemEntity> classifier = repository.findById("SUSPENSION_TYPE__WORK_STOPPED");
.id("TEST_EDITABLENONHIERARCHICAL__TEST001").build();
Optional<ClassifierItemEntity> classifier = repository.findById("TEST_EDITABLENONHIERARCHICAL__TEST001");
shiftRequest.setPayload(dto, requestMetaDTO);
ShiftClassifierItemResponse response = classifierItemsOfficeListener.shift(shiftRequest);
assertThat(classifier).isNotEmpty();
assertThat(classifier.get().getSeqNo()).isEqualTo(1);
assertThat(response.getPayload().get(0).getSeqNo()).isEqualTo(2);
assertThat(classifier.get().getSeqNo()).isEqualTo(100000001);
assertThat(response.getPayload().get(0).getSeqNo()).isEqualTo(100000002);
assertThat(response.getError()).isNull();
dto.setDirection(ShiftDirection.UP);
shiftRequest.setPayload(dto, requestMetaDTO);
......@@ -70,8 +70,8 @@ class ClassifierItemsOfficeListenerTest extends ClassifierTestBase {
randomUUID().toString(), List.of(RolePrivilegeCode.TI_MANAGE_CLASSIFIERS.name()));
ShiftClassifierDirectionDto dto = ShiftClassifierDirectionDto.builder()
.direction(ShiftDirection.UP)
.id("SUSPENSION_TYPE__PROHIBIT_USE_OF_WORK_EQUIPMENT").build();
Optional<ClassifierItemEntity> classifier = repository.findById("SUSPENSION_TYPE__PROHIBIT_USE_OF_WORK_EQUIPMENT");
.id("DEGREE_OF_VIOLATION__DEGREE_002").build();
Optional<ClassifierItemEntity> classifier = repository.findById("DEGREE_OF_VIOLATION__DEGREE_002");
shiftRequest.setPayload(dto, requestMetaDTO);
ShiftClassifierItemResponse response = classifierItemsOfficeListener.shift(shiftRequest);
assertThat(classifier).isNotEmpty();
......@@ -140,7 +140,7 @@ class ClassifierItemsOfficeListenerTest extends ClassifierTestBase {
randomUUID().toString(), List.of(RolePrivilegeCode.TI_MANAGE_CLASSIFIERS.name()));
ShiftClassifierDirectionDto dto = ShiftClassifierDirectionDto.builder()
.direction(ShiftDirection.UP)
.id("PROCEDURAL_ACT_TAGS__TAG_001").build();
.id("TEST_RISK_BUSINESS_TYPE_CATEGORY__FISHING").build();
shiftRequest.setPayload(dto, requestMetaDTO);
ShiftClassifierItemResponse response = classifierItemsOfficeListener.shift(shiftRequest);
assertThat(response.getError().getCode()).isEqualTo(ClassifierErrorCode.CLASSIFIERS_1033.getCode());
......
--liquibase formatted sql
--changeset hando:2020-07-16.002-update-suspension-type
INSERT INTO classifier_item (id, classifier_definition_id, code, editable, name, object_status, seq_no, upper_classifier_item_id, valid_from, valid_until, level)
VALUES
('SUSPENSION_TYPE__WORK_STOPPED_TAG', 'SUSPENSION_TYPE', 'WORK_STOPPED_TAG', FALSE, 'Elule ohtliku töö tegemise peatamine märgistusvahendiga', 'CURRENT', 2, null, now(), null, null),
('SUSPENSION_TYPE__PROHIBIT_USE_OF_WORK_EQUIPMENT_TAG', 'SUSPENSION_TYPE', 'PROHIBIT_USE_OF_WORK_EQUIPMENT_TAG', FALSE, 'Ohtliku töövahendi kasutamise peatamine märgistusvahendiga', 'CURRENT', 4, null, now(), null, null);
UPDATE classifier_item set seq_no = 3, editable = FALSE where id = 'SUSPENSION_TYPE__PROHIBIT_USE_OF_WORK_EQUIPMENT';
UPDATE classifier_item set editable = FALSE where id = 'SUSPENSION_TYPE__WORK_STOPPED';
--liquibase formatted sql
--changeset jyrgen:2020-07-17.add-creator-type-system
DELETE FROM classifier_item where id = 'CREATOR_TYPE__SYSTEM' and classifier_definition_id = 'CREATOR_TYPE';
INSERT INTO classifier_item (id, classifier_definition_id, code, editable, name, object_status, seq_no, upper_classifier_item_id, valid_from, valid_until, level)
VALUES ('CREATOR_TYPE__SYSTEM', 'CREATOR_TYPE', 'SYSTEM', false, 'TEiS', 'CURRENT', 3, null, now(), null, null);
--liquibase formatted sql
--changeset jyrgen:2020-07-21.add-object-type-risk-factor
INSERT INTO classifier_item (id, classifier_definition_id, code, editable, name, object_status, seq_no, upper_classifier_item_id, valid_from, valid_until, level)
VALUES ('OBJECT_TYPE__RISK_FACTOR', 'OBJECT_TYPE', 'RISK_FACTOR', false, 'Ohu andmeobjekt', 'CURRENT', 10, null, now(), null, null);
\ No newline at end of file
--liquibase formatted sql
--changeset hando:2020-07-21.1-definitions-update-ordered-and-editable-values
UPDATE classifier_definition set ordered = TRUE, editable = true where id = 'INSPECTION_TOPIC';
UPDATE classifier_definition set ordered = TRUE, editable = true where id = 'PROCEDURAL_ACT_TAGS';
UPDATE classifier_definition set ordered = TRUE, editable = true where id = 'INSPECTION_DOCUMENT';
UPDATE classifier_definition set ordered = TRUE, editable = true where id = 'VIOLATION_ACT_LEGISLATION';
UPDATE classifier_definition set ordered = TRUE, editable = true where id = 'VIOLATION_LEGISLATION';
UPDATE classifier_definition set ordered = FALSE, editable = false where id = 'EMTAK';
UPDATE classifier_definition set ordered = TRUE, editable = true where id = 'DOCUMENT_ACCESS_RESTRICTION_TYPE';
UPDATE classifier_definition set ordered = FALSE, editable = false where id = 'SUPERVISION_PLAN_TYPE';
UPDATE classifier_definition set ordered = FALSE, editable = false where id = 'SUPERVISION_PLAN_STATUS';
UPDATE classifier_definition set ordered = FALSE, editable = false where id = 'PROCEEDING_STATUS';
UPDATE classifier_definition set ordered = FALSE, editable = false where id = 'PROCEEDING_LEGAL_BASIS';
UPDATE classifier_definition set ordered = FALSE, editable = false where id = 'PROCEDURAL_ACT_STATUS';
UPDATE classifier_definition set ordered = FALSE, editable = false where id = 'VIOLATION_STATUS';
UPDATE classifier_definition set ordered = TRUE, editable = true where id = 'DEGREE_OF_VIOLATION';
UPDATE classifier_definition set ordered = FALSE, editable = false where id = 'OBJECT_TYPE';
UPDATE classifier_definition set ordered = FALSE, editable = false where id = 'CONDUCTING_TIME_TYPE';
UPDATE classifier_definition set ordered = FALSE, editable = false where id = 'FILE_CONTEXT_TYPE';
UPDATE classifier_definition set ordered = FALSE, editable = false where id = 'CREATOR_TYPE';
UPDATE classifier_definition set ordered = FALSE, editable = false where id = 'COUNTRY';
UPDATE classifier_definition set ordered = FALSE, editable = false where id = 'COUNTY';
UPDATE classifier_definition set ordered = FALSE, editable = false where id = 'CITY_OR_PARISH';
UPDATE classifier_definition set ordered = FALSE, editable = false where id = 'VIOLATION_ACT_STATUS';
UPDATE classifier_definition set ordered = FALSE, editable = false where id = 'VIOLATION_ACT_TYPE';
UPDATE classifier_definition set ordered = FALSE, editable = false where id = 'VIOLATION_ELIMINATION_DEADLINE_TYPE';
UPDATE classifier_definition set ordered = FALSE, editable = false where id = 'SUSPENSION_TYPE';
--liquibase formatted sql
--changeset jyrgen:2020-07-22.1.add-risk-settings-status
DELETE FROM classifier_item where id in ('RISK_SETTINGS_STATUS_ACTIVE', 'RISK_SETTINGS_STATUS_INACTIVE') and classifier_definition_id = 'RISK_SETTINGS_STATUS';
DELETE FROM classifier_definition where id = 'RISK_SETTINGS_STATUS';
INSERT INTO classifier_definition (id, default_value, editable, name, hierarchical)
VALUES ('RISK_SETTINGS_STATUS', 'ACTIVE', false, 'Riskianalüüsi seadistuste (ettevõtluse tüübid, ohud, abinõud, mõõdetavad näitajad) staatus', false);
INSERT INTO classifier_item (id, classifier_definition_id, code, editable, name, object_status, seq_no, upper_classifier_item_id, valid_from, valid_until, level)
VALUES ('RISK_SETTINGS_STATUS_ACTIVE', 'RISK_SETTINGS_STATUS', 'ACTIVE', false, 'Kasutusel', 'CURRENT', 1, null, now(), null, null),
('RISK_SETTINGS_STATUS_INACTIVE', 'RISK_SETTINGS_STATUS', 'INACTIVE', false, 'Mitte kasutusel', 'CURRENT', 2, null, now(), null, null);
UPDATE classifier_item set id = 'RISK_SETTINGS_STATUS__ACTIVE' where id = 'RISK_SETTINGS_STATUS_ACTIVE' and classifier_definition_id = 'RISK_SETTINGS_STATUS';
UPDATE classifier_item set id = 'RISK_SETTINGS_STATUS__INACTIVE' where id = 'RISK_SETTINGS_STATUS_INACTIVE' and classifier_definition_id = 'RISK_SETTINGS_STATUS';
\ No newline at end of file
......@@ -19,14 +19,18 @@ VALUES
('TEST_EDITABLEHIERARCHICAL_2', 'TEST004', true, 'Hundid', true, TRUE),
('TEST_NONHIERARCHICAL', null, false, 'Siilid', false,FALSE),
('TEST_EDITABLENONHIERARCHICAL', null, true, 'Rebased', false,TRUE),
('TEST_NONEDITABLEHIERARCHICAL', null, false, 'Kanad', true, FALSE);
('TEST_NONEDITABLEHIERARCHICAL', null, false, 'Kanad', true, FALSE),
('TEST_RISK_BUSINESS_TYPE_CATEGORY', null, true, 'Ärid', true, FALSE),
('TEST_RISK_FACTOR_CATEGORY', 'ACTIVE', true, 'Riskianalüüsi riski kategooriate grupp (liigituse kõrgem tase).', false, true),
('TEST_RISK_ASSESSMENT_STATUS', 'IN_PROGRESS', false, 'Riskianalüüsi staatus.', false, true);
INSERT INTO classifier_attribute_definition (id, classifier_definition_id, code, name, mandatory, data_type)
VALUES
('TEST_ATTRIBUTE_DEFINITION','TEST_EDITABLENONHIERARCHICAL','ATTRIBUTE_DEFINITION','Test attribuudi definitsion.', false, 'TEXT'),
('TEST_ATTRIBUTE_DEFINITION2','TEST_EDITABLENONHIERARCHICAL','ATTRIBUTE_DEFINITION2','Test attribuudi definitsion_2.', true, 'BOOLEAN'),
('TEST_ATTRIBUTE_DEFINITION3','TEST_EDITABLENONHIERARCHICAL','ATTRIBUTE_DEFINITION3','Test attribuudi definitsion_3.', true, 'INT'),
('TEST_ATTRIBUTE_DEFINITION4','TEST_EDITABLENONHIERARCHICAL','ATTRIBUTE_DEFINITION4','Test attribuudi definitsion_4.', true, 'DOUBLE');
('TEST_ATTRIBUTE_DEFINITION4','TEST_EDITABLENONHIERARCHICAL','ATTRIBUTE_DEFINITION4','Test attribuudi definitsion_4.', true, 'DOUBLE'),
('TEST_ATTRIBUTE_DEFINITION5','TEST_EDITABLENONHIERARCHICAL','ATTRIBUTE_DEFINITION5','Test attribuudi definitsion_5, non mandatory boolean', false, 'BOOLEAN');
INSERT INTO classifier_item (
id,
......@@ -91,7 +95,15 @@ VALUES
('INSPECTION_TOPIC__INSPECTION_TOPIC_3_2','INSPECTION_TOPIC','INSPECTION_TOPIC_3_2',TRUE, '3.2. Liikumisteede ja takistuste märgistus', 'CURRENT', 100000002, 'INSPECTION_TOPIC__INSPECTION_TOPIC_3', now(), null, 2),
('INSPECTION_TOPIC__INSPECTION_TOPIC_3_2_1','INSPECTION_TOPIC','INSPECTION_TOPIC_3_2_1',TRUE, '3.2.1. Kas liikumisteed on märgistatud korrektselt?', 'CURRENT', 100000001, 'INSPECTION_TOPIC__INSPECTION_TOPIC_3_2', now(), null, 3),
('INSPECTION_TOPIC__INSPECTION_TOPIC_3_2_2','INSPECTION_TOPIC','INSPECTION_TOPIC_3_2_2',TRUE, '3.2.2. Kas liikumisteel esinevad takistused on märgistatud?', 'CURRENT', 100000002, 'INSPECTION_TOPIC__INSPECTION_TOPIC_3_2', now(), null,3 ),
('INSPECTION_TOPIC__INSPECTION_TOPIC_3_2_3','INSPECTION_TOPIC','INSPECTION_TOPIC_3_2_3',TRUE, '3.2.3. Kas tõkestatud liikumisteede puhul on liikumine märgistusega ümber suunatud?', 'CURRENT', 100000003, 'INSPECTION_TOPIC__INSPECTION_TOPIC_3_2', now(), null, 3);
('INSPECTION_TOPIC__INSPECTION_TOPIC_3_2_3','INSPECTION_TOPIC','INSPECTION_TOPIC_3_2_3',TRUE, '3.2.3. Kas tõkestatud liikumisteede puhul on liikumine märgistusega ümber suunatud?', 'CURRENT', 100000003, 'INSPECTION_TOPIC__INSPECTION_TOPIC_3_2', now(), null, 3),
('TEST_RISK_BUSINESS_TYPE_CATEGORY__FISHING', 'TEST_RISK_BUSINESS_TYPE_CATEGORY', 'FISHING', FALSE, 'just fishing stuff', 'CURRENT', 100000001, null,now(),null, null),
('TEST_RISK_BUSINESS_TYPE_CATEGORY__DEMOLITION', 'TEST_RISK_BUSINESS_TYPE_CATEGORY', 'DEMOLITION', FALSE, 'wrecking stuff', 'CURRENT', 100000002, null,now(),null, null),
('TEST_RISK_BUSINESS_TYPE_CATEGORY__MEDICINE', 'TEST_RISK_BUSINESS_TYPE_CATEGORY', 'MEDICINE', FALSE, 'fixing humanoids', 'CURRENT', 100000003, null,now(),null, null),
('TEST_RISK_FACTOR_CATEGORY__RADIATION', 'TEST_RISK_FACTOR_CATEGORY', 'RADIATION', FALSE, 'Radiatsiooni tase', 'CURRENT', 100000001, null,now(),null, null),
('TEST_RISK_FACTOR_CATEGORY__ABSORB', 'TEST_RISK_FACTOR_CATEGORY', 'ABSORB', FALSE, 'Imavuse tähtis mõõdik', 'CURRENT', 100000002, null,now(),null, null),
('TEST_RISK_ASSESSMENT_STATUS__IN_PROGRESS', 'TEST_RISK_ASSESSMENT_STATUS', 'IN_PROGRESS', FALSE, 'Tegemisel', 'CURRENT', 100000001, null,now(),null, null),
('TEST_RISK_ASSESSMENT_STATUS__CONFIRMED', 'TEST_RISK_ASSESSMENT_STATUS', 'CONFIRMED', FALSE, 'Kinnitatud', 'CURRENT', 100000002, null,now(),null, null),
('TEST_RISK_ASSESSMENT_STATUS__ARCHIVED', 'TEST_RISK_ASSESSMENT_STATUS', 'ARCHIVED', FALSE, 'Arhiveeritud', 'CURRENT', 100000003, null,now(),null, null);
/*ATTRIBUTE VALUES*/
INSERT INTO classifier_attribute_value (
......
Markdown is supported
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