|
| 1 | +<?php |
| 2 | + |
| 3 | +namespace CarloEusebi\RegistroSportESalute\Factories; |
| 4 | + |
| 5 | +use CarloEusebi\RegistroSportESalute\Organization; |
| 6 | +use Faker\Factory; |
| 7 | + |
| 8 | +class OrganizationFactory |
| 9 | +{ |
| 10 | + public static function create(): Organization |
| 11 | + { |
| 12 | + $faker = Factory::create('it_IT'); |
| 13 | + |
| 14 | + return Organization::fromArray([ |
| 15 | + 'id' => $faker->numberBetween(100000, 999999), |
| 16 | + 'id_pad' => str_pad((string) $faker->numberBetween(100000, 999999), 8, '0', STR_PAD_LEFT), |
| 17 | + 'presentazione_data' => $faker->dateTimeBetween('-5 years', '-1 year')->format('Y-m-d\TH:i:sP'), |
| 18 | + 'approvazione_data' => $faker->dateTimeBetween('-1 year', 'now')->format('Y-m-d\TH:i:sP'), |
| 19 | + 'societa__codiceFiscale' => $faker->regexify('[0-9]{11}'), |
| 20 | + 'societa__iconaVcf' => 'static/icons/age_'.$faker->numberBetween(1, 10).'.png', |
| 21 | + 'organismi_affiliazioni_attive' => [ |
| 22 | + 'static/os/asi.png', |
| 23 | + ], |
| 24 | + 'statoIstruttoria__descrizione' => $faker->randomElement(['Domanda accolta', 'In attesa', 'Domanda respinta']), |
| 25 | + 'utenza' => $faker->optional(0.7, '')->userName, |
| 26 | + 'societa__natura_giuridica' => $faker->randomElement(['Società a Responsabilità Limitata', 'Associazione Sportiva Dilettantistica', 'Società Sportiva Dilettantistica']), |
| 27 | + 'societa__denominazione' => $faker->company, |
| 28 | + 'societa__sedeLegale__regione__denominazione' => $faker->citySuffix, |
| 29 | + 'societa__sedeLegale__comune__denominazione' => $faker->city, |
| 30 | + 'affiliazione_scaduta_organismo_icona' => $faker->optional(0.3, '')->imageUrl(50, 50), |
| 31 | + 'richiestaIntegrazioni_prima_data' => $faker->dateTimeBetween('-1 year', '-6 months')->format('Y-m-d\TH:i:sP'), |
| 32 | + 'richiestaIntegrazioni_ultima_data' => $faker->dateTimeBetween('-6 months', '-3 months')->format('Y-m-d\TH:i:sP'), |
| 33 | + 'invioIntegrazioni_prima_data' => $faker->dateTimeBetween('-3 months', '-2 months')->format('Y-m-d\TH:i:sP'), |
| 34 | + 'invioIntegrazioni_ultima_data' => $faker->dateTimeBetween('-2 months', '-1 month')->format('Y-m-d\TH:i:sP'), |
| 35 | + 'richiestaAggiornamenti_ultima_data' => $faker->dateTimeBetween('-1 month', 'now')->format('Y-m-d\TH:i:sP'), |
| 36 | + 'richiestaAggiornamenti_icona' => [ |
| 37 | + 'icona' => $faker->randomElement(['fa-solid fa-check', 'fa-solid fa-times', 'fa-solid fa-exclamation']), |
| 38 | + 'colore' => $faker->randomElement(['verde', 'rosso', 'giallo']), |
| 39 | + ], |
| 40 | + 'invioAggiornamenti_ultima_data' => $faker->dateTimeBetween('-1 month')->format('Y-m-d\TH:i:sP'), |
| 41 | + 'tipoIstruttoria' => $faker->numberBetween(1, 3), |
| 42 | + 'statoIstruttoria_icona' => [ |
| 43 | + 'icona' => $faker->randomElement(['fa-solid fa-check', 'fa-solid fa-times', 'fa-solid fa-exclamation']), |
| 44 | + 'colore' => $faker->randomElement(['verde', 'rosso', 'giallo']), |
| 45 | + ], |
| 46 | + ]); |
| 47 | + } |
| 48 | +} |
0 commit comments