Make sure all objects also add user group

This commit is contained in:
James Cole
2023-08-11 19:37:28 +02:00
parent e1ba2d9ad9
commit a9bd0f551d
20 changed files with 60 additions and 38 deletions

View File

@@ -92,6 +92,7 @@ class AccountFactory
$return = $this->create(
[
'user_id' => $this->user->id,
'user_group_id' => $this->user->user_group_id,
'name' => $accountName,
'account_type_id' => $type->id,
'account_type_name' => null,
@@ -199,6 +200,7 @@ class AccountFactory
$active = array_key_exists('active', $data) ? $data['active'] : true;
$databaseData = [
'user_id' => $this->user->id,
'user_group_id' => $this->user->user_group_id,
'account_type_id' => $type->id,
'name' => $data['name'],
'order' => 25000,

View File

@@ -67,6 +67,7 @@ class BillFactory
'match' => 'MIGRATED_TO_RULES',
'amount_min' => $data['amount_min'],
'user_id' => $this->user->id,
'user_group_id' => $this->user->user_group_id,
'transaction_currency_id' => $currency->id,
'amount_max' => $data['amount_max'],
'date' => $data['date'],

View File

@@ -70,8 +70,9 @@ class CategoryFactory
try {
return Category::create(
[
'user_id' => $this->user->id,
'name' => $categoryName,
'user_id' => $this->user->id,
'user_group_id' => $this->user->user_group_id,
'name' => $categoryName,
]
);
} catch (QueryException $e) {

View File

@@ -107,6 +107,7 @@ class RecurrenceFactory
$recurrence = new Recurrence(
[
'user_id' => $this->user->id,
'user_group_id' => $this->user->user_group_id,
'transaction_type_id' => $type->id,
'title' => $title,
'description' => $description,

View File

@@ -83,14 +83,15 @@ class TagFactory
$latitude = 0.0 === (float)$data['latitude'] ? null : (float)$data['latitude']; // intentional float
$longitude = 0.0 === (float)$data['longitude'] ? null : (float)$data['longitude']; // intentional float
$array = [
'user_id' => $this->user->id,
'tag' => trim($data['tag']),
'tagMode' => 'nothing',
'date' => $data['date'],
'description' => $data['description'],
'latitude' => null,
'longitude' => null,
'zoomLevel' => null,
'user_id' => $this->user->id,
'user_group_id' => $this->user->user_group_id,
'tag' => trim($data['tag']),
'tagMode' => 'nothing',
'date' => $data['date'],
'description' => $data['description'],
'latitude' => null,
'longitude' => null,
'zoomLevel' => null,
];
$tag = Tag::create($array);
if (null !== $tag && null !== $latitude && null !== $longitude) {