api.services.ultimate3000.store =============================== .. py:module:: api.services.ultimate3000.store .. autoapi-nested-parse:: Redis working store for the UltiMate 3000 estimations: fast reads/writes; Airtable is synced after each request. Keys (JSON values): u3000:client: the client (email, phone, language, telemetry, then contact/company details) u3000:email: -> token (one personal link per email) u3000:client::ests list of estimation ids, oldest first u3000:est: an estimation request (modules, address, logistics, totals, Airtable record id) Attributes ---------- .. autoapisummary:: api.services.ultimate3000.store.PREFIX Classes ------- .. autoapisummary:: api.services.ultimate3000.store.Store Functions --------- .. autoapisummary:: api.services.ultimate3000.store.new_token api.services.ultimate3000.store.now Module Contents --------------- .. py:data:: PREFIX :value: 'u3000' .. py:function:: new_token() -> str .. py:function:: now() -> str .. py:class:: Store(redis: redis.Redis) .. py:attribute:: redis .. py:method:: token_for_email(email: str) -> str | None .. py:method:: create_client(client: dict[str, Any]) -> str | None None when a client already exists for that email (its link is never handed out here). .. py:method:: client(token: str) -> dict[str, Any] | None .. py:method:: update_client(token: str, fields: dict[str, Any]) -> dict[str, Any] .. py:method:: add_estimation(token: str, estimation: dict[str, Any]) -> dict[str, Any] .. py:method:: estimation(est_id: str) -> dict[str, Any] | None .. py:method:: update_estimation(est_id: str, fields: dict[str, Any]) -> None .. py:method:: estimations(token: str) -> list[dict[str, Any]]