Skip to content

Commit

Permalink
Update ModerationSource values and documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
isoos committed Sep 30, 2024
1 parent 4ce0164 commit ccd00ca
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions app/lib/admin/models.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ class ModerationCase extends db.ExpandoModel<String> {

/// The source of the case, one of:
/// - `external-notification`,
/// - `internal-notification` (only used for reports from @google.com accounts), or,
/// - `trusted-flagger`,
/// - `authorities`,
/// - `legal-referral`,
/// - `automated-detection`. (will not be used)
@db.StringProperty(required: true)
late String source;
Expand Down Expand Up @@ -199,17 +201,17 @@ class ModerationCase extends db.ExpandoModel<String> {

abstract class ModerationSource {
static const externalNotification = 'external-notification';
static const internalNotification = 'internal-notification';
static const trustedFlagger = 'trusted-flagger';
static const authorities = 'authorities';
static const legalReferral = 'legal-referral';
static const automatedDetection = 'automated-detection';

static const _values = [
externalNotification,
internalNotification,
trustedFlagger,
authorities,
legalReferral,
automatedDetection,
];
static bool isValidSource(String value) => _values.contains(value);
}
Expand Down

0 comments on commit ccd00ca

Please sign in to comment.