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

{% block endpoints %}
  <h4>{% trans "Family" %}</h4>
  <ul class="endpoints">
    <li class="get-method">
      {% url 'generic-endpoint' connector='family' slug=object.slug endpoint='family' rest='link/' as link_url %}
      <div class="description"><span class="description--label">{% trans 'Link to a family:' %}</span>
        <a class="example-url" href="{{ link_url }}">{{ site_base_uri }}{{ link_url }}?NameID=...&login=...&password=...</a></div>
    </li>
    <li class="get-method">
      {% url 'generic-endpoint' connector='family' slug=object.slug endpoint='family' rest='unlink/' as unlink_url %}
      <div class="description"><span class="description--label">{% trans 'Unlink from a family:' %}</span>
        <a class="example-url" href="{{ unlink_url }}">{{ site_base_uri }}{{ unlink_url }}?NameID=...</a></div>
    </li>
    <li class="get-method">
      {% url 'generic-endpoint' connector='family' slug=object.slug endpoint='family' as family_url %}
      <div class="description"><span class="description--label">{% trans 'Get family informations:' %}</span>
        <a class="example-url" href="{{ family_url }}">{{ site_base_uri }}{{ family_url }}?NameID=...</a></div>
    </li>
    <li class="get-method">
      {% url 'generic-endpoint' connector='family' slug=object.slug endpoint='family' rest='adults/' as adults_url %}
      <div class="description"><span class="description--label">{% trans 'Get family adults:' %}</span>
        <a class="example-url" href="{{ adults_url }}">{{ site_base_uri }}{{ adults_url }}?NameID=...</a></div>
    </li>
    <li class="get-method">
      {% url 'generic-endpoint' connector='family' slug=object.slug endpoint='family' rest='children/' as children_url %}
      <div class="description"><span class="description--label">{% trans 'Get family children:' %}</span>
        <a class="example-url" href="{{ children_url }}">{{ site_base_uri }}{{ children_url }}?NameID=...</a></div>
    </li>
  </ul>
  <h4>{% trans "Invoices" %}</h4>
  <ul class="endpoints">
    <li class="get-method">
      {% url 'generic-endpoint' connector='family' slug=object.slug endpoint='regie' rest='invoices/' as invoices_url %}
      <div class="description"><span class="description--label">{% trans 'Get payable invoices:' %}</span>
        <a class="example-url" href="{{ invoices_url }}">{{ site_base_uri }}{{ invoices_url }}?NameID=...</a></div>
    </li>
    <li class="get-method">
      {% url 'generic-endpoint' connector='family' slug=object.slug endpoint='regie' rest='invoices/history/' as invoices_history_url %}
      <div class="description"><span class="description--label">{% trans 'Get invoices history:' %}</span>
        <a class="example-url" href="{{ invoices_history_url }}">{{ site_base_uri }}{{ invoices_history_url }}?NameID=...</a></div>
    </li>
    <li class="get-method">
      {% url 'generic-endpoint' connector='family' slug=object.slug endpoint='regie' rest='invoice/invoice_id/' as invoice_url %}
      <div class="description"><span class="description--label">{% trans 'Get invoice details:' %}</span>
        <a class="example-url" href="{{ invoice_url }}">{{ site_base_uri }}{{ invoice_url }}</a></div>
    </li>
    <li class="get-method">
      {% url 'generic-endpoint' connector='family' slug=object.slug endpoint='regie' rest='invoice/invoice_id/pdf/' as invoice_pdf_url %}
      <div class="description"><span class="description--label">{% trans 'Get invoice PDF:' %}</span>
        <a href="{{ invoice_pdf_url }}">{{ site_base_uri }}{{ invoice_pdf_url }}</a></div>
    </li>
    <li class="post-method">
      {% url 'generic-endpoint' connector='family' slug=object.slug endpoint='regie' rest='invoice/invoice_id/pay/' as invoice_pay_url %}
      <div class="description"><span class="description--label">{% trans 'Pay invoice:' %}</span>
        <a class="example-url" href="{{ invoice_pay_url }}">{{ site_base_uri }}{{ invoice_pay_url }}</a></div>
    </li>
  </ul>
{% endblock %}
