feat : finalisation du tableau d'estimation des poids bovin
This commit is contained in:
@@ -8,6 +8,7 @@ Project overview
|
||||
Backend conventions
|
||||
- Use English for code identifiers/messages; keep “pont-bascule” as domain term.
|
||||
- API Platform operations are defined on Doctrine entities.
|
||||
- No custom repository classes are used (`src/Repository` removed); use default Doctrine repositories via `EntityManagerInterface`.
|
||||
- Reception entity is in `src/Entity/Reception.php`, with custom weigh endpoint `/receptions/weigh`.
|
||||
- Reception fields: `date_reception`, `license_plate`, `current_step` (default 0), `is_valid` (default false).
|
||||
- Reception also has `identification_number` (auto `N-BR-####`), `merchandise_type`, `merchandise_detail`, `buildings` (M2M), and `pellet_buildings` (via `reception_pellet_building`).
|
||||
@@ -17,6 +18,13 @@ Backend conventions
|
||||
- Custom exception: `App\Exception\PontBasculeException` with French messages, mapped to 500 in provider.
|
||||
- Parsing of pont-bascule payload is in `src/Service/PontBasculePayloadDecoder.php`.
|
||||
- `config/reference.php` is auto-generated; keep it.
|
||||
- Bovine storage:
|
||||
- `src/Entity/Bovine.php` with fields `nationalNumber` (unique), `receivedWeight`, `arrivalDate`, and `buildingCase` (ManyToOne).
|
||||
- `src/Entity/BuildingCase.php` has `bovines` (OneToMany).
|
||||
- Case PDF report:
|
||||
- Endpoint: `GET /building_cases/{id}/weights-report` (provider: `App\State\BuildingCaseWeightsReportProvider`).
|
||||
- Template: `templates/case_weights_report.html.twig`.
|
||||
- Projection logic is done in backend from `arrivalDate`; daily gain is currently fixed at `1.3 kg/day` for all races.
|
||||
|
||||
Frontend conventions
|
||||
- Nuxt SSR disabled; Tailwind used.
|
||||
@@ -36,6 +44,7 @@ Frontend conventions
|
||||
- Service layer lives in `frontend/services/` with typed DTOs in `frontend/services/dto/`.
|
||||
- Reception service uses `receptions`, `receptions/{id}`, `receptions/weigh` and supports success/error toast keys.
|
||||
- Reception receipt endpoint is `receptions/{id}/receipt` (PDF) via `frontend/composables/usePdfPrinter.ts`.
|
||||
- Infrastructure case page prints the case weight report PDF from `frontend/pages/infrastructure/case.vue` using `usePdfPrinter('/building_cases/{id}/weights-report')`.
|
||||
|
||||
Environment & routing
|
||||
- Frontend dev server: `npm run dev` in `frontend/`.
|
||||
@@ -47,6 +56,11 @@ Environment & routing
|
||||
Notes
|
||||
- Do not add a GET that creates resources; use POST + PATCH.
|
||||
- Keep endpoints in plural (API Platform convention).
|
||||
- Seed and fixtures conventions:
|
||||
- `app:seed` now seeds infrastructure (`statut`, `building_layout`, `building_case`, `building_case_position`) and bovines.
|
||||
- `app:seed` uses intermediate flushes (after buildings and after infrastructure) so find queries can resolve just-created records.
|
||||
- Bovine seed rows use a legacy case token mapping to building-case code (`B{building}-C{case}`) before fallback to direct id lookup.
|
||||
- Fixtures include `BuildingInfrastructureFixtures` + `BovineFixtures` (via `AppFixtures` dependencies).
|
||||
- New reference data added:
|
||||
- Reception types (`reception_type`, fields: `label`, `code`), selectable on reception form.
|
||||
- Merchandise types (`merchandise_type`, fields: `label`, `code`) and pellet types (`pellet_type`, fields: `label`, `code`).
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
:disabled="!hasCaseId"
|
||||
@click="printCaseReport"
|
||||
>
|
||||
Imprimer case {{ caseId || '-' }}
|
||||
Imprimer
|
||||
</UiButton>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -150,11 +150,7 @@ final readonly class BuildingCaseWeightsReportProvider implements ProviderInterf
|
||||
|
||||
private function resolveDailyGainKg(?string $breedCode): float
|
||||
{
|
||||
return match ($breedCode) {
|
||||
'34' => 1.3, // Limousin
|
||||
'38' => 1.5, // Charolais
|
||||
default => 1.4, // Other breeds
|
||||
};
|
||||
return 1.3;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -179,39 +179,9 @@
|
||||
FOOTER VACCINS / NOTES
|
||||
========================= */
|
||||
.footer {
|
||||
margin-top: 6px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.footer th {
|
||||
background: #ffffff;
|
||||
font-size: 9px;
|
||||
font-weight: 700;
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
.footer td {
|
||||
font-size: 8px;
|
||||
padding: 2px;
|
||||
height: 18px;
|
||||
}
|
||||
|
||||
.footer .small {
|
||||
font-size: 8px;
|
||||
}
|
||||
|
||||
/* Ligne méta */
|
||||
.meta {
|
||||
margin-top: 3px;
|
||||
text-align: right;
|
||||
font-size: 8px;
|
||||
color: #444;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
/* Petits ajustements dompdf */
|
||||
.mt-0 { margin-top: 0; }
|
||||
.mb-0 { margin-bottom: 0; }
|
||||
|
||||
/* Header droit sans bordures par défaut */
|
||||
.header-right-free,
|
||||
.header-right-free td {
|
||||
@@ -363,68 +333,46 @@
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<!-- =========================
|
||||
FOOTER (traitements / vaccins)
|
||||
========================= -->
|
||||
{# <table class="footer">#}
|
||||
{# <colgroup>#}
|
||||
{# #}{# 14 colonnes pour gérer proprement les colspan #}
|
||||
{# <col style="width:12.5%">#}
|
||||
{# <col style="width:8%">#}
|
||||
{# <col style="width:12.5%">#}
|
||||
{# <col style="width:8%">#}
|
||||
{# <col style="width:12.5%">#}
|
||||
{# <col style="width:8%">#}
|
||||
{# <col style="width:12.5%">#}
|
||||
{# <col style="width:8%">#}
|
||||
{# <col style="width:8%">#}
|
||||
{# <col style="width:6%">#}
|
||||
{# <col style="width:8%">#}
|
||||
{# <col style="width:8%">#}
|
||||
{# <col style="width:6%">#}
|
||||
{# <col style="width:8%">#}
|
||||
{# </colgroup>#}
|
||||
|
||||
{# <tr>#}
|
||||
{# <th colspan="2">Date</th>#}
|
||||
{# <th colspan="2">Antibiotique</th>#}
|
||||
{# <th colspan="2">Date</th>#}
|
||||
{# <th colspan="2">Antero</th>#}
|
||||
{# <th colspan="3">Grippe</th>#}
|
||||
{# <th colspan="3">Protivity</th>#}
|
||||
{# </tr>#}
|
||||
|
||||
{# <tr>#}
|
||||
{# <td colspan="2"></td>#}
|
||||
{# <td colspan="2"></td>#}
|
||||
{# <td colspan="2"></td>#}
|
||||
{# <td colspan="2"></td>#}
|
||||
|
||||
{# <td class="small">Date</td>#}
|
||||
{# <td colspan="2" class="small">Intranasale</td>#}
|
||||
|
||||
{# <td class="small">Date</td>#}
|
||||
{# <td colspan="2" class="small">Rappel 30 jours</td>#}
|
||||
{# </tr>#}
|
||||
|
||||
{# <tr>#}
|
||||
{# <td colspan="2"></td>#}
|
||||
{# <td colspan="2"></td>#}
|
||||
{# <td colspan="2"></td>#}
|
||||
{# <td colspan="2" class="small">Rappel 30 jours</td>#}
|
||||
|
||||
{# <td></td>#}
|
||||
{# <td colspan="2" class="small">Rappel 90 jours</td>#}
|
||||
|
||||
{# <td></td>#}
|
||||
{# <td colspan="2" class="small">3 semaines</td>#}
|
||||
{# </tr>#}
|
||||
{# </table>#}
|
||||
|
||||
{# <div class="meta">#}
|
||||
{# Édité le {{ printedAt|date('d/m/Y H:i') }} - Case {{ buildingCase.code ?? '' }}#}
|
||||
{# </div>#}
|
||||
<table class="footer" style="border-collapse:collapse; margin-top: 32px">
|
||||
<tr>
|
||||
<td style="height: 20px; border: 0" colspan="4"></td>
|
||||
<td style="font-weight: 700" colspan="2">Grippe</td>
|
||||
<td style="font-weight: 700" colspan="2">Protivity</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="height: 20px">Date</td>
|
||||
<td>Antibiotique</td>
|
||||
<td>Date</td>
|
||||
<td>Antero</td>
|
||||
<td>Date</td>
|
||||
<td>Intranasale</td>
|
||||
<td>Date</td>
|
||||
<td>Rappel 30 jours</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="height: 20px"></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="height: 20px"></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user