[Task]: Add new illegal_category field in abuse reports (original) (raw)
As part of https://mozilla-hub.atlassian.net/browse/AMOENG-683, we need to add a new illegal_category field in the feedback form. The first step is to make it available in the API, which this issue is about.
The possible values for this new fields are:
- Animal welfare
- Consumer information infringements
- Data protection and privacy violations
- Illegal or harmful speech
- Intellectual property infringements
- Negative effects on civic discourse or elections
- Non-consensual behavior
- Pornography or sexualized content
- Protection of minors
- Risk for public security
- Scams or fraud
- Self-harm
- Unsafe, non-compliant, or prohibited products
- Violence
- Other
Though, we'll want to have constants in the API.
This new field should be sent to Cinder, in the illegal_category field of the AMO Report entity. Each value sent should be normalized to look like one of the following:
STATEMENT_CATEGORY_ANIMAL_WELFARESTATEMENT_CATEGORY_CONSUMER_INFORMATIONSTATEMENT_CATEGORY_DATA_PROTECTION_AND_PRIVACY_VIOLATIONSSTATEMENT_CATEGORY_ILLEGAL_OR_HARMFUL_SPEECHSTATEMENT_CATEGORY_INTELLECTUAL_PROPERTY_INFRINGEMENTSSTATEMENT_CATEGORY_NEGATIVE_EFFECTS_ON_CIVIC_DISCOURSE_OR_ELECTIONSSTATEMENT_CATEGORY_NON_CONSENSUAL_BEHAVIOURSTATEMENT_CATEGORY_PORNOGRAPHY_OR_SEXUALIZED_CONTENTSTATEMENT_CATEGORY_PROTECTION_OF_MINORSSTATEMENT_CATEGORY_RISK_FOR_PUBLIC_SECURITYSTATEMENT_CATEGORY_SCAMS_AND_FRAUDSTATEMENT_CATEGORY_SELF_HARMSTATEMENT_CATEGORY_UNSAFE_AND_PROHIBITED_PRODUCTSSTATEMENT_CATEGORY_VIOLENCESTATEMENT_CATEGORY_OTHER
Now given that we won't have the frontend work done yet, the only way to send this new field is to use the API directly, e.g. with HTTPie:
http --json POST 'https://addons-dev.allizom.org/api/v5/abuse/report/user/?lang=en-US' --raw '{"user":12345,"message":"test","reason":"illegal","reporter_email":null,"reporter_name":null,"lang":"en-US","illegal_category":"animal_welfare"}'
┆Issue is synchronized with this Jira Task