Skip to content

Instantly share code, notes, and snippets.

@vitaly-t
Created June 10, 2022 13:41
Show Gist options
  • Save vitaly-t/d7cdba7c6de24965920a7847fc23f313 to your computer and use it in GitHub Desktop.
Save vitaly-t/d7cdba7c6de24965920a7847fc23f313 to your computer and use it in GitHub Desktop.

FirstHome UI

Steps for changing local UI to use FirstHome interface layouts.

  1. Remove all database schemas.
  2. Re-run the API to auto-create the entire database.
  3. Add a firsthome tenant:
insert into creditlogic.tenants(id, tenant_name, schema_name, created_date, modified_date)
       values('f14874af-0fa9-4871-8a87-0f22428f9528', 'First Home Scheme', 'firsthome', now(), now());
  1. Re-run the API, which now will pick up the new tenant record, and auto-generate firsthome schema.

  2. Set organization to the firsthome tenant for localhost (for creditlogic.hosts + firsthome.cfg_environment):

update creditlogic.hosts set organisation_id = 'f14874af-0fa9-4871-8a87-0f22428f9528' where name = 'localhost';
update firsthome.cfg_environment set organisation_id = 'f14874af-0fa9-4871-8a87-0f22428f9528' where host = 'localhost';
  1. From here,
    • we add organization:
INSERT INTO organisation (id,
                          description,
                          name,
                          version,
                          created_by,
                          modified_by,
                          modified_date,
                          created_date,
                          logo_url,
                          colour_theme,
                          address1,
                          address2,
                          address3,
                          address4,
                          website_url,
                          phone_no,
                          company_email,
                          consent_url,
                          privacy_url,
                          cbi_authorization_no,
                          credit_logic_url,
                          theme_accent_color,
                          theme_primary_color,
                          default_application_fee,
                          outbound_comms_email,
                          stressed_rate_margin,
                          docusign_impersonated_user_id,
                          email_footer_text,
                          self_registration_alert_email,
                          docusign_brand_id,
                          docusign_email_subject,
                          docusign_email_body,
                          parent_id,
                          default_lender,
                          alternate_channel_url,
                          ses_override,
                          haven_source_code,
                          favicon,
                          self_registration_lead_enabled,
                          self_registration_application_enabled,
                          header_image,
                          login_screen_logo,
                          login_image,
                          main_image,
                          main_image_desktop,
                          privacy_policy_url,
                          terms_and_conditions_url,
                          data_protection_url,
                          page_title,
                          theme,
                          contact_phone,
                          clearing_house_id,
                          outbound_comms_bcc_email)
VALUES ('f14874af-0fa9-4871-8a87-0f22428f9528',
        'First Home Scheme',
        'First Home',
        0,
        'd0dc83d0-45a0-11e9-b210-d663bd873d93',
        'd0dc83d0-45a0-11e9-b210-d663bd873d93',
        CURRENT_TIMESTAMP,
        CURRENT_TIMESTAMP,
        'https://firsthome.dev5.creditlogic.net/assets/lg/f14874af_logo.png',
        NULL,
        'Address line 1',
        'Address line 2',
        'Address line 3',
        'Address line 4 / Eircode',
        'www.firsthome.ie',
        '0818 275 662',
        '[email protected]',
        'https://firsthome.ie/consent.html',
        'https://firsthome.ie/privacy.html',
        'C111222',
        'https://firsthome.dev5.creditlogic.net',
        '#5aab43',
        '#ffffff',
        195,
        NULL,
        2,
        NULL,
        NULL,
        NULL,
        NULL,
        NULL,
        NULL,
        NULL,
        NULL,
        NULL,
        false,
        NULL,
        'favicon.ico',
        false,
        true,
        'assets/lg/f14874af_logo.png',
        'assets/lg/f14874af_logo.png',
        'assets/bgs/f14874af_bg_destkop.jpg',
        'assets/bgs/f14874af_bg_mobile.jpg',
        'assets/bgs/f14874af_bg_destkop.jpg',
        'https://www.somewebsitelink.com/privacy',
        'https://www.somewebsitelink.com/terms',
        'https://www.creditlogic.io/',
        'First Home Scheme',
--         'firsthome-theme',
        'creditlogic-theme',
        '0818 275 662',
        'f14874af-0fa9-4871-8a87-0f22428f9528',
        NULL);   
  • and we update organisation IDs:
update app_user set organisation_id = 'f14874af-0fa9-4871-8a87-0f22428f9528';
update alert_preferences set organisation_id = 'f14874af-0fa9-4871-8a87-0f22428f9528';
update task_preferences set organisation_id = 'f14874af-0fa9-4871-8a87-0f22428f9528';
update cfg_application_stage set organisation_id = 'f14874af-0fa9-4871-8a87-0f22428f9528';
update cfg_feature set organisation_id = 'f14874af-0fa9-4871-8a87-0f22428f9528';
update cfg_product set organisation_id = 'f14874af-0fa9-4871-8a87-0f22428f9528';
update cfg_product_profile set organisation_id = 'f14874af-0fa9-4871-8a87-0f22428f9528';
update cfg_document_group set organisation_id = 'f14874af-0fa9-4871-8a87-0f22428f9528';
delete from organisation where id = '40114436-2425-4769-9e04-cc9f66dbb0ee';

The steps above are sufficient to run FirstHome UI, but for complete configuration, you may want to also run all of the scripts from Configuration per environment DB scripts.

@vitaly-t
Copy link
Author

For the last UPDATE-s, need to use on top:

SET SEARCH_PATH = firsthome;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment