'decimal:2', 'source' => InvestmentSource::class, 'status' => InvestmentStatus::class, 'approved_at' => 'datetime', 'completed_at' => 'datetime', 'cancelled_at' => 'datetime', ]; } public function user(): BelongsTo { return $this->belongsTo(User::class, 'user_id'); } public function account(): BelongsTo { return $this->belongsTo(InvestmentAccount::class, 'investment_account_id'); } public function investmentType(): BelongsTo { return $this->belongsTo(InvestmentType::class, 'investment_type_id'); } public function createdBy(): BelongsTo { return $this->belongsTo(User::class, 'created_by'); } public function approvedBy(): BelongsTo { return $this->belongsTo(User::class, 'approved_by'); } public function ledgerEntries(): HasMany { return $this->hasMany(InvestmentLedger::class, 'investment_id'); } public function payment(): HasOne { return $this->hasOne(InvestmentPayment::class, 'investment_id'); } public function salaryDeductionDetail(): HasOne { return $this->hasOne(SalaryDeductionBatchDetail::class, 'investment_id'); } }