PluginProbe
Billingo Official for WooCommerce / trunk
Billingo Official for WooCommerce vtrunk
4.3.3 4.3.2 trunk 0.0.2 1.0.0 2.0 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 All 82 releases
billingo / src / Factories / PartnerFactory.php

PartnerFactory.php in Billingo Official for WooCommerce trunk, at src/Factories/PartnerFactory.php

38 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace App\Billingo\Factories;
4
5 use App\Billingo\Enums\Partner\ShowTypeEnum;
6 use App\Billingo\Enums\Partner\TaxTypeEnum;
7 use App\Billingo\Models\Address;
8 use App\Billingo\Models\Partner\PartnerCustomBillingoSettings;
9 use App\Billingo\Models\Partner\PartnerGiroSettings;
10 use App\Billingo\Models\Partner\PartnerShipping;
11
12 class PartnerFactory extends BaseFactory
13 {
14
15 public function definition(): array
16 {
17 return [
18 'id' => $this->faker->numberBetween(1, 1000),
19 'name' => $this->faker->company(),
20 'address' => Address::factory(),
21 'emails' => $this->faker->boolean() ? [$this->faker->email(), $this->faker->email()] : null,
22 'taxcode' => $this->faker->optional()->regexify('[0-9]{8}-[0-9]{1}-[0-9]{2}'),
23 'iban' => $this->faker->optional()->iban(),
24 'swift' => $this->faker->optional()->swiftBicNumber(),
25 'account_number' => $this->faker->optional()->regexify('[A-Z]{2}--[0-9]{6}'),
26 'phone' => $this->faker->optional()->phoneNumber(),
27 'general_ledger_number' => $this->faker->optional()->regexify('[0-9]{5}'),
28 'tax_type' => $this->faker->optional()->randomElement(getEnumValues(TaxTypeEnum::class)),
29 'custom_billing_settings' => $this->faker->boolean() ? PartnerCustomBillingoSettings::factory() : null,
30 'group_member_tax_number' => $this->faker->optional()->regexify('[0-9]{8}'),
31 'giro_settings' => $this->faker->boolean() ? PartnerGiroSettings::factory() : null,
32 'partner_shipping' => $this->faker->boolean() ? PartnerShipping::factory() : null,
33 'internal_comment' => $this->faker->optional()->sentence(),
34 'partner_show_type' => $this->faker->optional()->randomElement(getEnumValues(ShowTypeEnum::class)),
35 ];
36 }
37 }
38