feat(accounts): fresh accounts implementation

This commit is contained in:
Darko Gjorgjijoski
2026-08-20 23:48:22 +02:00
parent 973fda1df6
commit d5dc446b24
42 changed files with 3768 additions and 0 deletions
@@ -0,0 +1,43 @@
<?php
namespace App\Domains\Accounts\Http\Requests;
use App\Rules\Base64Mime;
use Illuminate\Foundation\Http\FormRequest;
/**
* The envelope carrying a new company logo.
*
* One optional field: a JSON document holding a file name and a data URI. When
* it is there it has to name a raster image the branding collection accepts,
* and the bytes behind the data URI have to agree with that name.
*
* The removal flag travels in the same payload but is deliberately unchecked —
* the controller reads it straight off the request.
*/
class CompanyLogoRequest extends FormRequest
{
/** Image types the logo may be. */
private const ALLOWED_TYPES = ['gif', 'jpg', 'png'];
/**
* Ownership of the company is settled by the gate in the controller.
*/
public function authorize(): bool
{
return true;
}
/**
* @return array<string, array<int, mixed>>
*/
public function rules(): array
{
return [
'company_logo' => [
'nullable',
new Base64Mime(self::ALLOWED_TYPES),
],
];
}
}