feat: implement barangay and household management with associated tests
This commit is contained in:
@@ -2,9 +2,12 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Notifications\VerifyEmailNotification;
|
||||
use Database\Factories\UserFactory;
|
||||
use Illuminate\Contracts\Auth\MustVerifyEmail;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasOne;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
@@ -17,19 +20,27 @@ use Spatie\Permission\Traits\HasRoles;
|
||||
|
||||
class User extends Authenticatable implements MustVerifyEmail
|
||||
{
|
||||
/** @use HasFactory<\Database\Factories\UserFactory> */
|
||||
/** @use HasFactory<UserFactory> */
|
||||
use HasApiTokens, HasFactory, HasRoles, LogsActivity, Notifiable, SoftDeletes;
|
||||
|
||||
public const ROLE_SUPER_ADMIN = 'super_admin';
|
||||
|
||||
public const ROLE_ADMIN = 'admin';
|
||||
|
||||
public const ROLE_RESIDENT = 'resident';
|
||||
|
||||
public const ROLE_DRIVER = 'driver';
|
||||
|
||||
public const ROLE_HELPER = 'helper';
|
||||
|
||||
public const ROLE_SCANNER = 'scanner';
|
||||
|
||||
public const ROLE_STORE_PARTNER = 'store_partner';
|
||||
|
||||
public const STATUS_ACTIVE = 'active';
|
||||
|
||||
public const STATUS_SUSPENDED = 'suspended';
|
||||
|
||||
public const STATUS_PENDING = 'pending';
|
||||
|
||||
protected $fillable = [
|
||||
@@ -91,7 +102,7 @@ class User extends Authenticatable implements MustVerifyEmail
|
||||
|
||||
public function sendEmailVerificationNotification(): void
|
||||
{
|
||||
$this->notify(new \App\Notifications\VerifyEmailNotification());
|
||||
$this->notify(new VerifyEmailNotification);
|
||||
}
|
||||
|
||||
public function headedHousehold(): HasOne
|
||||
@@ -129,7 +140,7 @@ class User extends Authenticatable implements MustVerifyEmail
|
||||
return $this->hasOne(StorePartnerProfile::class);
|
||||
}
|
||||
|
||||
public function tenant(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function tenant(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Tenant::class);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user