| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- <?php
- namespace App\Models;
- use Illuminate\Database\Eloquent\Factories\HasFactory;
- use Illuminate\Database\Eloquent\Model;
- use Illuminate\Database\Eloquent\Relations\BelongsTo;
- use Illuminate\Database\Eloquent\Relations\HasMany;
- use Illuminate\Database\Eloquent\SoftDeletes;
- /**
- * @property int $id
- * @property int $class_package_unit_id
- * @property int|null $irrecusable_proposal_id
- * @property float|null $registration_value
- * @property bool $registration_included_in_course
- * @property bool $registration_installments_allowed
- * @property int $registration_max_installments
- * @property float|null $classes_value
- * @property bool $classes_included_in_course
- * @property bool $classes_installments_allowed
- * @property int $classes_max_installments
- * @property float|null $classes_discount_percentage
- * @property float $materials_total_value
- * @property bool $materials_included_in_course
- * @property bool $materials_installments_allowed
- * @property int $materials_max_installments
- * @property float|null $total_value
- * @property int $total_max_installments
- * @property string|null $condition
- * @property-read \App\Models\ClassPackageUnit $packageUnit
- * @property-read \App\Models\IrrecusableProposal|null $baseIrrecusableProposal
- * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\IrrecusableProposalUnitProduct> $products
- */
- class IrrecusableProposalUnit extends Model
- {
- use HasFactory, SoftDeletes;
- protected $table = 'irrecusable_proposal_units';
- protected $guarded = ['id'];
- protected $casts = [
- 'registration_value' => 'float',
- 'registration_included_in_course' => 'boolean',
- 'registration_installments_allowed' => 'boolean',
- 'registration_max_installments' => 'integer',
- 'classes_value' => 'float',
- 'classes_included_in_course' => 'boolean',
- 'classes_installments_allowed' => 'boolean',
- 'classes_max_installments' => 'integer',
- 'classes_discount_percentage' => 'float',
- 'materials_total_value' => 'float',
- 'materials_included_in_course' => 'boolean',
- 'materials_installments_allowed' => 'boolean',
- 'materials_max_installments' => 'integer',
- 'total_value' => 'float',
- 'total_max_installments' => 'integer',
- ];
- public function packageUnit(): BelongsTo
- {
- return $this->belongsTo(ClassPackageUnit::class, 'class_package_unit_id');
- }
- public function baseIrrecusableProposal(): BelongsTo
- {
- return $this->belongsTo(IrrecusableProposal::class, 'irrecusable_proposal_id');
- }
- public function products(): HasMany
- {
- return $this->hasMany(IrrecusableProposalUnitProduct::class);
- }
- }
|