Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New AuthorizationHandler to check the census from an excel file #7

Closed
5 tasks done
xredo opened this issue Nov 3, 2017 · 2 comments
Closed
5 tasks done

New AuthorizationHandler to check the census from an excel file #7

xredo opened this issue Nov 3, 2017 · 2 comments

Comments

@xredo
Copy link
Contributor

xredo commented Nov 3, 2017

Description

A new AuthorizationHandler will be created to allow new users to be validated against a census that will be uploaded from an excel file. The AuthorizationHandler will accept the citizen minimum age as a configuration parameter. If the user doesn't meet the age requirement configured in the parameter it won't be authorised.

The excel file will have a CSV format and it will contain the following data for every user:

  • ID document
  • Birth Date

The excel file will be uploaded from the Admin Panel of every organisation. Only users with the admin role will be able to upload the excel file. We will display if there is any excel file loaded and if there is one, the date when it was loaded and the number of citizens loaded to the organisation.

Tasks

  • Add a new section in the Decidim Admin Panel to upload a new Excel file for an organisation.
  • Display the date when the excel was uploaded for the last time and the number of citizens in the census for the organization.
  • Create a new AuthorizationHandler that will use the data uploaded from the excel file.
  • The AuthorizationHandler will be configurable with a minimum user age required to authorise the user.
  • Attach a sample excel file in xlsx format to the issue.

Technical discussion

We need to analyse if creating an engine is the best way to encapsulate the code that we will be writing. I suggest implementing first a version overriding the Decidim behaviours in the project itself and then determine if the added core is complex enough to be created as a separate extension.

Resources

@xredo xredo changed the title New AuthorizationHandler to checks the census from an excel file New AuthorizationHandler to check the census from an excel file Nov 3, 2017
@xredo xredo added the feature label Nov 3, 2017
@xredo xredo added this to the New Authorization Handlers milestone Nov 3, 2017
@xredo
Copy link
Contributor Author

xredo commented Nov 15, 2017

There are new requirements regarding the upload of the Excel files: Remove census for an organization and incremental updates.

Incremental updates

When a new CSC is uploaded we won't remove any existing record. We will load the new ones incrementally.

Remove Census

A new button in the Census admin view is required to remove all the Census that has been loaded for an organization.

@danigb
Copy link
Contributor

danigb commented Nov 15, 2017

Additional tasks:

  • When importing, normalize all document numbers by removing all non-letter or number characters, and converting to upper case
  • When querying (AuthorizationHandler), apply the same document number normalization
  • Import should merge instead of replacing data (and remove duplicates: last wins)
  • Add a button to the UI to remove all census data
  • Check performance with 200k CSV file
  • If the the authorization is not enabled, show a message in admin
  • Add a notice in README about why remove duplicates in an background job
  • Translate to catalan and english
  • Fix rspec controller tests
  • Try to use /admin/censuses_upload instead of /censuses_upload

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants