| 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 |
|