Overview
Excerptinfo |
---|
This feature is currently only available for Building Permits and Public Works modules on the portal. |
The Contractor Restriction functionality allows for the
...
setting of
...
restriction for what applications can be applied for, as well as what values may be selected
...
in drop down fields.
Info |
---|
This feature is only available currently for the permits and entitlements modules on the portal |
...
A contractor_classification AIF field must be added to the clients backoffice contractors(license) module for this feature to work.
...
Backoffice
A new Contractor Classification field will be made available and required in the Backoffice Contractors module. This select field will allow for the assigning of one contractor classification to a contractor record.
Warning |
---|
After this feature is enabled, contractors with no classification assigned will not be able to apply for any Building or Public Works applications is restrictions exist. |
Portal
Portal Workflow
The current portal workflow will remain. The user will select the type of permit they are applying for, agree to the terms, select a location and then enter the contact information. When the contractor is selected, the portal will gather the contractors classification and verify if the selected application is valid for the selected contractor.
If the contractor classification does not allow the selected permit type or field selection, a configured message will be displayed and the user will not be able to move forward with the application.
Configuration
Table Structure
Before enabling this feature, ensure the section tables have been created on the portal
Code Block |
---|
-- REQUIRED db struct for permits
CREATE TABLE permits.config_contractor_classification
(
id serial,
project_id integer,
classification character varying,
enabled boolean
)
WITH (
OIDS=FALSE
);
ALTER TABLE permits.config_contractor_classification
OWNER TO north;
GRANT ALL ON TABLE permits.config_contractor_classification TO north;
--GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE permits.config_contractor_classification TO limited;
-- REQUIRED db struct for entitlements
CREATE TABLE entitlements.config_contractor_classification
(
id serial,
project_id integer,
classification character varying,
enabled boolean
)
WITH (
OIDS=FALSE
);
ALTER TABLE entitlements.config_contractor_classification
OWNER TO north;
GRANT ALL ON TABLE entitlements.config_contractor_classification TO north;
--GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE entitlements.config_contractor_classification TO limited;
-- REQUIRED db struct for permits
CREATE TABLE permits.config_contractor_classification_fields
(
id serial,
field_id integer,
classification character varying,
option_value character varying,
enabled boolean
)
WITH (
OIDS=FALSE
);
ALTER TABLE permits.config_contractor_classification_fields
OWNER TO north;
GRANT ALL ON TABLE permits.config_contractor_classification_fields TO north;
--GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE permits.config_contractor_classification_fields TO limited;
-- REQUIRED db struct for entitlements
CREATE TABLE entitlements.config_contractor_classification_fields
(
id serial,
field_id integer,
classification character varying,
option_value character varying,
enabled boolean
)
WITH (
OIDS=FALSE
);
ALTER TABLE entitlements.config_contractor_classification_fields
OWNER TO north;
GRANT ALL ON TABLE entitlements.config_contractor_classification_fields TO north;
--GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE entitlements.config_contractor_classification_fields TO limited;
|
Enabling the feature
Code Block |
---|
-- REQUIRED enable feature on portal
--select setval('public.options_id_seq', 139);
INSERT INTO public.options (name, value) VALUES ('contractor_classification_permits', 'on');
INSERT INTO public.options (name, value) VALUES ('contractor_classification_entitlements', 'on'); |
Basic Configuration options
Application restrictions
Configure which contractor classifications can apply for a permit.
$module.config.contractor_classification
...
Column
...
Description
...
Notes
...
project_id
...
The ID of the project
...
from $module.config_projects
...
classification
...
The textual value of the classification that should be allowed to apply for this project.
...
This must match the value of the contractor_classification AIF in the backoffice exactly
...
enabled
...
boolean (true)
...
Determines if this rule is enforced
Code Block |
---|
-- EXAMPLE specify required classification for permits section project_id of 1
-- if none are specified feature is disabled
INSERT INTO permits.config_contractor_classification (project_id, classification, enabled) VALUES (441, 'Type C Contractor (CC)', 't');
INSERT INTO permits.config_contractor_classification (project_id, classification, enabled) VALUES (441, 'Type A Contractor (AC)', 't');
INSERT INTO entitlements.config_contractor_classification (project_id, classification, enabled) VALUES (6, 'Type C Contractor (CC)', 't');
INSERT INTO entitlements.config_contractor_classification (project_id, classification, enabled) VALUES (6, 'Type A Contractor (AC)', 't'); |
Field Restrictions
Sets which values are available for the configured field based on the contractors classification
This only works with single select fields
...
Column
...
Description
...
Notes
...
field_id
...
The ID of the field
...
From $module.config_fields
...
classification
...
The textual value of the classification that should be allowed to apply for this project.
...
This must match the value of the contractor_classification AIF in the backoffice exactly
...
option_value
...
The value in the select box that should be allowed for this classification
...
enabled
...
boolean (true)
...
Determines if this rule should be enforced
Code Block |
---|
-- EXAMPLE relate a field id to allowed values for a classification type
INSERT INTO permits.config_contractor_classification_fields (field_id, classification, option_value, enabled) VALUES (26159, 'Type C Contractor (CC)', 'H-5', 't');
INSERT INTO entitlements.config_contractor_classification_fields (field_id, classification, option_value, enabled) VALUES (26159, 'Type C Contractor (CC)', 'H-5', 't'); |
Error text
The text shown when a user attempts to apply for a application they are not permitted to or select a field value they are not permitted to is configurable
...
Example invalid contractor selected, with default error message
If a valid contractor is selected, the application can continue like normal.
Restricted Fields
For any select fields that have restrictions on what values a user can select, the field will still display all available values to prevent confusion. However, if a user selects a restricted value, they will be shown a configured error message and the selection will be cleared.
If the field is required, they will not be able to continue their application until a valid selection is made.
...
Example invalid field option selected, with default message