novas funcionalidades dos formulario
tests / ci (push) Canceled after 0s

This commit is contained in:
2026-10-02 11:13:37 +02:00
parent a6afb4e97a
commit 4f35313d06
104 changed files with 7653 additions and 178 deletions
+29 -1
View File
@@ -2,9 +2,37 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class ExistingBusiness extends DomainRecord
{
protected $hidden = ['payload'];
protected $casts = ['payload' => 'encrypted:array', 'version_no' => 'integer'];
protected $casts = [
'payload' => 'encrypted:array',
'version_no' => 'integer',
'amount_min' => 'decimal:2',
'amount_max' => 'decimal:2',
'available_percentage' => 'decimal:2',
'submitted_at' => 'immutable_datetime',
'published_at' => 'immutable_datetime',
'expires_at' => 'immutable_datetime',
'next_action_due_at' => 'immutable_datetime',
];
/** @return BelongsTo<Sector, $this> */
public function sector(): BelongsTo
{
return $this->belongsTo(Sector::class);
}
/** @param Builder<ExistingBusiness> $query
* @return Builder<ExistingBusiness>
*/
public function scopePublished(Builder $query): Builder
{
return $query->where('status', 'published')->whereNotNull('published_at')->where('published_at', '<=', now())
->where(fn (Builder $q) => $q->whereNull('expires_at')->orWhere('expires_at', '>=', today()));
}
}