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:
@@ -84,14 +84,9 @@ class User extends Authenticatable
|
||||
'denied_roles' => \App\Casts\UserActionsArrayCast::class ,
|
||||
];
|
||||
|
||||
public function userInfo()
|
||||
public function resident()
|
||||
{
|
||||
return $this->hasOne(\App\Models\Market\UserInfo::class, 'user_id');
|
||||
}
|
||||
|
||||
public function cooperativeMemberships()
|
||||
{
|
||||
return $this->hasMany(\App\Models\Market\CooperativeMember::class, 'user_id');
|
||||
return $this->hasOne(\App\Models\Barangay\Resident::class, 'user_id');
|
||||
}
|
||||
|
||||
public function creator()
|
||||
@@ -153,17 +148,21 @@ class User extends Authenticatable
|
||||
*/
|
||||
public function isUltimate(): bool
|
||||
{
|
||||
return $this->acct_type === UserTypes::ULTIMATE;
|
||||
return $this->acct_type === UserTypes::SUPER_ADMIN;
|
||||
}
|
||||
|
||||
public function isSuperOperator(): bool
|
||||
public function isPunongBarangay(): bool
|
||||
{
|
||||
return $this->acct_type === UserTypes::SUPER_OPERATOR;
|
||||
return $this->acct_type === UserTypes::PUNONG_BARANGAY;
|
||||
}
|
||||
|
||||
public function isOperator(): bool
|
||||
public function isBarangayStaff(): bool
|
||||
{
|
||||
return $this->acct_type === UserTypes::OPERATOR;
|
||||
return in_array($this->acct_type, [
|
||||
UserTypes::PUNONG_BARANGAY, UserTypes::KAGAWAD, UserTypes::SECRETARY,
|
||||
UserTypes::TREASURER, UserTypes::SK_CHAIRPERSON, UserTypes::SK_COUNCILOR,
|
||||
UserTypes::TANOD, UserTypes::BHW, UserTypes::DAYCARE_WORKER, UserTypes::STAFF,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user