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

SpecIn

One Airtable Specification record: key (a Specification type

ModelIn

The group's Model. created_by_group=False means the group selected

VariationIn

A Variation of the group's Model. created_by_group=False means an

UnitValues

What operations recorded about one physical item.

UnitIn

One physical item (Toutes les unités) of a product group.

UnitCreation

Set only when the Unit is created (a pre-created reprise Unit already

UnitSyncRequest

Create or complete the Unit of one received item, once operations

UnitRestore

A pre-created reprise Unit given back its values from before the first

PushRequest

Create or update one product group in Airtable (draft push, §6E1-E2).

Conflict

PushResult

UnitSyncResult

VariantConversion

An existing default Variation turned into a variant on validation (§6B).

ValidateRequest

UnvalidateRequest

CompatLink

CancelRequest

Delete what a cancelled group created in Airtable (§6E6). Records the

CancelResult

AccessoryLinkResult

Module Contents

class api.domain.intake.SpecIn

Bases: pydantic.BaseModel

One Airtable Specification record: key (a Specification type record), 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.BaseModel

The group’s Model. created_by_group=False means 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.BaseModel

A Variation of the group’s Model. created_by_group=False means 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
axis: SpecIn | None = None
specs: list[SpecIn]
class api.domain.intake.UnitValues

Bases: pydantic.BaseModel

What 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: UnitValues

One 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.BaseModel

Set 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: UnitValues

Create or complete the Unit of one received item, once operations finished it. idempotency_key is stable per item (app-unit:<id>): a retry never creates a second Unit. baseline maps 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.BaseModel

A 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.BaseModel

Create or update one product group in Airtable (draft push, §6E1-E2).

baseline maps 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
model: ModelIn
variations: list[VariationIn]
units: list[UnitIn]
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]]
conflicts: list[Conflict]
class api.domain.intake.UnitSyncResult

Bases: pydantic.BaseModel

status: Literal['in_sync', 'conflict']
id: str
created: bool
written: dict[str, Any]
conflicts: list[Conflict]
class api.domain.intake.VariantConversion

Bases: pydantic.BaseModel

An existing default Variation turned into a variant on validation (§6B).

variation_id: str
axis: SpecIn
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]

Bases: pydantic.BaseModel

host_model_id: str
accessory_model_id: str
class api.domain.intake.CancelRequest

Bases: pydantic.BaseModel

Delete 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]
class api.domain.intake.CancelResult

Bases: pydantic.BaseModel

deleted: dict[str, list[str]]
restored_unit_ids: list[str]
class api.domain.intake.AccessoryLinkResult

Bases: pydantic.BaseModel

compat_row_id: str
row_created: bool
already_linked: bool