updated code

This commit is contained in:
harish
2024-10-19 13:10:13 +05:30
174 changed files with 7882 additions and 1012 deletions

View File

@@ -539,7 +539,7 @@
<dropColumn tableName="FORM"
columnName="order_no" />
</changeSet>
<changeSet id="03-09-2024_1" author="Rajesh Khore">
<sql>
TRUNCATE TABLE FORM_FIELD RESTART IDENTITY;
@@ -696,7 +696,7 @@
path="classpath:db/dump/inserted_form_field_data_13_09_2024.sql" />
</changeSet>
<changeSet id="12-09-2024_1" author="Rajesh Khore">
<addColumn tableName="flow_edges">
<column name="tracking_id" type="VARCHAR(255)"></column>
@@ -710,29 +710,43 @@
<sqlFile dbms="postgresql"
path="classpath:db/dump/updated_form_field_data_16-09-2024.sql" />
</changeSet>
<changeSet id="23-09-2024_1" author="Harish Bagora" dbms="postgresql">
<!-- Procedure for automatically setting the updated_date -->
<createProcedure>
CREATE OR REPLACE FUNCTION gepafin_schema.clock_timestamp_updated_date_column()
RETURNS TRIGGER
LANGUAGE plpgsql
AS $$
BEGIN
NEW.updated_date = clock_timestamp();
RETURN NEW;
END;
$$;
</createProcedure>
<createProcedure>
CREATE OR REPLACE FUNCTION gepafin_schema.clock_timestamp_created_date_column()
RETURNS TRIGGER
LANGUAGE plpgsql
AS $$
BEGIN
IF NEW.created_date IS NULL THEN
NEW.created_date = clock_timestamp();
END IF;
NEW.updated_date = NEW.created_date;
RETURN NEW;
END;
$$;
</createProcedure>
</changeSet>
<changeSet id="23-09-2024_1" author="Rajesh Khore">
<createTable tableName="saml_response_log">
<column name="id" type="INTEGER" autoIncrement="true">
</column>
<column name="request" type="TEXT">
</column>
<column name="response" type="TEXT">
</column>
<column name="authentication_object" type="TEXT">
</column>
<column name="exception_object" type="TEXT">
</column>
<column name="created_date" type="TIMESTAMP WITHOUT TIME ZONE">
</column>
<column name="updated_date" type="TIMESTAMP WITHOUT TIME ZONE">
</column>
<createTable tableName="saml_response">
<column name="id" type="INTEGER" autoIncrement="true"></column>
<column name="authentication_object" type="TEXT"> </column>
<column name="created_date" type="TIMESTAMP WITHOUT TIME ZONE"></column>
<column name="token" type="varchar(255)"></column>
<column name="updated_date" type="TIMESTAMP WITHOUT TIME ZONE"></column>
</createTable>
</changeSet>
<changeSet id="25-09-2024_1" author="Harish Bagora">
@@ -769,17 +783,241 @@
</column>
</createTable>
</changeSet>
<changeSet id="25-09-2024_2" author="Harish Bagora">
<createTable tableName="USER_HUB">
<column name="id" type="BIGINT" autoIncrement="true">
<constraints primaryKey="true" nullable="false" unique="true" primaryKeyName="user_hub_pkey"/>
<changeSet id="25-09-2024_2" author="Nisha kashyap">
<update tableName="form_field">
<column name="name" value="textinput" />
<where>id = 13</where>
</update>
</changeSet>
<changeSet id="25-09-2024_1" author="Rajesh Khore">
<addColumn tableName="gepafin_user">
<column name="codice_fiscale" type="varchar(255)">
<constraints nullable="true" unique="true"/>
</column>
<column name="date_of_birth" type="TIMESTAMP WITHOUT TIME ZONE"></column>
</addColumn>
<dropNotNullConstraint tableName="gepafin_user" columnName="password"/>
</changeSet>
<changeSet id="27-09-2024_1" author="Rajesh Khore">
<createTable tableName="beneficiary">
<column name="id" type="INTEGER" autoIncrement="true">
<constraints nullable="false" primaryKey="true"
primaryKeyName="beneficiary_pkey" />
</column>
<column name="EMAIL" type="VARCHAR(255)" />
<column name="FIRST_NAME" type="VARCHAR(255)" />
<column name="LAST_NAME" type="VARCHAR(255)" />
<column name="PHONE_NUMBER" type="VARCHAR(255)" />
<column name="ORGANIZATION" type="TEXT" />
<column name="ADDRESS" type="TEXT" />
<column name="CITY" type="TEXT" />
<column name="COUNTRY" type="TEXT" />
<column name="CODICE_FISCALE" type="varchar(255)">
<constraints nullable="true" unique="true"/>
</column>
<column name="DATE_OF_BIRTH" type="TIMESTAMP" />
<column name="created_date" type="TIMESTAMP WITHOUT TIME ZONE"/>
<column name="updated_date" type="TIMESTAMP WITHOUT TIME ZONE"/>
</createTable>
<dropColumn tableName="gepafin_user" columnName="codice_fiscale"/>
<dropNotNullConstraint tableName="gepafin_user" columnName="first_name"/>
<dropNotNullConstraint tableName="gepafin_user" columnName="last_name"/>
<addColumn tableName="gepafin_user">
<column name="beneficiary_id" type="INTEGER">
<constraints nullable="true" foreignKeyName="fk_beneficiary_gepafin_user" references="beneficiary(id)"/>
</column>
<column name="hub_id" type="VARCHAR(255)">
</addColumn>
</changeSet>
<changeSet id="27-09-2024_2" author="Rajesh Khore">
<createTable tableName="COMPANY">
<column name="id" type="INTEGER" autoIncrement="true">
<constraints nullable="false" primaryKey="true"
primaryKeyName="company_pkey" />
</column>
<column name="COMPANY_NAME" type="VARCHAR(255)">
<constraints nullable="false"/>
</column>
<column name="VAT_NUMBER" type="VARCHAR(255)">
<constraints nullable="true" unique="true"/>
</column>
<column name="CODICE_FISCALE" type="VARCHAR(255)"/>
<column name="ADDRESS" type="VARCHAR(255)"/>
<column name="PHONE_NUMBER" type="VARCHAR(255)"/>
<column name="CITY" type="VARCHAR(255)"/>
<column name="PROVINCE" type="VARCHAR(255)"/>
<column name="CAP" type="VARCHAR(255)"/>
<column name="COUNTRY" type="VARCHAR(255)"/>
<column name="PEC" type="VARCHAR(255)"/>
<column name="EMAIL" type="VARCHAR(255)"/>
<column name="NUMBER_OF_EMPLOYEES" type="VARCHAR(255)"/>
<column name="ANNUAL_REVENUE" type="NUMERIC"/>
<column name="created_date" type="TIMESTAMP WITHOUT TIME ZONE"/>
<column name="updated_date" type="TIMESTAMP WITHOUT TIME ZONE"/>
</createTable>
</changeSet>
<changeSet id="27-09-2024_3" author="Rajesh Khore">
<createTable tableName="USER_WITH_COMPANY">
<column name="id" type="INTEGER" autoIncrement="true">
<constraints nullable="false" primaryKey="true"
primaryKeyName="user_with_company_pkey" />
</column>
<column name="USER_ID" type="INTEGER"/>
<column name="BENEFICIARY_ID" type="INTEGER"/>
<column name="COMPANY_ID" type="INTEGER"/>
<column name="created_date" type="TIMESTAMP WITHOUT TIME ZONE"/>
<column name="updated_date" type="TIMESTAMP WITHOUT TIME ZONE"/>
</createTable>
</changeSet>
<changeSet id="27-09-2024_4" author="Rajesh Khore">
<addColumn tableName="APPLICATION">
<column name="COMPANY_ID" type="INTEGER">
<constraints nullable="true" foreignKeyName="fk_COMPANY_APPLICATION" references="company(id)"/>
</column>
</addColumn>
<addColumn tableName="FAQ">
<column name="COMPANY_ID" type="INTEGER"/>
</addColumn>
</changeSet>
<changeSet id="01-10-2024_1" author="Nisha Kashyap">
<addColumn tableName="call">
<column name="amount_min" type="numeric"></column>
<column name="phone_number" type="VARCHAR(255)"></column>
<column name="email" type="VARCHAR(255)"></column>
<column name="end_time" type="TIME"></column>
<column name="start_time" type="TIME"></column>
</addColumn>
</changeSet>
<changeSet id="03-10-2024_1" author="Nisha Kashyap">
<sql>
TRUNCATE TABLE FORM_FIELD RESTART IDENTITY;
</sql>
<sqlFile dbms="postgresql"
path="classpath:db/dump/updated_form_field_data_03-10-2024.sql" />
</changeSet>
<changeSet id="08-10-2024_1" author="Rajesh Khore">
<createTable tableName="user_company_delegation">
<column name="id" type="INTEGER" autoIncrement="true">
<constraints nullable="false" primaryKey="true"
primaryKeyName="user_company_delegation_pkey" />
</column>
<column name="USER_ID" type="INTEGER" />
<column name="COMPANY_ID" type="INTEGER" />
<column name="BENEFICIARY_ID" type="INTEGER" />
<column name="FILE_NAME" type="VARCHAR(255)" />
<column name="FILE_PATH" type="VARCHAR(255)" />
<column name="STATUS" type="VARCHAR(50)" />
<column name="created_date" type="TIMESTAMP WITHOUT TIME ZONE" />
<column name="updated_date" type="TIMESTAMP WITHOUT TIME ZONE" />
</createTable>
<!-- Optional: If you have any indexes, constraints, or foreign keys -->
<addForeignKeyConstraint
baseTableName="user_company_delegation" baseColumnNames="USER_ID"
referencedTableName="gepafin_user" referencedColumnNames="ID"
constraintName="fk_user_company_delegation_gepafin_user" />
<addForeignKeyConstraint
baseTableName="user_company_delegation" baseColumnNames="COMPANY_ID"
referencedTableName="company" referencedColumnNames="ID"
constraintName="fk_user_company_delegation_company" />
<addForeignKeyConstraint
baseTableName="user_company_delegation"
baseColumnNames="BENEFICIARY_ID" referencedTableName="beneficiary"
referencedColumnNames="ID"
constraintName="fk_user_company_delegation_beneficiary" />
</changeSet>
<changeSet id="08-10-2024_2" author="Rajesh Khore">
<addColumn tableName="user_with_company">
<column name="IS_LEGAL_REPRESENTANT" type="BOOLEAN" />
</addColumn>
</changeSet>
<changeSet id="03-10-2024_2" author="Nisha Kashyap">
<sql>
TRUNCATE TABLE FORM_FIELD RESTART IDENTITY;
</sql>
<sqlFile dbms="postgresql"
path="classpath:db/dump/updated_form_field_data_03-10-2024_1.sql" />
</changeSet>
<changeSet id="07-10-2024_1" author="Harish Bagora">
<addColumn tableName="beneficiary">
<column name="PRIVACY" type="BOOLEAN" defaultValueBoolean="false"/>
<column name="TERMS" type="BOOLEAN" defaultValueBoolean="false"/>
<column name="MARKETING" type="BOOLEAN"/>
<column name="OFFERS" type="BOOLEAN"/>
<column name="THIRD_PARTY" type="BOOLEAN"/>
<column name="email_pec" type="VARCHAR(255)"/>
</addColumn>
<addNotNullConstraint tableName="beneficiary" columnName="PRIVACY" />
<addNotNullConstraint tableName="beneficiary" columnName="TERMS" />
<addColumn tableName="COMPANY">
<column name="contact_name" type="VARCHAR(255)"/>
<column name="contact_email" type="VARCHAR(255)"/>
</addColumn>
</changeSet>
<changeSet id="07-10-2024_2" author="Nisha Kashyap">
<modifyDataType
tableName="application_form_field"
columnName="field_value"
newDataType="TEXT"/>
</changeSet>
<changeSet id="08-10-2024_2" author="Nisha Kashyap">
<createTable tableName="protocol">
<column name="id" type="INTEGER" autoIncrement="true">
<constraints nullable="false" primaryKey="true"
primaryKeyName="protocol_pkey" />
</column>
<column name="protocol_number" type="INTEGER">
<constraints nullable="false"/>
</column>
<column name="year" type="INTEGER">
<constraints nullable="false"/>
</column>
<column name="call_id" type="INTEGER">
<constraints nullable="false"/>
</column>
<column name="time" type="TIME">
<constraints nullable="false"/>
</column>
<column name="application_id" type="INTEGER">
<constraints nullable="false"/>
</column>
<column name="created_date" type="TIMESTAMP WITHOUT TIME ZONE"/>
<column name="updated_date" type="TIMESTAMP WITHOUT TIME ZONE"/>
</createTable>
<addColumn tableName="application">
<column name="protocol_number" type="INTEGER">
</column>
</addColumn>
</changeSet>
<changeSet id="11-10-2024_1" author="Harish Bagora">
<createTable tableName="beneficiary_preferred_call">
<column autoIncrement="true" name="id" type="BIGINT">
<constraints nullable="false" primaryKey="true" primaryKeyName="beneficiary_preferred_call_pkey"/>
</column>
<column name="beneficiary_id" type="BIGINT"/>
<column name="user_id" type="BIGINT">
<constraints nullable="false"/>
</column>
<column name="company_id" type="BIGINT"/>
<column name="call_id" type="BIGINT"/>
<column name="status" type="VARCHAR(255)"/>
<column name="created_date" type="TIMESTAMP WITHOUT TIME ZONE">
<constraints nullable="true"/>
</column>
@@ -788,5 +1026,138 @@
</column>
</createTable>
</changeSet>
<changeSet id="10-10-2024_1" author="Rajesh Khore">
<createTable tableName="system_email_template">
<column name="id" type="INTEGER" autoIncrement="true">
<constraints nullable="false" primaryKey="true"
primaryKeyName="system_email_template_pkey" />
</column>
<column name="TEMPLATE_NAME" type="VARCHAR(255)"/>
<column name="TYPE" type="VARCHAR(255)"/>
<column name="HTML_CONTENT" type="TEXT"/>
<column name="SUBJECT" type="TEXT"/>
<column name="JSON" type="TEXT"/>
<column name="SYSTEM" type="BOOLEAN"/>
<column name="IS_DELETED" type="BOOLEAN" defaultValueBoolean="true">
<constraints nullable="false"/>
</column>
<column name="created_date" type="TIMESTAMP WITHOUT TIME ZONE"/>
<column name="updated_date" type="TIMESTAMP WITHOUT TIME ZONE"/>
</createTable>
</changeSet>
<changeSet id="10-10-2024_2" author="Rajesh Khore">
<sqlFile dbms="postgresql"
path="db/dump/insert_system_email_template_for_application_submission.sql" />
</changeSet>
<changeSet id="12-10-2024_1" author="Rajesh Khore">
<createTable tableName="application_signed_document">
<column name="id" type="INTEGER" autoIncrement="true">
<constraints primaryKey="true" primaryKeyName="application_signed_document_pkey" nullable="false"/>
</column>
<column name="APPLICATION_ID" type="INTEGER">
<constraints nullable="false"/>
</column>
<column name="FILE_NAME" type="VARCHAR(255)"/>
<column name="FILE_PATH" type="VARCHAR(255)"/>
<column name="STATUS" type="VARCHAR(64)"/>
<column name="created_date" type="TIMESTAMP WITHOUT TIME ZONE"/>
<column name="updated_date" type="TIMESTAMP WITHOUT TIME ZONE"/>
</createTable>
<addForeignKeyConstraint baseTableName="application_signed_document"
baseColumnNames="APPLICATION_ID"
referencedTableName="application"
referencedColumnNames="ID"
constraintName="fk_application_signed_document_application"/>
</changeSet>
<changeSet id="13-10-2024_1" author="Rajesh Khore">
<update tableName="form_field">
<column name="validators" value='{"custom": "nonEmptyTables"}' />
<where>name='table'</where>
</update>
</changeSet>
<changeSet id="14-10-2024_1" author="Harish Bagora">
<sqlFile dbms="postgresql"
path="db/dump/update_system_email_template_of_application_submission.sql" />
</changeSet>
<changeSet id="15-10-2024_2" author="Nisha Kashyap">
<preConditions onFail="MARK_RAN">
<not>
<tableExists tableName="login_attempt" />
</not>
</preConditions>
<createTable tableName="login_attempt">
<column autoIncrement="true" name="id" type="INTEGER">
<constraints nullable="false" primaryKey="true"
primaryKeyName="login_attempt_pkey" />
</column>
<column name="username" type="VARCHAR(255)">
<constraints nullable="false"/>
</column>
<column name="user_id" type="INTEGER" />
<column name="attempt_date" type="TIMESTAMP WITHOUT TIME ZONE" >
<constraints nullable="false"/>
</column>
<column name="ip_address" type="VARCHAR(100)" />
<column name="user_agent" type="VARCHAR(255)" />
<column name="result" type="VARCHAR(100)">
<constraints nullable="false"/>
</column>
<column name="attempt_type" type="VARCHAR(100)" defaultValue="LOGIN">
<constraints nullable="false"/>
</column>
<column name="error_msg" type="VARCHAR(255)" />
</createTable>
</changeSet>
<changeSet id="15-10-2024_1" author="Harish Bagora">
<insert tableName="gepafin_user">
<column name="password" value="$2a$10$doUyOcEm8WPuFfpFT5y18.1DvZzF7exbqgy9X0P27cUBK7YWbfzzS"/>
<column name="email" value="instructor@test.test"/>
<column name="first_name" value="Test"/>
<column name="last_name" value="Instructor"/>
<column name="phone_number" value="9876543210"/>
<column name="role_id" valueComputed="3"/>
<column name="status" value="ACTIVE"/>
<column name="last_login" value="2024-10-15 00:00:00"/>
<column name="created_date" value="2024-10-15 00:00:00"/>
<column name="updated_date" value="2024-10-15 00:00:00"/>
<column name="organization" value="PreInstructorOrg"/>
<column name="address" value="789 Victory Road"/>
<column name="city" value="Naples"/>
<column name="country" value="Italy"/>
</insert>
</changeSet>
<changeSet id="16-10-2024_1" author="Harish Bagora">
<addColumn tableName="user_with_company">
<column name="is_deleted" type="BOOLEAN" defaultValueBoolean="false">
<constraints nullable="false"/>
</column>
</addColumn>
</changeSet>
<changeSet id="17-10-2024_1" author="Rajesh Khore">
<addColumn tableName="GEPAFIN_USER">
<column name="HUB_ID" type="INTEGER">
<constraints nullable="false"
foreignKeyName="fk_hub_gepafin_user"
references="hub(id)" />
</column>
</addColumn>
<addColumn tableName="CALL">
<column name="HUB_ID" type="INTEGER">
<constraints nullable="false"
foreignKeyName="fk_hub_gepafin_call"
references="call(id)" />
</column>
</addColumn>
</changeSet>
</databaseChangeLog>

View File

@@ -5,4 +5,5 @@
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.23.xsd">
<include file="db/changelog/db.changelog-1.0.0.xml"/>
<include file="db/changelog/dynamic-triggers.xml" />
</databaseChangeLog>

View File

@@ -0,0 +1,51 @@
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/pro http://www.liquibase.org/xml/ns/pro/liquibase-pro-4.0.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.23.xsd">
<changeSet id="23-09-2024_3" author="Harish Bagora" runAlways="true">
<sql splitStatements="false">
DO $$
DECLARE
r RECORD;
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'
)
LOOP
EXECUTE format(
'CREATE OR REPLACE TRIGGER tg_gepafin_schema_updated_at_%I
BEFORE UPDATE ON gepafin_schema.%I
FOR EACH ROW
EXECUTE FUNCTION gepafin_schema.clock_timestamp_updated_date_column()',
r.table_name, r.table_name
);
END LOOP;
-- 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'
)
LOOP
EXECUTE format(
'CREATE OR REPLACE TRIGGER tg_gepafin_schema_created_at_%I
BEFORE INSERT ON gepafin_schema.%I
FOR EACH ROW
EXECUTE FUNCTION gepafin_schema.clock_timestamp_created_date_column()',
r.table_name, r.table_name
);
END LOOP;
END;
$$ LANGUAGE plpgsql;
</sql>
</changeSet>
</databaseChangeLog>

View File

@@ -0,0 +1,34 @@
INSERT INTO gepafin_schema.system_email_template (id, template_name, "type", html_content, subject, "json", "system", is_deleted, created_date, updated_date) VALUES(1, 'Application submission template to beneficiary and company', 'APPLICATION_SUBMISSION_TO_USER_AND_COMPANY', '<html>
<body style="font-family: Arial, sans-serif; color: #333; line-height: 1.6;">
<div style="padding: 20px; border: 1px solid #ddd; border-radius: 8px; max-width: 600px; margin: auto;">
<p>Buongiorno,</p>
<p>
Si comunica che, in riferimento alla domanda di concessione di
Finanziamento agevolato a valere sul Fondo prestiti
<strong>{{call_name}}</strong> di cui all''oggetto, la stessa è stata
regolarmente acquisita ed è stata registrata con Protocollo n.
<strong>{{protocol_number}}</strong> del <strong>{{date}}</strong> alle
<strong>{{time}}</strong>.
</p>
<p>Distinti Saluti,</p>
<p>
<strong>Gepafin S.p.a.</strong>
</p>
</div>
</body>
</html>', 'BANDO {{call_name}} - Domanda di concessione di finanziamento agevolato {{company_name}}', NULL, true, false, '2024-10-10 16:10:31.035', '2024-10-11 10:09:23.037');
INSERT INTO gepafin_schema.system_email_template (id, template_name, "type", html_content, subject, "json", "system", is_deleted, created_date, updated_date) VALUES(2, 'Application submission template to gepafin', 'APPLICATION_SUBMISSION_TO_GEPAFIN', '<html>
<body style="font-family: Arial, sans-serif; color: #333; line-height: 1.6;">
<div style="padding: 20px; border: 1px solid #ddd; border-radius: 8px; max-width: 600px; margin: auto;">
<p>
In riferimento alla domanda di concessione di Finanziamento agevolato a valere sul Fondo prestiti
<strong>{{call_name}}</strong> di cui alloggetto, la stessa è stata regolarmente acquisita ed è stata
registrata con Protocollo n. <strong>{{protocol_number}}</strong> del <strong>{{date}}</strong> e <strong>{{time}}</strong>.
</p>
<p>Distinti Saluti,</p>
<p>
<strong>Gepafin S.p.a.</strong>
</p>
</div>
</body>
</html>', 'BANDO {{call_name}} - Domanda di concessione di finanziamento agevolato {{company_name}}', NULL, true, false, '2024-10-10 16:10:31.035', '2024-10-11 10:09:57.224');

View File

@@ -0,0 +1,19 @@
UPDATE gepafin_schema.system_email_template
SET html_content = '<html>
<body style="font-family: Arial, sans-serif; color: #333; line-height: 1.6;">
<div style="padding: 20px; border: 1px solid #ddd; border-radius: 8px; max-width: 600px; margin: auto;">
<p>
In riferimento alla domanda di concessione di Finanziamento agevolato a valere sul Fondo prestiti
<strong>{{call_name}}</strong> di cui alloggetto, la stessa è stata regolarmente acquisita ed è stata
registrata con Protocollo n. <strong>{{protocol_number}}</strong> del <strong>{{date}}</strong> alle <strong>{{time}}</strong>.
</p>
<p>Distinti Saluti,</p>
<p>
<strong>Gepafin S.p.a.</strong>
</p>
</div>
</body>
</html>',
updated_date = '2024-10-14 10:00:00'
WHERE type = 'APPLICATION_SUBMISSION_TO_GEPAFIN';

View File

@@ -0,0 +1,99 @@
INSERT INTO FORM_FIELD (SORT_ORDER, NAME, LABEL, DESCRIPTION, SETTINGS, VALIDATORS, CREATED_DATE, UPDATED_DATE)
VALUES
(1, 'textinput', 'Testo Breve', 'Per risposte concise (nomi, titoli, brevi descrizioni)',
'[{"name": "label", "value": "Testo Breve"}, {"name": "placeholder", "value": ""}]',
'{"isRequired": false, "custom": null}',
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
(2, 'textarea', 'Testo Lungo', 'Campo di testo esteso per paragrafi, descrizioni, proposte',
'[{"name": "label", "value": "Testo Lungo"}, {"name": "placeholder", "value": ""}]',
'{"isRequired": false, "custom": null}',
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
(3, 'wysiwyg', 'Campo di Testo Formattato', 'Editor avanzato per testo con formattazione',
'[{"name": "label", "value": "Testo Formattato"}, {"name": "placeholder", "value": ""}]',
'{"isRequired": false, "custom": null}',
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
(4, 'numberinput', 'Campo Numerico', 'Per l''inserimento di valori numerici (quantità, importi, percentuali)',
'[{"name": "label", "value": "Numero"}, {"name": "placeholder", "value": "0"}, {"name": "step", "value": "0"}]',
'{"isRequired": false, "custom": null}',
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
(5, 'radio', 'Scelta Singola', 'Gruppo di opzioni per selezione singola',
'[{"name": "label", "value": "Scelta Singola"}, {"name": "options", "value": "[]"}]',
'{"isRequired": false, "custom": null}',
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
(6, 'select', 'Menu a Tendina', 'Selezione da opzioni predefinite',
'[{"name": "label", "value": "Menu a Tendina"}, {"name": "options", "value": "[]"}]',
'{"isRequired": false,"custom": null}',
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
(7, 'checkboxes', 'Scelta Multipla', 'Gruppo di opzioni per selezione singola o multipla',
'[{"name": "label", "value": "Scelta Multipla"}, {"name": "options", "value": "[]"}]',
'{"isRequired": false,"custom": null}',
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
(8, 'switch', 'Casella di Spunta', 'Per selezioni binarie, accettazioni, conferme',
'[{"name": "label", "value": "Casella di Spunta"}]',
'{"isRequired": false, "custom": null}',
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
(9, 'datepicker', 'Data', 'Selezione di data',
'[{"name": "label", "value": "Data"}]',
'{"isRequired": false, "custom": null}',
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
(10, 'fileupload', 'Caricamento File', 'Per l''upload di documenti o immagini',
'[{"name": "label", "value": "Caricamento File"}, {"name": "mime", "value": "[]"}]',
'{"isRequired": false, "maxSize": 100000, "custom": null}',
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
(11, 'textinput', 'Campo Partita IVA', 'Specifico per l''inserimento del numero di Partita IVA',
'[{"name": "label", "value": "Partita IVA"}, {"name": "placeholder", "value": ""}]',
'{"isRequired": true,"custom": "isPIVA"}',
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
(12, 'textinput', 'Campo Codice Fiscale', 'Specifico per l''inserimento del Codice Fiscale italiano per persone fisiche e giuridiche',
'[{"name": "label", "value": "Codice Fiscale"}, {"name": "placeholder", "value": ""}]',
'{"isRequired": true, "custom": "isCodiceFiscale"}',
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
(13, 'numberinput', 'Campo CAP', 'Per l''inserimento del Codice di Avviamento Postale',
'[{"name": "label", "value": "CAP"}, {"name": "placeholder", "value": ""}]',
'{"isRequired": true,"custom": "isCAP"}',
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
(14, 'textinput', 'Campo IBAN', 'Per l''inserimento del codice IBAN',
'[{"name": "label", "value": "IBAN"}, {"name": "placeholder", "value": ""}]',
'{"isRequired": true,"custom": "isIBAN"}',
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
(15, 'textinput', 'Campo Email', 'Per l''inserimento di indirizzi email standard (non PEC)',
'[{"name": "label", "value": "Campo Email"}, {"name": "placeholder", "value": "nome@esempio.it"}]',
'{"isRequired": false, "custom": "isEmail"}',
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
(16, 'textinput', 'Campo PEC', 'Specifico per l''inserimento di un indirizzo di Posta Elettronica Certificata',
'[{"name": "label", "value": "Campo PEC"}, {"name": "placeholder", "value": "nome@pec.it"}]',
'{"isRequired": false, "custom": "isEmailPEC"}',
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
(17, 'textinput', 'Campo URL', 'Per l''inserimento di indirizzi web',
'[{"name": "label", "value": "Indirizzo URL"}, {"name": "placeholder", "value": ""}]',
'{"isRequired": false, "custom": "isUrl"}',
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
(18, 'textinput', 'Marca da bollo', 'Per inserire codice di marca da bollo',
'[{"name": "label", "value": "Marca da bollo"}, {"name": "placeholder", "value": "Numero identificativo"}]',
'{"isRequired": false, "custom": "isMarcaDaBollo"}',
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
(19, 'paragraph', 'Paragrafo', 'Semplice testo formattato',
'[{"name": "text", "value": ""}]', '{}',
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
(20, 'table', 'Tabella', 'Tabella',
'[{"name": "label", "value": "Tabella"}, {"name": "table_columns", "value": {}}]', '{}',
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);

View File

@@ -0,0 +1,101 @@
INSERT INTO FORM_FIELD (SORT_ORDER, NAME, LABEL, DESCRIPTION, SETTINGS, VALIDATORS, CREATED_DATE, UPDATED_DATE)
VALUES
(1, 'textinput', 'Testo Breve', 'Per risposte concise (nomi, titoli, brevi descrizioni)',
'[{"name": "label", "value": "Testo Breve"}, {"name": "placeholder", "value": ""}]',
'{"isRequired": false, "minLength": null, "maxLength": null, "pattern": null, "custom": null}',
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
(2, 'textarea', 'Testo Lungo', 'Campo di testo esteso per paragrafi, descrizioni, proposte',
'[{"name": "label", "value": "Testo Lungo"}, {"name": "placeholder", "value": ""}]',
'{"isRequired": false, "minLength": null, "maxLength": null, "pattern": null, "custom": null}',
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
(3, 'wysiwyg', 'Campo di Testo Formattato', 'Editor avanzato per testo con formattazione',
'[{"name": "label", "value": "Testo Formattato"}, {"name": "placeholder", "value": ""}]',
'{"isRequired": false, "minLength": null, "maxLength": null, "pattern": null, "custom": null}',
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
(4, 'numberinput', 'Campo Numerico', 'Per l''inserimento di valori numerici (quantità, importi, percentuali)',
'[{"name": "label", "value": "Numero"}, {"name": "placeholder", "value": "0"}, {"name": "step", "value": "0"}]',
'{"isRequired": false, "min": null, "max": null, "pattern": null, "custom": null}',
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
(5, 'radio', 'Scelta Singola', 'Gruppo di opzioni per selezione singola',
'[{"name": "label", "value": "Scelta Singola"}, {"name": "options", "value": []}]',
'{"isRequired": false, "custom": null}',
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
(6, 'select', 'Menu a Tendina', 'Selezione da opzioni predefinite',
'[{"name": "label", "value": "Menu a Tendina"}, {"name": "options", "value": []}]',
'{"isRequired": false, "custom": null}',
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
(7, 'checkboxes', 'Scelta Multipla', 'Gruppo di opzioni per selezione singola o multipla',
'[{"name": "label", "value": "Scelta Multipla"}, {"name": "options", "value": []}]',
'{"isRequired": false, "min": null, "max": null, "custom": null}',
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
(8, 'switch', 'Casella di Spunta', 'Per selezioni binarie, accettazioni, conferme',
'[{"name": "label", "value": "Casella di Spunta"}]',
'{"isRequired": false}',
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
(9, 'datepicker', 'Data', 'Selezione di data',
'[{"name": "label", "value": "Data"}]',
'{"isRequired": false}',
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
(10, 'fileupload', 'Caricamento File', 'Per l''upload di documenti o immagini',
'[{"name": "label", "value": "Caricamento File"}, {"name": "mime", "value": []}]',
'{"isRequired": false, "maxSize": 100000}',
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
(11, 'textinput', 'Campo Partita IVA', 'Specifico per l''inserimento del numero di Partita IVA',
'[{"name": "label", "value": "Partita IVA"}, {"name": "placeholder", "value": ""}]',
'{"isRequired": true, "custom": "isPIVA"}',
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
(12, 'textinput', 'Campo Codice Fiscale','Specifico per l''inserimento del Codice Fiscale italiano per persone fisiche e giuridiche',
'[{"name": "label", "value": "Codice Fiscale"}, {"name": "placeholder", "value": ""}]',
'{"isRequired": true, "custom": "isCodiceFiscale"}',
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
(13, 'textinput', 'Campo CAP','Per l''inserimento del Codice di Avviamento Postale',
'[{"name": "label", "value": "CAP"}, {"name": "placeholder", "value": ""}]',
'{"isRequired": true, "custom": "isCAP"}',
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
(14, 'textinput', 'Campo IBAN', 'Per l''inserimento del codice IBAN',
'[{"name": "label", "value": "IBAN"}, {"name": "placeholder", "value": ""}]',
'{"isRequired": true, "custom": "isIBAN"}',
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
(15, 'textinput', 'Campo Email', 'Per l''inserimento di indirizzi email standard (non PEC)',
'[{"name": "label", "value": "Campo Email"}, {"name": "placeholder", "value": "nome@esempio.it"}]',
'{"isRequired": false, "custom": "isEmail"}',
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
(16, 'textinput', 'Campo PEC', 'Specifico per l''inserimento di un indirizzo di Posta Elettronica Certificata',
'[{"name": "label", "value": "Campo PEC"}, {"name": "placeholder", "value": "nome@pec.it"}]',
'{"isRequired": false, "custom": "isEmailPEC"}',
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
(17, 'textinput', 'Campo URL', 'Per l''inserimento di indirizzi web',
'[{"name": "label", "value": "Indirizzo URL"}, {"name": "placeholder", "value": ""}]',
'{"isRequired": false, "custom": "isUrl"}',
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
(18, 'textinput', 'Marca da bollo', 'Per inserire codice di marca da bollo',
'[{"name": "label", "value": "Marca da bollo"}, {"name": "placeholder", "value": "Numero identificativo"}]',
'{"isRequired": false, "custom": "isMarcaDaBollo"}',
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
(19, 'paragraph', 'Paragrafo', 'Semplice testo formattato',
'[{"name": "text", "value": ""}]',
'{}',
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
(20, 'table', 'Tabella', 'Tabella',
'[{"name": "label", "value": "Tabella"}, {"name": "table_columns", "value": []}]',
'{}',
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);