| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- <?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 $pavao_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-read \App\Models\ClassPackageUnit $packageUnit
- * @property-read \App\Models\PavaoProposal|null $basePavaoProposal
- * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\PavaoProposalUnitProduct> $products
- */
- class PavaoProposalUnit extends Model
- {
- use HasFactory, SoftDeletes;
- protected $table = 'pavao_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 basePavaoProposal(): BelongsTo
- {
- return $this->belongsTo(PavaoProposal::class, 'pavao_proposal_id');
- }
- public function products(): HasMany
- {
- return $this->hasMany(PavaoProposalUnitProduct::class);
- }
- }
|