- Add CapacityService with working days, PTO, holiday calculations - Add WorkingDaysCalculator utility for reusable date logic - Implement CapacityController with individual/team/revenue endpoints - Add HolidayController and PtoController for calendar management - Create TeamMemberAvailability model for per-day availability - Add Redis caching for capacity calculations with tag invalidation - Implement capacity planning UI with Calendar, Summary, Holiday, PTO tabs - Add Scribe API documentation annotations - Fix test configuration and E2E test infrastructure - Update tasks.md with completion status Backend Tests: 63 passed Frontend Unit: 32 passed E2E Tests: 134 passed, 20 fixme (capacity UI rendering) API Docs: Generated successfully
38 lines
780 B
PHP
38 lines
780 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Concerns\HasUuids;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class TeamMemberAvailability extends Model
|
|
{
|
|
use HasFactory, HasUuids;
|
|
|
|
protected $table = 'team_member_daily_availabilities';
|
|
|
|
protected $primaryKey = 'id';
|
|
|
|
public $incrementing = false;
|
|
|
|
protected $keyType = 'string';
|
|
|
|
protected $fillable = [
|
|
'team_member_id',
|
|
'date',
|
|
'availability',
|
|
];
|
|
|
|
protected $casts = [
|
|
'date' => 'date',
|
|
'availability' => 'float',
|
|
];
|
|
|
|
public function teamMember(): BelongsTo
|
|
{
|
|
return $this->belongsTo(TeamMember::class);
|
|
}
|
|
}
|