Skip to content

Commit 8ca1248

Browse files
Feature/wip (#1013)
* wip product * init productgroup * wip connect * fix columns for product * cleanup productgroup * added bulking to transform * Fix styling * transform cleanup * Fix styling * feat connect options for listening to queue * Update ProductGroupResource.php * Update ProductResource.php * feat transform bulk function * Fix styling * fix transform from item->record * cleanup connect * cleanup transform * Fix styling * wip address * wip company * wip contact * wip department * wip productgroup + product * wip staff * changed transform for more complex variables * Fix styling * wip contact auth * wip core relation fix * fix db column * fix db column supplier * Update SupplierRules.php * wip transform * wip product * cleanup productgroup * feat connect options for listening to queue * feat transform bulk function * Fix styling * cleanup connect * cleanup transform * Fix styling * wip productgroup + product * Fix styling * Fix styling * add moox/verapdf
1 parent 69989b0 commit 8ca1248

195 files changed

Lines changed: 11036 additions & 4226 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

packages/address/database/migrations/create_addresses_table.php.stub

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ return new class extends Migration
1414
$table->id();
1515
$table->string('label', 120)->nullable();
1616
$table->string('name', 160)->nullable();
17-
$table->string('street', 160)->nullable();
17+
$table->string('street', 160);
1818
$table->string('street2', 160)->nullable();
19-
$table->string('postal_code', 20)->nullable()->index();
20-
$table->string('city', 120)->nullable()->index();
19+
$table->string('postal_code', 20)->index();
20+
$table->string('city', 120)->index();
2121
$table->string('state', 120)->nullable();
22-
$table->string('country_code', 2)->nullable()->index();
22+
$table->string('country_code', 2)->index();
2323
$table->boolean('is_primary')->default(false)->index();
2424
$table->json('data')->nullable();
2525
$table->softDeletes();

packages/address/src/Models/Address.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919
*
2020
* @property string|null $label
2121
* @property string|null $name
22-
* @property string|null $street
22+
* @property string $street
2323
* @property string|null $street2
24-
* @property string|null $postal_code
25-
* @property string|null $city
24+
* @property string $postal_code
25+
* @property string $city
2626
* @property string|null $state
27-
* @property string|null $country_code
27+
* @property string $country_code
2828
* @property bool $is_primary
2929
* @property array<string, mixed>|null $data
3030
*/

packages/address/src/Resources/AddressResource.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ public static function form(Schema $form): Schema
8080
->maxLength(120),
8181
TextInput::make('name')
8282
->label(__('address::fields.name'))
83-
->required()
8483
->rules(AddressRules::for('name'))
8584
->maxLength(160),
8685
TextInput::make('street')
@@ -189,7 +188,7 @@ public static function table(Table $table): Table
189188
->sortable(),
190189
...static::getTaxonomyColumns(),
191190
])
192-
->defaultSort('name')
191+
->defaultSort('id', 'desc')
193192
->recordActions([...static::getTableActions()])
194193
->toolbarActions([...static::getBulkActions()])
195194
->filters([

packages/address/src/Support/AddressRules.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public static function rules(): array
1313
{
1414
return [
1515
'label' => ['nullable', 'string', 'max:120'],
16-
'name' => ['required', 'string', 'max:160'],
16+
'name' => ['nullable', 'string', 'max:160'],
1717
'street' => ['required', 'string', 'max:160'],
1818
'street2' => ['nullable', 'string', 'max:160'],
1919
'postal_code' => ['required', 'string', 'max:20'],

packages/address/tests/Feature/FilamentAddressTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434

3535
it('can render table columns for addresses', function (): void {
3636
livewire(ListAddresses::class)
37-
->assertTableColumnExists('name')
37+
->assertTableColumnExists('label')
38+
->assertTableColumnExists('street')
3839
->assertTableColumnExists('city')
3940
->assertTableColumnExists('postal_code')
4041
->assertTableColumnExists('country_code')

packages/company/config/company.php

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,6 @@
2424
'archived',
2525
],
2626

27-
'company_types' => [
28-
'customer',
29-
'supplier',
30-
'partner',
31-
'prospect',
32-
'internal',
33-
],
34-
3527
'default_currency_code' => 'EUR',
3628

3729
'resources' => [
@@ -57,9 +49,9 @@
5749
'icon' => 'gmdi-check-circle-o',
5850
'query' => [
5951
[
60-
'field' => 'is_active',
52+
'field' => 'status',
6153
'operator' => '=',
62-
'value' => true,
54+
'value' => 'active',
6355
],
6456
[
6557
'field' => 'deleted_at',
@@ -100,8 +92,8 @@
10092
'model' => Company::class,
10193
'related_resource' => CompanyResource::class,
10294
'foreign_key' => 'parent_id',
103-
'display_columns' => ['name', 'company_type', 'status'],
104-
'badge_columns' => ['company_type', 'status'],
95+
'display_columns' => ['name', 'status'],
96+
'badge_columns' => ['status'],
10597
'record_select_search_columns' => ['name', 'display_name', 'legal_name'],
10698
'actions' => [
10799
'header' => ['associate'],
@@ -120,8 +112,8 @@
120112
'model' => Company::class,
121113
'related_resource' => CompanyResource::class,
122114
'foreign_key' => 'parent_id',
123-
'display_columns' => ['name', 'company_type', 'status'],
124-
'badge_columns' => ['company_type', 'status'],
115+
'display_columns' => ['name', 'status'],
116+
'badge_columns' => ['status'],
125117
'create_prefill' => [
126118
'parent_id' => 'owner.id',
127119
],

packages/company/database/Factories/CompanyFactory.php

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ public function definition(): array
2727
'display_name' => $name,
2828
'legal_name' => fake()->optional(0.6)->company().' '.fake()->randomElement(['GmbH', 'AG', 'KG', 'OHG', 'Ltd.']),
2929
'note' => fake()->optional(0.2)->sentence(),
30-
'search_terms' => null,
3130
'parent_id' => null,
3231
'external_reference' => fake()->optional(0.3)->bothify('EXT-####'),
3332
'phone' => fake()->optional(0.7)->phoneNumber(),
@@ -36,37 +35,12 @@ public function definition(): array
3635
'email' => fake()->optional(0.8)->companyEmail(),
3736
'tax_number' => fake()->optional(0.4)->numerify('########'),
3837
'vat_number' => fake()->optional(0.5)->bothify('DE#########'),
39-
'has_no_vat_number' => false,
40-
'partner_type' => null,
41-
'partner_id' => null,
42-
'company_type' => fake()->randomElement(config('company.company_types', ['customer'])),
4338
'default_currency_code' => config('company.default_currency_code', 'EUR'),
44-
'is_fully_owned_subsidiary' => false,
45-
'no_marketing_action' => fake()->boolean(10),
46-
'no_marketing_action_reason' => null,
4739
'language_id' => null,
48-
'localization_id' => null,
49-
'sort' => fake()->optional(0.3)->numberBetween(1, 999),
50-
'is_active' => true,
51-
'approved_at' => null,
5240
'data' => null,
5341
];
5442
}
5543

56-
public function customer(): static
57-
{
58-
return $this->state(fn (): array => [
59-
'company_type' => 'customer',
60-
]);
61-
}
62-
63-
public function supplier(): static
64-
{
65-
return $this->state(fn (): array => [
66-
'company_type' => 'supplier',
67-
]);
68-
}
69-
7044
public function draft(): static
7145
{
7246
return $this->state(fn (): array => [
@@ -77,7 +51,6 @@ public function draft(): static
7751
public function inactive(): static
7852
{
7953
return $this->state(fn (): array => [
80-
'is_active' => false,
8154
'status' => 'inactive',
8255
]);
8356
}
@@ -86,7 +59,6 @@ public function withParent(Company $parent): static
8659
{
8760
return $this->state(fn (): array => [
8861
'parent_id' => $parent->getKey(),
89-
'is_fully_owned_subsidiary' => fake()->boolean(70),
9062
]);
9163
}
9264
}

packages/company/database/migrations/create_companies_table.php.stub

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ return new class extends Migration
1818
$table->string('display_name', 120)->nullable();
1919
$table->string('legal_name', 120)->nullable();
2020
$table->text('note')->nullable();
21-
$table->text('search_terms')->nullable();
2221

2322
$table->foreignUuid('parent_id')->nullable()->constrained('companies')->nullOnDelete();
2423
$table->string('external_reference', 100)->nullable()->index();
@@ -30,23 +29,9 @@ return new class extends Migration
3029

3130
$table->string('tax_number', 30)->nullable();
3231
$table->string('vat_number', 30)->nullable();
33-
$table->boolean('has_no_vat_number')->default(false);
3432

35-
$table->unsignedTinyInteger('partner_type')->nullable()->index();
36-
$table->unsignedBigInteger('partner_id')->nullable()->index();
37-
$table->string('company_type', 30)->default('customer')->index();
3833
$table->char('default_currency_code', 3)->default('EUR');
39-
$table->boolean('is_fully_owned_subsidiary')->default(false);
40-
$table->boolean('no_marketing_action')->default(false);
41-
$table->string('no_marketing_action_reason', 255)->nullable();
42-
4334
$table->foreignId('language_id')->nullable()->constrained('static_languages')->nullOnDelete();
44-
$table->foreignId('localization_id')->nullable()->constrained('localizations')->nullOnDelete();
45-
46-
$table->integer('sort')->nullable();
47-
$table->boolean('is_active')->default(true)->index();
48-
$table->timestamp('approved_at')->nullable();
49-
$table->nullableMorphs('approved_by');
5035

5136
$table->json('data')->nullable();
5237
$table->softDeletes();

packages/company/resources/lang/de/fields.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
'display_name' => 'Anzeigename',
77
'legal_name' => 'Rechtlicher Name',
88
'note' => 'Notiz',
9-
'search_terms' => 'Suchbegriffe',
109
'parent' => 'Muttergesellschaft',
1110
'children' => 'Tochtergesellschaften',
1211
'contacts' => 'Kontakte',
@@ -20,24 +19,12 @@
2019
'email' => 'E-Mail',
2120
'tax_number' => 'Steuernummer',
2221
'vat_number' => 'USt-IdNr.',
23-
'has_no_vat_number' => 'Keine USt-IdNr.',
24-
'partner_type' => 'Partner-Typ',
25-
'partner_id' => 'Partner-ID',
26-
'company_type' => 'Firmentyp',
2722
'default_currency_code' => 'Standardwährung',
28-
'is_fully_owned_subsidiary' => 'Vollständige Tochter',
29-
'no_marketing_action' => 'Kein Marketing',
30-
'no_marketing_action_reason' => 'Grund (kein Marketing)',
3123
'language_id' => 'Sprache',
32-
'localization_id' => 'Lokalisierung',
33-
'sort' => 'Sortierung',
34-
'is_active' => 'Aktiv',
35-
'approved_at' => 'Freigegeben am',
3624
'data' => 'Zusätzliche Daten',
3725
'identity' => 'Stammdaten',
3826
'contact' => 'Kontakt',
3927
'tax' => 'Steuer & Register',
40-
'partner' => 'Partner-Verknüpfung',
4128
'settings' => 'Einstellungen',
4229
'active' => 'Aktiv',
4330
'customers' => 'Kunden',

packages/company/resources/lang/en/fields.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
'display_name' => 'Display name',
77
'legal_name' => 'Legal name',
88
'note' => 'Note',
9-
'search_terms' => 'Search terms',
109
'parent' => 'Parent company',
1110
'children' => 'Subsidiaries',
1211
'addresses' => 'Addresses',
@@ -20,24 +19,12 @@
2019
'email' => 'Email',
2120
'tax_number' => 'Tax number',
2221
'vat_number' => 'VAT number',
23-
'has_no_vat_number' => 'No VAT number',
24-
'partner_type' => 'Partner type',
25-
'partner_id' => 'Partner ID',
26-
'company_type' => 'Company type',
2722
'default_currency_code' => 'Default currency',
28-
'is_fully_owned_subsidiary' => 'Fully owned subsidiary',
29-
'no_marketing_action' => 'No marketing',
30-
'no_marketing_action_reason' => 'No marketing reason',
3123
'language_id' => 'Language',
32-
'localization_id' => 'Localization',
33-
'sort' => 'Sort order',
34-
'is_active' => 'Active',
35-
'approved_at' => 'Approved at',
3624
'data' => 'Additional data',
3725
'identity' => 'Identity',
3826
'contact' => 'Contact',
3927
'tax' => 'Tax & registration',
40-
'partner' => 'Partner link',
4128
'settings' => 'Settings',
4229
'active' => 'Active',
4330
'customers' => 'Customers',

0 commit comments

Comments
 (0)