FORMS-208: (Admin) Allow File Submissions for Forms
User Story Description:
As an Admin I want to be able to allow file submissions for a given form.
Business Rationale:
In some use cases data is aggregated by an intermediary user (e.g. Health Authority) and submitting each dataset individually is not feasible/realistic.
(In the future it can be explored if this intermediary is not required).
Priority: Must Have
Dependencies:
[List potential dependencies with other User Stories or Tasks]
# | Task or User Story | Type of Dependency |
1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
Technical Details:
First create a migration file for Knex to add a new column to allow a form to upload file contain this code :
exports.up = function (knex) {
return Promise.resolve()
.then(() => knex.schema.alterTable('form', table => {
table.boolean('allowSubmitterToUploadFile').notNullable().defaultTo(false).comment('This parameter allow submitter to load data from csv file');
}));
};
exports.down = function (knex) {
return Promise.resolve()
.then(() => knex.schema.alterTable('form', table => {
table.dropColumn('allowSubmitterToUploadFile');
}));
};
After run this command
npm run migrate
Edit the form model to add the new field “allowSubmitterToUploadFile”.
go to the form service in the create function add this line :
obj.allowSubmitterToUploadFile = data.allowSubmitterToUploadFile;
before this line
Acceptance Criteria:
[List the Acceptance Criteria]
# | Description | Notes |
1 | As a form designer I am able to check/uncheck the box “Enable File Submissions for this form“ in the Form Functionality section of the Form settings |
|
2 | The setting is saved in the database |
|
3 |
|
|
4 |
|
|
5 |
|
|
Prototype/Mockups
Provide high fidelity prototype or mockup
Out of Scope:
Building the logic to parse the file or generate the template is not part of this story
Contact(s):
Table of Contents