Skip to content

Commit

Permalink
on adapte les seeds pour pouvoir être lancés sur clever cloud
Browse files Browse the repository at this point in the history
  • Loading branch information
agallou committed Aug 31, 2024
1 parent 093ff4a commit bd79b29
Show file tree
Hide file tree
Showing 8 changed files with 85 additions and 24 deletions.
34 changes: 32 additions & 2 deletions db/seeds/Compta.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,13 @@ public function run()
'description' => 'Une recette qui rapporte',
'attachment_filename' => $path.'/test_file1.pdf',
'idevenement' => 5,
'idcompte' => 1
'idclef' => '',
'idcompte' => 1,
'numero' => '',
'obs_regl' => '',
'idoperation' => 0,
'idmode_regl' => 0,
'date_regl' => '0000-00-00',
],
[
'id' => '2',
Expand All @@ -44,7 +50,15 @@ public function run()
'date_ecriture' => date('Y-10-18'),
'description' => 'Une dépense très utile',
'idevenement' => 5,
'idcompte' => 1

'idcompte' => 1,
'idclef' => 2,
'numero' => '',
'obs_regl' => '',
'idoperation' => 0,

'idmode_regl' => 0,
'date_regl' => '0000-00-00',
],
[
'id' => '3',
Expand All @@ -56,6 +70,14 @@ public function run()
'comment' => null,
'attachment_required' => 1,
'idcompte' => 1,
'idclef' => 3,
'numero' => '',
'obs_regl' => '',
'idoperation' => 0,
'idcategorie' => 0,
'idmode_regl' => 0,
'date_regl' => '0000-00-00',
'idevenement' => 0,
],
[
'id' => '4',
Expand All @@ -68,6 +90,14 @@ public function run()
'attachment_required' => 1,
'idcompte' => 1,
'montant_ht_soumis_tva_20' => 13,
'idclef' => 4,
'numero' => '',
'obs_regl' => '',
'idoperation' => 0,
'idcategorie' => 0,
'idmode_regl' => 0,
'date_regl' => '0000-00-00',
'idevenement' => 0,
],
];

Expand Down
2 changes: 1 addition & 1 deletion db/seeds/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function run()
'date_fin_saisie_nuites_hotel' => $event - $oneDayInSeconds * 7,
'place_name' => 'Paris',
'place_address' => 'Marriott Rive Gauche',
'date_annonce_planning' => date('Y-m-d', $event),
'date_annonce_planning' => date('U', $event),
'transport_information_enabled' => 1,
'has_prices_defined_with_vat' => 1,
],
Expand Down
15 changes: 13 additions & 2 deletions db/seeds/Facture.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@ public function run()
'prenom' => 'Yan',
'etat_paiement' => 1,
'devise_facture' => 'EUR',
'ref_clt1' => 'Forum PHP 2023'
'ref_clt1' => 'Forum PHP 2023',
'service' => '',
'observation' => '',
'ref_clt2' => '',
'ref_clt3' => '',
'tel' => '',
],
[
'id' => '2',
Expand All @@ -43,7 +48,13 @@ public function run()
'prenom' => 'Yan',
'etat_paiement' => 1,
'devise_facture' => 'EUR',
'ref_clt1' => 'Forum PHP 2024'
'ref_clt1' => 'Forum PHP 2024',
'service' => '',
'observation' => '',
'ref_clt2' => '',
'ref_clt3' => '',
'tel' => '',

],
];

Expand Down
6 changes: 5 additions & 1 deletion db/seeds/Feuilles.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,14 @@ private function prepareFeuilles(array $items, $parentId, &$baseId = null)

$preparedFeuiles = [];
foreach ($items as $item) {
$lien = null;
if (isset($item['lien'])) {
$lien = $item['lien'];
}
$preparedFeuiles[$currentId] = [
'id' => ($currentId = ++$baseId),
'nom' => $item['nom'],
'lien' => $item['lien'],
'lien' => $lien,
'id_parent' => $parentId,
'etat' => 1,
];
Expand Down
11 changes: 7 additions & 4 deletions db/seeds/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ public function run()
'language_code' => 'fr',
'markdown' => 1,
'joindin' => 24041,
'date_publication' => null
'date_publication' => null,
'has_allowed_to_sharing_with_local_offices' => 1,
],
[
'session_id' => self::ID_SESSIONS[1],
Expand All @@ -59,7 +60,8 @@ public function run()
'language_code' => 'fr',
'markdown' => 0,
'joindin' => 24138,
'date_publication' => (new \DateTime())->modify('-1 days')->format('Y-m-d H:i:s')
'date_publication' => (new \DateTime())->modify('-1 days')->format('Y-m-d H:i:s'),
'has_allowed_to_sharing_with_local_offices' => 1,
],
[
'session_id' => 3,
Expand All @@ -81,7 +83,8 @@ public function run()
'language_code' => 'fr',
'markdown' => 1,
'joindin' => 24041,
'date_publication' => (new \DateTime())->modify('+5 days')->format('Y-m-d H:i:s')
'date_publication' => (new \DateTime())->modify('+5 days')->format('Y-m-d H:i:s'),
'has_allowed_to_sharing_with_local_offices' => 1,
],
];

Expand Down Expand Up @@ -132,7 +135,7 @@ public function run()
'fin' => $date->format('U'),
'id_salle' => 1,
'id_forum' => Event::ID_FORUM,
'keynote' => ''
'keynote' => 0,
];
++$i;
}
Expand Down
20 changes: 10 additions & 10 deletions db/seeds/Tarif.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,55 +12,55 @@ public function run()
'technical_name' => 'AFUP_FORUM_DEUXIEME_JOURNEE',
'pretty_name' => 'Deuxième journée',
'public' => true,
'members_only' => false,
'members_only' => 0,
'default_price' => 150,
'active' => true,
'day' => 'two',
'cfp_submitter_only' => false,
'cfp_submitter_only' => 0,
],
[
'id' => 2,
'technical_name' => 'AFUP_FORUM_2_JOURNEES',
'pretty_name' => '2 Jours',
'public' => true,
'members_only' => false,
'members_only' => 0,
'default_price' => 250,
'active' => true,
'day' => 'one,two',
'cfp_submitter_only' => false,
'cfp_submitter_only' => 0,
],
[
'id' => 3,
'technical_name' => 'AFUP_FORUM_2_JOURNEES_AFUP',
'pretty_name' => '2 Jours AFUP',
'public' => true,
'members_only' => true,
'members_only' => 1,
'default_price' => 150,
'active' => true,
'day' => 'one,two',
'cfp_submitter_only' => false,
'cfp_submitter_only' => 0,
],
[
'id' => 4,
'technical_name' => 'AFUP_TEST',
'pretty_name' => 'Pour les tests',
'public' => true,
'members_only' => true,
'members_only' => 1,
'default_price' => 100,
'active' => true,
'day' => 'one,two',
'cfp_submitter_only' => false,
'cfp_submitter_only' => 0,
],
[
'id' => 5,
'technical_name' => 'AFUP_CFP',
'pretty_name' => 'Spécial CFP',
'public' => true,
'members_only' => false,
'members_only' => 0,
'default_price' => 2,
'active' => true,
'day' => 'one,two',
'cfp_submitter_only' => true,
'cfp_submitter_only' => 1,
],
];

Expand Down
2 changes: 1 addition & 1 deletion db/seeds/TechletterSubscriptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class TechletterSubscriptions extends AbstractSeed
{
public function run()
{
$subscriptionDate = (new DateTime())->format(DateTime::ATOM);
$subscriptionDate = (new DateTime())->format('Y-m-d H:i:s');
$data = [
[
'user_id' => Users::ID_USER_ADMIN,
Expand Down
19 changes: 16 additions & 3 deletions db/seeds/Users.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ public function run()
'niveau' => 2, // AFUP_DROITS_NIVEAU_ADMINISTRATEUR,
'prenom' => 'Admin',
'email' => '[email protected]',
'niveau_modules' => '00000'
'niveau_modules' => '00000',
'roles' => '',
'adresse' => '',
],
// utilisateur ayant expiré, avec une date de cotisation fixe, utile pour les tests
[
Expand All @@ -84,6 +86,8 @@ public function run()
'prenom' => 'Jean',
'email' => '[email protected]',
'niveau_modules' => '00000',
'roles' => '',
'adresse' => '',
],
// utilisateurs avec des cotisations à dates fixes pour les tests
[
Expand All @@ -97,7 +101,9 @@ public function run()
'niveau_modules' => '00000',
'adresse' => '15, main road',
'code_postal' => '93501-1100',
'ville' => 'Mojave, CA'
'ville' => 'Mojave, CA',
'roles' => '',
'adresse' => '',
],
[
'id' => self::ID_USER_PERSONNE_LIE_PERSONNE_MORALE_FIXED_COTISATIONS,
Expand All @@ -110,6 +116,8 @@ public function run()
'roles' => '["ROLE_COMPANY_MANAGER"]',
'id_personne_morale' => self::ID_PERSONNE_MORALE_HELIOS_AEROSPACE,
'niveau_modules' => '00000',
'roles' => '',
'adresse' => '',
],
[
'id' => self::ID_USER_PERSONNE_MORALE,
Expand All @@ -122,6 +130,8 @@ public function run()
'roles' => '["ROLE_COMPANY_MANAGER"]',
'id_personne_morale' => self::ID_PERSONNE_MORALE_MY_CORP,
'niveau_modules' => '00000',
'roles' => '',
'adresse' => '',
],
[
'id' => self::ID_USER_PERSONNE_MORALE_NON_MANAGER,
Expand All @@ -134,7 +144,9 @@ public function run()
'roles' => '[]',
'id_personne_morale' => self::ID_PERSONNE_MORALE_MY_CORP,
'niveau_modules' => '00000',
'etat' => 1
'etat' => 1,
'roles' => '',
'adresse' => '',
],
[
'id' => self::ID_USER_PERSONNE_PHYSIQUE,
Expand All @@ -147,6 +159,7 @@ public function run()
'roles' => '[]',
'etat' => User::STATUS_ACTIVE,
'niveau_modules' => '00000',
'adresse' => '',
],
];

Expand Down

0 comments on commit bd79b29

Please sign in to comment.