api.scripts.create_product_shopify ================================== .. py:module:: api.scripts.create_product_shopify .. autoapi-nested-parse:: Creates the Shopify product of an Airtable Model (record_id: the Model id). The whole product (options, variants, prices, stock, weight, image) is written by one `productSet` (api/services/shopify_products.py), then its metafields and documentation PDF. Strict: a Model missing a description, weight, type or a usable photo is not created. Never twice: before creating, every product the Model's "Annonces Shopify" records point to is looked up on Shopify; right after creating, the record is written (or a record whose product is gone is reused), so a retried trigger finds it and stops. A creation that fails after that is rolled back, and the Model's next triggers are skipped for ROLLBACK_COOLDOWN_SECONDS. Attributes ---------- .. autoapisummary:: api.scripts.create_product_shopify.logger api.scripts.create_product_shopify.ROLLBACK_COOLDOWN_SECONDS Classes ------- .. autoapisummary:: api.scripts.create_product_shopify.CreateProductShopifyScript Module Contents --------------- .. py:data:: logger .. py:data:: ROLLBACK_COOLDOWN_SECONDS :value: 900 .. py:class:: CreateProductShopifyScript .. py:attribute:: name :value: 'create_product_shopify' .. py:attribute:: schedule :value: None .. py:method:: is_configured() -> bool .. py:method:: run(previous_snapshot: dict[str, Any] | None = None, report_stage: api.scripts.base.StageReporter = lambda stage: None, **kwargs: Any) -> tuple[api.scripts.base.ScriptResult, dict[str, Any] | None]