Implement creator studio and upload updates
This commit is contained in:
51
app/Enums/ModerationActionType.php
Normal file
51
app/Enums/ModerationActionType.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
namespace App\Enums;
|
||||
|
||||
enum ModerationActionType: string
|
||||
{
|
||||
case MarkSafe = 'mark_safe';
|
||||
case ConfirmSpam = 'confirm_spam';
|
||||
case Ignore = 'ignore';
|
||||
case Resolve = 'resolve';
|
||||
case HideComment = 'hide_comment';
|
||||
case HideArtwork = 'hide_artwork';
|
||||
case AutoHideComment = 'auto_hide_comment';
|
||||
case AutoHideArtwork = 'auto_hide_artwork';
|
||||
case RestoreComment = 'restore_comment';
|
||||
case RestoreArtwork = 'restore_artwork';
|
||||
case BlockDomain = 'block_domain';
|
||||
case MarkDomainSuspicious = 'mark_domain_suspicious';
|
||||
case AllowDomain = 'allow_domain';
|
||||
case Rescan = 'rescan';
|
||||
case BulkReview = 'bulk_review';
|
||||
case MarkFalsePositive = 'mark_false_positive';
|
||||
case Escalate = 'escalate';
|
||||
case ResolveCluster = 'resolve_cluster';
|
||||
case ReviewerFeedback = 'reviewer_feedback';
|
||||
|
||||
public function label(): string
|
||||
{
|
||||
return match ($this) {
|
||||
self::MarkSafe => 'Mark Safe',
|
||||
self::ConfirmSpam => 'Confirm Spam',
|
||||
self::Ignore => 'Ignore',
|
||||
self::Resolve => 'Resolve',
|
||||
self::HideComment => 'Hide Comment',
|
||||
self::HideArtwork => 'Hide Artwork',
|
||||
self::AutoHideComment => 'Auto-hide Comment',
|
||||
self::AutoHideArtwork => 'Auto-hide Artwork',
|
||||
self::RestoreComment => 'Restore Comment',
|
||||
self::RestoreArtwork => 'Restore Artwork',
|
||||
self::BlockDomain => 'Block Domain',
|
||||
self::MarkDomainSuspicious => 'Mark Domain Suspicious',
|
||||
self::AllowDomain => 'Allow Domain',
|
||||
self::Rescan => 'Rescan',
|
||||
self::BulkReview => 'Bulk Review',
|
||||
self::MarkFalsePositive => 'Mark False Positive',
|
||||
self::Escalate => 'Escalate',
|
||||
self::ResolveCluster => 'Resolve Cluster',
|
||||
self::ReviewerFeedback => 'Reviewer Feedback',
|
||||
};
|
||||
}
|
||||
}
|
||||
35
app/Enums/ModerationContentType.php
Normal file
35
app/Enums/ModerationContentType.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace App\Enums;
|
||||
|
||||
enum ModerationContentType: string
|
||||
{
|
||||
case ArtworkComment = 'artwork_comment';
|
||||
case ArtworkDescription = 'artwork_description';
|
||||
case ArtworkTitle = 'artwork_title';
|
||||
case UserBio = 'user_bio';
|
||||
case UserProfileLink = 'user_profile_link';
|
||||
case CollectionTitle = 'collection_title';
|
||||
case CollectionDescription = 'collection_description';
|
||||
case StoryTitle = 'story_title';
|
||||
case StoryContent = 'story_content';
|
||||
case CardTitle = 'card_title';
|
||||
case CardText = 'card_text';
|
||||
|
||||
public function label(): string
|
||||
{
|
||||
return match ($this) {
|
||||
self::ArtworkComment => 'Artwork Comment',
|
||||
self::ArtworkDescription => 'Artwork Description',
|
||||
self::ArtworkTitle => 'Artwork Title',
|
||||
self::UserBio => 'User Bio',
|
||||
self::UserProfileLink => 'User Profile Link',
|
||||
self::CollectionTitle => 'Collection Title',
|
||||
self::CollectionDescription => 'Collection Description',
|
||||
self::StoryTitle => 'Story Title',
|
||||
self::StoryContent => 'Story Content',
|
||||
self::CardTitle => 'Card Title',
|
||||
self::CardText => 'Card Text',
|
||||
};
|
||||
}
|
||||
}
|
||||
37
app/Enums/ModerationDomainStatus.php
Normal file
37
app/Enums/ModerationDomainStatus.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace App\Enums;
|
||||
|
||||
enum ModerationDomainStatus: string
|
||||
{
|
||||
case Allowed = 'allowed';
|
||||
case Neutral = 'neutral';
|
||||
case Suspicious = 'suspicious';
|
||||
case Blocked = 'blocked';
|
||||
case Escalated = 'escalated';
|
||||
case ReviewRequired = 'review_required';
|
||||
|
||||
public function label(): string
|
||||
{
|
||||
return match ($this) {
|
||||
self::Allowed => 'Allowed',
|
||||
self::Neutral => 'Neutral',
|
||||
self::Suspicious => 'Suspicious',
|
||||
self::Blocked => 'Blocked',
|
||||
self::Escalated => 'Escalated',
|
||||
self::ReviewRequired => 'Review Required',
|
||||
};
|
||||
}
|
||||
|
||||
public function badgeClass(): string
|
||||
{
|
||||
return match ($this) {
|
||||
self::Allowed => 'badge-success',
|
||||
self::Neutral => 'badge-light',
|
||||
self::Suspicious => 'badge-warning',
|
||||
self::Blocked => 'badge-danger',
|
||||
self::Escalated => 'badge-dark',
|
||||
self::ReviewRequired => 'badge-info',
|
||||
};
|
||||
}
|
||||
}
|
||||
31
app/Enums/ModerationEscalationStatus.php
Normal file
31
app/Enums/ModerationEscalationStatus.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Enums;
|
||||
|
||||
enum ModerationEscalationStatus: string
|
||||
{
|
||||
case None = 'none';
|
||||
case ReviewRequired = 'review_required';
|
||||
case Escalated = 'escalated';
|
||||
case Urgent = 'urgent';
|
||||
|
||||
public function label(): string
|
||||
{
|
||||
return match ($this) {
|
||||
self::None => 'None',
|
||||
self::ReviewRequired => 'Review Required',
|
||||
self::Escalated => 'Escalated',
|
||||
self::Urgent => 'Urgent',
|
||||
};
|
||||
}
|
||||
|
||||
public function badgeClass(): string
|
||||
{
|
||||
return match ($this) {
|
||||
self::None => 'badge-light',
|
||||
self::ReviewRequired => 'badge-info',
|
||||
self::Escalated => 'badge-warning',
|
||||
self::Urgent => 'badge-danger',
|
||||
};
|
||||
}
|
||||
}
|
||||
19
app/Enums/ModerationRuleType.php
Normal file
19
app/Enums/ModerationRuleType.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Enums;
|
||||
|
||||
enum ModerationRuleType: string
|
||||
{
|
||||
case SuspiciousKeyword = 'suspicious_keyword';
|
||||
case HighRiskKeyword = 'high_risk_keyword';
|
||||
case Regex = 'regex';
|
||||
|
||||
public function label(): string
|
||||
{
|
||||
return match ($this) {
|
||||
self::SuspiciousKeyword => 'Suspicious Keyword',
|
||||
self::HighRiskKeyword => 'High-risk Keyword',
|
||||
self::Regex => 'Regex Rule',
|
||||
};
|
||||
}
|
||||
}
|
||||
52
app/Enums/ModerationSeverity.php
Normal file
52
app/Enums/ModerationSeverity.php
Normal file
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
namespace App\Enums;
|
||||
|
||||
enum ModerationSeverity: string
|
||||
{
|
||||
case Low = 'low';
|
||||
case Medium = 'medium';
|
||||
case High = 'high';
|
||||
case Critical = 'critical';
|
||||
|
||||
public function label(): string
|
||||
{
|
||||
return match ($this) {
|
||||
self::Low => 'Low',
|
||||
self::Medium => 'Medium',
|
||||
self::High => 'High',
|
||||
self::Critical => 'Critical',
|
||||
};
|
||||
}
|
||||
|
||||
public function badgeClass(): string
|
||||
{
|
||||
return match ($this) {
|
||||
self::Low => 'badge-light',
|
||||
self::Medium => 'badge-warning',
|
||||
self::High => 'badge-danger',
|
||||
self::Critical => 'badge-dark text-white',
|
||||
};
|
||||
}
|
||||
|
||||
public static function fromScore(int $score): self
|
||||
{
|
||||
$thresholds = app('config')->get('content_moderation.severity_thresholds', [
|
||||
'critical' => 90,
|
||||
'high' => 60,
|
||||
'medium' => 30,
|
||||
]);
|
||||
|
||||
if ($score >= $thresholds['critical']) {
|
||||
return self::Critical;
|
||||
}
|
||||
if ($score >= $thresholds['high']) {
|
||||
return self::High;
|
||||
}
|
||||
if ($score >= $thresholds['medium']) {
|
||||
return self::Medium;
|
||||
}
|
||||
|
||||
return self::Low;
|
||||
}
|
||||
}
|
||||
34
app/Enums/ModerationStatus.php
Normal file
34
app/Enums/ModerationStatus.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Enums;
|
||||
|
||||
enum ModerationStatus: string
|
||||
{
|
||||
case Pending = 'pending';
|
||||
case ReviewedSafe = 'reviewed_safe';
|
||||
case ConfirmedSpam = 'confirmed_spam';
|
||||
case Ignored = 'ignored';
|
||||
case Resolved = 'resolved';
|
||||
|
||||
public function label(): string
|
||||
{
|
||||
return match ($this) {
|
||||
self::Pending => 'Pending',
|
||||
self::ReviewedSafe => 'Safe',
|
||||
self::ConfirmedSpam => 'Spam',
|
||||
self::Ignored => 'Ignored',
|
||||
self::Resolved => 'Resolved',
|
||||
};
|
||||
}
|
||||
|
||||
public function badgeClass(): string
|
||||
{
|
||||
return match ($this) {
|
||||
self::Pending => 'badge-warning',
|
||||
self::ReviewedSafe => 'badge-success',
|
||||
self::ConfirmedSpam => 'badge-danger',
|
||||
self::Ignored => 'badge-secondary',
|
||||
self::Resolved => 'badge-info',
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user