feat: implement barangay system phases 2-14
Complete adaptation from BukidBountyApp to Philippine barangay governance: - Barangay models: Resident, Household, HouseholdMember, Blotter, BlotterHearing, DocumentRequest, RequestPayment, RequestType, BarangayProject, BarangayBudget - Controllers: ResidentController, HouseholdController, BlotterController, BlotterHearingController, DocumentRequestController, RequestTypeController, ProjectController, BudgetController, QRPHController, AdminConsoleController, UserController, FileController, ChapterController, LoginController - Vue pages: Home, ManageResidents, ResidentProfile, ManageHouseholds, ManageBlotters, BlotterDetail, RequestDocument, ManageDocumentRequests, DocumentRequestDetail, ManageRequestTypes, ManageProjects, BudgetLedger, AdminConsole - Barangay roles: PunongBarangay, Kagawad, Secretary, Treasurer, SK, Tanod, BHW, Staff, Resident - UserPermissions matrix rewritten with barangay-specific permission mappings - VueRouteMap replaced with barangay SPA routes - UserActions enum references corrected across all controllers - Removed all market/cooperative/POS/subscription code and models
This commit is contained in:
@@ -4,7 +4,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Support;
|
||||
|
||||
use App\Models\Accounting\Account;
|
||||
use App\Models\SystemSetting;
|
||||
use Hypervel\Support\Facades\Config;
|
||||
use Hypervel\Support\Str;
|
||||
|
||||
@@ -6,8 +6,7 @@ namespace App\Support;
|
||||
|
||||
use Hypervel\Codec\Json;
|
||||
use App\Models\User;
|
||||
use App\Models\Market\Product;
|
||||
use App\Models\Market\Store;
|
||||
use App\Models\Barangay\Resident;
|
||||
|
||||
/**
|
||||
* HashkeyResolver provides a universal resolver for any model by hashkey.
|
||||
@@ -51,25 +50,11 @@ class HashkeyResolver
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve a product by its hashkey.
|
||||
*
|
||||
* @param string $hashkey The product's hashkey
|
||||
* @return mixed|null The resolved Product instance or null if not found
|
||||
* Resolve a resident by their hashkey.
|
||||
*/
|
||||
public function resolveProductByHashkey($hashkey)
|
||||
public function resolveResidentByHashkey($hashkey)
|
||||
{
|
||||
return $this->resolveByHashkey($hashkey, Product::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve a store by its hashkey.
|
||||
*
|
||||
* @param string $hashkey The store's hashkey
|
||||
* @return mixed|null The resolved Store instance or null if not found
|
||||
*/
|
||||
public function resolveStoreByHashkey($hashkey)
|
||||
{
|
||||
return $this->resolveByHashkey($hashkey, Store::class);
|
||||
return $this->resolveByHashkey($hashkey, Resident::class);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -86,15 +86,11 @@ class SystemSettingsHelper
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the main cooperative/organization model (if any).
|
||||
* Get the barangay name from settings.
|
||||
*/
|
||||
public static function mainOrganization(): ?\App\Models\Market\Organization
|
||||
public static function barangayName(): ?string
|
||||
{
|
||||
$hashkey = static::mainOrganizationHashkey();
|
||||
if (!$hashkey) {
|
||||
return null;
|
||||
}
|
||||
return \App\Models\Market\Organization::where('hashkey', $hashkey)->first();
|
||||
return static::get('barangay_name');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user