Skip to content

Commit 2b08899

Browse files
authored
feat: implement tariff codes (WO-10)
* feat(tariff-codes): implement tariff codes * chore: tariff codes improvements * chore: import improvements * chore: format * chore: capitalize only first letter
1 parent 421264d commit 2b08899

17 files changed

Lines changed: 1470 additions & 1 deletion

File tree

composer.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,10 @@
4545
"datalinx/php-utils": "^2.5",
4646
"eclipsephp/common": "dev-main",
4747
"filament/filament": "^3.3",
48+
"filament/spatie-laravel-translatable-plugin": "^3.3",
4849
"laravel/framework": "^11.0|^12.0",
49-
"spatie/laravel-package-tools": "^1.19"
50+
"spatie/laravel-package-tools": "^1.19",
51+
"spatie/laravel-translatable": "^6.11"
5052
},
5153
"require-dev": {
5254
"laravel/pint": "^1.21",
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
namespace Eclipse\World\Factories;
4+
5+
use Eclipse\World\Models\TariffCode;
6+
use Illuminate\Database\Eloquent\Factories\Factory;
7+
8+
class TariffCodeFactory extends Factory
9+
{
10+
protected $model = TariffCode::class;
11+
12+
public function definition(): array
13+
{
14+
return [
15+
'year' => (int) date('Y'),
16+
'code' => $this->faker->unique()->numerify('####'),
17+
'name' => [
18+
'en' => $this->faker->words(3, true),
19+
],
20+
'measure_unit' => [
21+
'en' => $this->faker->randomElement(['pcs', 'kg', 'l', 'm']),
22+
],
23+
];
24+
}
25+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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::create('world_tariff_codes', function (Blueprint $table) {
12+
$table->id();
13+
$table->smallInteger('year')->index();
14+
$table->string('code', 20)->index();
15+
$table->json('name');
16+
$table->json('measure_unit')->nullable();
17+
$table->timestamps();
18+
$table->softDeletes();
19+
20+
$table->unique(['year', 'code']);
21+
});
22+
}
23+
24+
public function down(): void
25+
{
26+
Schema::dropIfExists('world_tariff_codes');
27+
}
28+
};

resources/lang/en/tariff-codes.php

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
<?php
2+
3+
return [
4+
5+
'nav_label' => 'Tariff Codes',
6+
'breadcrumb' => 'Tariff Codes',
7+
'plural' => 'Tariff Codes',
8+
9+
'table' => [
10+
'year' => [
11+
'label' => 'Year',
12+
],
13+
'code' => [
14+
'label' => 'Code',
15+
],
16+
'name' => [
17+
'label' => 'Name',
18+
],
19+
],
20+
21+
'actions' => [
22+
'create' => [
23+
'label' => 'New tariff code',
24+
'heading' => 'New Tariff Code',
25+
],
26+
'edit' => [
27+
'label' => 'Edit',
28+
'heading' => 'Edit Tariff Code',
29+
],
30+
'delete' => [
31+
'label' => 'Delete',
32+
'heading' => 'Delete Tariff Code',
33+
],
34+
'restore' => [
35+
'label' => 'Restore',
36+
'heading' => 'Restore Tariff Code',
37+
],
38+
'force_delete' => [
39+
'label' => 'Permanent delete',
40+
'heading' => 'Permanent Deletion of Tariff Code',
41+
'description' => 'Are you sure you want to delete the tariff code :name? This action cannot be undone.',
42+
],
43+
],
44+
45+
'form' => [
46+
'year' => [
47+
'label' => 'Year',
48+
],
49+
'code' => [
50+
'label' => 'Code',
51+
],
52+
'name' => [
53+
'label' => 'Name',
54+
],
55+
'measure_unit' => [
56+
'label' => 'Measure unit',
57+
],
58+
],
59+
60+
'validation' => [
61+
'code' => [
62+
'unique' => 'A tariff code with this code already exists.',
63+
],
64+
],
65+
66+
'import' => [
67+
'action_label' => 'Import Tariff Codes',
68+
'modal_heading' => 'Import CN tariff codes',
69+
'locales_label' => 'Locales',
70+
'job_name' => 'Import Tariff Codes',
71+
],
72+
73+
'notifications' => [
74+
'queued' => [
75+
'title' => 'Tariff Codes Import queued',
76+
],
77+
'completed' => [
78+
'title' => 'Tariff Codes Import completed',
79+
],
80+
'failed' => [
81+
'title' => 'Tariff Codes Import failed',
82+
],
83+
],
84+
];

resources/lang/hr/tariff-codes.php

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
<?php
2+
3+
return [
4+
5+
'nav_label' => 'Carinske šifre',
6+
'breadcrumb' => 'Carinske šifre',
7+
'plural' => 'Carinske šifre',
8+
9+
'table' => [
10+
'year' => [
11+
'label' => 'Godina',
12+
],
13+
'code' => [
14+
'label' => 'Šifra',
15+
],
16+
'name' => [
17+
'label' => 'Naziv',
18+
],
19+
],
20+
21+
'actions' => [
22+
'create' => [
23+
'label' => 'Nova carinska šifra',
24+
'heading' => 'Nova carinska šifra',
25+
],
26+
'edit' => [
27+
'label' => 'Uredi',
28+
'heading' => 'Uredi carinsku šifru',
29+
],
30+
'delete' => [
31+
'label' => 'Obriši',
32+
'heading' => 'Obriši carinsku šifru',
33+
],
34+
'restore' => [
35+
'label' => 'Vrati',
36+
'heading' => 'Vrati carinsku šifru',
37+
],
38+
'force_delete' => [
39+
'label' => 'Trajno brisanje',
40+
'heading' => 'Trajno brisanje carinske šifre',
41+
'description' => 'Jeste li sigurni da želite obrisati carinsku šifru :name? Ova radnja je nepovratna.',
42+
],
43+
],
44+
45+
'form' => [
46+
'year' => [
47+
'label' => 'Godina',
48+
],
49+
'code' => [
50+
'label' => 'Šifra',
51+
],
52+
'name' => [
53+
'label' => 'Naziv',
54+
],
55+
'measure_unit' => [
56+
'label' => 'Mjerna jedinica',
57+
],
58+
],
59+
60+
'validation' => [
61+
'code' => [
62+
'unique' => 'Carinska šifra s ovom šifrom već postoji.',
63+
],
64+
],
65+
66+
'import' => [
67+
'action_label' => 'Uvoz carinskih šifara',
68+
'modal_heading' => 'Uvoz CN carinskih šifara',
69+
'locales_label' => 'Jezici',
70+
'job_name' => 'Uvoz carinskih šifara',
71+
],
72+
73+
'notifications' => [
74+
'queued' => [
75+
'title' => 'Uvoz carinskih šifara na čekanju',
76+
],
77+
'completed' => [
78+
'title' => 'Uvoz carinskih šifara dovršen',
79+
],
80+
'failed' => [
81+
'title' => 'Uvoz carinskih šifara nije uspio',
82+
],
83+
],
84+
];

resources/lang/sl/tariff-codes.php

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
<?php
2+
3+
return [
4+
5+
'nav_label' => 'Carinske oznake',
6+
'breadcrumb' => 'Carinske oznake',
7+
'plural' => 'Carinske oznake',
8+
9+
'table' => [
10+
'year' => [
11+
'label' => 'Leto',
12+
],
13+
'code' => [
14+
'label' => 'Koda',
15+
],
16+
'name' => [
17+
'label' => 'Naziv',
18+
],
19+
],
20+
21+
'actions' => [
22+
'create' => [
23+
'label' => 'Nova carinska oznaka',
24+
'heading' => 'Nova carinska oznaka',
25+
],
26+
'edit' => [
27+
'label' => 'Uredi',
28+
'heading' => 'Uredi carinsko oznako',
29+
],
30+
'delete' => [
31+
'label' => 'Izbriši',
32+
'heading' => 'Izbriši carinsko oznako',
33+
],
34+
'restore' => [
35+
'label' => 'Obnovi',
36+
'heading' => 'Obnovi carinsko oznako',
37+
],
38+
'force_delete' => [
39+
'label' => 'Trajni izbris',
40+
'heading' => 'Trajni izbris carinske oznake',
41+
'description' => 'Ali ste prepričani, da želite izbrisati carinsko oznako :name? Tega dejanja ni mogoče razveljaviti.',
42+
],
43+
],
44+
45+
'form' => [
46+
'year' => [
47+
'label' => 'Leto',
48+
],
49+
'code' => [
50+
'label' => 'Koda',
51+
],
52+
'name' => [
53+
'label' => 'Naziv',
54+
],
55+
'measure_unit' => [
56+
'label' => 'Merska enota',
57+
],
58+
],
59+
60+
'validation' => [
61+
'code' => [
62+
'unique' => 'Carinska oznaka s to kodo že obstaja.',
63+
],
64+
],
65+
66+
'import' => [
67+
'action_label' => 'Uvozi carinske oznake',
68+
'modal_heading' => 'Uvoz CN carinskih oznak',
69+
'locales_label' => 'Jeziki',
70+
'job_name' => 'Uvoz carinskih oznak',
71+
],
72+
73+
'notifications' => [
74+
'queued' => [
75+
'title' => 'Uvoz carinskih oznak v čakalni vrsti',
76+
],
77+
'completed' => [
78+
'title' => 'Uvoz carinskih oznak zaključen',
79+
],
80+
'failed' => [
81+
'title' => 'Uvoz carinskih oznak ni uspel',
82+
],
83+
],
84+
];

0 commit comments

Comments
 (0)