-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a55fb43
commit 710f709
Showing
10 changed files
with
1,615 additions
and
0 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
datascience/src/pipeline/emails/stylesheets/email_to_control_units.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
h1 { | ||
font-size: 1.999rem; | ||
} | ||
|
||
h2 { | ||
font-size: 1.414rem; | ||
} | ||
|
||
body { | ||
text-align: unset; | ||
max-width: 54rem; | ||
} | ||
|
||
strong { | ||
font-weight: bold; | ||
} |
45 changes: 45 additions & 0 deletions
45
...science/src/pipeline/emails/templates/email_actions_to_units/email_actions_to_units.jinja
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<!DOCTYPE html> | ||
<html lang="fr"> | ||
<head> | ||
<title>Bilan hebdomadaire contrôle des pêches</title> | ||
<meta charset="UTF-8"> | ||
<style> | ||
{% include "splendid.css" %} | ||
{% include "email_to_control_units.css" %} | ||
</style> | ||
</head> | ||
<body> | ||
<header> | ||
<h1>Bilan hebdomadaire contrôle des pêches</h1> | ||
</header> | ||
<hr /> | ||
<main> | ||
<section> | ||
<p>Bonjour,</p> | ||
<p>Vous trouverez ci-dessous les données des actions de <strong>contrôle des pêches</strong> effectuées par votre unité | ||
(<strong>{{ control_unit_name }}</strong>) <strong>entre le {{ from_date }} et le {{ to_date }}</strong> que vous avez rapportés au Centre National de Surveillance des Pêches (CNSP).</p> | ||
<p>Seuls les contrôles et surveillances dont les données sont complètes sont transmis dans ce bilan hebdomadaire. Si certaines données n'ont pas encore été transmises (par ex. l'établissement d'un PV ou non), | ||
il est normal que le contrôle ne figure pas encore dans le rapport.</p> | ||
<p>Si des données sont manquantes, incorrectes ou incomplètes, ou pour toute remarque concernant ce bilan, n'hésitez pas à <strong>contacter le CNSP : <a href="mailto:{{ cnsp_france_email_address }}">{{ cnsp_france_email_address }}</a></strong>.</p> | ||
</section> | ||
<hr /> | ||
<section> | ||
<h2>Contrôles à quai</h2> | ||
{{ land_controls }} | ||
|
||
<h2>Contrôles en mer</h2> | ||
{{ sea_controls }} | ||
|
||
<h2>Contrôles aériens</h2> | ||
{{ air_controls }} | ||
|
||
<h2>Surveillances aériennes</h2> | ||
{{ air_surveillances }} | ||
</section> | ||
</main> | ||
<footer class="no-vertical-margin"> | ||
<hr/> | ||
<p>Centre National de Surveillance des Pêches - Tél : +33 2 97 29 34 27</p> | ||
</footer> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
from dataclasses import dataclass | ||
from datetime import datetime | ||
from typing import List | ||
|
||
import pandas as pd | ||
|
||
from src.pipeline.helpers.dates import Period | ||
|
||
|
||
@dataclass | ||
class ControlUnitWithEmails: | ||
control_unit_id: int | ||
control_unit_name: str | ||
emails: List[str] | ||
|
||
|
||
@dataclass | ||
class ControlUnitActions: | ||
""" | ||
Control unit and its fisheries control actions between two dates. | ||
""" | ||
|
||
control_unit: ControlUnitWithEmails | ||
period: Period | ||
land_controls: pd.DataFrame | ||
sea_controls: pd.DataFrame | ||
air_controls: pd.DataFrame | ||
air_surveillances: pd.DataFrame | ||
|
||
|
||
@dataclass | ||
class ControlUnitActionsSentMessage: | ||
control_unit_id: int | ||
control_unit_name: str | ||
email_address: str | ||
sending_datetime_utc: datetime | ||
actions_min_datetime_utc: datetime | ||
actions_max_datetime_utc: datetime | ||
number_of_actions: int | ||
success: bool | ||
error_code: int | ||
error_message: str |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.