api.domain.catalog¶
Airtable catalog domain model.
Maps the real Airtable base rather than a flat product list: Model -> Variation -> Toutes les unités (physical units), with Annonces Shopify holding the Shopify listing tied to a Model. Field names below are the literal Airtable field names confirmed against that base’s schema.
Attributes¶
Classes¶
Functions¶
|
Whether a unit's "Etat esthétique" keeps it off Shopify. |
|
Whether a "Prix de vente HT" (Airtable) or a variant price (Shopify, |
|
The first PDF in an Airtable attachment field's value, or |
|
How many of |
|
|
|
|
|
|
|
|
|
A link that opens |
Module Contents¶
- api.domain.catalog.SELLABLE_COMMERCIAL_STATUS = 'A vendre'¶
- api.domain.catalog.DEFAULT_CONDITION = 'Très bon'¶
- api.domain.catalog.DECLASSE_CONDITION = 'Neuf déclassé'¶
- api.domain.catalog.EXCLUDED_CONDITIONS = ['Abimé', 'Très abimé']¶
- api.domain.catalog.is_excluded_condition(condition: Any) bool¶
Whether a unit’s “Etat esthétique” keeps it off Shopify.
- api.domain.catalog.is_positive_price(value: Any) bool¶
Whether a “Prix de vente HT” (Airtable) or a variant price (Shopify, a decimal string) is a real price – False for 0, negative, empty or non-numeric values.
- api.domain.catalog.pick_pdf_attachment(value: Any) dict[str, Any] | None¶
The first PDF in an Airtable attachment field’s value, or
None.Recognized by MIME type, or by a
.pdffilename when Airtable didn’t record one. Non-PDF attachments (a photo dropped into the field by mistake) are ignored rather than uploaded as “the PDF”.
- class api.domain.catalog.Model¶
- record_id: str¶
- name: str¶
- shopify_id: str | None¶
- to_sell_on_shopify: bool¶
- variation_ids: list[str] = []¶
- shopify_listing_ids: list[str] = []¶
- documentation_attachment_id: str | None = None¶
- class api.domain.catalog.Variation¶
- record_id: str¶
- name: str¶
- model_id: str | None¶
- to_sell_on_shopify: bool¶
- variant_values: list[str] = []¶
- unit_ids: list[str] = []¶
- class api.domain.catalog.Unit¶
- record_id: str¶
- variation_id: str | None¶
- commercial_status: str | None¶
- aesthetic_condition: str | None¶
- variation_ids: list[str] = []¶
- sale_price: Any = None¶
- name: str | None = None¶
- class api.domain.catalog.ShopifyListing¶
- record_id: str¶
- model_id: str | None¶
- shopify_id: str | None¶
- status: str | None¶
- name: str | None = None¶
- api.domain.catalog.added_since(current_ids: set[str], previous_ids: list[str] | None) int¶
How many of
current_idsare new compared to a prior run’s snapshot.previous_idsbeingNonemeans “no prior run” (first run ever), reported as zero additions rather than the size of the whole catalog.
- api.domain.catalog.fetch_shopify_listings() list[ShopifyListing]¶
- api.domain.catalog.record_url(table: str, record_id: str) str | None¶
A link that opens
record_idin Airtable’s web UI, orNone.Returns
Nonerather than raising when the table’s real id/view can’t be resolved (e.g. a token that loses schema-read access later) – this is a display nicety, never allowed to break a run.