<?php

return [
    /*
    |--------------------------------------------------------------------------
    | Review Approval Settings
    |--------------------------------------------------------------------------
    |
    | When require_approval is true, all new reviews will be set to
    | is_approved = false and require admin approval before being displayed.
    | When false, reviews are automatically approved upon creation.
    |
    */
    'require_approval' => env('REVIEWS_REQUIRE_APPROVAL', true),

    /*
    |--------------------------------------------------------------------------
    | Verified Purchase Only
    |--------------------------------------------------------------------------
    |
    | When verified_purchase_only is true, users can only review products
    | they have purchased (order_id must be provided and validated).
    | When false, any user can review any product.
    |
    */
    'verified_purchase_only' => env('REVIEWS_VERIFIED_PURCHASE_ONLY', false),

    /*
    |--------------------------------------------------------------------------
    | Allow Guest Reviews
    |--------------------------------------------------------------------------
    |
    | When allow_guest_reviews is true, unauthenticated users can submit
    | reviews. When false, only authenticated users can submit reviews.
    |
    */
    'allow_guest_reviews' => env('REVIEWS_ALLOW_GUEST_REVIEWS', false),

    /*
    |--------------------------------------------------------------------------
    | Edit Time Limit
    |--------------------------------------------------------------------------
    |
    | Number of hours after creation that a user can edit their review.
    | After this time, only admins can edit the review.
    |
    */
    'edit_time_limit_hours' => env('REVIEWS_EDIT_TIME_LIMIT_HOURS', 24),

    /*
    |--------------------------------------------------------------------------
    | Rate Limit Days
    |--------------------------------------------------------------------------
    |
    | Number of days between reviews for the same product by the same user.
    | This prevents users from submitting multiple reviews for the same product.
    |
    */
    'rate_limit_days' => env('REVIEWS_RATE_LIMIT_DAYS', 30),

    /*
    |--------------------------------------------------------------------------
    | Throttle Per IP
    |--------------------------------------------------------------------------
    |
    | Maximum number of review submissions allowed per IP address per minute.
    | This helps prevent spam and abuse.
    |
    */
    'throttle_per_ip' => env('REVIEWS_THROTTLE_PER_IP', 5),

    /*
    |--------------------------------------------------------------------------
    | Profanity Filter
    |--------------------------------------------------------------------------
    |
    | When enabled, reviews containing profanity will be automatically
    | flagged for moderation. Requires a profanity detection service
    | or word list to be implemented.
    |
    */
    'enable_profanity_filter' => env('REVIEWS_ENABLE_PROFANITY_FILTER', false),

    /*
    |--------------------------------------------------------------------------
    | Auto-Flag Suspicious Reviews
    |--------------------------------------------------------------------------
    |
    | When enabled, reviews from the same IP address within a short time
    | period will be automatically flagged for moderation.
    |
    */
    'auto_flag_suspicious' => env('REVIEWS_AUTO_FLAG_SUSPICIOUS', true),

    /*
    |--------------------------------------------------------------------------
    | Suspicious Review Threshold
    |--------------------------------------------------------------------------
    |
    | Number of reviews from the same IP address within the time window
    | (in minutes) that triggers auto-flagging.
    |
    */
    'suspicious_review_threshold' => [
        'count' => env('REVIEWS_SUSPICIOUS_COUNT', 3),
        'minutes' => env('REVIEWS_SUSPICIOUS_MINUTES', 60),
    ],
];

