Compare commits
3 Commits
7f2e61c059
...
9e33a577e8
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9e33a577e8 | ||
|
|
8cb570126a | ||
|
|
60d53b2d67 |
@@ -4,10 +4,10 @@ Scope: code changes related only to `BR-PT-004 - Market Price Import`.
|
||||
|
||||
## PT-BL-001 - Enforce uniqueness at model level
|
||||
|
||||
- Status: to be tested
|
||||
- Status: done
|
||||
- Implementation commit: `eaae2e5`
|
||||
- Priority: high
|
||||
- Source: [rules/market-price-import.md](../rules/market-price-import.md)
|
||||
- Source: [business rules/market-price-import.md](../business%20rules/market-price-import.md)
|
||||
- Requirement: enforce uniqueness of `(price, price_date)` at model level without adding a database constraint yet.
|
||||
- Work done:
|
||||
- added model-level validation on `price.price_value`
|
||||
@@ -27,7 +27,7 @@ Scope: code changes related only to `BR-PT-004 - Market Price Import`.
|
||||
|
||||
- Status: open
|
||||
- Priority: medium
|
||||
- Source: [rules/market-price-import.md](../rules/market-price-import.md)
|
||||
- Source: [business rules/market-price-import.md](../business%20rules/market-price-import.md)
|
||||
- Requirement: prefer the user's/default locale date format for ambiguous slash dates, then fall back to the current parsing order only if no locale preference is available.
|
||||
- Current behavior: `DD/MM/YYYY` is tried before `MM/DD/YYYY`.
|
||||
- Expected code impact:
|
||||
@@ -41,7 +41,7 @@ Scope: code changes related only to `BR-PT-004 - Market Price Import`.
|
||||
|
||||
- Status: open
|
||||
- Priority: high
|
||||
- Source: [rules/market-price-import.md](../rules/market-price-import.md)
|
||||
- Source: [business rules/market-price-import.md](../business%20rules/market-price-import.md)
|
||||
- Requirement: `price_value` is mandatory for imported rows. Missing `price_value` must be reported as a row error.
|
||||
- Current behavior: empty `price_value` is imported as an empty value.
|
||||
- Expected code impact:
|
||||
@@ -55,7 +55,7 @@ Scope: code changes related only to `BR-PT-004 - Market Price Import`.
|
||||
|
||||
- Status: open
|
||||
- Priority: high
|
||||
- Source: [rules/market-price-import.md](../rules/market-price-import.md)
|
||||
- Source: [business rules/market-price-import.md](../business%20rules/market-price-import.md)
|
||||
- Requirement: duplicate rows for the same `(price_index, price_date)` inside the same Excel file must be reported as row errors. The duplicate row must not import or update data.
|
||||
- Expected code impact:
|
||||
- `modules/purchase_trade/pricing.py`
|
||||
@@ -68,7 +68,7 @@ Scope: code changes related only to `BR-PT-004 - Market Price Import`.
|
||||
|
||||
- Status: open
|
||||
- Priority: medium
|
||||
- Source: [rules/market-price-import.md](../rules/market-price-import.md)
|
||||
- Source: [business rules/market-price-import.md](../business%20rules/market-price-import.md)
|
||||
- Requirement: distinguish business validation errors from file, parsing, and technical errors in the import result.
|
||||
- Current behavior: row errors are grouped under one `Errors` section.
|
||||
- Expected code impact:
|
||||
@@ -78,3 +78,17 @@ Scope: code changes related only to `BR-PT-004 - Market Price Import`.
|
||||
- result message separates business validation errors from parsing/technical errors
|
||||
- invalid workbook and missing required columns remain blocking `UserError`
|
||||
- row-level errors still let the import continue
|
||||
|
||||
## PT-BL-006 - Fix missing default currency on created price index
|
||||
|
||||
- Status: open
|
||||
- Priority: high
|
||||
- Source bug: [BUG-PT-001](../bugs.md#bug-pt-001---missing-default-currency-in-price-index-automatic-creation)
|
||||
- Source rule: [business rules/market-price-import.md](../business%20rules/market-price-import.md)
|
||||
- Requirement: when the market price import automatically creates a missing `price.price`, the created price index must have default currency `USD`.
|
||||
- Current behavior: the created price index can miss the default currency even though the import specification expects `USD`.
|
||||
- Expected code impact:
|
||||
- `modules/purchase_trade/pricing.py`
|
||||
- Expected tests:
|
||||
- automatic price index creation assigns `price_currency` to the `USD` currency record
|
||||
- if the `USD` currency record cannot be found, behavior remains aligned with the rule for optional default references
|
||||
|
||||
63
modules/purchase_trade/docs/bugs.md
Normal file
63
modules/purchase_trade/docs/bugs.md
Normal file
@@ -0,0 +1,63 @@
|
||||
# Bugs - Purchase Trade
|
||||
|
||||
This file is the bug register for `purchase_trade`.
|
||||
|
||||
## Workflow
|
||||
|
||||
1. Register every new bug in this file with a stable bug ID.
|
||||
2. Create a matching backlog entry for every new bug.
|
||||
3. Link the bug entry to the backlog entry.
|
||||
4. When fixed, record the implementation commit in the backlog entry.
|
||||
5. Keep the bug entry as history and update its status.
|
||||
|
||||
## Status Values
|
||||
|
||||
- `reported`
|
||||
- `confirmed`
|
||||
- `backlog-created`
|
||||
- `in-progress`
|
||||
- `to-be-tested`
|
||||
- `done`
|
||||
- `rejected`
|
||||
|
||||
## Bug Template
|
||||
|
||||
```md
|
||||
### BUG-PT-001 - Short title
|
||||
|
||||
- Status: `reported`
|
||||
- Area:
|
||||
- Reported date: `YYYY-MM-DD`
|
||||
- Reported by:
|
||||
- Related rule:
|
||||
- Backlog entry:
|
||||
- Severity:
|
||||
- Environment:
|
||||
- Description:
|
||||
- Steps to reproduce:
|
||||
- Expected behavior:
|
||||
- Actual behavior:
|
||||
- Evidence:
|
||||
- Notes:
|
||||
```
|
||||
|
||||
## Bugs
|
||||
|
||||
### BUG-PT-001 - Missing default currency in Price Index automatic creation
|
||||
|
||||
- Status: `backlog-created`
|
||||
- Area: Market Price Import
|
||||
- Reported date: `2026-05-08`
|
||||
- Reported by: user
|
||||
- Related rule: [BR-PT-004 - Market Price Import](business%20rules/market-price-import.md)
|
||||
- Backlog entry: [PT-BL-006](backlog/market-price-import-backlog.md#pt-bl-006---fix-missing-default-currency-on-created-price-index)
|
||||
- Severity:
|
||||
- Environment:
|
||||
- Description: during market price import, if a price index should be created, then the default currency defined to USD is missing.
|
||||
- Steps to reproduce:
|
||||
- import market prices with `Create price index if missing` enabled
|
||||
- include a `price_index` that does not already exist
|
||||
- Expected behavior: the automatically created `price.price` has default currency `USD`.
|
||||
- Actual behavior: the automatically created `price.price` has no default currency.
|
||||
- Evidence:
|
||||
- Notes:
|
||||
@@ -3,8 +3,8 @@
|
||||
Statut: `draft`
|
||||
Version: `v0.3`
|
||||
Derniere mise a jour: `2026-05-07`
|
||||
Owner metier: `a completer`
|
||||
Owner technique: `a completer`
|
||||
Owner metier: `Open Squared`
|
||||
Owner technique: `Open Squared`
|
||||
|
||||
## 1) Scope
|
||||
|
||||
@@ -30,16 +30,16 @@ Owner technique: `a completer`
|
||||
|
||||
| ID | Titre | Domaine | Detail |
|
||||
| --- | --- | --- | --- |
|
||||
| BR-PT-001 | Ajustement de la quantite theorique apres creation du contrat | Lot / Purchase | [rules/lot-quantity.md](rules/lot-quantity.md) |
|
||||
| BR-PT-002 | Le lot physique est le pont metier entre purchase, sale et shipment | Lot / Navigation | [rules/lot-navigation.md](rules/lot-navigation.md) |
|
||||
| BR-PT-003 | Le freight amount des templates facture vient du fee de shipment | Invoice / Freight | [rules/invoice-freight.md](rules/invoice-freight.md) |
|
||||
| BR-PT-004 | Market Price Import | Pricing | [rules/market-price-import.md](rules/market-price-import.md) |
|
||||
| BR-PT-001 | Ajustement de la quantite theorique apres creation du contrat | Lot / Purchase | [business rules/lot-quantity.md](business%20rules/lot-quantity.md) |
|
||||
| BR-PT-002 | Le lot physique est le pont metier entre purchase, sale et shipment | Lot / Navigation | [business rules/lot-navigation.md](business%20rules/lot-navigation.md) |
|
||||
| BR-PT-003 | Le freight amount des templates facture vient du fee de shipment | Invoice / Freight | [business rules/invoice-freight.md](business%20rules/invoice-freight.md) |
|
||||
| BR-PT-004 | Market Price Import | Pricing | [business rules/market-price-import.md](business%20rules/market-price-import.md) |
|
||||
|
||||
## 4) Convention pour les nouvelles regles
|
||||
|
||||
Voir aussi [documentation-management.md](documentation-management.md) pour le workflow complet de gestion documentaire.
|
||||
|
||||
Ajouter une ligne au catalogue puis creer une fiche detaillee dans `docs/rules/`.
|
||||
Ajouter une ligne au catalogue puis creer une fiche detaillee dans `docs/business rules/`.
|
||||
|
||||
Structure recommandee:
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ This guide records the documentation workflow to apply for future `purchase_trad
|
||||
## Rule Documentation Structure
|
||||
|
||||
- Keep `business-rules.md` as the entry point and rule catalog.
|
||||
- Store detailed business rules in `docs/rules/`, one file per substantial rule.
|
||||
- Store detailed business rules in `docs/business rules/`, one file per substantial rule.
|
||||
- Use stable business rule IDs such as `BR-PT-004`.
|
||||
- Add every new detailed rule to the catalog in `business-rules.md`.
|
||||
- Keep rule files focused on business behavior, expected outcomes, edge cases, impacted files, tests, and open questions.
|
||||
@@ -62,6 +62,35 @@ Example:
|
||||
- expected code impact
|
||||
- expected tests
|
||||
|
||||
Backlog status values:
|
||||
|
||||
- `open`: identified, not started yet
|
||||
- `in-progress`: currently being worked on
|
||||
- `blocked`: cannot progress until a dependency or question is resolved
|
||||
- `implemented`: code or documentation change made, not yet validated
|
||||
- `to-be-tested`: implemented and waiting for targeted validation in the right environment
|
||||
- `tested`: targeted validation passed
|
||||
- `done`: tested, committed, and no further action expected
|
||||
- `rejected`: intentionally not implemented
|
||||
|
||||
Default workflow:
|
||||
|
||||
```text
|
||||
open -> in-progress -> to-be-tested -> tested -> done
|
||||
```
|
||||
|
||||
Use `implemented` only when the change is made but no validation attempt has happened yet. Use `to-be-tested` when validation must happen in another environment or could not be completed locally.
|
||||
|
||||
## Bug Management
|
||||
|
||||
- Register every new bug in `docs/bugs.md`.
|
||||
- Use stable bug IDs such as `BUG-PT-001`.
|
||||
- Every new bug must have a matching backlog entry.
|
||||
- Link the bug entry to its backlog entry.
|
||||
- If the bug belongs to an existing feature backlog, add it there.
|
||||
- If the bug does not clearly belong to an existing feature backlog, create a dedicated backlog file under `docs/backlog/`.
|
||||
- When the bug is fixed, record the implementation commit in the backlog entry and update the bug status.
|
||||
|
||||
## Review Workflow
|
||||
|
||||
For future development work:
|
||||
|
||||
Reference in New Issue
Block a user