Add machines with day-by-day work lists for job tasks
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Modules\Machines\Domain\Enums;
|
||||
|
||||
/**
|
||||
* The unit of a machine counter (spec 19.5): prints, sheets, printed area,
|
||||
* ink used, cut length or running hours.
|
||||
*/
|
||||
enum CounterUnit: string
|
||||
{
|
||||
case Piece = 'piece';
|
||||
case Sheet = 'sheet';
|
||||
case SquareMetre = 'square_metre';
|
||||
case Millilitre = 'millilitre';
|
||||
case Metre = 'metre';
|
||||
case Hour = 'hour';
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Modules\Machines\Domain\Enums;
|
||||
|
||||
/**
|
||||
* The kind of machine (spec 19.4): printing presses that use ink or toner
|
||||
* (e.g. wide-format printers), sticker cutters, and others. Labels are in
|
||||
* lang/*\/machines.php under types.
|
||||
*/
|
||||
enum MachineType: string
|
||||
{
|
||||
case Printer = 'printer';
|
||||
case Cutter = 'cutter';
|
||||
case Other = 'other';
|
||||
|
||||
/**
|
||||
* The counters suggested for a new machine of this type (spec 19.5), as
|
||||
* translation keys of their names with their units.
|
||||
*
|
||||
* @return list<array{name: string, unit: CounterUnit}>
|
||||
*/
|
||||
public function suggestedCounters(): array
|
||||
{
|
||||
return match ($this) {
|
||||
self::Printer => [
|
||||
['name' => 'prints', 'unit' => CounterUnit::Piece],
|
||||
['name' => 'printed_area', 'unit' => CounterUnit::SquareMetre],
|
||||
],
|
||||
self::Cutter => [
|
||||
['name' => 'cut_length', 'unit' => CounterUnit::Metre],
|
||||
],
|
||||
self::Other => [],
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user