Skip to content

Commit 49bc667

Browse files
committed
sormas schema and validation properties
1 parent 3c52600 commit 49bc667

File tree

2 files changed

+50
-1
lines changed

2 files changed

+50
-1
lines changed

sormas-api/src/main/resources/validations.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,4 +329,5 @@ systemConfigurationValueValidationNotAEmail = Value is not a valid email address
329329
systemConfigurationValueValidationNotAValidEmailsenderName = Value is not a valid email sender name. Name should contain only alphabets.
330330
systemConfigurationValueValidationNotAValidSmsSenderName = Value is not a valid name. Name should contain only letters and numbers without spaces & special characters. For more info please see https://developer.vonage.com/en/messaging/sms/guides/custom-sender-id .
331331
smsAuthKeyValueValidation = SMS Auth key value is not valid
332-
smsAuthSecretValueValidation = SMS Auth secret value is not valid
332+
smsAuthSecretValueValidation = SMS Auth secret value is not valid
333+
systemConfigurationValueValidationInvalidBackgroundColor=Pre-defined values are: green, red, indigo, gray, default (case-sensitive) otherwise must match hexadecimal format, example: #dd2b0e or #4AA

sormas-backend/src/main/resources/sql/sormas_schema.sql

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15062,4 +15062,52 @@ ALTER TABLE testreport_history ADD COLUMN serotype character varying(255);
1506215062
ALTER TABLE testreport_history ADD COLUMN straincallstatus character varying(255);
1506315063

1506415064
INSERT INTO schema_version (version_number, comment) VALUES (602, 'External message additional fields');
15065+
15066+
-- System configuration to visually distinguish different system types
15067+
15068+
ALTER TABLE systemconfigurationvalue
15069+
ADD CONSTRAINT uk_systemconfigurationvalue_config_key UNIQUE (config_key);
15070+
15071+
DO
15072+
$$
15073+
DECLARE
15074+
general_configuration_id bigint;
15075+
15076+
BEGIN
15077+
-- Check if the category 'EMAIL' already exists
15078+
SELECT id
15079+
INTO general_configuration_id
15080+
FROM systemconfigurationcategory
15081+
WHERE name = 'GENERAL_CATEGORY';
15082+
15083+
-- Insert the general category if it doesn't exist
15084+
IF
15085+
general_configuration_id IS NULL THEN
15086+
INSERT INTO systemconfigurationcategory(id, uuid, changedate, creationdate, name, caption, description)
15087+
VALUES (nextval('entity_seq'), generate_base32_uuid(), now(), now(), 'GENERAL_CATEGORY', 'i18n/General/categoryGeneral',
15088+
'i18n/General/categoryGeneral')
15089+
RETURNING id INTO general_configuration_id;
15090+
END IF;
15091+
15092+
-- Insert new configuration if missing
15093+
15094+
INSERT INTO systemconfigurationvalue(config_key, config_value, category_id, value_optional, value_pattern,
15095+
value_encrypt, data_provider, validation_message, changedate, creationdate,
15096+
id,
15097+
uuid)
15098+
VALUES ('MENU_BACKGROUND_COLOR', 'default', general_configuration_id, true,
15099+
'^(default|red|green|indigo|gray)|(#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}))$', false,
15100+
null,
15101+
'i18n/systemConfigurationValueValidationInvalidBackgroundColor', now(), now(), nextval('entity_seq'),
15102+
generate_base32_uuid())
15103+
ON CONFLICT (config_key) DO NOTHING;
15104+
END
15105+
$$
15106+
LANGUAGE plpgsql;
15107+
15108+
15109+
15110+
INSERT INTO schema_version (version_number, comment)
15111+
VALUES (603, 'System configuration: to visually distinguish different system types');
15112+
1506515113
-- *** Insert new sql commands BEFORE this line. Remember to always consider _history tables. ***

0 commit comments

Comments
 (0)