- Updated ProductIndex component to improve category and product filtering with memoization. - Refactored Combobox components for better performance and usability. - Added PurchaseController routes for managing purchases with appropriate permissions. - Created comprehensive tests for purchase management, covering creation, updating, and deletion scenarios. - Ensured proper handling of raw materials and their variants during purchase operations. - Implemented validation for required fields in purchase creation and updates.
32 lines
787 B
PHP
32 lines
787 B
PHP
<?php
|
|
|
|
namespace App\Enums;
|
|
|
|
enum Modules: string
|
|
{
|
|
case PRODUCT = 'product';
|
|
case EMPLOYEE = 'employee';
|
|
case ORDER = 'order';
|
|
case PURCHASE = 'purchase';
|
|
case RAW_MATERIAL = 'raw_material';
|
|
case EXPENSE = 'expense';
|
|
case USER = 'user';
|
|
case HOMEPAGE = 'homepage';
|
|
case OTHER = 'other';
|
|
|
|
public function label(): string
|
|
{
|
|
return match ($this) {
|
|
self::PRODUCT => 'Produk',
|
|
self::EMPLOYEE => 'Karyawan',
|
|
self::ORDER => 'Pesanan',
|
|
self::PURCHASE => 'Belanja',
|
|
self::RAW_MATERIAL => 'Bahan Baku',
|
|
self::EXPENSE => 'Pengeluaran',
|
|
self::USER => 'Pengguna',
|
|
self::HOMEPAGE => 'Homepage',
|
|
self::OTHER => 'Lainnya',
|
|
};
|
|
}
|
|
}
|