Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
n/a
0 / 0
n/a
0 / 0
CRAP
n/a
0 / 0
RolePlayCallTypeSettings
n/a
0 / 0
n/a
0 / 0
0
n/a
0 / 0
1<?php
2
3namespace App\Http\Models;
4
5/**
6 * Stores a user-editable target call duration per RolePlay call type, at
7 * three overlapping scopes: system (Vengreso CMC default), company (set by
8 * a company Global Admin, with an optional flag to lock out user overrides)
9 * and user (the authenticated user's personal target).
10 *
11 * Resolution order at runtime: user → company → system → hard-coded default.
12 * A company row with `allow_user_override = false` causes the user row to
13 * be ignored during resolution and surfaced as locked in the UI.
14 *
15 * @property string $call_type One of 'cold-call' or 'discovery-call'
16 * @property string $scope One of 'system' | 'company' | 'user'
17 * @property string|null $scope_id Company id for company scope, user id for
18 *                                 user scope, null for system.
19 * @property int $target_duration_seconds Target duration for this call type
20 * @property bool|null $allow_user_override Only meaningful at company scope.
21 *                                          When false the user row is
22 *                                          ignored by the resolver.
23 */
24class RolePlayCallTypeSettings extends Moloquent
25{
26    public const SCOPE_SYSTEM = 'system';
27
28    public const SCOPE_COMPANY = 'company';
29
30    public const SCOPE_USER = 'user';
31
32    public const CALL_TYPE_COLD_CALL = 'cold-call';
33
34    public const CALL_TYPE_DISCOVERY_CALL = 'discovery-call';
35
36    public const SUPPORTED_CALL_TYPES = [
37        self::CALL_TYPE_COLD_CALL,
38        self::CALL_TYPE_DISCOVERY_CALL,
39    ];
40
41    protected $table = 'role_play_call_type_settings';
42
43    protected $fillable = [
44        'call_type',
45        'scope',
46        'scope_id',
47        'target_duration_seconds',
48        'allow_user_override',
49    ];
50
51    protected $casts = [
52        'target_duration_seconds' => 'integer',
53        'allow_user_override' => 'boolean',
54    ];
55}