api.domain.intake¶
Payloads exchanged with app.rewake.fr for the product intake workflow.
The app owns the workflow state (receiving batches, product groups, review);
the API only turns one product group into Airtable records. Every entity the
app sends carries a ref: a stable, app-side identifier (e.g.
"variation:12") used to remember which Airtable record it became, so a
retried push never creates the same record twice (see
api/services/catalog_sync.py).
See the catalog-intake guide in the public documentation site and the product-creation spec (§6E).
Classes¶
One Airtable |
|
The group's Model. |
|
A Variation of the group's Model. |
|
What operations recorded about one physical item. |
|
One physical item ( |
|
Set only when the Unit is created (a pre-created reprise Unit already |
|
Create or complete the Unit of one received item, once operations |
|
A pre-created reprise Unit given back its values from before the first |
|
Create or update one product group in Airtable (draft push, §6E1-E2). |
|
An existing default Variation turned into a variant on validation (§6B). |
|
Delete what a cancelled group created in Airtable (§6E6). Records the |
|
Module Contents¶
- class api.domain.intake.SpecIn¶
Bases:
pydantic.BaseModelOne Airtable
Specificationrecord: key (aSpecification typerecord), value and unit.- ref: str¶
- spec_type_id: str¶
- valeur: str¶
- unite: str | None = None¶
- airtable_id: str | None = None¶
- class api.domain.intake.ModelIn¶
Bases:
pydantic.BaseModelThe group’s Model.
created_by_group=Falsemeans the group selected an existing Model: the push links to it but never edits or deletes it.- ref: str¶
- airtable_id: str | None = None¶
- created_by_group: bool = True¶
- modele: str = ''¶
- marque_id: str | None = None¶
- type_id: str | None = None¶
- longueur_mm: float | None = None¶
- hauteur_mm: float | None = None¶
- profondeur_mm: float | None = None¶
- poids_kg: float | None = None¶
- short_description: str | None = None¶
- long_description: str | None = None¶
- class api.domain.intake.VariationIn¶
Bases:
pydantic.BaseModelA Variation of the group’s Model.
created_by_group=Falsemeans an existing Variation the group’s Units are added to: never edited here.- ref: str¶
- airtable_id: str | None = None¶
- created_by_group: bool = True¶
- is_variant: bool = False¶
- class api.domain.intake.UnitValues¶
Bases:
pydantic.BaseModelWhat operations recorded about one physical item.
- numero_de_serie: str | None = None¶
- etat_esthetique: str | None = None¶
- etat_fonctionnel: str | None = None¶
- commentaire_atelier: str | None = None¶
- host_variation_id: str | None = None¶
- class api.domain.intake.UnitIn¶
Bases:
UnitValuesOne physical item (
Toutes les unités) of a product group.- ref: str¶
- airtable_id: str | None = None¶
- variation_ref: str¶
- class api.domain.intake.UnitCreation¶
Bases:
pydantic.BaseModelSet only when the Unit is created (a pre-created reprise Unit already has them): the reprise it comes from and, for an item of the reprise proposal, that equipment row, whose buy-back price and client photos are copied (read at creation: attachment links expire).
- operation_id: str | None = None¶
- equipment_id: str | None = None¶
- class api.domain.intake.UnitSyncRequest¶
Bases:
UnitValuesCreate or complete the Unit of one received item, once operations finished it.
idempotency_keyis stable per item (app-unit:<id>): a retry never creates a second Unit.baselinemaps the Unit’s record id to the fields the app last wrote there (conflict detection, as for a group push).- idempotency_key: str¶
- airtable_id: str | None = None¶
- variation_id: str¶
- creation: UnitCreation¶
- baseline: dict[str, dict[str, Any]]¶
- class api.domain.intake.UnitRestore¶
Bases:
pydantic.BaseModelA pre-created reprise Unit given back its values from before the first push (rule 9): it is never deleted by this flow.
- unit_id: str¶
- fields: dict[str, Any]¶
- class api.domain.intake.PushRequest¶
Bases:
pydantic.BaseModelCreate or update one product group in Airtable (draft push, §6E1-E2).
baselinemaps an Airtable record id to the field values the app last wrote there; a record whose current values differ from its baseline was edited in Airtable since, and is reported as a conflict instead of being overwritten.- idempotency_key: str¶
- variations: list[VariationIn]¶
- removed_unit_ids: list[str]¶
- removed_spec_ids: list[str]¶
- removed_variation_ids: list[str]¶
- restored_units: list[UnitRestore]¶
- baseline: dict[str, dict[str, Any]]¶
- class api.domain.intake.Conflict¶
Bases:
pydantic.BaseModel- table: str¶
- airtable_id: str¶
- field: str¶
- baseline: Any = None¶
- current: Any = None¶
- class api.domain.intake.PushResult¶
Bases:
pydantic.BaseModel- status: Literal['in_sync', 'conflict']¶
- ids: dict[str, str]¶
- written: dict[str, dict[str, Any]]¶
- class api.domain.intake.UnitSyncResult¶
Bases:
pydantic.BaseModel- status: Literal['in_sync', 'conflict']¶
- id: str¶
- created: bool¶
- written: dict[str, Any]¶
- class api.domain.intake.VariantConversion¶
Bases:
pydantic.BaseModelAn existing default Variation turned into a variant on validation (§6B).
- variation_id: str¶
- class api.domain.intake.ValidateRequest¶
Bases:
pydantic.BaseModel- model_id: str¶
- variation_ids: list[str]¶
- conversions: list[VariantConversion]¶
- confirm_shopify: bool = False¶
- class api.domain.intake.UnvalidateRequest¶
Bases:
pydantic.BaseModel- model_id: str¶
- variation_ids: list[str]¶
- class api.domain.intake.CompatLink¶
Bases:
pydantic.BaseModel- host_model_id: str¶
- accessory_model_id: str¶
- class api.domain.intake.CancelRequest¶
Bases:
pydantic.BaseModelDelete what a cancelled group created in Airtable (§6E6). Records the group only selected must not be listed here.
- model_id: str | None = None¶
- model_created: bool = False¶
- variation_ids: list[str]¶
- spec_ids: list[str]¶
- unit_ids: list[str]¶
- restore_units: list[UnitRestore]¶
- compat_links: list[CompatLink]¶