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

{% block description %}
{% endblock %}

{% block endpoints %}
<ul>
<li>{% trans 'Check WS availability:' %} <a href="{% url 'agoraplus-ping' slug=object.slug %}"
        >{{ site_base_uri }}{% url 'agoraplus-ping' slug=object.slug %}</a>[?debug]</li>
</ul>

<h4>{% trans "Family" %}</h4>
<ul>
<li>{% trans 'Link:' %} <a href="{% url 'agoraplus-family-link' slug=object.slug %}"
        >{{ site_base_uri }}{% url 'agoraplus-family-link' slug=object.slug %}?NameID=…&login=…&password=…</a></li>
<li>{% trans 'Unlink:' %} <a href="{% url 'agoraplus-family-unlink' slug=object.slug %}"
        >{{ site_base_uri }}{% url 'agoraplus-family-unlink' slug=object.slug %}?NameID=…</a></li>
<li>{% trans 'Get all family informations:' %} <a href="{% url 'agoraplus-family' slug=object.slug %}"
        >{{ site_base_uri }}{% url 'agoraplus-family' slug=object.slug %}?NameID=…</a></li>
<li>{% trans 'Get specific family items (list of adults, children, etc.):' %}
       <a href="{% url 'agoraplus-family-items' slug=object.slug key='key' %}"
          >{{ site_base_uri }}{% url 'agoraplus-family-items' slug=object.slug key='key' %}?NameID=...</a>
       — <em>key</em>: <em>adults</em>, <em>children</em>, <em>contacts</em>, etc.</li>
<li>{% trans 'Get specific family item:' %}
       <a href="{% url 'agoraplus-family-item' slug=object.slug key='key' item_id='id' %}"
          >{{ site_base_uri }}{% url 'agoraplus-family-item' slug=object.slug key='key' item_id='id' %}?NameID=...</a></li>
</ul>

<h4>{% trans "User" %}</h4>
<ul>
<li>{% trans 'User:' %} <a href="{% url 'agoraplus-user' slug=object.slug %}"
    >{{ site_base_uri }}{% url 'agoraplus-user' slug=object.slug %}</a>[?login=…]</li>
<li>{% trans 'Authentication:' %} <a href="{% url 'agoraplus-auth' slug=object.slug %}"
        >{{ site_base_uri }}{% url 'agoraplus-auth' slug=object.slug %}?login=…&password=…</a></li>
<li>{% trans 'Update phone number:' %} POST <a href="{% url 'agoraplus-phone-update' slug=object.slug %}"
        >{{ site_base_uri }}{% url 'agoraplus-phone-update' slug=object.slug %}?NameID=…</a></li>
    — {% trans 'JSON payload: wcs Formdata with Agora+ fields' %}
<li>{% trans 'Update profession:' %} POST <a href="{% url 'agoraplus-profession-update' slug=object.slug %}"
        >{{ site_base_uri }}{% url 'agoraplus-profession-update' slug=object.slug %}?NameID=…</a></li>
    — {% trans 'JSON payload: wcs Formdata with Agora+ fields' %}
</ul>

<h4>{% trans "Address" %}</h4>
<ul>
<li>{% trans 'Communes:' %}
    <a href="{% url 'agoraplus-commune' slug=object.slug %}"
       >{{ site_base_uri }}{% url 'agoraplus-commune' slug=object.slug %}</a>[id/|?q=…]</li>
<li>{% trans 'Type of streets:' %}
    <a href="{% url 'agoraplus-type-of-street' slug=object.slug %}"
       >{{ site_base_uri }}{% url 'agoraplus-type-of-street' slug=object.slug %}</a>[id/]</li>
<li>{% trans 'Streets:' %}
    <a href="{% url 'agoraplus-street' slug=object.slug %}"
       >{{ site_base_uri }}{% url 'agoraplus-street' slug=object.slug %}</a>[id/|?q=…]</li>
<li>{% trans 'List of streets of a commune, by type:' %}
    <a href="{% url 'agoraplus-street-search' slug=object.slug commune_id='commune-id' type_of_street_id='tos-id' %}"
       >{{ site_base_uri }}{% url 'agoraplus-street-search' slug=object.slug commune_id='commune-id' type_of_street_id='tos-id' %}</a>[id/|?q=…]</li>
<li>{% trans 'Update address:' %} POST
    <a href="{% url 'agoraplus-address-update' slug=object.slug %}"
       >{{ site_base_uri }}{% url 'agoraplus-address-update' slug=object.slug %}?NameID=…</a>
    — {% trans 'JSON payload: wcs Formdata with Agora+ fields' %}
    </li>
</ul>

<h4>{% trans "Other references" %}</h4>
<ul>
<li>{% trans 'Generic reference:' %} <a href="{% url 'agoraplus-reference' slug=object.slug name="name" %}"
    >{{ site_base_uri }}{% url 'agoraplus-reference' slug=object.slug name="name" %}</a>[id/|?q=…]
       — <em>key</em>: <em>civilites</em> <em>annees_refs</em>, <em>modes_accueils</em> (see Agora+ documentation)</li>
<li>{% trans 'School:' %} <a href="{% url 'agoraplus-school' slug=object.slug %}"
    >{{ site_base_uri }}{% url 'agoraplus-school' slug=object.slug %}</a>[id/]</li>
<li>{% trans 'Schools for a child, based on the family adress:' %}
    <a href="{% url 'agoraplus-school' slug=object.slug %}"
       >{{ site_base_uri }}{% url 'agoraplus-school' slug=object.slug %}?NameID=…&amp;(child_id=…|birthdate=yyyy-mm-dd)[&year_id=NN]</a>
     — <em>year_id</em> from {% url 'agoraplus-reference' slug=object.slug name="annees_refs" %}</li>
<li>{% trans 'All schools for a birthdate:' %}
    <a href="{% url 'agoraplus-school' slug=object.slug %}"
       >{{ site_base_uri }}{% url 'agoraplus-school' slug=object.slug %}?birthdate=yyyy-mm-dd</a></li>
<li>{% trans 'Educational Stages:' %}
    <a href="{% url 'agoraplus-educational-stage' slug=object.slug %}"
       >{{ site_base_uri }}{% url 'agoraplus-educational-stage' slug=object.slug %}</a>[id/]</li>
<li>{% trans 'Educational Stages for a child:' %}
    <a href="{% url 'agoraplus-educational-stage' slug=object.slug %}"
       >{{ site_base_uri }}{% url 'agoraplus-educational-stage' slug=object.slug %}</a>?(NameID=…&amp;child_id=…|birthdate=yyyy-mm-dd)[&year_id=NN]
     — <em>year_id</em> from {% url 'agoraplus-reference' slug=object.slug name="annees_refs" %}</li>
</ul>

<h4>{% trans 'Verifications before injection' %}</h4>
<ul>
<li>{% trans 'Email:' %} <a href="{% url 'agoraplus-exist-email' slug=object.slug %}"
        >{{ site_base_uri }}{% url 'agoraplus-exist-email' slug=object.slug %}?email=test@example.net</a></li>
<li>{% trans 'Child:' %} <a href="{% url 'agoraplus-exist-child' slug=object.slug %}"
        >{{ site_base_uri }}{% url 'agoraplus-exist-child' slug=object.slug %}?first_name=xxx&last_name=xxx&birthdate=yyyy-mm-dd</a></li>
<li>{% trans 'Adult (representant):' %} <a href="{% url 'agoraplus-exist-representant' slug=object.slug %}"
        >{{ site_base_uri }}{% url 'agoraplus-exist-representant' slug=object.slug %}?first_name=xxx&last_name=xxx[&birthdate=yyyy-mm-dd]</a></li>
<li>{% trans 'List all existing persons:' %} <a href="{% url 'agoraplus-exist-list' slug=object.slug %}"
        >{{ site_base_uri }}{% url 'agoraplus-exist-list' slug=object.slug %}?first_name=xxx&last_name=xxx[&birthdate=yyyy-mm-dd]</a></li>
</ul>

<h4>{% trans 'Insert objects in sas' %}</h4>
<ul>
<li>{% trans 'Add a family:' %} POST <a href="{% url 'agoraplus-sas-family' slug=object.slug %}"
    >{{ site_base_uri }}{% url 'agoraplus-sas-family' slug=object.slug %}</a>
    — {% trans 'JSON payload: wcs Formdata with Agora+ fields and extra' %}
</li>
<li>{% trans 'Add a child:' %} POST <a href="{% url 'agoraplus-sas-child' slug=object.slug %}"
    >{{ site_base_uri }}{% url 'agoraplus-sas-child' slug=object.slug %}</a>
    — {% trans 'JSON payload: wcs Formdata with Agora+ fields and extra' %}
</li>
<li>{% trans 'Add a contact:' %} POST <a href="{% url 'agoraplus-sas-contact' slug=object.slug %}"
    >{{ site_base_uri }}{% url 'agoraplus-sas-contact' slug=object.slug %}</a>
    — {% trans 'JSON payload: wcs Formdata with Agora+ fields and extra' %}
</li>
<li>{% trans 'Check duplicates in sas objects:' %} <a href="{% url 'agoraplus-sas-check-duplicates' slug=object.slug %}"
    >{{ site_base_uri }}{% url 'agoraplus-sas-check-duplicates' slug=object.slug %}?NameID=…</a>
</li>
</ul>

<h4>{% trans 'Push sas objects to Agora+' %}</h4>
<ul>
<li>{% trans 'Push sas family (adults):' %} <a href="{% url 'agoraplus-sas-family-push' slug=object.slug %}"
    >{{ site_base_uri }}{% url 'agoraplus-sas-family-push' slug=object.slug %}?NameID=…[&validation]</a></li>
<li>{% trans 'Push sas child:' %} <a href="{% url 'agoraplus-sas-child-push' slug=object.slug sas_child_id='NNN' %}"
    >{{ site_base_uri }}{% url 'agoraplus-sas-child-push' slug=object.slug sas_child_id='NNN' %}?NameID=…</a></li>
<li>{% trans 'Push sas contact:' %} <a href="{% url 'agoraplus-sas-contact-push' slug=object.slug sas_contact_id='NNN' %}"
    >{{ site_base_uri }}{% url 'agoraplus-sas-contact-push' slug=object.slug sas_contact_id='NNN' %}?NameID=…</a></li>
</ul>

<h4>{% trans 'Remove sas objects' %}</h4>
<ul>
<li>{% trans 'Remove a child in sas:' %} <a href="{% url 'agoraplus-sas-child-delete' slug=object.slug sas_child_id='NNN' %}"
    >{{ site_base_uri }}{% url 'agoraplus-sas-child-delete' slug=object.slug sas_child_id='NNN' %}?NameID=…</a></li>
<li>{% trans 'Remove a contact in sas:' %} <a href="{% url 'agoraplus-sas-contact-delete' slug=object.slug sas_contact_id='NNN' %}"
    >{{ site_base_uri }}{% url 'agoraplus-sas-contact-delete' slug=object.slug sas_contact_id='NNN' %}?NameID=…</a></li>
<li>{% trans 'Remove a family (all related objects):' %} <a href="{% url 'agoraplus-sas-family-delete' slug=object.slug %}"
    >{{ site_base_uri }}{% url 'agoraplus-sas-family-delete' slug=object.slug %}?NameID=…</a>
</li>
</ul>

<h4>{% trans 'Incomes' %}</h4>
<ul>
<li>{% trans 'Incomes declaration:' %} POST <a href="{% url 'agoraplus-incomes-declaration' slug=object.slug %}"
    >{{ site_base_uri }}{% url 'agoraplus-incomes-declaration' slug=object.slug %}?NameID=…</a>
    — {% trans 'JSON payload: wcs Formdata with Agora+ fields' %}
</li>
</ul>

<h4>{% trans 'Enrollments' %}</h4>
<ul>
<li>{% trans 'School Enrollment:' %} POST <a href="{% url 'agoraplus-school-enrollment' slug=object.slug %}"
    >{{ site_base_uri }}{% url 'agoraplus-school-enrollment' slug=object.slug %}</a>
    — {% trans 'JSON payload: wcs Formdata with Agora+ fields' %}
</li>
<li>{% trans 'Children school enrollments:' %} GET <a href="{% url 'agoraplus-school-enrollments' slug=object.slug %}"
    >{{ site_base_uri }}{% url 'agoraplus-school-enrollments' slug=object.slug %}?NameID=…</a>
</li>
<li>{% trans 'Nursery Enrollment:' %} POST <a href="{% url 'agoraplus-nursery-enrollment' slug=object.slug %}"
    >{{ site_base_uri }}{% url 'agoraplus-nursery-enrollment' slug=object.slug %}</a>
    — {% trans 'JSON payload: wcs Formdata with Agora+ fields' %}
</li>
<li>{% trans 'Nursery Enrollment Result:' %} <a href="{% url 'agoraplus-nursery-enrollment-result' enroll_id='NNN' slug=object.slug %}"
    >{{ site_base_uri }}{% url 'agoraplus-nursery-enrollment-result' enroll_id='NNN' slug=object.slug %}</a>
</li>
</ul>

<h4>{% trans 'Invoices' %}</h4>
<ul>
  <li>
    {% url 'agoraplus-invoices' slug=object.slug as payable_invoices_url %}
    {% trans 'Get payable invoices:' %} <a href="{{ payable_invoices_url }}">{{ site_base_uri }}{{ payable_invoices_url }}?NameID=…</a>
  </li>
  <li>
    {% url 'agoraplus-invoices-history' slug=object.slug as invoices_history_url %}
    {% trans 'Get invoices history:' %} <a href="{{ invoices_history_url }}">{{ site_base_uri }}{{ invoices_history_url }}?NameID=…</a>
  </li>
  <li>
    {% url 'agoraplus-invoice' slug=object.slug invoice_id='invoice_id' as invoice_url %}
    {% trans 'Get invoice details:' %} <a href="{{ invoice_url }}">{{ site_base_uri }}{{ invoice_url }}?NameID=…</a>
  </li>
  <li>
    {% url 'agoraplus-invoice-pdf' slug=object.slug invoice_id='invoice_id' as invoice_pdf_url %}
    {% trans 'Get invoice PDF:' %} <a href="{{ invoice_pdf_url }}">{{ site_base_uri }}{{ invoice_pdf_url }}?NameID=…</a>
  </li>
  <li>
    {% url 'agoraplus-invoice-payment' slug=object.slug invoice_id='invoice_id' as invoice_payment_url %}
    {% trans 'Pay invoice(POST):' %} <a href="{{ invoice_payment_url }}">{{ site_base_uri }}{{ invoice_payment_url }}?NameID=…</a>
    {% trans 'JSON payload data:' %}
    <ul>
      <li>transaction_number</li>
      <li>transaction_date</li>
    </ul>
  </li>
</ul>

<h4>{% trans 'Documents' %}</h4>
<ul>
<li>{% trans 'Document (pass-through):' %} POST <a href="{% url 'agoraplus-document' slug=object.slug %}"
    >{{ site_base_uri }}{% url 'agoraplus-document' slug=object.slug %}</a> —
    {% trans 'JSON payload:' %}
    <ul>
      <li><em>uri</em> {% trans 'uri, with query-string' %}</li>
      <li><em>content_type</em> {% trans 'document must have this content-type' %}</li>
    </ul>
</li>
</ul>
{% endblock %}

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

<p>
{% trans 'Sas access is limited to the following API users:' %}
</p>
{% access_rights_table resource=object permission='can_access_sas' %}
{% endblock %}
