{% extends "passerelle/manage/service_view.html" %}
{% load i18n passerelle %}

{% block endpoints %}
<h4>{% trans "Family" %}</h4>
<ul>
  <li>
    {% url 'generic-endpoint' connector='family' slug=object.slug endpoint='family' rest='link/' as link_url %}
    {% trans 'Link to a family:' %}
    <a href="{{ link_url }}">{{ site_base_uri }}{{ link_url }}?NameID=...&login=...&password=...</a>
  </li>
  <li>
    {% url 'generic-endpoint' connector='family' slug=object.slug endpoint='family' rest='unlink/' as unlink_url %}
    {% trans 'Unlink from a family:' %}
    <a href="{{ unlink_url }}">{{ site_base_uri }}{{ unlink_url }}?NameID=...</a>
  </li>
  <li>
    {% url 'generic-endpoint' connector='family' slug=object.slug endpoint='family' as family_url %}
    {% trans 'Get family informations:' %}
    <a href="{{ family_url }}">{{ site_base_uri }}{{ family_url }}?NameID=...</a>
  </li>
  <li>
    {% url 'generic-endpoint' connector='family' slug=object.slug endpoint='family' rest='adults/' as adults_url %}
    {% trans 'Get family adults:' %}
    <a href="{{ adults_url }}">{{ site_base_uri }}{{ adults_url }}?NameID=...</a>
  </li>
  <li>
    {% url 'generic-endpoint' connector='family' slug=object.slug endpoint='family' rest='children/' as children_url %}
    {% trans 'Get family children:' %}
    <a href="{{ children_url }}">{{ site_base_uri }}{{ children_url }}?NameID=...</a>
  </li>
</ul>

<h4>{% trans "Invoices" %}</h4>
<ul>
  <li>
    {% url 'generic-endpoint' connector='family' slug=object.slug endpoint='regie' rest='invoices/' as invoices_url %}
    {% trans 'Get payable invoices:' %}
    <a href="{{ invoices_url }}">{{ site_base_uri }}{{ invoices_url }}?NameID=...</a>
  </li>
  <li>
    {% url 'generic-endpoint' connector='family' slug=object.slug endpoint='regie' rest='invoices/history/' as invoices_history_url %}
    {% trans 'Get invoices history:' %}
    <a href="{{ invoices_history_url }}">{{ site_base_uri }}{{ invoices_history_url }}?NameID=...</a>
  </li>
  <li>
    {% url 'generic-endpoint' connector='family' slug=object.slug endpoint='regie' rest='invoice/invoice_id/' as invoice_url %}
    {% trans 'Get invoice details:' %}
    <a href="{{ invoice_url }}">{{ site_base_uri }}{{ invoice_url }}</a>
  </li>
  <li>
    {% url 'generic-endpoint' connector='family' slug=object.slug endpoint='regie' rest='invoice/invoice_id/pdf/' as invoice_pdf_url %}
    {% trans 'Get invoice PDF:' %}
    <a href="{{ invoice_pdf_url }}">{{ site_base_uri }}{{ invoice_pdf_url }}</a>
  </li>
  <li>
    {% url 'generic-endpoint' connector='family' slug=object.slug endpoint='regie' rest='invoice/invoice_id/pay/' as invoice_pay_url %}
    {% trans 'Pay invoice:' %}
    <a href="{{ invoice_pay_url }}">{{ site_base_uri }}{{ invoice_pay_url }}</a>
  </li>
</ul>
{% endblock %}


{% block security %}
<p>
  {% trans 'Access is limited to the following API users:' %}
</p>
{% access_rights_table resource=object permission='can_access' %}
{% endblock %}
