api.routes.internal.ultimate3000 ================================ .. py:module:: api.routes.internal.ultimate3000 .. autoapi-nested-parse:: UltiMate 3000 buy-back estimations, used by info.rewake.fr/ultimate3000 (through its Next proxy routes). Clients are identified by their personal-link token (32 hex); estimations live in Redis and are synced to Airtable by the Celery task `ultimate3000_offer` once the client requests an offer. See api/services/ultimate3000/. Attributes ---------- .. autoapisummary:: api.routes.internal.ultimate3000.router api.routes.internal.ultimate3000.Str api.routes.internal.ultimate3000.OptStr api.routes.internal.ultimate3000.Mobile api.routes.internal.ultimate3000.Langue api.routes.internal.ultimate3000.Token api.routes.internal.ultimate3000.Email api.routes.internal.ultimate3000.DB Classes ------- .. autoapisummary:: api.routes.internal.ultimate3000.ClientIn api.routes.internal.ultimate3000.ModuleIn api.routes.internal.ultimate3000.EstimateIn api.routes.internal.ultimate3000.OfferIn api.routes.internal.ultimate3000.ResumeIn Functions --------- .. autoapisummary:: api.routes.internal.ultimate3000.get_store api.routes.internal.ultimate3000.get_catalog api.routes.internal.ultimate3000.post_estimate api.routes.internal.ultimate3000.create_client api.routes.internal.ultimate3000.resume_client api.routes.internal.ultimate3000.read_client api.routes.internal.ultimate3000.request_offer api.routes.internal.ultimate3000.read_estimation api.routes.internal.ultimate3000.estimation_image Package Contents ---------------- .. py:data:: router .. py:data:: Str .. py:data:: OptStr .. py:data:: Mobile .. py:data:: Langue .. py:data:: Token .. py:data:: Email .. py:function:: get_store() -> api.services.ultimate3000.store.Store .. py:data:: DB .. py:class:: ClientIn Bases: :py:obj:`pydantic.BaseModel` First step: just enough for a personal link. The rest is asked with the offer request. .. py:attribute:: email :type: Email .. py:attribute:: mobile :type: Mobile | None :value: None .. py:attribute:: langue :type: Langue :value: 'fr' .. py:attribute:: telemetry :type: Annotated[dict[str, str], Field(max_length=30)] .. py:class:: ModuleIn Bases: :py:obj:`pydantic.BaseModel` .. py:attribute:: categorie :type: Literal[*pricing.CATEGORIES] .. py:attribute:: modele :type: Str .. py:attribute:: annee_fabrication :type: Annotated[int, Field(ge=1990, le=date.today().year)] .. py:attribute:: etat :type: Literal['fonctionnel', 'non_fonctionnel', 'non_teste'] :value: 'non_teste' .. py:attribute:: numero_serie :type: OptStr :value: None .. py:attribute:: commentaire :type: Annotated[str | None, Field(max_length=1000)] :value: None .. py:method:: in_price_list() -> ModuleIn .. py:class:: EstimateIn Bases: :py:obj:`pydantic.BaseModel` .. py:attribute:: modules :type: Annotated[list[ModuleIn], Field(max_length=pricing.MAX_MODULES)] .. py:attribute:: logistique :type: Literal[*pricing.LOGISTICS] | None :value: None .. py:attribute:: cables_vipers :type: bool :value: False .. py:class:: OfferIn Bases: :py:obj:`EstimateIn` The offer request: modules, the client's details, pickup address and logistics. .. py:attribute:: modules :type: Annotated[list[ModuleIn], Field(min_length=1, max_length=pricing.MAX_MODULES)] .. py:attribute:: logistique :type: Literal[*pricing.LOGISTICS] .. py:attribute:: france_metropolitaine :type: bool :value: True .. py:attribute:: prenom :type: Str .. py:attribute:: nom :type: Str .. py:attribute:: mobile :type: Mobile .. py:attribute:: telephone_fixe :type: OptStr :value: None .. py:attribute:: poste :type: OptStr :value: None .. py:attribute:: entreprise :type: Str .. py:attribute:: siret :type: Annotated[str | None, Field(pattern='^\\d{9}(\\d{5})?$')] :value: None .. py:attribute:: numero_tva :type: OptStr :value: None .. py:attribute:: site_web :type: OptStr :value: None .. py:attribute:: numero_rue :type: Str .. py:attribute:: code_postal :type: Annotated[str, Field(min_length=2, max_length=10)] .. py:attribute:: ville :type: Str .. py:attribute:: pays :type: Annotated[str, Field(min_length=2, max_length=2)] :value: 'FR' .. py:attribute:: livraison_esperee_avant :type: datetime.date | None :value: None .. py:attribute:: langue :type: Langue :value: 'fr' .. py:class:: ResumeIn Bases: :py:obj:`pydantic.BaseModel` .. py:attribute:: email :type: Email .. py:function:: get_catalog() -> dict[str, Any] .. py:function:: post_estimate(body: EstimateIn) -> dict[str, Any] .. py:function:: create_client(body: ClientIn, request: fastapi.Request, store: DB, tasks: fastapi.BackgroundTasks) -> dict[str, str] .. py:function:: resume_client(body: ResumeIn, store: DB, tasks: fastapi.BackgroundTasks) -> dict[str, Any] E-mails the client-space link. Same answer whether the email exists or not, so it can't be used to probe clients. .. py:function:: read_client(token: Token, store: DB) -> dict[str, Any] .. py:function:: request_offer(token: Token, body: OfferIn, store: DB) -> dict[str, Any] .. py:function:: read_estimation(est_id: Token, store: DB) -> dict[str, Any] What the /ultimate3000/render page draws: modules and packing only, no personal data. .. py:function:: estimation_image(est_id: Token, store: DB) -> fastapi.responses.Response The machines as a PNG (for e-mails). Rendered once; an estimation never changes.