diff --git a/app/Models/BankIntegration.php b/app/Models/BankIntegration.php index cb34a6e88e96..89eb9d7b78b5 100644 --- a/app/Models/BankIntegration.php +++ b/app/Models/BankIntegration.php @@ -23,12 +23,6 @@ class BankIntegration extends BaseModel protected $dates = [ ]; - protected $casts = [ - 'updated_at' => 'timestamp', - 'created_at' => 'timestamp', - 'deleted_at' => 'timestamp', - ]; - public function getEntityType() { return self::class; diff --git a/app/Models/BankTransaction.php b/app/Models/BankTransaction.php index db8bb71608cd..043198166764 100644 --- a/app/Models/BankTransaction.php +++ b/app/Models/BankTransaction.php @@ -22,13 +22,7 @@ class BankTransaction extends BaseModel protected $dates = [ ]; - - protected $casts = [ - 'updated_at' => 'timestamp', - 'created_at' => 'timestamp', - 'deleted_at' => 'timestamp', - ]; - + public function getEntityType() { return self::class; diff --git a/app/Transformers/CompanyTransformer.php b/app/Transformers/CompanyTransformer.php index a635719a66cd..5a0ea9f063bf 100644 --- a/app/Transformers/CompanyTransformer.php +++ b/app/Transformers/CompanyTransformer.php @@ -67,6 +67,7 @@ class CompanyTransformer extends EntityTransformer * @var array */ protected $availableIncludes = [ + 'bank_transactions', 'documents', 'users', 'designs', @@ -103,7 +104,6 @@ class CompanyTransformer extends EntityTransformer 'recurring_expenses', 'purchase_orders', 'bank_integrations', - 'bank_transactions', ]; /** @@ -223,6 +223,16 @@ class CompanyTransformer extends EntityTransformer return $this->includeCollection($company->tokens, $transformer, CompanyToken::class); } + public function includeBankTransactions(Company $company) + { + $transformer = new BankTransactionTransformer($this->serializer); + + nlog("GEET"); + nlog($company->bank_transactions()->count()); + + return $this->includeCollection($company->bank_transactions, $transformer, BankTransaction::class); + } + public function includeBankIntegrations(Company $company) { $transformer = new BankIntegrationTransformer($this->serializer); @@ -230,13 +240,6 @@ class CompanyTransformer extends EntityTransformer return $this->includeCollection($company->bank_integrations, $transformer, BankIntegration::class); } - public function includeBankTransactions(Company $company) - { - $transformer = new BankTransactionTransformer($this->serializer); - - return $this->includeCollection($company->bank_transactions, $transformer, BankTransaction::class); - } - public function includeTokensHashed(Company $company) { $transformer = new CompanyTokenHashedTransformer($this->serializer);