Skip to content

Commit 7014356

Browse files
authored
feat(currencies): implement currencies import and management (WO-5)
1 parent 45bfa6a commit 7014356

12 files changed

Lines changed: 894 additions & 1 deletion

File tree

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
namespace Eclipse\World\Factories;
4+
5+
use Eclipse\World\Models\Currency;
6+
use Illuminate\Database\Eloquent\Factories\Factory;
7+
8+
class CurrencyFactory extends Factory
9+
{
10+
/**
11+
* The name of the factory's corresponding model.
12+
*
13+
* @var string
14+
*/
15+
protected $model = Currency::class;
16+
17+
/**
18+
* Define the model's default state.
19+
*
20+
* @return array<string, mixed>
21+
*/
22+
public function definition(): array
23+
{
24+
return [
25+
'id' => fake()->lexify('???'),
26+
'name' => fake()->currencyCode(),
27+
'is_active' => fake()->boolean(80), // 80% chance of being active
28+
];
29+
}
30+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Support\Facades\Schema;
6+
7+
return new class extends Migration
8+
{
9+
public function up(): void
10+
{
11+
Schema::table('world_currencies', function (Blueprint $table) {
12+
$table->boolean('is_active')->default(false)->change();
13+
});
14+
}
15+
16+
public function down(): void
17+
{
18+
Schema::table('world_currencies', function (Blueprint $table) {
19+
$table->string('is_active')->change();
20+
});
21+
}
22+
};

resources/lang/en/currencies.php

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
<?php
2+
3+
return [
4+
5+
'nav_label' => 'Currencies',
6+
'breadcrumb' => 'Currencies',
7+
'plural' => 'Currencies',
8+
9+
'table' => [
10+
'id' => [
11+
'label' => 'Code',
12+
],
13+
'name' => [
14+
'label' => 'Name',
15+
],
16+
'is_active' => [
17+
'label' => 'Active',
18+
],
19+
],
20+
21+
'actions' => [
22+
'create' => [
23+
'label' => 'New currency',
24+
'heading' => 'New Currency',
25+
],
26+
'edit' => [
27+
'label' => 'Edit',
28+
'heading' => 'Edit Currency',
29+
],
30+
'delete' => [
31+
'label' => 'Delete',
32+
'heading' => 'Delete Currency',
33+
],
34+
'restore' => [
35+
'label' => 'Restore',
36+
'heading' => 'Restore Currency',
37+
],
38+
'force_delete' => [
39+
'label' => 'Permanent delete',
40+
'heading' => 'Permanent Deletion of Currency',
41+
'description' => 'Are you sure you want to delete the currency :name? This action cannot be undone.',
42+
],
43+
],
44+
45+
'form' => [
46+
'id' => [
47+
'label' => 'Code',
48+
'helper' => 'Three-letter currency code (ISO 4217)',
49+
],
50+
'name' => [
51+
'label' => 'Name',
52+
],
53+
'is_active' => [
54+
'label' => 'Active',
55+
],
56+
],
57+
58+
'import' => [
59+
'action_label' => 'Import Currencies',
60+
'modal_heading' => 'Import Currencies',
61+
'success_title' => 'Import Currencies',
62+
'success_message' => 'The import currencies job has been queued.',
63+
],
64+
65+
'notifications' => [
66+
'success' => [
67+
'title' => 'Currencies Import Completed',
68+
'message' => 'All currencies have been successfully imported and updated.',
69+
],
70+
'failed' => [
71+
'title' => 'Currencies Import Failed',
72+
'message' => 'Failed to import currencies data.',
73+
],
74+
],
75+
];

resources/lang/hr/currencies.php

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
<?php
2+
3+
return [
4+
5+
'nav_label' => 'Valute',
6+
'breadcrumb' => 'Valute',
7+
'plural' => 'Valute',
8+
9+
'table' => [
10+
'id' => [
11+
'label' => 'Kod',
12+
],
13+
'name' => [
14+
'label' => 'Naziv',
15+
],
16+
'is_active' => [
17+
'label' => 'Aktivna',
18+
],
19+
],
20+
21+
'actions' => [
22+
'create' => [
23+
'label' => 'Nova valuta',
24+
'heading' => 'Nova valuta',
25+
],
26+
'edit' => [
27+
'label' => 'Uredi',
28+
'heading' => 'Uredi valutu',
29+
],
30+
'delete' => [
31+
'label' => 'Obriši',
32+
'heading' => 'Obriši valutu',
33+
],
34+
'restore' => [
35+
'label' => 'Vrati',
36+
'heading' => 'Vrati valutu',
37+
],
38+
'force_delete' => [
39+
'label' => 'Trajno obriši',
40+
'heading' => 'Trajno brisanje valute',
41+
'description' => 'Jeste li sigurni da želite obrisati valutu :name? Ova radnja se ne može poništiti.',
42+
],
43+
],
44+
45+
'form' => [
46+
'id' => [
47+
'label' => 'Kod',
48+
'helper' => 'Troslovni kod valute (ISO 4217)',
49+
],
50+
'name' => [
51+
'label' => 'Naziv',
52+
],
53+
'is_active' => [
54+
'label' => 'Aktivna',
55+
],
56+
],
57+
58+
'import' => [
59+
'action_label' => 'Uvezi valute',
60+
'modal_heading' => 'Uvezi valute',
61+
'success_title' => 'Uvezi valute',
62+
'success_message' => 'Posao uvoza valuta je dodan u red za izvršavanje.',
63+
],
64+
65+
'notifications' => [
66+
'success' => [
67+
'title' => 'Uvoz valuta je završen',
68+
'message' => 'Sve valute su uspješno uvezene i ažurirane.',
69+
],
70+
'failed' => [
71+
'title' => 'Uvoz valuta nije uspješan',
72+
'message' => 'Uvoz podataka o valutama nije uspješan.',
73+
],
74+
],
75+
];

resources/lang/sl/currencies.php

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
<?php
2+
3+
return [
4+
5+
'nav_label' => 'Valute',
6+
'breadcrumb' => 'Valute',
7+
'plural' => 'Valute',
8+
9+
'table' => [
10+
'id' => [
11+
'label' => 'Koda',
12+
],
13+
'name' => [
14+
'label' => 'Ime',
15+
],
16+
'is_active' => [
17+
'label' => 'Aktivna',
18+
],
19+
],
20+
21+
'actions' => [
22+
'create' => [
23+
'label' => 'Nova valuta',
24+
'heading' => 'Nova valuta',
25+
],
26+
'edit' => [
27+
'label' => 'Uredi',
28+
'heading' => 'Uredi valuto',
29+
],
30+
'delete' => [
31+
'label' => 'Izbriši',
32+
'heading' => 'Izbriši valuto',
33+
],
34+
'restore' => [
35+
'label' => 'Obnovi',
36+
'heading' => 'Obnovi valuto',
37+
],
38+
'force_delete' => [
39+
'label' => 'Trajno izbriši',
40+
'heading' => 'Trajno brisanje valute',
41+
'description' => 'Ali ste prepričani, da želite izbrisati valuto :name? Tega dejanja ni mogoče razveljaviti.',
42+
],
43+
],
44+
45+
'form' => [
46+
'id' => [
47+
'label' => 'Koda',
48+
'helper' => 'Tritrkovna koda valute (ISO 4217)',
49+
],
50+
'name' => [
51+
'label' => 'Ime',
52+
],
53+
'is_active' => [
54+
'label' => 'Aktivna',
55+
],
56+
],
57+
58+
'import' => [
59+
'action_label' => 'Uvozi valute',
60+
'modal_heading' => 'Uvozi valute',
61+
'success_title' => 'Uvozi valute',
62+
'success_message' => 'Opravilo uvoza valut je bilo dodano v čakalno vrsto.',
63+
],
64+
65+
'notifications' => [
66+
'success' => [
67+
'title' => 'Uvoz valut je končan',
68+
'message' => 'Vse valute so bile uspešno uvožene in posodobljene.',
69+
],
70+
'failed' => [
71+
'title' => 'Uvoz valut ni uspel',
72+
'message' => 'Uvoz podatkov o valutah ni uspel.',
73+
],
74+
],
75+
];

resources/lang/sr/currencies.php

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
<?php
2+
3+
return [
4+
5+
'nav_label' => 'Valute',
6+
'breadcrumb' => 'Valute',
7+
'plural' => 'Valute',
8+
9+
'table' => [
10+
'id' => [
11+
'label' => 'Kod',
12+
],
13+
'name' => [
14+
'label' => 'Naziv',
15+
],
16+
'is_active' => [
17+
'label' => 'Aktivna',
18+
],
19+
],
20+
21+
'actions' => [
22+
'create' => [
23+
'label' => 'Nova valuta',
24+
'heading' => 'Nova valuta',
25+
],
26+
'edit' => [
27+
'label' => 'Uredi',
28+
'heading' => 'Uređivanje valute',
29+
],
30+
'delete' => [
31+
'label' => 'Izbriši',
32+
'heading' => 'Brisanje valute',
33+
],
34+
'restore' => [
35+
'label' => 'Obnovi',
36+
'heading' => 'Obnavljanje valute',
37+
],
38+
'force_delete' => [
39+
'label' => 'Trajno izbriši',
40+
'heading' => 'Trajno brisanje valute',
41+
'description' => 'Da li ste sigurni da želite izbrisati valutu :name? Zapis više neće biti moguće obnoviti.',
42+
],
43+
],
44+
45+
'form' => [
46+
'id' => [
47+
'label' => 'Kod',
48+
'helper' => 'Troslovni kod valute (ISO 4217)',
49+
],
50+
'name' => [
51+
'label' => 'Naziv',
52+
],
53+
'is_active' => [
54+
'label' => 'Aktivna',
55+
],
56+
],
57+
58+
'import' => [
59+
'action_label' => 'Uvezi valute',
60+
'modal_heading' => 'Uvoz valuta',
61+
'success_title' => 'Uvoz valuta',
62+
'success_message' => 'Zadatak za uvoz valuta je dodat u red čekanja.',
63+
],
64+
65+
'notifications' => [
66+
'success' => [
67+
'title' => 'Uvoz valuta završen',
68+
'message' => 'Sve valute su uspešno uvežene i ažurirane.',
69+
],
70+
'failed' => [
71+
'title' => 'Uvoz valuta neuspešan',
72+
'message' => 'Neuspešan uvoz podataka valuta.',
73+
],
74+
],
75+
];

0 commit comments

Comments
 (0)