Skip to content

Update article date : Date des articles modifiés - #48

Merged
raynaldlao merged 1 commit into
masterfrom
update-article-date
Jul 22, 2026
Merged

Update article date : Date des articles modifiés#48
raynaldlao merged 1 commit into
masterfrom
update-article-date

Conversation

@raynaldlao

Copy link
Copy Markdown
Owner

Contexte

Chaque mise à jour d'article enregistre désormais un timestamp article_edited_at (UTC) dans la base de données. Les pages de détail et de liste affichent un indicateur "edited at …" formaté en Europe/Paris. Le nom de la colonne DB (article_edited_at) est aligné sur les noms de variables dans le domaine, les DTO et les adaptateurs (convention article_ partout).

Modifications

Base de données

  • Migration V15 — Nouvelle colonne article_edited_at TIMESTAMP sur articles
  • docker-compose.yml — Flyway 12 → 13 (compatibilité V15)

Domaine

  • src/application/domain/article.py — Nouveau paramètre article_edited_at dans Article.__init__()

Services

  • article_service.pyupdate_article() définit article_article_edited_at = datetime.now(UTC) avant la sauvegarde

Adaptateurs de persistance

  • sqlalchemy_article_model.py — Nouvelle colonne mappée
  • sqlalchemy_article_adapter.py — Passage de article_edited_at dans les chemins UPDATE et INSERT
  • article_record.py — Nouveau champ + transmission à to_domain()

DTO de réponse

  • article_response.py — Nouveaux champs article_edited_at et article_edited_at_formatted, méthode statique _to_local_full() pour le formatage complet (mois jour, année at HH:MM), docstrings. Suppression de la fonction morte _blocks_to_plain_text()

Adaptateur Flask

  • flask_article_adapter.py — Exposition de "article_edited_at" dans l'API JSON

Frontend

  • article_detail.html — Indicateur "edited at …" après la date de publication
  • article_list.html — Même indicateur dans les métadonnées de chaque article
  • article.css — Style .article-edited-line (couleur on-surface-variant)

Tests

  • test_article_service.py — Vérifie que update_article() set le timestamp
  • test_article_response.py — Formattage Europe/Paris avec et sans edited_at
  • test_flask_article_adapter.py — Présence de la clé "article_edited_at" dans la réponse JSON
  • test_article_record.py — Mock mis à jour avec le nouveau champ
  • test_workflow_integration.py — Round-trip complet : création → édition → vérification en base

…at`. Each update now records an UTC timestamp, exposed through the domain, adapters and API, formatted to full Europe/Paris local time in responses. Detail and list pages display an “edited at …” indicator, CSS adds the edited‑line style, and all affected tests validate the new field end‑to‑end
@raynaldlao
raynaldlao requested a review from hlargitte July 21, 2026 19:59
@raynaldlao raynaldlao self-assigned this Jul 21, 2026

@hlargitte hlargitte left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

LGTM

@raynaldlao
raynaldlao merged commit 5e18fae into master Jul 22, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants