Skip to content

Add "referenced" and "unchanged" fields to statistics on Import Participant #3645

Description

@Borreg0

Describe the issue

When importing participants from csv file, statistics for total, created, updated, new, error, structure levels and warning are calculated by backend. According to the new Participant Import Rework (OpenSlides/openslides-client#5124), a new kind of user "Referenced" should be added to be displayed along with the rest of statistics (On footer, imported summary dialog and as a field on filters).

This should be added to the backend in order to keep both functionality and logic together.

Payload from client (handle_request)

[{"action":"participant.json_upload","data":[{"data":[{"first_name":"a","structure_level":"Test structure level a","groups":"Delegates","number":"12345-67891","vote_weight":"1","gender":"female","username":"a","default_password":"a","is_active":"1","is_physical_person":"1","comment":"Test comment a"},{"first_name":"b","structure_level":"Test structure level b","groups":"Delegates","number":"12345-67892","vote_weight":"1","gender":"diverse","username":"b","default_password":"jKwSLGCk","is_active":"1","is_physical_person":"1","comment":"Test comment b as an external user"},{"last_name":"Administrator","structure_level":"Test structure level","groups":"Admin","number":"12345-67890","vote_weight":"1","gender":"male","username":"admin","default_password":"admin","is_active":"1","is_physical_person":"1","is_present":"1","comment":"Test comment"}],"meeting_id":4}]}]

Response from backend

"statistics": [
{"name": "total", "value": 3}, 
{"name": "created", "value": 0}, 
{"name": "updated", "value": 3},
{"name": "error", "value": 0},
{"name": "warning", "value": 0},
{"name": "structure levels created", "value": 3}, 
{"name": "groups created", "value": 0}],
 "state": "done"}
]]

Expected behavior
Receive a response like this:

"statistics": [
{"name": "total", "value": 3}, 
{"name": "created", "value": 0}, 
{"name": "updated", "value": 1},
**{"name": "referenced", "value": 2},**
{"name": "error", "value": 0},
{"name": "warning", "value": 0},
**{"name": "unchanged", "value": 3},**
{"name": "structure levels created", "value": 3}, 
{"name": "groups created", "value": 0}],
 "state": "done"}
]]

Additional context

I am currently building a workaround on client, but this cannot be a permanent solution

Metadata

Metadata

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions