Files
BarangaySystem/app/Models/Barangay/BarangayBudget.php
Jonathan Sykes fbb7e3ff37
Some checks failed
tests / PHP 8.2 (swoole-5.1.6) (push) Has been cancelled
tests / PHP 8.3 (swoole-5.1.6) (push) Has been cancelled
tests / PHP 8.4 (swoole-6.0) (push) Has been cancelled
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
2026-06-07 03:09:09 +08:00

43 lines
888 B
PHP

<?php
declare(strict_types=1);
namespace App\Models\Barangay;
use App\Models\Model;
class BarangayBudget extends Model
{
protected ?string $table = 'barangay_budget';
protected array $fillable = [
'hashkey', 'fiscal_year', 'category', 'source',
'amount', 'description', 'date', 'reference', 'encoded_by',
];
protected array $casts = [
'amount' => 'decimal:2',
'date' => 'date',
];
public function encodedBy()
{
return $this->belongsTo(\App\Models\User::class, 'encoded_by');
}
public function scopeIncome($query)
{
return $query->where('category', 'INCOME');
}
public function scopeExpense($query)
{
return $query->where('category', 'EXPENSE');
}
public function scopeByYear($query, int $year)
{
return $query->where('fiscal_year', $year);
}
}