feat: L'Ami Fiduciaire V1.0.0 — full codebase with Story 0.1 complete

Initial commit of the L'Ami Fiduciaire SaaS platform built on Laravel 12,
Vue 3, Inertia.js 2, and Tailwind CSS 4.

Story 0.1 (rename folders to declarations in database) is implemented and
code-reviewed: migration, rollback, and 6 Pest tests all passing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-11 23:33:10 +00:00
commit 35545c2a8f
1517 changed files with 246774 additions and 0 deletions

85
app/Models/Message.php Normal file
View File

@@ -0,0 +1,85 @@
<?php
namespace App\Models;
use App\Enums\ActorType;
use App\Enums\MessageType;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class Message extends Model
{
/**
* The attributes that are mass assignable.
*
* @var list<string>
*/
protected $fillable = [
'folder_id',
'type',
'body',
'sent_by_type',
'sent_by_id',
'metadata',
];
/**
* Get the attributes that should be cast.
*
* @return array<string, string>
*/
protected function casts(): array
{
return [
'type' => MessageType::class,
'sent_by_type' => ActorType::class,
'metadata' => 'array',
];
}
/**
* Get the folder that owns the message.
*
* @return BelongsTo<Folder, $this>
*/
public function folder(): BelongsTo
{
return $this->belongsTo(Folder::class);
}
/**
* Get the user who sent the message (when sent_by_type is user).
*
* @return BelongsTo<User, $this>
*/
public function senderUser(): BelongsTo
{
return $this->belongsTo(User::class, 'sent_by_id');
}
/**
* Get the client who sent the message (when sent_by_type is client).
*
* @return BelongsTo<Client, $this>
*/
public function senderClient(): BelongsTo
{
return $this->belongsTo(Client::class, 'sent_by_id');
}
/**
* Get the sender display name.
*/
public function getSenderNameAttribute(): string
{
if ($this->sent_by_type?->is(ActorType::User)) {
return $this->senderUser?->name ?? '—';
}
if ($this->sent_by_type?->is(ActorType::Client)) {
return $this->senderClient?->company_name ?? 'Client';
}
return '—';
}
}