Skip to content

✨(ingestion) post cleaned offer to web#692

Open
AntoineAugusti wants to merge 1 commit into
mainfrom
feat/post-cleaned-offer
Open

✨(ingestion) post cleaned offer to web#692
AntoineAugusti wants to merge 1 commit into
mainfrom
feat/post-cleaned-offer

Conversation

@AntoineAugusti
Copy link
Copy Markdown
Member

📝 Description

Contexte

Après le nettoyage d'une offre dans le pipeline d'ingestion, celle-ci n'était pas transmise à l'API web. Cette PR ajoute cette étape finale et met
à jour upsert_at en base une fois la transmission effectuée.

Changements

Nouveau use case : PostCleanedOfferUseCase

  • Interface de gateway IPublishOfferGateway dans la couche domaine
  • Use case PostCleanedOfferUseCase dans la couche application
  • Implémentation WebPublishOfferGateway qui sérialise l'offre via OfferUpsertPayload (Pydantic) et la poste sur POST /api/v1/offres/creer_modifier/

Pipeline mis à jour

  • IngestOfferPipeline appelle désormais PostCleanedOfferUseCase après mark_as_cleaned
  • mark_as_upserted est appelé en base après un POST réussi

Refactoring des gateways web

  • BaseWebGateway extrait avec _get, _post, _auth_headers et le préfixe /api/v1 centralisé
  • WebArchiveGateway, WebSourcesGateway et WebPublishOfferGateway en héritent

Repository

  • mark_as_upserted ajouté à IRawOfferRepository et RawOfferRepository

Tests

  • Tests unitaires pour le use case, le gateway et le pipeline
  • Tests d'intégration pour mark_as_upserted
  • Tests de présentation mis à jour pour mocker le nouveau POST vers l'API web

🏷️ Type de changement

  • 🐛 Correction de bug
  • 🎢 Nouvelle fonctionnalité (changement non bloquant qui ajoute une fonctionnalité)
  • 🥁 Changement breaking (modification ou fonctionnalité qui pourrait casser le fonctionnement existant) nécessitant une mise à jour de la documentation
  • 📚 Mise à jour de la documentation
  • ♻️ Refactorisation
  • 🔧 Changement technique

🔧 Modifications

Lister les changements principaux

🛸 Dépendances requises pour ce changement (si applicable)

🏝️ Comment tester (si applicable)

Étapes pour reproduire ou tester

📸 Captures d’écran (si applicable)

✅ Liste de contrôle

  • 💅 J’ai ajouté ou mis à jour les tests appropriés.
  • 📝 J’ai mis à jour ou ajouté la documentation nécessaire.
  • 🚀 J’ai pris en compte l’impact sur les performances, la sécurité et l’expérience utilisateur.
  • 👀 J’ai demandé une revue à une personne de l’équipe.

@AntoineAugusti AntoineAugusti linked an issue Jun 5, 2026 that may be closed by this pull request
@AntoineAugusti AntoineAugusti added the added PR: backward compatible addition label Jun 5, 2026

class WebPublishOfferGateway(BaseWebGateway, IPublishOfferGateway):
async def publish(self, offer: Offer) -> None:
await self._post(
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Demande #690 pour l'authentification

async def publish(self, offer: Offer) -> None:
await self._post(
"/offres/creer_modifier/",
json={"offres": [self._serialize(offer)]},
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requiert #693

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

added PR: backward compatible addition

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ingestion : poster dans web les offres nettoyées

1 participant