Skip to content

Commit

Permalink
Merge pull request #408 from afup/import-2023
Browse files Browse the repository at this point in the history
import 2023
  • Loading branch information
BenoitLeveque authored Mar 4, 2024
2 parents ca3d588 + f298f89 commit 78704aa
Show file tree
Hide file tree
Showing 45 changed files with 1,611 additions and 648 deletions.
3 changes: 0 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@
"symfony/flex": true,
"symfony/runtime": true
},
"platform": {
"php": "8.1.0"
},
"preferred-install": {
"*": "dist"
},
Expand Down
1,309 changes: 687 additions & 622 deletions composer.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion config/routes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ afup_barometre_homepage:
methods: GET
controller: Symfony\Bundle\FrameworkBundle\Controller\RedirectController
defaults:
path: /about
path: /report/2023
permanent: false

afup_barometre_form:
Expand Down
21 changes: 21 additions & 0 deletions config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,24 @@ services:
parent: App\Report\AbstractReport
tags: ['barometre.report']

App\Report\AgeReport:
parent: App\Report\AbstractReport
tags: ['barometre.report']

App\Report\LeaveJobReport:
parent: App\Report\AbstractReport
tags: ['barometre.report']

App\Report\ExperienceInCurrentJobReport:
parent: App\Report\AbstractReport
tags: ['barometre.report']

App\Report\RetrainingReport:
parent: App\Report\AbstractReport
tags: ['barometre.report']
calls:
- setChildReports: [ [ '@App\Report\RetrainingEvolutionReport' ] ]

App\Report\SpecialitySalaryReport:
parent: App\Report\AbstractReport
tags: ['barometre.report']
Expand All @@ -205,6 +223,9 @@ services:
App\Report\PhpVersionEvolutionReport:
parent: App\Report\AbstractDistributionEvolutionReport

App\Report\RetrainingEvolutionReport:
parent: App\Report\AbstractDistributionEvolutionReport

App\Report\PhpVersionReport:
parent: App\Report\AbstractReport
calls:
Expand Down
26 changes: 26 additions & 0 deletions migrations/Version20231230123408.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

declare(strict_types=1);

namespace Application\Migrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

final class Version20231230123408 extends AbstractMigration
{
public function getDescription(): string
{
return 'new column for campaign 2023';
}

public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE response ADD leaveJob INT DEFAULT NULL, ADD discriminationDuringHiring INT DEFAULT NULL, ADD communityInclusion INT DEFAULT NULL, ADD age INT DEFAULT NULL');
}

public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE response DROP leaveJob, DROP discriminationDuringHiring, DROP communityInclusion, DROP age');
}
}
Binary file added public/reports/2023/evolution_age.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/reports/2023/evolution_php.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/reports/2023/evolution_retraining.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/reports/2023/evolution_salaire.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/reports/2023/evolution_salaire_genre.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/reports/2023/experience_in_current_job.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/reports/2023/leave_job.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/reports/2023/speciality.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 50 additions & 0 deletions src/Campaign/Format/Formats/Format2023.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?php

declare(strict_types=1);

namespace App\Campaign\Format\Formats;

class Format2023 extends Format2021
{
public function getColumns()
{
return [
'', // Horodateur,
'gross_annual_salary', // Quelle est votre rémunération annuelle brute fixe en euro ?
'variable_annual_salary', // Quelle est votre rémunération annuelle brut variable (hors part fixe) en euro ?
'salary_satisfaction', // Estimez-vous votre rémunération satisfaisante ?
'salary_inflation', // Votre entreprise vous propose-t-elle à minima une réévaluation annuelle de votre rémunération du niveau de l’inflation ?
'initial_training', // Quelle est votre formation initiale ?
'retraining', // Venez-vous d'une reconversion ?
'status', // Quel est votre statut actuel ?
'job_title', // Quel est l'intitulé de votre poste actuel ?
'contract_work_duration', // Quelle est votre durée de travail contractuelle ?
'experience_in_year', // Quel est votre nombre d'année d'expérience total ?
'experience_in_current_job', // Quel est votre nombre d'année d'expérience dans votre entreprise actuelle ?
'leave_job', // Si vous avez cherché à changer de poste en cette année, est-ce que vous avez ?
'freelance_tjm', // Quelle est votre TJM en euro ?
'freelance_average_work_day', // Quel est votre nombre de jours travaillé en moyenne dans l’année ?
'company_department', // Quel est votre département de travail ?,
'company_type', // Dans quel type d'entreprise travaillez-vous ?,
'company_size', // Taille de votre entreprise,
'job_interest', // Quels sont les aspects les plus importants dans votre emploi actuel ?
'company_origin', // "Si elle n'est pas française, quelle est l'origine de votre entreprise ou maison mère ?"
'discrimination_during_hiring', // Avez-vous le sentiment d'avoir été victime de discrimination à l'embauche ?
'other_language', // "Développez-vous dans d'autres langages que PHP ? Si oui, quel est le principal ?"
'remote_usage', // Travaillez-vous en télétravail ?,
'remote_pace', // Quel serait le rythme idéal en télétravail pour vous ? (en nombre de jour par semaine),
'technological_watch', // Faites-vous régulièrement de la veille technique ?,
'os_developpment', // Sous quel OS développez-vous principalement ?,
'number_meetup_participation', // À combien d'événement / meetup tech avez-vous participé sur la dernière année ?,
'community_inclusion', // Est-ce que vous pensez que l'AFUP, sa communauté et ses événements sont inclusifs ?
'speciality', // Quelle est votre plus grande spécialité ?,
'php_version', // Quelle version de PHP utilisez-vous au quotidien ?,
'php_strength', // "D'après vous, quelle est la plus grande force de PHP ?"
'has_formation', // Avez-vous suivi une formation au cours de ces deux dernières années ?,
'formation_subject', // Sur quel(s) sujet(s) avez-vous été formés ?,
'formation_impact', // Cela a-t-il eu une incidence sur votre emploi/rémunération ?,
'gender', // Vous êtes
'age', // Quel âge avez-vous ?
];
}
}
22 changes: 20 additions & 2 deletions src/Campaign/ResponseFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
use App\Enums\GenderEnums;
use App\Enums\InitialTrainingEnums;
use App\Enums\JobTitleEnums;
use App\Enums\LeaveJobEnums;
use App\Enums\MeetupParticipationEnums;
use App\Enums\OsDeveloppmentEnums;
use App\Enums\OtherLanguageEnums;
Expand All @@ -51,6 +52,8 @@

class ResponseFactory
{
public static $job_title = [];

public function __construct(
private readonly \NumberFormatter $numberFormatter,
private readonly EnumsCollection $enums,
Expand Down Expand Up @@ -81,6 +84,9 @@ public function createResponse(array $data, Campaign $campaign): Response
'NumberMeetupParticipation' => 'number_meetup_participation',
'Covid19RemoteIdealPace' => 'covid19_remote_ideal_pace',
'Covid19WorkCondition' => 'covid19_work_condition',
'age' => 'age',
'communityInclusion' => 'community_inclusion',
'discriminationDuringHiring' => 'discrimination_during_hiring',
];

foreach ($numberValues as $field => $dataKey) {
Expand All @@ -99,6 +105,7 @@ public function createResponse(array $data, Campaign $campaign): Response
'jobTitle' => ['key' => 'job_title', 'class' => JobTitleEnums::class],
'experience' => ['key' => 'experience', 'class' => ExperienceEnums::class],
'contractWorkDuration' => ['key' => 'contract_work_duration', 'class' => ContractWorkDurationEnums::class],
'leaveJob' => ['key' => 'leave_job', 'class' => LeaveJobEnums::class],
'companyType' => ['key' => 'company_type', 'class' => CompanyTypeEnums::class],
'companySize' => ['key' => 'company_size', 'class' => CompanySizeEnums::class],
'OtherLanguage' => ['key' => 'other_language', 'class' => OtherLanguageEnums::class],
Expand All @@ -124,10 +131,21 @@ public function createResponse(array $data, Campaign $campaign): Response
];

foreach ($enumValues as $field => $enum) {
$enumClass = $this->enums->getEnums($enum['class']);
$enumId = $enumClass->getIdByLabel($data[$enum['key']] ?? null);

if ($enumClass instanceof JobTitleEnums && 0 === $enumId) {
$enumId = $enumClass->oldChoices[$data[$enum['key']]] ?? 0;
}

if ($enumClass instanceof PHPVersionEnums && 'PHP 5.6 ou inférieur' === $data[$enum['key']]) {
$enumId = $enumClass::PHP_56;
}

$this->propertyAccessor->setValue(
$response,
$field,
$this->enums->getEnums($enum['class'])->getIdByLabel($data[$enum['key']] ?? null)
$enumId
);
}

Expand Down Expand Up @@ -161,7 +179,7 @@ public function createResponse(array $data, Campaign $campaign): Response
explode(', ', $data['speciality'] ?? '')
);

if ('oui' === mb_strtolower($data['has_certification'])) {
if (isset($data['has_certification']) && 'oui' === mb_strtolower($data['has_certification'])) {
$this->addCertification(
$response,
explode(', ', $data['certification_list'] ?? null)
Expand Down
60 changes: 60 additions & 0 deletions src/Entity/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,18 @@ class Response
#[ORM\Column(type: 'integer', nullable: true)]
private ?int $numberMeetupParticipation = null;

#[ORM\Column(type: 'integer', nullable: true)]
private ?int $leaveJob = null;

#[ORM\Column(type: 'integer', nullable: true)]
private ?int $discriminationDuringHiring = null;

#[ORM\Column(type: 'integer', nullable: true)]
private ?int $communityInclusion = null;

#[ORM\Column(type: 'integer', nullable: true)]
private ?int $age = null;

public function __construct()
{
$this->certifications = new ArrayCollection();
Expand Down Expand Up @@ -836,4 +848,52 @@ public function addJobInterest(JobInterest $jobInterest): self

return $this;
}

public function getLeaveJob(): ?int
{
return $this->leaveJob;
}

public function setLeaveJob(?int $leaveJob): self
{
$this->leaveJob = $leaveJob;

return $this;
}

public function getDiscriminationDuringHiring(): ?int
{
return $this->discriminationDuringHiring;
}

public function setDiscriminationDuringHiring(?int $discriminationDuringHiring): self
{
$this->discriminationDuringHiring = $discriminationDuringHiring;

return $this;
}

public function getCommunityInclusion(): ?int
{
return $this->communityInclusion;
}

public function setCommunityInclusion(?int $communityInclusion): self
{
$this->communityInclusion = $communityInclusion;

return $this;
}

public function getAge(): ?int
{
return $this->age;
}

public function setAge(?int $age): self
{
$this->age = $age;

return $this;
}
}
20 changes: 20 additions & 0 deletions src/Enums/CommunityInclusionEnums.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

namespace App\Enums;

class CommunityInclusionEnums extends AbstractEnums
{
public const PAS_DU_TOUT_D_ACCORD = 1;
public const PLUTOT_PAS_D_ACCORD = 2;
public const SANS_OPINION = 3;
public const PLUTOT_D_ACCORD = 4;
public const COMPLETEMENT_D_ACCORD = 5;

protected array $choices = [
self::PAS_DU_TOUT_D_ACCORD => 'Pas du tout d\'accord',
self::PLUTOT_PAS_D_ACCORD => 'Plutôt pas d\'accord',
self::SANS_OPINION => 'Sans opinion',
self::PLUTOT_D_ACCORD => 'Plutôt d\'accord',
self::COMPLETEMENT_D_ACCORD => 'Complètement d\'accord',
];
}
2 changes: 1 addition & 1 deletion src/Enums/CompanyTypeEnums.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class CompanyTypeEnums extends AbstractEnums

protected array $choices = [
self::PRESSE_MEDIA => 'Presse / média',
self::SSII => 'SSII / conseil',
self::SSII => 'Entreprise de services du numérique (ESN) / conseil',
self::AGENCE_COMM => 'Agence de communication',
self::CLIENT_FINAL => "Service informatique d'un client final",
self::STARTUP => 'Startup',
Expand Down
20 changes: 20 additions & 0 deletions src/Enums/DiscriminationDuringHiringEnums.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

namespace App\Enums;

class DiscriminationDuringHiringEnums extends AbstractEnums
{
public const PAS_DU_TOUT_D_ACCORD = 1;
public const PLUTOT_PAS_D_ACCORD = 2;
public const SANS_OPINION = 3;
public const PLUTOT_D_ACCORD = 4;
public const COMPLETEMENT_D_ACCORD = 5;

protected array $choices = [
self::PAS_DU_TOUT_D_ACCORD => 'Pas du tout d\'accord',
self::PLUTOT_PAS_D_ACCORD => 'Plutôt pas d\'accord',
self::SANS_OPINION => 'Sans opinion',
self::PLUTOT_D_ACCORD => 'Plutôt d\'accord',
self::COMPLETEMENT_D_ACCORD => 'Complètement d\'accord',
];
}
16 changes: 14 additions & 2 deletions src/Enums/ExperienceEnums.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,25 @@ class ExperienceEnums extends AbstractEnums
public const XP_0_2 = 1;
public const XP_2_5 = 2;
public const XP_5_10 = 3;
public const XP_10 = 4;
public const XP_10_15 = 4;
public const XP_15_20 = 5;
public const XP_20_25 = 6;
public const XP_25_30 = 7;
public const XP_30_35 = 8;
public const XP_35_40 = 9;
public const XP_40 = 10;

protected array $choices = [
self::XP_0_2 => '0 à 2 ans',
self::XP_2_5 => '2 à 5 ans',
self::XP_5_10 => '5 à 10 ans',
self::XP_10 => 'Plus de 10 ans',
self::XP_10_15 => '10 à 15 ans',
self::XP_15_20 => '15 à 20 ans',
self::XP_20_25 => '20 à 25 ans',
self::XP_25_30 => '25 à 30 ans',
self::XP_30_35 => '30 à 35 ans',
self::XP_35_40 => '35 à 40 ans',
self::XP_40 => 'Plus de 40 ans',
];

protected function getDefaultValue(): ?int
Expand Down
2 changes: 1 addition & 1 deletion src/Enums/GenderEnums.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class GenderEnums extends AbstractEnums
self::MALE => 'Hommes',
self::FEMALE => 'Femmes',
self::NONE => 'Non précisé',
self::NON_BINARY => 'Personnes non-binaires',
self::NON_BINARY => 'Une personne non-binaire',
self::AUTRE => 'Autre',
];

Expand Down
24 changes: 19 additions & 5 deletions src/Enums/JobTitleEnums.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,30 @@ class JobTitleEnums extends AbstractEnums
public const DEVOPS = 10;

protected array $choices = [
self::DIRECTEUR => 'Directeur, cadre dirigeant',
self::DIRECTEUR => 'Directeur et Directrice, cadre dirigeant',
self::RESPONSABLE_EQUIPE => "Cadre intermédiaire, responsable d'équipe",
self::CHEF_PROJET => 'Chef de projet',
self::LEAD_DEVELOPPEUR => 'Lead développeur',
self::CHEF_PROJET => 'Chef/Cheffe de projet',
self::LEAD_DEVELOPPEUR => 'Lead développeur/Lead développeuse',
self::ARCHITECTE => 'Architecte',
self::CONSULTANT => 'Consultant',
self::FORMATEUR => 'Formateur',
self::DEVELOPPEUR => 'Développeur',
self::FORMATEUR => 'Formateur/Formatrice',
self::DEVELOPPEUR => 'Développeur/Développeuse',
self::SYSADMIN => 'Sysadmin',
self::DEVOPS => 'Devops',
self::AUTRE => 'Autre',
];

public array $oldChoices = [
'Directeur, cadre dirigeant' => self::DIRECTEUR,
"Cadre intermédiaire, responsable d'équipe" => self::RESPONSABLE_EQUIPE,
'Chef de projet' => self::CHEF_PROJET,
'Lead développeur' => self::LEAD_DEVELOPPEUR,
'Architecte' => self::ARCHITECTE,
'Consultant' => self::CONSULTANT,
'Formateur' => self::FORMATEUR,
'Développeur' => self::DEVELOPPEUR,
'Sysadmin' => self::SYSADMIN,
'Devops' => self::DEVOPS,
'Autre' => self::AUTRE,
];
}
Loading

0 comments on commit 78704aa

Please sign in to comment.