Skip to content

Commit

Permalink
docs: Use typer role
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmckinney committed Aug 22, 2024
1 parent f7992b0 commit a2bc571
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
20 changes: 10 additions & 10 deletions app/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ class ApplicationStatus(StrEnum):

#: Credere sends an invitation to the borrower.
#:
#: (:doc:`fetch-awards</commands>`)
#: (:typer:`python-m-app-fetch-awards`)
PENDING = "PENDING"
#: Borrower declines the invitation.
#:
Expand Down Expand Up @@ -183,7 +183,7 @@ class ApplicationStatus(StrEnum):
INFORMATION_REQUESTED = "INFORMATION_REQUESTED"
#: Borrower doesn't accept, or doesn't submit the application or information requested.
#:
#: (:doc:`update-applications-to-lapsed</commands>`)
#: (:typer:`python-m-app-update-applications-to-lapsed`)
LAPSED = "LAPSED"
#: Lender pre-approves the application, and Credere asks the borrower to upload its contract.
#:
Expand All @@ -207,11 +207,11 @@ class BorrowerStatus(StrEnum):


class MessageType(StrEnum):
#: PENDING (:doc:`fetch-awards</commands>`)
#: PENDING (:typer:`python-m-app-fetch-awards`)
BORROWER_INVITATION = "BORROWER_INVITATION"
#: PENDING (:doc:`send-reminders</commands>`)
#: PENDING (:typer:`python-m-app-send-reminders`)
BORROWER_PENDING_APPLICATION_REMINDER = "BORROWER_PENDING_APPLICATION_REMINDER"
#: ACCEPTED (:doc:`send-reminders</commands>`)
#: ACCEPTED (:typer:`python-m-app-send-reminders`)
BORROWER_PENDING_SUBMIT_REMINDER = "BORROWER_PENDING_SUBMIT_REMINDER"
#: ACCEPTED → SUBMITTED (``/applications/submit``)
SUBMISSION_COMPLETED = "SUBMISSION_COMPLETED"
Expand All @@ -235,7 +235,7 @@ class MessageType(StrEnum):
CONTRACT_UPLOAD_CONFIRMATION_TO_FI = "CONTRACT_UPLOAD_CONFIRMATION_TO_FI"
#: CONTRACT_UPLOADED → COMPLETED (``/applications/{id}/complete-application``)
CREDIT_DISBURSED = "CREDIT_DISBURSED"
#: STARTED | CONTRACT_UPLOADED (:doc:`sla-overdue-applications</commands>`)
#: STARTED | CONTRACT_UPLOADED (:typer:`python-m-app-sla-overdue-applications`)
OVERDUE_APPLICATION = "OVERDUE_APPLICATION"
#: ACCEPTED (``/applications/find-alternative-credit-option``)
APPLICATION_COPIED = "APPLICATION_COPIED"
Expand Down Expand Up @@ -645,7 +645,7 @@ def pending_introduction_reminder(cls, session: Session) -> "Query[Self]":
:attr:`~app.settings.Settings.reminder_days_before_expiration` days from now, and whose
borrower hasn't already received a reminder to accept and may receive Credere invitations.
.. seealso:: :doc:`send-reminders</commands>`
.. seealso:: :typer:`python-m-app-send-reminders`
"""
return (
session.query(cls)
Expand All @@ -666,7 +666,7 @@ def pending_submission_reminder(cls, session: Session) -> "Query[Self]":
:attr:`~app.settings.Settings.reminder_days_before_lapsed` days from now, and whose
borrower hasn't already received a reminder to submit.
.. seealso:: :doc:`send-reminders</commands>`
.. seealso:: :typer:`python-m-app-send-reminders`
"""
lapsed_at = col(cls.borrower_accepted_at) + timedelta(days=app_settings.days_to_change_to_lapsed)

Expand All @@ -684,7 +684,7 @@ def lapseable(cls, session: Session) -> "Query[Self]":
borrower to respond (PENDING, ACCEPTED, INFORMATION_REQUESTED) for
:attr:`~app.settings.Settings.days_to_change_to_lapsed` days.
.. seealso:: :doc:`update-applications-to-lapsed</commands>`
.. seealso:: :typer:`python-m-app-update-applications-to-lapsed`
"""
delta = timedelta(days=app_settings.days_to_change_to_lapsed)

Expand Down Expand Up @@ -739,7 +739,7 @@ def archivable(cls, session: Session) -> "Query[Self]":
(DECLINED, REJECTED, COMPLETED, LAPSED) for
:attr:`~app.settings.Settings.days_to_erase_borrowers_data` days.
.. seealso:: :doc:`remove-dated-application-data</commands>`
.. seealso:: :typer:`python-m-app-remove-dated-application-data`
"""
delta = timedelta(days=app_settings.days_to_erase_borrowers_data)

Expand Down
8 changes: 4 additions & 4 deletions app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class Settings(BaseSettings):
#: .. seealso::
#:
#: - :attr:`~app.settings.Settings.reminder_days_before_expiration`
#: - :doc:`fetch-awards</commands>`
#: - :typer:`python-m-app-fetch-awards`
application_expiration_days: int = 7
#: The number of days before a PENDING application's expiration date, past which the borrower is sent a reminder.
#:
Expand All @@ -89,7 +89,7 @@ class Settings(BaseSettings):
#:
#: .. seealso::
#:
#: - :doc:`sla-overdue-applications</commands>`
#: - :typer:`python-m-app-sla-overdue-applications`
#: - :meth:`app.models.Application.days_waiting_for_lender`
progress_to_remind_started_applications: float = 0.7
#: The number of days for which to wait for the borrower to respond, after which an application becomes LAPSED.
Expand All @@ -105,9 +105,9 @@ class Settings(BaseSettings):

#: The application token to the `SECOP API <https://datos.gov.co/profile/edit/developer_settings>`__.
colombia_secop_app_token: str = ""
#: The number of items to retrieve at once in :doc:`fetch-awards</commands>`.
#: The number of items to retrieve at once in :typer:`python-m-app-fetch-awards`.
secop_pagination_limit: int = 5
#: The number of days of past items to retrieve the first time :doc:`fetch-awards</commands>` runs.
#: The number of days of past items to retrieve the first time :typer:`python-m-app-fetch-awards` runs.
secop_default_days_from_ultima_actualizacion: int = 365

# Email addresses
Expand Down
4 changes: 2 additions & 2 deletions docs/contributing/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,11 @@ Update translations
.. note::

The ``babel.cfg`` file indicates from which ``StrEnum`` classes to extract messages. If Credere is deployed in English, we must add an ``en`` locale to translate these. Otherwise, the translations will be the database values, like "MICRO" instead of "0 to 10".
The ``babel.cfg`` file lists from which ``StrEnum`` classes to extract messages. If Credere is deployed in English, we need to add an ``en`` locale to translate these. Otherwise, the translations will be database values like "MICRO", not "0 to 10".

.. admonition:: Reference

``pybabel`` commands in `Translate with Transifex <https://ocp-software-handbook.readthedocs.io/en/latest/python/i18n.html#translate-with-transifex>`__
The ``pybabel`` commands are from `Translate with Transifex <https://ocp-software-handbook.readthedocs.io/en/latest/python/i18n.html#translate-with-transifex>`__.

Update API
~~~~~~~~~~
Expand Down
6 changes: 3 additions & 3 deletions docs/deployment/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ Issues and `performance <https://open-contracting-partnership.sentry.io/performa


- ``/applications/access-scheme`` is in *Slow HTTP Ops*, because Sentry measures the entire request, which including the background task, and not the response time.
- Sort the *All Transactions* tab by the **Failure Rate** column, then click on a transaction and look at the *Status Breakdown* in the right sidebar, to check for potential issues to correct. Infrequently accessed endpoints are more likely to have a high failure rate, since a single error can cause a double-digit rate.
- Sort the *All Transactions* tab by the *Failure Rate* column, then click on a transaction and look at the *Status Breakdown* in the right sidebar, to check for potential issues to correct.

.. seealso::
.. note:: Infrequently accessed endpoints are likely to have a high rate, since a single error can cause a double-digit rate.

`Performance Metrics <https://docs.sentry.io/product/performance/metrics/>`__
.. seealso:: `Performance Metrics <https://docs.sentry.io/product/performance/metrics/>`__
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-r ../requirements.txt
furo
sphinx-design
sphinxcontrib-typer>=0.4
sphinxcontrib-typer>=0.4.1

0 comments on commit a2bc571

Please sign in to comment.