refactor: extract rate formatting logic to RateService and add tests

This commit is contained in:
2025-05-31 15:22:50 +03:00
parent b19748ef20
commit cc4e74f3f1
13 changed files with 278 additions and 56 deletions
+8 -2
View File
@@ -19,6 +19,14 @@ class CityFactory extends Factory
{
return [
'name' => fake()->randomElement(City::supportedCities()),
'label' => function ($attributes) {
return match ($attributes['name']) {
City::SANAA => 'صنعاء',
City::ADEN => 'عدن',
default => $attributes['name'],
};
},
];
}
@@ -26,7 +34,6 @@ class CityFactory extends Factory
{
return $this->state([
'name' => City::SANAA,
'label' => 'صنعاء',
]);
}
@@ -34,7 +41,6 @@ class CityFactory extends Factory
{
return $this->state([
'name' => City::ADEN,
'label' => 'عدن',
]);
}
}