Browse Source

Adds opentalentId to public events

Adds the `opentalentId` field to the `view_public_events` view and the corresponding `PublicEvent` entity.

This change allows retrieving the original OpenTalent ID for events,
which is necessary for some synchronization and data consistency tasks.
Olivier Massot 2 tháng trước cách đây
mục cha
commit
75f6c19e2b

+ 2 - 0
sql/schema-extensions/001-view_public_events.sql

@@ -1,6 +1,7 @@
 CREATE OR REPLACE VIEW view_public_events AS
     SELECT
         b.uuid,
+        b.id as opentalentId,
         b.organization_id AS organizationId,
         o.name AS structureName,
         b.name,
@@ -56,6 +57,7 @@ CREATE OR REPLACE VIEW view_public_events AS
     UNION
     SELECT
         aw.uuid,
+        null as opentalentId,
         null AS organizationId,
         NULL AS structureName,
         aw.name,

+ 14 - 0
src/Entity/Public/PublicEvent.php

@@ -49,6 +49,9 @@ class PublicEvent
     #[ORM\Column]
     private string $uuid;
 
+    #[ORM\Column(type: 'integer')]
+    private int $opentalentId;
+
     #[ORM\Column(type: 'integer')]
     private int $organizationId;
 
@@ -166,6 +169,17 @@ class PublicEvent
         return $this;
     }
 
+    public function getOpentalentId(): int
+    {
+        return $this->opentalentId;
+    }
+
+    public function setOpentalentId(int $opentalentId): self
+    {
+        $this->opentalentId = $opentalentId;
+        return $this;
+    }
+
     public function getName(): string
     {
         return $this->name;