Skip to content

Commit

Permalink
Real Estate Development Accessory Observer typologies
Browse files Browse the repository at this point in the history
Sale Observer Buying Option
  • Loading branch information
michaelnakamura committed Jun 9, 2022
1 parent 812bd4d commit 5c4c387
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
20 changes: 18 additions & 2 deletions src/Observers/RealEstateDevelopment/AccessoryObserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,21 @@ public function created($accessory)

$accessory->loadMissing(
'real_estate_development',
'accessory'
'accessory',
'typologies'
);
if ($accessory->real_estate_development) {
$accessory->real_estate_development->loadMissing(
'blueprints'
);
}
if ($accessory->typologies) {
foreach ($accessory->typologies as $acessoryTypology) {
$acessoryTypology->loadMissing(
'blueprints'
);
}
}

$data = $accessory->toArray();
$data['sync_to'] = 'sys';
Expand All @@ -46,13 +54,21 @@ public function updated($accessory)

$accessory->loadMissing(
'real_estate_development',
'accessory'
'accessory',
'typologies'
);
if ($accessory->real_estate_development) {
$accessory->real_estate_development->loadMissing(
'blueprints'
);
}
if ($accessory->typologies) {
foreach ($accessory->typologies as $acessoryTypology) {
$acessoryTypology->loadMissing(
'blueprints'
);
}
}

$data = $accessory->toArray();
$data['sync_to'] = 'sys';
Expand Down
2 changes: 2 additions & 0 deletions src/Observers/SaleObserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public function created($sale)
'supervisor',
'blueprint',
'proposal_model',
'buying_options',
'periodicities',
'facts',
'real_estate_agency',
Expand Down Expand Up @@ -78,6 +79,7 @@ public function updated($sale)
'supervisor',
'blueprint',
'proposal_model',
'buying_options',
'periodicities',
'facts',
'real_estate_agency',
Expand Down

0 comments on commit 5c4c387

Please sign in to comment.