소스 검색

fix entities relations

Olivier Massot 6 달 전
부모
커밋
08b71fb1cc

+ 79 - 65
src/Entity/Access/Access.php

@@ -126,38 +126,42 @@ class Access implements UserInterface, PasswordAuthenticatedUserInterface
     #[ORM\Column(type: 'json', length: 4294967295, nullable: true)]
     private ?array $setting = [];
 
-    #[ORM\OneToOne(mappedBy: 'access', cascade: ['persist'], orphanRemoval: true)]
+    #[ORM\OneToOne(mappedBy: 'access', cascade: ['persist', 'remove'])]
     private ?AccessBilling $accessBilling;
 
     /** @var Collection<int, PersonActivity> */
-    #[ORM\OneToMany(targetEntity: PersonActivity::class, mappedBy: 'access', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(targetEntity: PersonActivity::class, mappedBy: 'access', cascade: ['persist', 'remove'])]
     private Collection $personActivity;
 
     /** @var Collection<int, OrganizationFunction> */
-    #[ORM\OneToMany(targetEntity: OrganizationFunction::class, mappedBy: 'access', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(targetEntity: OrganizationFunction::class, mappedBy: 'access', cascade: ['persist', 'remove'])]
     private Collection $organizationFunction;
 
     /** @var Collection<int, OrganizationLicence> */
-    #[ORM\OneToMany(targetEntity: OrganizationLicence::class, mappedBy: 'licensee', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(targetEntity: OrganizationLicence::class, mappedBy: 'licensee', cascade: ['persist', 'remove'])]
     private Collection $organizationLicences;
 
     /** @var Collection<int, PersonalizedList> */
-    #[ORM\OneToMany(targetEntity: PersonalizedList::class, mappedBy: 'access', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(targetEntity: PersonalizedList::class, mappedBy: 'access', cascade: ['persist', 'remove'])]
     private Collection $personalizedLists;
 
     /** @var Collection<int, Notification> */
-    #[ORM\OneToMany(targetEntity: Notification::class, mappedBy: 'recipientAccess', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(targetEntity: Notification::class, mappedBy: 'recipientAccess', cascade: ['persist', 'remove'])]
     private Collection $notifications;
 
     /** @var Collection<int, NotificationUser> */
-    #[ORM\OneToMany(targetEntity: NotificationUser::class, mappedBy: 'access', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(targetEntity: NotificationUser::class, mappedBy: 'access', cascade: ['persist', 'remove'])]
     private Collection $notificationUsers;
 
-    /** @var Collection<int, Access> */
+    /**
+     * @var Collection<int, Access>
+     */
     #[ORM\ManyToMany(targetEntity: Access::class, mappedBy: 'children', cascade: ['persist'])]
     private Collection $guardians;
 
-    /** @var Collection<int, Access> */
+    /**
+     * @var Collection<int, Access>
+     */
     #[ORM\ManyToMany(targetEntity: Access::class, inversedBy: 'guardians', cascade: ['persist'])]
     #[ORM\JoinTable(name: 'children_guardians')]
     #[ORM\JoinColumn(name: 'guardians_id', referencedColumnName: 'id')]
@@ -165,15 +169,15 @@ class Access implements UserInterface, PasswordAuthenticatedUserInterface
     private Collection $children;
 
     /** @var Collection<int, AccessPayer> */
-    #[ORM\OneToMany(targetEntity: AccessPayer::class, mappedBy: 'accessPayer', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(targetEntity: AccessPayer::class, mappedBy: 'accessPayer', cascade: ['persist', 'remove'])]
     private Collection $billingPayers;
 
     /** @var Collection<int, AccessPayer> */
-    #[ORM\OneToMany(targetEntity: AccessPayer::class, mappedBy: 'accessReceiver', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(targetEntity: AccessPayer::class, mappedBy: 'accessReceiver', cascade: ['persist', 'remove'])]
     private Collection $billingReceivers;
 
     /** @var Collection<int, AccessIntangible> */
-    #[ORM\OneToMany(targetEntity: AccessIntangible::class, mappedBy: 'access', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(targetEntity: AccessIntangible::class, mappedBy: 'access', cascade: ['persist', 'remove'])]
     private Collection $accessIntangibles;
 
     #[ORM\ManyToOne(inversedBy: 'publicationDirectors')]
@@ -185,34 +189,40 @@ class Access implements UserInterface, PasswordAuthenticatedUserInterface
     private ?EducationNotationConfig $educationNotationConfig;
 
     /** @var Collection<int, CompanyPerson> */
-    #[ORM\OneToMany(targetEntity: CompanyPerson::class, mappedBy: 'company', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(targetEntity: CompanyPerson::class, mappedBy: 'company', cascade: ['persist', 'remove'])]
     private Collection $companyPersonAccesses;
 
     /** @var Collection<int, CompanyPerson> */
-    #[ORM\OneToMany(targetEntity: CompanyPerson::class, mappedBy: 'access', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(targetEntity: CompanyPerson::class, mappedBy: 'access', cascade: ['persist', 'remove'])]
     private Collection $companyPersonCompany;
 
     /** @var Collection<int, EducationStudent> */
-    #[ORM\OneToMany(targetEntity: EducationStudent::class, mappedBy: 'access', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(targetEntity: EducationStudent::class, mappedBy: 'access', cascade: ['persist', 'remove'])]
     private Collection $educationStudent;
 
     /** @var Collection<int, EducationStudent> */
-    #[ORM\ManyToMany(targetEntity: EducationStudent::class, mappedBy: 'teachers', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\ManyToMany(targetEntity: EducationStudent::class, mappedBy: 'teachers', cascade: ['persist'])]
     private Collection $educationStudentByTeacher;
 
     /** @var Collection<int, EducationTeacher> */
-    #[ORM\OneToMany(targetEntity: EducationTeacher::class, mappedBy: 'teacher', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(targetEntity: EducationTeacher::class, mappedBy: 'teacher', cascade: ['persist', 'remove'])]
     private Collection $educationTeachers;
 
     /** @var Collection<int, PersonHoliday> */
-    #[ORM\OneToMany(targetEntity: PersonHoliday::class, mappedBy: 'access', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(targetEntity: PersonHoliday::class, mappedBy: 'access', cascade: ['persist', 'remove'])]
     private Collection $holidays;
 
-    /** @var Collection<int, Course> */
+    /**
+     * TODO: orphanRemoval?
+     * @var Collection<int, Course>
+     */
     #[ORM\ManyToMany(targetEntity: Course::class, mappedBy: 'students', cascade: ['persist'])]
     private Collection $courses;
 
-    /** @var Collection<int, Course> */
+    /**
+     * TODO: orphanRemoval?
+     * @var Collection<int, Course>
+     */
     #[ORM\ManyToMany(targetEntity: Course::class, mappedBy: 'organizer', cascade: ['persist'])]
     private Collection $practicalCourses;
 
@@ -220,7 +230,10 @@ class Access implements UserInterface, PasswordAuthenticatedUserInterface
     #[ORM\ManyToMany(targetEntity: Event::class, mappedBy: 'organizer', cascade: ['persist'])]
     private Collection $eventOrganizers;
 
-    /** @var Collection<int, EducationalProject> */
+    /**
+     * TODO: orphanRemoval?
+     * @var Collection<int, EducationalProject>
+     */
     #[ORM\ManyToMany(targetEntity: EducationalProject::class, mappedBy: 'organizer', cascade: ['persist'])]
     private Collection $educationalProjectOrganizers;
 
@@ -235,181 +248,182 @@ class Access implements UserInterface, PasswordAuthenticatedUserInterface
     private bool $ielEnabled = false;
 
     /** @var Collection<int, EducationalProjectPayer> */
-    #[ORM\OneToMany(targetEntity: EducationalProjectPayer::class, mappedBy: 'educationalProjectPayer', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(targetEntity: EducationalProjectPayer::class, mappedBy: 'educationalProjectPayer', cascade: ['persist', 'remove'])]
     private Collection $billingEducationalProjectPayers;
 
     /** @var Collection<int, Bill> */
-    #[ORM\OneToMany(targetEntity: Bill::class, mappedBy: 'access', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(targetEntity: Bill::class, mappedBy: 'access', cascade: ['persist', 'remove'])]
     private Collection $bills;
 
     /** @var Collection<int, BillLine> */
-    #[ORM\OneToMany(targetEntity: BillLine::class, mappedBy: 'access', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(targetEntity: BillLine::class, mappedBy: 'access', cascade: ['persist', 'remove'])]
     private Collection $billLines;
 
     /** @var Collection<int, BillCredit> */
-    #[ORM\OneToMany(targetEntity: BillCredit::class, mappedBy: 'access', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(targetEntity: BillCredit::class, mappedBy: 'access', cascade: ['persist', 'remove'])]
     private Collection $billCredits;
 
     /** @var Collection<int, EducationalProject> */
-    #[ORM\OneToMany(targetEntity: EducationalProject::class, mappedBy: 'silentPartner', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(targetEntity: EducationalProject::class, mappedBy: 'silentPartner', cascade: ['persist', 'remove'])]
     private Collection $silentPartners;
 
     /** @var Collection<int, EducationalProject> */
-    #[ORM\OneToMany(targetEntity: EducationalProject::class, mappedBy: 'operationalPartner', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(targetEntity: EducationalProject::class, mappedBy: 'operationalPartner', cascade: ['persist', 'remove'])]
     private Collection $operationalPartners;
 
     /** @var Collection<int, EventUser> */
-    #[ORM\OneToMany(targetEntity: EventUser::class, mappedBy: 'guest', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(targetEntity: EventUser::class, mappedBy: 'guest', cascade: ['persist', 'remove'])]
     private Collection $eventUsers;
 
     /** @var Collection<int, ExamenConvocation> */
-    #[ORM\OneToMany(targetEntity: ExamenConvocation::class, mappedBy: 'student', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(targetEntity: ExamenConvocation::class, mappedBy: 'student', cascade: ['persist', 'remove'])]
     private Collection $examenConvocations;
 
     /** @var Collection<int, EquipmentRepair> */
-    #[ORM\OneToMany(targetEntity: EquipmentRepair::class, mappedBy: 'provider', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(targetEntity: EquipmentRepair::class, mappedBy: 'provider', cascade: ['persist', 'remove'])]
     private Collection $equipmentRepairProviders;
 
     /** @var Collection<int, Attendance> */
-    #[ORM\OneToMany(targetEntity: Attendance::class, mappedBy: 'access', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(targetEntity: Attendance::class, mappedBy: 'access', cascade: ['persist', 'remove'])]
     private Collection $attendances;
 
     /** @var Collection<int, AttendanceBooking> */
-    #[ORM\OneToMany(targetEntity: AttendanceBooking::class, mappedBy: 'access', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(targetEntity: AttendanceBooking::class, mappedBy: 'access', cascade: ['persist', 'remove'])]
     private Collection $attendanceBookings;
 
     /** @var Collection<int, Attendance> */
-    #[ORM\OneToMany(targetEntity: Attendance::class, mappedBy: 'replacement', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(targetEntity: Attendance::class, mappedBy: 'replacement', cascade: ['persist', 'remove'])]
     private Collection $attendanceReplacements;
 
     /** @var Collection<int, RoomRepair> */
-    #[ORM\OneToMany(targetEntity: RoomRepair::class, mappedBy: 'provider', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(targetEntity: RoomRepair::class, mappedBy: 'provider', cascade: ['persist', 'remove'])]
     private Collection $roomRepairProviders;
 
     /** @var Collection<int, PlaceRepair> */
-    #[ORM\OneToMany(targetEntity: PlaceRepair::class, mappedBy: 'provider', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(targetEntity: PlaceRepair::class, mappedBy: 'provider', cascade: ['persist', 'remove'])]
     private Collection $placeRepairProviders;
 
     /** @var Collection<int, Email> */
-    #[ORM\OneToMany(targetEntity: Email::class, mappedBy: 'author', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(targetEntity: Email::class, mappedBy: 'author', cascade: ['persist', 'remove'])]
     private Collection $emails;
 
     /** @var Collection<int, Mail> */
-    #[ORM\OneToMany(targetEntity: Mail::class, mappedBy: 'author', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(targetEntity: Mail::class, mappedBy: 'author', cascade: ['persist', 'remove'])]
     private Collection $mails;
 
     /** @var Collection<int, Sms> */
-    #[ORM\OneToMany(targetEntity: Sms::class, mappedBy: 'author', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(targetEntity: Sms::class, mappedBy: 'author', cascade: ['persist', 'remove'])]
     private Collection $sms;
 
     /** @var Collection<int, Jury> */
-    #[ORM\ManyToMany(targetEntity: Jury::class, mappedBy: 'members', orphanRemoval: true)]
+    #[ORM\ManyToMany(targetEntity: Jury::class, mappedBy: 'members', cascade: ['persist'])]
     private Collection $juryMembers;
 
     /** @var Collection<int, Organization> */
-    #[ORM\OneToMany(targetEntity: Organization::class, mappedBy: 'contactPerson', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(targetEntity: Organization::class, mappedBy: 'contactPerson', cascade: ['persist', 'remove'])]
     private Collection $organizationContacts;
 
     /** @var Collection<int, CommissionMember> */
-    #[ORM\OneToMany(targetEntity: CommissionMember::class, mappedBy: 'member', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(targetEntity: CommissionMember::class, mappedBy: 'member', cascade: ['persist', 'remove'])]
     private Collection $commissionMembers;
 
     /** @var Collection<int, Equipment> */
-    #[ORM\OneToMany(targetEntity: Equipment::class, mappedBy: 'supplier', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(targetEntity: Equipment::class, mappedBy: 'supplier', cascade: ['persist', 'remove'])]
     private Collection $equipmentSuppliers;
 
     /** @var Collection<int, Equipment> */
-    #[ORM\OneToMany(targetEntity: Equipment::class, mappedBy: 'controlManager', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(targetEntity: Equipment::class, mappedBy: 'controlManager', cascade: ['persist', 'remove'])]
     private Collection $equipmentControlManagers;
 
     /** @var Collection<int, Equipment> */
-    #[ORM\OneToMany(targetEntity: Equipment::class, mappedBy: 'editor', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(targetEntity: Equipment::class, mappedBy: 'editor', cascade: ['persist', 'remove'])]
     private Collection $equipmentEditors;
 
     /** @var Collection<int, EquipmentLoan> */
-    #[ORM\OneToMany(targetEntity: EquipmentLoan::class, mappedBy: 'borrower', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(targetEntity: EquipmentLoan::class, mappedBy: 'borrower', cascade: ['persist', 'remove'])]
     private Collection $equipmentLoans;
 
     /** @var Collection<int, Equipment> */
-    #[ORM\OneToMany(targetEntity: Equipment::class, mappedBy: 'access', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(targetEntity: Equipment::class, mappedBy: 'access', cascade: ['persist', 'remove'])]
     private Collection $equipments;
 
     /** @var Collection<int, AccessFictionalIntangible> */
-    #[ORM\OneToMany(targetEntity: AccessFictionalIntangible::class, mappedBy: 'access', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(targetEntity: AccessFictionalIntangible::class, mappedBy: 'access', cascade: ['persist', 'remove'])]
     private Collection $accessFictionalIntangibles;
 
     /** @var Collection<int, Donor> */
-    #[ORM\OneToMany(targetEntity: Donor::class, mappedBy: 'access', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(targetEntity: Donor::class, mappedBy: 'access', cascade: ['persist', 'remove'])]
     private Collection $donors;
 
     /** @var Collection<int, AccessReward> */
-    #[ORM\OneToMany(targetEntity: AccessReward::class, mappedBy: 'access', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(targetEntity: AccessReward::class, mappedBy: 'access', cascade: ['persist', 'remove'])]
     private Collection $accessRewards;
 
     /** @var Collection<int, OrganizationResponsability> */
-    #[ORM\OneToMany(targetEntity: OrganizationResponsability::class, mappedBy: 'access', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(targetEntity: OrganizationResponsability::class, mappedBy: 'access', cascade: ['persist', 'remove'])]
     private Collection $organizationResponsabilities;
 
     /** @var Collection<int, AccessWish> */
-    #[ORM\OneToMany(targetEntity: AccessWish::class, mappedBy: 'accessOriginal', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(targetEntity: AccessWish::class, mappedBy: 'accessOriginal', cascade: ['persist', 'remove'])]
     private Collection $accessWishes;
 
     /** @var Collection<int, WorkByUser> */
-    #[ORM\OneToMany(targetEntity: WorkByUser::class, mappedBy: 'student', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(targetEntity: WorkByUser::class, mappedBy: 'student', cascade: ['persist', 'remove'])]
     private Collection $workByUsers;
 
     /** @var Collection<int, Tagg> */
     #[ORM\ManyToMany(targetEntity: Tagg::class, inversedBy: 'accesses', cascade: ['persist'])]
+    #[ORM\OrderBy(value: ['label' => 'ASC'])]
     #[ORM\JoinTable(name: 'tag_access')]
     #[ORM\JoinColumn(name: 'access_id', referencedColumnName: 'id')]
     #[ORM\InverseJoinColumn(name: 'tag_id', referencedColumnName: 'id')]
     private Collection $tags;
 
     // TODO: revoir le mapping, on ne peut pas mapper à une mapped superclass comme abstract booking
-    //    #[ORM\ManyToMany(mappedBy: 'organizer', targetEntity: AbstractBooking::class, cascade: ['persist'], orphanRemoval: false)]
+    //    #[ORM\ManyToMany(mappedBy: 'organizer', targetEntity: AbstractBooking::class, cascade: ['persist', 'remove'], orphanRemoval: false)]
     //    private Collection $bookingOrganizers;
 
     /** @var Collection<int, AdvancePayment> */
-    #[ORM\OneToMany(targetEntity: AdvancePayment::class, mappedBy: 'access', cascade: [], orphanRemoval: true)]
+    #[ORM\OneToMany(targetEntity: AdvancePayment::class, mappedBy: 'access', cascade: ['persist', 'remove'])]
     private Collection $advancePayments;
 
     /** @var Collection<int, AbstractMessage> */
-    #[ORM\OneToMany(targetEntity: AbstractMessage::class, mappedBy: 'author', cascade: [], orphanRemoval: true)]
+    #[ORM\OneToMany(targetEntity: AbstractMessage::class, mappedBy: 'author', cascade: ['persist', 'remove'])]
     private Collection $messages;
 
     /** @var Collection<int, Equipment> */
-    #[ORM\OneToMany(targetEntity: Equipment::class, mappedBy: 'managerControl', cascade: [], orphanRemoval: false)]
+    #[ORM\OneToMany(targetEntity: Equipment::class, mappedBy: 'managerControl', cascade: ['persist', 'remove'])]
     private Collection $equipmentManagerControls;
 
     /** @var Collection<int, EquipmentControl> */
-    #[ORM\OneToMany(targetEntity: EquipmentControl::class, mappedBy: 'accompanist', cascade: [], orphanRemoval: true)]
+    #[ORM\OneToMany(targetEntity: EquipmentControl::class, mappedBy: 'accompanist', cascade: ['persist', 'remove'])]
     private Collection $accompanistControl;
 
     /** @var Collection<int, AccessReward> */
-    #[ORM\OneToMany(targetEntity: AccessReward::class, mappedBy: 'access', cascade: ['persist'], orphanRemoval: true)]
+    #[ORM\OneToMany(targetEntity: AccessReward::class, mappedBy: 'access', cascade: ['persist', 'remove'])]
     private Collection $rewards;
 
-    #[ORM\OneToOne(targetEntity: AccessSocial::class, mappedBy: 'access', cascade: ['persist'], orphanRemoval: true)]
+    #[ORM\OneToOne(targetEntity: AccessSocial::class, mappedBy: 'access', cascade: ['persist', 'remove'])]
     private ?AccessSocial $accessSocial;
 
-    #[ORM\OneToOne(targetEntity: AccessNetworkSetting::class, mappedBy: 'access', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToOne(targetEntity: AccessNetworkSetting::class, mappedBy: 'access', cascade: ['persist', 'remove'])]
     private ?AccessNetworkSetting $accessNetworkSetting;
 
-    #[ORM\OneToOne(targetEntity: AccessCommunication::class, mappedBy: 'access', cascade: ['persist'], orphanRemoval: true)]
+    #[ORM\OneToOne(targetEntity: AccessCommunication::class, mappedBy: 'access', cascade: ['persist', 'remove'])]
     private ?AccessCommunication $accessCommunication;
 
-    #[ORM\OneToOne(targetEntity: CalendarSynchro::class, mappedBy: 'access', cascade: ['persist'], orphanRemoval: true)]
+    #[ORM\OneToOne(targetEntity: CalendarSynchro::class, mappedBy: 'access', cascade: ['persist', 'remove'])]
     private ?CalendarSynchro $calendarSynchro;
 
     /** @var Collection<int, Token> */
-    #[ORM\OneToMany(targetEntity: Token::class, mappedBy: 'access', cascade: ['persist'], orphanRemoval: true)]
+    #[ORM\OneToMany(targetEntity: Token::class, mappedBy: 'access', cascade: ['persist', 'remove'])]
     private Collection $tokens;
 
-    #[ORM\OneToOne(mappedBy: 'access', cascade: ['persist'], fetch: 'EAGER', orphanRemoval: true)]
+    #[ORM\OneToOne(mappedBy: 'access', cascade: ['persist', 'remove'], fetch: 'EAGER')]
     private ?Preferences $preferences;
 
     /** @var Collection<int, AbstractReport> */
-    #[ORM\OneToMany(targetEntity: AbstractReport::class, mappedBy: 'access', cascade: ['persist'], orphanRemoval: true)]
+    #[ORM\OneToMany(targetEntity: AbstractReport::class, mappedBy: 'access', cascade: ['persist', 'remove'])]
     private Collection $reports;
 
     #[Pure]

+ 15 - 0
src/Entity/Billing/BillingSettingRent.php

@@ -24,6 +24,10 @@ class BillingSettingRent
     #[ORM\OneToOne(targetEntity: BillingSetting::class, inversedBy: 'billingSettingRent', cascade: [])]
     protected ?BillingSetting $billingSetting;
 
+    #[ORM\ManyToOne(targetEntity: FamilyQuotientModel::class, cascade: [], inversedBy: 'billingSettingRents')]
+    #[ORM\JoinColumn(onDelete: 'SET NULL')]
+    protected FamilyQuotientModel $familyQuotientModel;
+
     public function getBillingSetting(): ?BillingSetting
     {
         return $this->billingSetting;
@@ -40,4 +44,15 @@ class BillingSettingRent
     {
         return $this->id;
     }
+
+    function getFamilyQuotientModel(): FamilyQuotientModel
+    {
+        return $this->familyQuotientModel;
+    }
+
+    function setFamilyQuotientModel(FamilyQuotientModel $familyQuotientModel): self
+    {
+        $this->familyQuotientModel = $familyQuotientModel;
+        return $this;
+    }
 }

+ 33 - 0
src/Entity/Billing/FamilyQuotientModel.php

@@ -7,6 +7,7 @@ namespace App\Entity\Billing;
 use ApiPlatform\Metadata\ApiResource;
 use App\Entity\Organization\Organization;
 use App\Entity\Product\IntangiblePriceAndDiscount;
+use Doctrine\Common\Collections\ArrayCollection;
 use Doctrine\Common\Collections\Collection;
 use Doctrine\ORM\Mapping as ORM;
 
@@ -34,6 +35,14 @@ class FamilyQuotientModel
     #[ORM\OneToMany(targetEntity: IntangiblePriceAndDiscount::class, mappedBy: 'familyQuotientModel', cascade: [], orphanRemoval: false)]
     protected Collection $intangiblePriceAndDiscounts;
 
+    #[ORM\OneToMany(targetEntity: BillingSettingRent::class, mappedBy: 'familyQuotientModel', cascade: [], orphanRemoval: false)]
+    protected Collection $billingSettingRents;
+
+    public function __construct()
+    {
+        $this->billingSettingRents = new ArrayCollection();
+    }
+
     public function getId(): int
     {
         return $this->id;
@@ -105,4 +114,28 @@ class FamilyQuotientModel
 
         return $this;
     }
+
+    function getBillingSettingRents(): Collection
+    {
+        return $this->billingSettingRents;
+    }
+
+    function addBillingSettingRent(BillingSettingRent $billingSettingRent): self
+    {
+        if (!$this->billingSettingRents->contains($billingSettingRent)) {
+            $this->billingSettingRents[] = $billingSettingRent;
+            $billingSettingRent->setFamilyQuotientModel($this);
+        }
+
+        return $this;
+    }
+
+    function removeBillingSettingRent(BillingSettingRent $billingSettingRent): self
+    {
+        if ($this->billingSettingRents->removeElement($billingSettingRent)) {
+            $billingSettingRent->setFamilyQuotientModel(null);
+        }
+
+        return $this;
+    }
 }

+ 2 - 0
src/Entity/Core/AbstractControl.php

@@ -34,6 +34,8 @@ abstract class AbstractControl
     /** @var Collection<int, Tagg> */
     #[ORM\ManyToMany(targetEntity: Tagg::class, inversedBy: 'controls')]
     #[ORM\JoinTable('tag_control')]
+    #[ORM\JoinColumn(name: 'control_id')]
+    #[ORM\InverseJoinColumn(name: 'tag_id')]
     protected Collection $tags;
 
     public function getId(): ?int

+ 6 - 2
src/Entity/Core/Tagg.php

@@ -40,6 +40,7 @@ use App\Entity\Product\Intangible;
 use Doctrine\Common\Collections\ArrayCollection;
 use Doctrine\Common\Collections\Collection;
 use Doctrine\ORM\Mapping as ORM;
+use Symfony\Component\Validator\Constraints as Assert;
 
 /**
  * Tag, étiquette.
@@ -54,6 +55,10 @@ class Tagg
     #[ORM\GeneratedValue]
     private ?int $id = null;
 
+    #[ORM\Column(length: 50)]
+    #[Assert\Length(min: 3, minMessage: "Label shall contain at least {{ limit }} characters.")]
+    protected string $label;
+
     #[ORM\ManyToOne]
     #[ORM\JoinColumn(nullable: false)]
     private Organization $organization;
@@ -188,7 +193,7 @@ class Tagg
 
     /** @var Collection<int, AbstractControl> */
     #[ORM\OneToMany(targetEntity: AbstractControl::class, mappedBy: 'tags', cascade: [], orphanRemoval: false)]
-    private Collection $controls;
+    protected Collection $controls;
 
     public function __construct()
     {
@@ -223,7 +228,6 @@ class Tagg
         $this->bookings = new ArrayCollection();
         $this->messages = new ArrayCollection();
         $this->repairs = new ArrayCollection();
-        $this->controls = new ArrayCollection();
         $this->educationCurriculumPacks = new ArrayCollection();
         $this->controls = new ArrayCollection();
     }

+ 35 - 0
src/Entity/Core/Tips.php

@@ -6,6 +6,9 @@ namespace App\Entity\Core;
 
 // use DH\Auditor\Provider\Doctrine\Auditing\Annotation\Auditable;
 use ApiPlatform\Metadata\ApiResource;
+use App\Entity\Organization\Organization;
+use Doctrine\Common\Collections\ArrayCollection;
+use Doctrine\Common\Collections\Collection;
 use Doctrine\ORM\Mapping as ORM;
 
 /**
@@ -18,4 +21,36 @@ use Doctrine\ORM\Mapping as ORM;
 #[ORM\Table(name: 'Information')]
 class Tips extends AbstractInformation
 {
+    #[ORM\ManyToMany(targetEntity: Organization::class, mappedBy: 'tips', cascade: [], orphanRemoval: false)]
+    protected Collection $organizations;
+
+    public function __construct()
+    {
+        $this->organizations = new ArrayCollection();
+        parent::__construct();
+    }
+
+    function getOrganizations(): Collection
+    {
+        return $this->organizations;
+    }
+
+    function addOrganization(Organization $organization): self
+    {
+        if (!$this->organizations->contains($organization)) {
+            $this->organizations[] = $organization;
+            $organization->addTip($this);
+        }
+
+        return $this;
+    }
+
+    function removeOrganization(Organization $organization): self
+    {
+        if ($this->organizations->removeElement($organization)) {
+            $organization->removeTip($this);
+        }
+
+        return $this;
+    }
 }

+ 41 - 0
src/Entity/Education/EducationCurriculumPack.php

@@ -8,6 +8,7 @@ use ApiPlatform\Metadata\ApiResource;
 use App\Entity\Core\Tagg;
 use App\Entity\Organization\Organization;
 use App\Entity\Product\Intangible;
+use Doctrine\Common\Collections\ArrayCollection;
 use Doctrine\Common\Collections\Collection;
 use Doctrine\ORM\Mapping as ORM;
 
@@ -29,6 +30,9 @@ class EducationCurriculumPack
 
     /** @var Collection<int, Tagg> */
     #[ORM\ManyToMany(targetEntity: Tagg::class, inversedBy: 'educationCurriculumPacks', cascade: ['persist'], orphanRemoval: false)]
+    #[ORM\JoinTable(name: 'tag_educationCurriculumPack')]
+    #[ORM\JoinColumn(name: 'educationcurriculumpack_id', onDelete: 'CASCADE')]
+    #[ORM\InverseJoinColumn(name: 'tagg_id', onDelete: 'CASCADE')]
     public Collection $tags;
 
     /** @var Collection<int, EducationCurriculum> */
@@ -62,6 +66,19 @@ class EducationCurriculumPack
     #[ORM\ManyToMany(targetEntity: Intangible::class, mappedBy: 'educationCurriculumPacks', cascade: [], orphanRemoval: false)]
     public Collection $intangibles;
 
+    #[ORM\OneToMany(
+        targetEntity: RequiredChoicesBlock::class,
+        mappedBy: 'educationCurriculumPack',
+        cascade: ['persist', 'remove'],
+        orphanRemoval: true,
+    )]
+    protected Collection $requiredChoicesBlocks;
+
+    public function __construct()
+    {
+        $this->requiredChoicesBlocks = new ArrayCollection();
+    }
+
     public function getId(): int
     {
         return $this->id;
@@ -205,4 +222,28 @@ class EducationCurriculumPack
 
         return $this;
     }
+
+    function getRequiredChoicesBlocks(): Collection
+    {
+        return $this->requiredChoicesBlocks;
+    }
+
+    function addRequiredChoicesBlock(RequiredChoicesBlock $requiredChoicesBlock): self
+    {
+        if (!$this->requiredChoicesBlocks->contains($requiredChoicesBlock)) {
+            $this->requiredChoicesBlocks[] = $requiredChoicesBlock;
+            $requiredChoicesBlock->setEducationCurriculumPack($this);
+        }
+
+        return $this;
+    }
+
+    function removeRequiredChoicesBlock(RequiredChoicesBlock $requiredChoicesBlock): self
+    {
+        if ($this->requiredChoicesBlocks->removeElement($requiredChoicesBlock)) {
+            $requiredChoicesBlock->setEducationCurriculumPack(null);
+        }
+
+        return $this;
+    }
 }

+ 91 - 0
src/Entity/Education/RequiredChoicesBlock.php

@@ -0,0 +1,91 @@
+<?php
+
+/**
+ * This file is auto-generated.
+ */
+
+declare(strict_types=1);
+
+namespace App\Entity\Education;
+
+use ApiPlatform\Metadata\ApiResource;
+use App\Entity\Education;
+use Doctrine\Common\Collections\ArrayCollection;
+use Doctrine\Common\Collections\Collection;
+use Doctrine\ORM\Mapping as ORM;
+
+#[ApiResource(operations: [])]
+#[ORM\Entity]
+class RequiredChoicesBlock
+{
+    #[ORM\Id]
+    #[ORM\Column]
+    #[ORM\GeneratedValue]
+    private int $id;
+
+    #[ORM\ManyToOne(targetEntity: EducationCurriculumPack::class, cascade: [], inversedBy: 'requiredChoicesBlocks')]
+    #[ORM\JoinColumn(nullable: false)]
+    protected Education\EducationCurriculumPack $educationCurriculumPack;
+
+    #[ORM\ManyToMany(
+        targetEntity: EducationCurriculum::class,
+        inversedBy: 'requiredChoicesEducationCurriculumPacks',
+        cascade: [],
+        orphanRemoval: false,
+    )]
+    #[ORM\JoinTable(name: 'requiredChoicesBlock_educationCurriculum')]
+    #[ORM\JoinColumn(name: 'requiredchoicesblock_id', onDelete: 'CASCADE')]
+    #[ORM\InverseJoinColumn(name: 'educationcurriculum_id', onDelete: 'CASCADE')]
+    protected Collection $educationCurriculums;
+
+    public function __construct()
+    {
+        $this->educationCurriculums = new ArrayCollection();
+    }
+
+    function getId(): int
+    {
+        return $this->id;
+    }
+
+    function setId(int $id): self
+    {
+        $this->id = $id;
+        return $this;
+    }
+
+    function getEducationCurriculumPack(): EducationCurriculumPack
+    {
+        return $this->educationCurriculumPack;
+    }
+
+    function setEducationCurriculumPack(EducationCurriculumPack $educationCurriculumPack): self
+    {
+        $this->educationCurriculumPack = $educationCurriculumPack;
+        return $this;
+    }
+
+    function getEducationCurriculums(): Collection
+    {
+        return $this->educationCurriculums;
+    }
+
+    function addEducationCurriculum(EducationCurriculum $educationCurriculum): self
+    {
+        if (!$this->educationCurriculums->contains($educationCurriculum)) {
+            $this->educationCurriculums[] = $educationCurriculum;
+            $educationCurriculum->addRequiredChoicesEducationCurriculumPack($this);
+        }
+
+        return $this;
+    }
+
+    function removeEducationCurriculum(EducationCurriculum $educationCurriculum): self
+    {
+        if ($this->educationCurriculums->removeElement($educationCurriculum)) {
+            $educationCurriculum->removeRequiredChoicesEducationCurriculumPack($this);
+        }
+
+        return $this;
+    }
+}

+ 1 - 1
src/Entity/Organization/CotisationByYear.php

@@ -25,7 +25,7 @@ class CotisationByYear
     #[ORM\JoinColumn(name: 'organization_id', referencedColumnName: 'id', nullable: false)]
     private Organization $organization;
 
-    #[ORM\OneToOne(targetEntity: CotisationStaffInfos::class, mappedBy: 'cotisationByYear', cascade: ['persist'])]
+    #[ORM\OneToOne(targetEntity: CotisationStaffInfos::class, mappedBy: 'cotisationByYear', cascade: ['persist', 'remove'])]
     protected ?CotisationStaffInfos $cotisationStaffInfos;
 
     public function getId(): ?int

+ 120 - 45
src/Entity/Organization/Organization.php

@@ -23,6 +23,7 @@ use App\Entity\Core\ContactPoint;
 use App\Entity\Core\File;
 use App\Entity\Core\Notification;
 use App\Entity\Core\Tagg;
+use App\Entity\Core\Tips;
 use App\Entity\Donor\Donor;
 use App\Entity\Education\CriteriaNotation;
 use App\Entity\Education\Cycle;
@@ -41,6 +42,7 @@ use App\Entity\Place\Place;
 use App\Entity\Product\Equipment;
 use App\Entity\Product\Intangible;
 use App\Entity\Reward\Reward;
+use App\Entity\Shop\Orders;
 use App\Entity\Traits\CreatedOnAndByTrait;
 use App\Enum\Organization\CategoryEnum;
 use App\Enum\Organization\LegalEnum;
@@ -95,7 +97,7 @@ class Organization
     private ?Settings $settings = null;
 
     /** @var Collection<int, Access> */
-    #[ORM\OneToMany(targetEntity: Access::class, mappedBy: 'organization', cascade: ['persist'])]
+    #[ORM\OneToMany(targetEntity: Access::class, mappedBy: 'organization', cascade: ['persist', 'remove'])]
     private Collection $accesses;
 
     /** @var Collection<int, NetworkOrganization> */
@@ -235,38 +237,44 @@ class Organization
     #[ORM\Column(nullable: true)]
     private ?string $otherPractice = null;
 
-    /** @var Collection<int, ContactPoint> */
+    /**
+     * orphanRemoval: on ne conserve pas un contact point qui n'est plus lié à aucune organisation ou person
+     * @var Collection<int, ContactPoint>
+     */
     #[ORM\ManyToMany(targetEntity: ContactPoint::class, mappedBy: 'organization', cascade: ['persist'], orphanRemoval: true)]
     private Collection $contactPoints;
 
-    /** @var Collection<int, BankAccount> */
-    #[ORM\ManyToMany(targetEntity: BankAccount::class, inversedBy: 'organization')]
+    /**
+     * orphanRemoval: on ne conserve pas un contact point qui n'est plus lié à aucune organisation ou person
+     * @var Collection<int, BankAccount>
+     */
+    #[ORM\ManyToMany(targetEntity: BankAccount::class, inversedBy: 'organization', cascade: ['persist'], orphanRemoval: true)]
     #[ORM\JoinColumn(name: 'organization_id', referencedColumnName: 'id', unique: true)]
     #[ORM\InverseJoinColumn(name: 'bankAccount_id', referencedColumnName: 'id')]
     private Collection $bankAccounts;
 
     /** @var Collection<int, OrganizationAddressPostal> */
-    #[ORM\OneToMany(targetEntity: OrganizationAddressPostal::class, mappedBy: 'organization', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(mappedBy: 'organization', targetEntity: OrganizationAddressPostal::class, cascade: ['persist', 'remove'])]
     private Collection $organizationAddressPostals;
 
     /** @var Collection<int, OrganizationLicence> */
-    #[ORM\OneToMany(targetEntity: OrganizationLicence::class, mappedBy: 'organization', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(mappedBy: 'organization', targetEntity: OrganizationLicence::class, cascade: ['persist', 'remove'])]
     private Collection $organizationLicences;
 
     /** @var Collection<int, OrganizationArticle> */
-    #[ORM\OneToMany(targetEntity: OrganizationArticle::class, mappedBy: 'organization', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(mappedBy: 'organization', targetEntity: OrganizationArticle::class, cascade: ['persist', 'remove'])]
     private Collection $organizationArticles;
 
     /** @var Collection<int, Cycle> */
-    #[ORM\OneToMany(targetEntity: Cycle::class, mappedBy: 'organization', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(mappedBy: 'organization', targetEntity: Cycle::class, cascade: ['persist', 'remove'])]
     private Collection $cycles;
 
     /** @var Collection<int, EducationTiming> */
-    #[ORM\OneToMany(targetEntity: EducationTiming::class, mappedBy: 'organization', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(mappedBy: 'organization', targetEntity: EducationTiming::class, cascade: ['persist', 'remove'])]
     private Collection $educationTimings;
 
     /** @var Collection<int, Subdomain> */
-    #[ORM\OneToMany(targetEntity: Subdomain::class, mappedBy: 'organization', cascade: ['persist', 'remove'])]
+    #[ORM\OneToMany(mappedBy: 'organization', targetEntity: Subdomain::class, cascade: ['persist', 'remove'])]
     private Collection $subdomains;
 
     #[ORM\ManyToOne(inversedBy: 'organizationContacts')]
@@ -274,96 +282,100 @@ class Organization
     private ?Access $contactPerson;
 
     /** @var Collection<int, OrganizationHoliday> */
-    #[ORM\OneToMany(targetEntity: OrganizationHoliday::class, mappedBy: 'organization', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(mappedBy: 'organization', targetEntity: OrganizationHoliday::class, cascade: ['persist', 'remove'])]
     private Collection $holidays;
 
     /** @var Collection<int, Course> */
-    #[ORM\OneToMany(targetEntity: Course::class, mappedBy: 'organization', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(mappedBy: 'organization', targetEntity: Course::class, cascade: ['persist', 'remove'])]
     private Collection $courses;
 
     /** @var Collection<int, EducationalProject> */
-    #[ORM\OneToMany(targetEntity: EducationalProject::class, mappedBy: 'organization', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(mappedBy: 'organization', targetEntity: EducationalProject::class, cascade: ['persist', 'remove'])]
     private Collection $educationalProjects;
 
     /** @var Collection<int, Event> */
-    #[ORM\OneToMany(targetEntity: Event::class, mappedBy: 'organization', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(mappedBy: 'organization', targetEntity: Event::class, cascade: ['persist', 'remove'])]
     private Collection $events;
 
     /** @var Collection<int, Examen> */
-    #[ORM\OneToMany(targetEntity: Examen::class, mappedBy: 'organization', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(mappedBy: 'organization', targetEntity: Examen::class, cascade: ['persist', 'remove'])]
     private Collection $examens;
 
     /** @var Collection<int, CriteriaNotation> */
-    #[ORM\OneToMany(targetEntity: CriteriaNotation::class, mappedBy: 'organization', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(mappedBy: 'organization', targetEntity: CriteriaNotation::class, cascade: ['persist', 'remove'])]
     private Collection $critereNotations;
 
     /** @var Collection<int, EducationCategory> */
-    #[ORM\OneToMany(targetEntity: EducationCategory::class, mappedBy: 'organization', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(mappedBy: 'organization', targetEntity: EducationCategory::class, cascade: ['persist', 'remove'])]
     private Collection $educationCategories;
 
     /** @var Collection<int, PeriodNotation> */
-    #[ORM\OneToMany(targetEntity: PeriodNotation::class, mappedBy: 'organization', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(mappedBy: 'organization', targetEntity: PeriodNotation::class, cascade: ['persist', 'remove'])]
     private Collection $periodNotations;
 
     /** @var Collection<int, File> */
-    #[ORM\OneToMany(targetEntity: File::class, mappedBy: 'organization', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(mappedBy: 'organization', targetEntity: File::class, cascade: ['persist', 'remove'])]
     private Collection $files;
 
     /** @var Collection<int, Notification> */
-    #[ORM\OneToMany(targetEntity: Notification::class, mappedBy: 'recipientOrganization', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(mappedBy: 'recipientOrganization', targetEntity: Notification::class, cascade: ['persist', 'remove'])]
     private Collection $notifications;
 
     /** @var Collection<int, Email> */
-    #[ORM\OneToMany(targetEntity: Email::class, mappedBy: 'organization', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(mappedBy: 'organization', targetEntity: Email::class, cascade: ['persist', 'remove'])]
     private Collection $emails;
 
     /** @var Collection<int, Mail> */
-    #[ORM\OneToMany(targetEntity: Mail::class, mappedBy: 'organization', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(mappedBy: 'organization', targetEntity: Mail::class, cascade: ['persist', 'remove'])]
     private Collection $mails;
 
     /** @var Collection<int, Sms> */
-    #[ORM\OneToMany(targetEntity: Sms::class, mappedBy: 'organization', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(mappedBy: 'organization', targetEntity: Sms::class, cascade: ['persist', 'remove'])]
     private Collection $sms;
 
     /** @var Collection<int, Activity> */
-    #[ORM\OneToMany(targetEntity: Activity::class, mappedBy: 'organization', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(mappedBy: 'organization', targetEntity: Activity::class, cascade: ['persist', 'remove'])]
     private Collection $activities;
 
     /** @var Collection<int, Jury> */
-    #[ORM\OneToMany(targetEntity: Jury::class, mappedBy: 'organization', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(mappedBy: 'organization', targetEntity: Jury::class, cascade: ['persist', 'remove'])]
     private Collection $juries;
 
     /** @var Collection<int, Commission> */
-    #[ORM\OneToMany(targetEntity: Commission::class, mappedBy: 'organization', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(mappedBy: 'organization', targetEntity: Commission::class, cascade: ['persist', 'remove'])]
     private Collection $commissions;
 
     /** @var Collection<int, Place> */
-    #[ORM\OneToMany(mappedBy: 'organization', targetEntity: Place::class, orphanRemoval: true)]
+    #[ORM\OneToMany(mappedBy: 'organization', targetEntity: Place::class, cascade: ['persist', 'remove'])]
     private Collection $places;
 
     /** @var Collection<int, Attendance> */
-    #[ORM\OneToMany(targetEntity: Attendance::class, mappedBy: 'organization', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(mappedBy: 'organization', targetEntity: Attendance::class, cascade: ['persist', 'remove'])]
     private Collection $attendances;
 
     /** @var Collection<int, Equipment> */
-    #[ORM\OneToMany(targetEntity: Equipment::class, mappedBy: 'organization', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(mappedBy: 'organization', targetEntity: Equipment::class, cascade: ['persist', 'remove'])]
     private Collection $equipments;
 
     /** @var Collection<int, Intangible> */
-    #[ORM\OneToMany(targetEntity: Intangible::class, mappedBy: 'organization', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(targetEntity: Intangible::class, mappedBy: 'organization', cascade: ['persist', 'remove'])]
     private Collection $intangibles;
 
     /** @var Collection<int, Donor> */
-    #[ORM\OneToMany(targetEntity: Donor::class, mappedBy: 'organization', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(targetEntity: Donor::class, mappedBy: 'organization', cascade: ['persist', 'remove'])]
     private Collection $donors;
 
     /** @var Collection<int, Reward> */
-    #[ORM\OneToMany(targetEntity: Reward::class, mappedBy: 'organization', cascade: ['persist', 'remove'], orphanRemoval: true)]
+    #[ORM\OneToMany(targetEntity: Reward::class, mappedBy: 'organization', cascade: ['persist', 'remove'])]
     private Collection $rewards;
 
     //    #[ORM\OneToOne()]
     //    private OnlineRegistrationSettings $onlineRegistrationSettings;
 
+    /** @var Collection<int, Tagg> */
+    #[ORM\OneToMany(targetEntity: Tagg::class, mappedBy: 'organization', cascade: ['persist', 'remove'])]
+    private Collection $ownedTags;
+
     /** @var Collection<int, Tagg> */
     #[ORM\ManyToMany(targetEntity: Tagg::class, inversedBy: 'organizations', cascade: ['persist'])]
     #[ORM\JoinTable(name: 'tag_organization')]
@@ -372,51 +384,64 @@ class Organization
     private Collection $tags;
 
     /** @var Collection<int, NetworkOrganization> */
-    #[ORM\OneToMany(targetEntity: NetworkOrganization::class, mappedBy: 'organization', cascade: ['persist'], orphanRemoval: true)]
+    #[ORM\OneToMany(targetEntity: NetworkOrganization::class, mappedBy: 'organization', cascade: ['persist', 'remove'])]
     protected Collection $network;
 
     /** @var Collection<int, NetworkOrganization> */
-    #[ORM\OneToMany(targetEntity: NetworkOrganization::class, mappedBy: 'parent', cascade: ['persist'], orphanRemoval: true)]
+    #[ORM\OneToMany(targetEntity: NetworkOrganization::class, mappedBy: 'parent', cascade: ['persist', 'remove'])]
     protected Collection $networkChild;
 
-    #[ORM\OneToOne(targetEntity: BillingExportSetting::class, mappedBy: 'organization', cascade: ['persist'])]
+    #[ORM\OneToOne(targetEntity: BillingExportSetting::class, mappedBy: 'organization', cascade: ['persist', 'remove'])]
     protected ?BillingExportSetting $billingExportSetting;
 
     /** @var Collection<int, Access> */
-    #[ORM\OneToMany(targetEntity: Access::class, mappedBy: 'organization', cascade: ['persist'], orphanRemoval: true)]
+    #[ORM\OneToMany(targetEntity: Access::class, mappedBy: 'organization', cascade: ['persist', 'remove'])]
     protected Collection $access;
 
     /** @var Collection<int, AbstractMessage> */
-    #[ORM\OneToMany(targetEntity: AbstractMessage::class, mappedBy: 'organization', cascade: [], orphanRemoval: true)]
+    #[ORM\OneToMany(targetEntity: AbstractMessage::class, mappedBy: 'organization', cascade: ['persist', 'remove'])]
     protected Collection $messages;
 
-    #[ORM\OneToOne(targetEntity: OnlineRegistrationSettings::class, mappedBy: 'organization', cascade: ['persist'])]
+    #[ORM\OneToOne(targetEntity: OnlineRegistrationSettings::class, mappedBy: 'organization', cascade: ['persist', 'remove'])]
     protected ?OnlineRegistrationSettings $onlineRegistrationSettings;
 
     /** @var Collection<int, CotisationByYear> */
-    #[ORM\OneToMany(targetEntity: CotisationByYear::class, mappedBy: 'organization', cascade: ['persist'], orphanRemoval: true)]
+    #[ORM\OneToMany(targetEntity: CotisationByYear::class, mappedBy: 'organization', cascade: ['persist', 'remove'])]
     protected Collection $cotisationByYears;
 
     /** @var Collection<int, AttendanceBookingReason> */
-    #[ORM\OneToMany(targetEntity: AttendanceBookingReason::class, mappedBy: 'organization', cascade: ['persist'], orphanRemoval: true)]
+    #[ORM\OneToMany(targetEntity: AttendanceBookingReason::class, mappedBy: 'organization', cascade: ['persist', 'remove'])]
     protected Collection $attendanceBookingReasons;
 
     /** @var Collection<int, Cycle> */
-    #[ORM\OneToMany(targetEntity: Cycle::class, mappedBy: 'organization', cascade: [], orphanRemoval: true)]
+    #[ORM\OneToMany(targetEntity: Cycle::class, mappedBy: 'organization', cascade: ['persist', 'remove'])]
     protected Collection $educationCurriculumPacks;
 
     /** @var Collection<int, FamilyQuotientModel> */
-    #[ORM\OneToMany(targetEntity: FamilyQuotientModel::class, mappedBy: 'organization', cascade: [], orphanRemoval: true)]
+    #[ORM\OneToMany(targetEntity: FamilyQuotientModel::class, mappedBy: 'organization', cascade: ['persist', 'remove'])]
     protected Collection $familyQuotientModels;
 
     /** @var Collection<int, BillSchedule> */
-    #[ORM\OneToMany(targetEntity: BillSchedule::class, mappedBy: 'organization', cascade: ['persist'], orphanRemoval: true)]
+    #[ORM\OneToMany(targetEntity: BillSchedule::class, mappedBy: 'organization', cascade: ['persist', 'remove'])]
     protected Collection $billSchedules;
 
     /** @var Collection<int, AbstractReport> */
-    #[ORM\OneToMany(targetEntity: AbstractReport::class, mappedBy: 'organization', cascade: ['persist'], orphanRemoval: true)]
+    #[ORM\OneToMany(targetEntity: AbstractReport::class, mappedBy: 'organization', cascade: ['persist', 'remove'])]
     private Collection $reports;
 
+    /** @var Collection<int, Orders> */
+    #[ORM\OneToMany(targetEntity: Orders::class, mappedBy: 'organization', cascade: [], orphanRemoval: true)]
+    protected Collection $orders;
+
+    /**
+     * orphanRemoval: on ne conserve pas un tips qui n'est plus lié à aucune organisation ou access
+     * @var Collection<int, Tips>
+     */
+    #[ORM\ManyToMany(targetEntity: Tips::class, inversedBy: 'organizations', cascade: ['persist'], orphanRemoval: false)]
+    #[ORM\JoinTable(name: 'organization_tips')]
+    #[ORM\JoinColumn(name: 'organization_id')]
+    protected Collection $tips;
+
     #[Pure]
     public function __construct()
     {
@@ -465,6 +490,8 @@ class Organization
         $this->educationCurriculumPacks = new ArrayCollection();
         $this->familyQuotientModels = new ArrayCollection();
         $this->billSchedules = new ArrayCollection();
+        $this->orders = new ArrayCollection();
+        $this->tips = new ArrayCollection();
     }
 
     public function getId(): ?int
@@ -528,7 +555,7 @@ class Organization
     public function setSettings(Settings $settings): self
     {
         $this->settings = $settings;
-        
+
         // set the owning side of the relation
         $settings->setOrganization($this);
 
@@ -2201,4 +2228,52 @@ class Organization
 
         return $this;
     }
+
+    function getOrders(): Collection
+    {
+        return $this->orders;
+    }
+
+    function addOrder(Orders $order): self
+    {
+        if (!$this->orders->contains($order)) {
+            $this->orders[] = $order;
+            $order->setOrganization($this);
+        }
+
+        return $this;
+    }
+
+    function removeOrder(Orders $order): self
+    {
+        if ($this->orders->removeElement($order)) {
+            $order->setOrganization(null);
+        }
+
+        return $this;
+    }
+
+    function getTips(): Collection
+    {
+        return $this->tips;
+    }
+
+    function addTip(Tips $tip): self
+    {
+        if (!$this->tips->contains($tip)) {
+            $this->tips[] = $tip;
+            $tip->addOrganization($this);
+        }
+
+        return $this;
+    }
+
+    function removeTip(Tips $tip): self
+    {
+        if ($this->tips->removeElement($tip)) {
+            $tip->removeOrganization($this);
+        }
+
+        return $this;
+    }
 }

+ 3 - 0
src/Entity/Product/AbstractProduct.php

@@ -30,6 +30,9 @@ abstract class AbstractProduct
 
     /** @var Collection<int, Tagg> */
     #[ORM\ManyToMany(targetEntity: Tagg::class, inversedBy: 'products', cascade: ['persist'], orphanRemoval: false)]
+    #[ORM\JoinTable(name: 'tag_product')]
+    #[ORM\JoinColumn(name: 'product_id', referencedColumnName: 'id')]
+    #[ORM\InverseJoinColumn(name: 'tag_id', referencedColumnName: 'id')]
     protected Collection $tags;
 
     public function __construct()

+ 58 - 0
src/Entity/Shop/Orders.php

@@ -0,0 +1,58 @@
+<?php
+
+declare(strict_types=1);
+
+namespace App\Entity\Shop;
+
+use ApiPlatform\Metadata\ApiResource;
+use App\Entity\Access\Access;
+use App\Entity\Organization\Organization;
+use Doctrine\ORM\Mapping as ORM;
+
+#[ApiResource(operations: [])]
+#[ORM\Entity]
+class Orders
+{
+    #[ORM\Id]
+    #[ORM\Column(length: 100)]
+    protected string $uuid;
+
+    #[ORM\ManyToOne(targetEntity: Organization::class, cascade: [], inversedBy: 'orders')]
+    protected Organization $organization;
+
+    #[ORM\ManyToOne(targetEntity: Access::class, cascade: [], inversedBy: 'orders')]
+    protected Access $access;
+
+    function getUuid(): mixed
+    {
+        return $this->uuid;
+    }
+
+    function setUuid(mixed $uuid): self
+    {
+        $this->uuid = $uuid;
+        return $this;
+    }
+
+     function getOrganization(): Organization
+    {
+        return $this->organization;
+    }
+
+    function setOrganization(Organization $organization): self
+    {
+        $this->organization = $organization;
+        return $this;
+    }
+
+    function getAccess(): Access
+    {
+        return $this->access;
+    }
+
+    function setAccess(Access $access): self
+    {
+        $this->access = $access;
+        return $this;
+    }
+}

+ 211 - 0
src/Entity/SimulationSession/SimulationSession.php

@@ -0,0 +1,211 @@
+<?php
+
+
+declare(strict_types=1);
+
+namespace App\Entity\SimulationSession;
+
+use ApiPlatform\Metadata\ApiResource;
+use App\Entity\Access\Access;
+use App\Entity\Token\Token;
+use Doctrine\ORM\Mapping as ORM;
+
+#[ApiResource(operations: [])]
+#[ORM\Entity]
+class SimulationSession
+{
+    #[ORM\Id]
+    #[ORM\Column]
+    #[ORM\GeneratedValue]
+    private int $id;
+
+    /** -- Warning : auto-generated property, checkup the attribute options -- */
+    #[ORM\Column]
+    protected mixed $initiatorIp;
+
+    /** -- Warning : auto-generated property, checkup the attribute options -- */
+    #[ORM\Column(type: 'date', options: ['nullable' => true])]
+    protected ?\DateTimeInterface $expiryDate;
+
+    /** -- Warning : auto-generated property, checkup the attribute options -- */
+    #[ORM\Column(options: ['default' => false])]
+    protected bool $alreadyUsed;
+
+    /** -- Warning : auto-generated property, checkup the attribute options -- */
+    #[ORM\Column(type: 'date', options: ['nullable' => true])]
+    protected ?\DateTimeInterface $createDate;
+
+    /** -- Warning : auto-generated property, checkup the attribute options -- */
+    #[ORM\Column(type: 'date', options: ['nullable' => true])]
+    protected ?\DateTimeInterface $updateDate;
+
+    /** -- Warning : auto-generated property, checkup the attribute options -- */
+    #[ORM\Column(type: 'integer', options: ['nullable' => true])]
+    protected int $legacyId;
+
+    /** -- Warning : auto-generated property, checkup the attribute options -- */
+    #[ORM\Column(type: 'integer', options: ['nullable' => true])]
+    protected int $createdBy;
+
+    /** -- Warning : auto-generated property, checkup the attribute options -- */
+    #[ORM\Column(type: 'integer', options: ['nullable' => true])]
+    protected int $updatedBy;
+
+    /** -- Warning : auto-generated property, checkup the attribute options -- */
+    #[ORM\Column(options: ['default' => false])]
+    protected bool $draft;
+
+    #[ORM\ManyToOne(targetEntity: Access::class, cascade: [], inversedBy: 'simulationSessionAccessInitiators')]
+    #[ORM\JoinColumn(nullable: false)]
+    protected Access $accessInitiator;
+
+    #[ORM\ManyToOne(targetEntity: Access::class, cascade: [], inversedBy: 'simulationSessionAccessSimulateds')]
+    #[ORM\JoinColumn(nullable: false)]
+    protected Access $accessSimulated;
+
+    #[ORM\OneToOne(mappedBy: 'simulationSession', targetEntity: Token::class, cascade: ['persist'])]
+    protected Token $token;
+
+    function getId(): int
+    {
+        return $this->id;
+    }
+
+    function setId(int $id): self
+    {
+        $this->id = $id;
+        return $this;
+    }
+
+    function getInitiatorIp(): mixed
+    {
+        return $this->initiatorIp;
+    }
+
+    function setInitiatorIp(mixed $initiatorIp): self
+    {
+        $this->initiatorIp = $initiatorIp;
+        return $this;
+    }
+
+    function getExpiryDate(): \DateTimeInterface
+    {
+        return $this->expiryDate;
+    }
+
+    function setExpiryDate(\DateTimeInterface $expiryDate): self
+    {
+        $this->expiryDate = $expiryDate;
+        return $this;
+    }
+
+    function getAlreadyUsed(): bool
+    {
+        return $this->alreadyUsed;
+    }
+
+    function setAlreadyUsed(bool $alreadyUsed): self
+    {
+        $this->alreadyUsed = $alreadyUsed;
+        return $this;
+    }
+
+    function getCreateDate(): \DateTimeInterface
+    {
+        return $this->createDate;
+    }
+
+    function setCreateDate(\DateTimeInterface $createDate): self
+    {
+        $this->createDate = $createDate;
+        return $this;
+    }
+
+    function getUpdateDate(): \DateTimeInterface
+    {
+        return $this->updateDate;
+    }
+
+    function setUpdateDate(\DateTimeInterface $updateDate): self
+    {
+        $this->updateDate = $updateDate;
+        return $this;
+    }
+
+    function getLegacyId(): int
+    {
+        return $this->legacyId;
+    }
+
+    function setLegacyId(int $legacyId): self
+    {
+        $this->legacyId = $legacyId;
+        return $this;
+    }
+
+    function getCreatedBy(): int
+    {
+        return $this->createdBy;
+    }
+
+    function setCreatedBy(int $createdBy): self
+    {
+        $this->createdBy = $createdBy;
+        return $this;
+    }
+
+    function getUpdatedBy(): int
+    {
+        return $this->updatedBy;
+    }
+
+    function setUpdatedBy(int $updatedBy): self
+    {
+        $this->updatedBy = $updatedBy;
+        return $this;
+    }
+
+    function getDraft(): bool
+    {
+        return $this->draft;
+    }
+
+    function setDraft(bool $draft): self
+    {
+        $this->draft = $draft;
+        return $this;
+    }
+
+    function getAccessInitiator(): Access\Access
+    {
+        return $this->accessInitiator;
+    }
+
+    function setAccessInitiator(Access\Access $accessInitiator): self
+    {
+        $this->accessInitiator = $accessInitiator;
+        return $this;
+    }
+
+    function getAccessSimulated(): Access\Access
+    {
+        return $this->accessSimulated;
+    }
+
+    function setAccessSimulated(Access\Access $accessSimulated): self
+    {
+        $this->accessSimulated = $accessSimulated;
+        return $this;
+    }
+
+    function getToken(): Token\Token
+    {
+        return $this->token;
+    }
+
+    function setToken(Token\Token $token): self
+    {
+        $this->token = $token;
+        return $this;
+    }
+}

+ 16 - 0
src/Entity/Token/Token.php

@@ -6,6 +6,7 @@ namespace App\Entity\Token;
 
 use ApiPlatform\Metadata\ApiResource;
 use App\Entity\Access\Access;
+use App\Entity\SimulationSession\SimulationSession;
 use Doctrine\ORM\Mapping as ORM;
 
 /**
@@ -24,6 +25,10 @@ class Token
     #[ORM\JoinColumn(referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
     private ?Access $access;
 
+    #[ORM\OneToOne(targetEntity: SimulationSession::class, inversedBy: 'token', cascade: ['persist'])]
+    #[ORM\JoinColumn(unique: true, onDelete: 'CASCADE')]
+    protected SimulationSession $simulationSession;
+
     public function getId(): int
     {
         return $this->id;
@@ -47,4 +52,15 @@ class Token
 
         return $this;
     }
+
+    function getSimulationSession(): SimulationSession
+    {
+        return $this->simulationSession;
+    }
+
+    function setSimulationSession(SimulationSession $simulationSession): self
+    {
+        $this->simulationSession = $simulationSession;
+        return $this;
+    }
 }

+ 1 - 0
src/Service/Organization/OrganizationFactory.php

@@ -846,6 +846,7 @@ class OrganizationFactory
             $this->entityManager->rollback();
             throw $e;
         }
+        return $organizationDeletionRequest;
 
         try {
             $this->deleteTypo3Website($organizationDeletionRequest->getOrganizationId());