Feat: Adds multi currency support (#88)

This commit is contained in:
hackerESQ
2025-04-09 19:25:15 -05:00
committed by GitHub
parent 6d6f968f42
commit eae345f243
100 changed files with 17735 additions and 35761 deletions
+32 -4
View File
@@ -41,28 +41,35 @@ class TransactionFactory extends Factory
public function yearsAgo(): static
{
return $this->state(fn (array $attributes) => [
'date' => $this->faker->dateTimeBetween('-5 years', '-3 years')->format('Y-m-d'),
'date' => now()->subYears($this->faker->numberBetween(3, 5))->toDateString(),
]);
}
public function lastYear(): static
{
return $this->state(fn (array $attributes) => [
'date' => now()->subYear()->format('Y-m-d'),
'date' => now()->subYear()->toDateString(),
]);
}
public function lastMonth(): static
{
return $this->state(fn (array $attributes) => [
'date' => now()->subMonth()->format('Y-m-d'),
'date' => now()->subMonth()->toDateString(),
]);
}
public function recent(): static
{
return $this->state(fn (array $attributes) => [
'date' => $this->faker->dateTimeBetween('-2 weeks', 'now')->format('Y-m-d'),
'date' => now()->subDays($this->faker->numberBetween(3, 14))->toDateString(),
]);
}
public function date($date): static
{
return $this->state(fn (array $attributes) => [
'date' => $date,
]);
}
@@ -80,6 +87,27 @@ class TransactionFactory extends Factory
]);
}
public function currency($currency): static
{
return $this->state(fn (array $attributes) => [
'currency' => $currency,
]);
}
public function costBasis($cost_basis): static
{
return $this->state(fn (array $attributes) => [
'cost_basis' => $cost_basis,
]);
}
public function salePrice($sale_price): static
{
return $this->state(fn (array $attributes) => [
'sale_price' => $sale_price,
]);
}
public function buy(): static
{
return $this->state(fn (array $attributes) => [