Rename default to native.

This commit is contained in:
James Cole
2025-01-19 11:40:07 +01:00
parent 3766128cb8
commit ae366341cc
10 changed files with 29 additions and 27 deletions

View File

@@ -37,7 +37,7 @@ class TransactionCurrency extends Model
use ReturnsIntegerIdTrait;
use SoftDeletes;
public ?bool $userGroupDefault = null;
public ?bool $userGroupNative = null;
public ?bool $userGroupEnabled = null;
protected $casts
= [
@@ -73,8 +73,8 @@ class TransactionCurrency extends Model
public function refreshForUser(User $user): void
{
$current = $user->userGroup->currencies()->where('transaction_currencies.id', $this->id)->first();
$default = app('amount')->getDefaultCurrencyByUserGroup($user->userGroup);
$this->userGroupDefault = $default->id === $this->id;
$native = app('amount')->getDefaultCurrencyByUserGroup($user->userGroup);
$this->userGroupNative = $native->id === $this->id;
$this->userGroupEnabled = null !== $current;
}