Skip to content

Conversation

@m4dm4rtig4n
Copy link
Contributor

Summary

  • Fix bug where linked_production_pdl_id comparison uses UUID instead of usage_point_id
  • Hide production PDLs that are linked to consumption PDLs from all page selectors
  • Ensures only consumption PDLs appear when production is linked, following the requirement: "Si j'ai liée un pdl de production à un pdl de consommation, il faut que tu affiche uniquement le PDL de consommation et masque le pdl de production"

Test plan

  • Verify production PDL linked to consumption PDL is hidden in header selector
  • Verify only consumption PDL is displayed when production is linked
  • Test on /production, /consumption_kwh, /dashboard, and other pages with PDL selector

- Fix bug where linked_production_pdl_id uses UUID instead of usage_point_id
- Move linkedProductionIds calculation outside production page logic
- Apply global filter to hide production PDLs linked to consumption PDLs
- Ensures only consumption PDLs appear in selectors when production is linked

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Copilot AI review requested due to automatic review settings December 5, 2025 09:09
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a critical bug in PDL (Point De Livraison / delivery point) filtering logic and implements global hiding of production PDLs that are linked to consumption PDLs. The bug occurred because linked_production_pdl_id stores the UUID (pdl.id), but the comparison was incorrectly using pdl.usage_point_id, causing linked production PDLs to not be properly filtered out.

Key Changes:

  • Fixed incorrect field comparison in production PDL filtering (using pdl.id instead of pdl.usage_point_id)
  • Moved linkedProductionIds calculation outside production-specific logic for reuse across all pages
  • Extended filtering to hide linked production PDLs globally across all page selectors, ensuring only consumption PDLs are displayed when production is linked

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@m4dm4rtig4n m4dm4rtig4n merged commit 10559d7 into main Dec 5, 2025
13 of 15 checks passed
@m4dm4rtig4n m4dm4rtig4n deleted the hide-linked-production-pdl branch December 18, 2025 07:59
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