Report for total notifications sent per day for each channel.

Daily volumes report: total volumes across the platform aggregated by whole business day (bst_date)
Volumes by service report: total volumes per service aggregated by the date range given.

NB: start and end dates are inclusive
This commit is contained in:
Rebecca Law
2022-03-07 14:30:11 +00:00
parent f827a825a1
commit 971cb745c9
8 changed files with 204 additions and 0 deletions

View File

@@ -0,0 +1,48 @@
{% extends "views/platform-admin/_base_template.html" %}
{% from "components/form.html" import form_wrapper %}
{% from "components/table.html" import mapping_table, row, text_field %}
{% block per_page_title %}
Daily volumes report
{% endblock %}
{% block platform_admin_content %}
<h1 class="heading-large">
Daily volumes Report
</h1>
{% call form_wrapper() %}
{{ form.start_date(param_extensions={"hint": {"text": "Use the format YYYY-MM-DD"}}) }}
{{ form.end_date(param_extensions={"hint": {"text": "Use the format YYYY-MM-DD"}}) }}
{{ page_footer('Download report') }}
{% endcall %}
<h2 class="heading-medium">
Data included in the report
</h2>
<div class="bottom-gutter-3-2">
{% call mapping_table(
caption='Descriptions of daily volumes data',
field_headings=['Name', 'Description'],
field_headings_visible=True,
caption_visible=False
) %}
{% for message_length, charge in [
('day', 'The whole business day in BST.'),
('sms totals', 'The number of text messages sent'),
('sms chargeable units', 'The number of text message fragments sent'),
('sms_fragments_times_multiplier', 'The number of text message fragments sent times the rate multiplier'),
('email totals', 'The number of emails sent'),
('letter totals', 'The number of letters sent'),
('letter sheet totals', The number of sheets sent)
] %}
{% call row() %}
{{ text_field(message_length) }}
{{ text_field(charge | safe) }}
{% endcall %}
{% endfor %}
{% endcall %}
</div>
{% endblock %}

View File

@@ -19,4 +19,10 @@
<p class="govuk-body">
<a class="govuk-link govuk-link--no-visited-state" href="{{ url_for('main.get_billing_report') }}">Billing Report</a>
</p>
<p class="govuk-body">
<a class="govuk-link govuk-link--no-visited-state" href="{{ url_for('main.get_volumes_by_service') }}">Volumes by service Report</a>
</p>
<p class="govuk-body">
<a class="govuk-link govuk-link--no-visited-state" href="{{ url_for('main.get_daily_volumes') }}">Daily volumes Report</a>
</p>
{% endblock %}

View File

@@ -0,0 +1,46 @@
{% extends "views/platform-admin/_base_template.html" %}
{% from "components/form.html" import form_wrapper %}
{% from "components/table.html" import mapping_table, row, text_field %}
{% block per_page_title %}
Volumes by service report
{% endblock %}
{% block platform_admin_content %}
<h1 class="heading-large">
Volumes by service Report
</h1>
{% call form_wrapper() %}
{{ form.start_date(param_extensions={"hint": {"text": "Use the format YYYY-MM-DD"}}) }}
{{ form.end_date(param_extensions={"hint": {"text": "Use the format YYYY-MM-DD"}}) }}
{{ page_footer('Download report') }}
{% endcall %}
<h2 class="heading-medium">
Data included in the report
</h2>
<div class="bottom-gutter-3-2">
{% call mapping_table(
caption='Descriptions of volumes by service data',
field_headings=['Name', 'Description'],
field_headings_visible=True,
caption_visible=False
) %}
{% for message_length, charge in [
('free allowance', 'Free allowance set for the service. This is the latest free allowance for the date range given'),
('sms notifications', 'The number of text messages sent by the service.'),
('sms volume', 'The number of text message fragments times the rate multiplier sent by the service.'),
('email totals', 'The number of emails sent by a service'),
('letter totals', 'The number of letters sent by a service'),
] %}
{% call row() %}
{{ text_field(message_length) }}
{{ text_field(charge | safe) }}
{% endcall %}
{% endfor %}
{% endcall %}
</div>
{% endblock %}