- Dark theme page background is #5a5e60; text on it is lifted to zinc-200 / primary-100 and TallStackUI's dark labels, hints and checkbox labels are lightened so everything stays at 4.5:1. - Shared HexColor picks white or black text by the higher WCAG contrast; a native-dialog colour picker and a large work dialog component. - Customers get a header colour (customers.header_color), set on the customer page. - New job status Jatkuvat / Kausi (ongoing): open, never late, billed monthly like running jobs. - Kanban model: board columns and views, urgent threshold, per-user board preferences (density, column colours and sort), card positions, tasks of continuing jobs pinned to the board, MoveBoardCard and board queries with logged hours from TimeTracking. Co-Authored-By: Claude Opus 5.5 <[email protected]>
92 lines
3.4 KiB
PHP
92 lines
3.4 KiB
PHP
<?php
|
|
|
|
namespace App\Modules\Jobs\Infrastructure\Persistence\Eloquent;
|
|
|
|
use App\Modules\Jobs\Domain\Enums\JobKind;
|
|
use App\Modules\Jobs\Domain\Enums\JobStatus;
|
|
use App\Modules\Jobs\Domain\Enums\PaymentBasis;
|
|
use App\Modules\Jobs\Domain\Enums\Priority;
|
|
use Carbon\CarbonImmutable;
|
|
use Database\Factories\CustomerJobFactory;
|
|
use Illuminate\Database\Eloquent\Attributes\Fillable;
|
|
use Illuminate\Database\Eloquent\Attributes\Table;
|
|
use Illuminate\Database\Eloquent\Attributes\UseFactory;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
/**
|
|
* Persistence model of a customer job, used only inside the Jobs
|
|
* Infrastructure layer. Service units, members, tags and links are in
|
|
* their own tables, read and written by the repository.
|
|
*
|
|
* @property int $id
|
|
* @property string $number
|
|
* @property string $name
|
|
* @property string|null $description
|
|
* @property int $customer_id
|
|
* @property CarbonImmutable|null $starts_on
|
|
* @property CarbonImmutable|null $due_on
|
|
* @property CarbonImmutable|null $planned_from
|
|
* @property CarbonImmutable|null $planned_to
|
|
* @property JobKind $kind
|
|
* @property JobStatus $status
|
|
* @property Priority $priority
|
|
* @property int $board_position
|
|
* @property PaymentBasis|null $payment_basis
|
|
* @property string|null $estimated_hours
|
|
* @property string|null $customer_reference
|
|
* @property string|null $instructions
|
|
* @property int $responsible_user_id
|
|
* @property int|null $contact_user_id
|
|
* @property int|null $customer_contact_id
|
|
* @property int|null $biller_user_id
|
|
* @property int|null $billing_unit_id
|
|
* @property int $created_by
|
|
* @property int|null $quoted_amount_cents
|
|
* @property int|null $monthly_fee_cents
|
|
* @property CarbonImmutable|null $completed_at
|
|
* @property int|null $quick_sale_year
|
|
* @property CarbonImmutable $created_at
|
|
*/
|
|
#[Table('customer_jobs')]
|
|
#[Fillable([
|
|
'number', 'name', 'description', 'customer_id', 'starts_on', 'due_on', 'planned_from', 'planned_to',
|
|
'kind', 'status', 'priority', 'payment_basis', 'estimated_hours', 'quoted_amount_cents', 'monthly_fee_cents', 'customer_reference', 'instructions',
|
|
'responsible_user_id', 'contact_user_id', 'customer_contact_id', 'biller_user_id', 'billing_unit_id', 'created_by', 'completed_at',
|
|
])]
|
|
#[UseFactory(CustomerJobFactory::class)]
|
|
class CustomerJobModel extends Model
|
|
{
|
|
/** @use HasFactory<CustomerJobFactory> */
|
|
use HasFactory;
|
|
|
|
/**
|
|
* @return array<string, string>
|
|
*/
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'customer_id' => 'integer',
|
|
'quoted_amount_cents' => 'integer',
|
|
'monthly_fee_cents' => 'integer',
|
|
'quick_sale_year' => 'integer',
|
|
'completed_at' => 'immutable_datetime',
|
|
'starts_on' => 'immutable_date',
|
|
'due_on' => 'immutable_date',
|
|
'planned_from' => 'immutable_date',
|
|
'planned_to' => 'immutable_date',
|
|
'kind' => JobKind::class,
|
|
'status' => JobStatus::class,
|
|
'priority' => Priority::class,
|
|
'payment_basis' => PaymentBasis::class,
|
|
'responsible_user_id' => 'integer',
|
|
'contact_user_id' => 'integer',
|
|
'customer_contact_id' => 'integer',
|
|
'biller_user_id' => 'integer',
|
|
'billing_unit_id' => 'integer',
|
|
'created_by' => 'integer',
|
|
'created_at' => 'immutable_datetime',
|
|
];
|
|
}
|
|
}
|