Api reference
components.shop.public.commands ¶
backfill_shop_visits ¶
backfill_shop_visits ¶
Backfill shop visits from Segment.
Source code in components/shop/public/commands/backfill_shop_visits.py
migrate_testimonials_to_saleor ¶
migrate_testimonials_to_saleor ¶
Migrate testimonials to Saleor by replacing Shopify product ids by Saleor product ids.
Source code in components/shop/public/commands/migrate_testimonials_to_saleor.py
supplier_action ¶
daily_routine ¶
Source code in components/shop/public/commands/supplier_action.py
fulfill_orders ¶
Source code in components/shop/public/commands/supplier_action.py
run_supplier_action ¶
Source code in components/shop/public/commands/supplier_action.py
sync_delivery_status ¶
Source code in components/shop/public/commands/supplier_action.py
synchronize_catalog ¶
Source code in components/shop/public/commands/supplier_action.py
synchronize_stocks ¶
Source code in components/shop/public/commands/supplier_action.py
update_draft_orders ¶
Source code in components/shop/public/commands/supplier_action.py
update_recent_orders ¶
Source code in components/shop/public/commands/supplier_action.py
update_trackings ¶
Source code in components/shop/public/commands/supplier_action.py
sync_product_recommendations ¶
sync_product_recommendations ¶
Synchronize product recommendations between Shopify and Saleor.
Source code in components/shop/public/commands/sync_product_recommendations.py
sync_saleor_channels ¶
sync_saleor_channels ¶
Synchronize two Saleor channels
Source code in components/shop/public/commands/sync_saleor_channels.py
components.shop.public.controllers ¶
admin_cancellation_mail ¶
admin_order ¶
admin_testimonial ¶
eligibility ¶
saleor_checkout ¶
saleor_webhook ¶
shop_user ¶
shopify_discount ¶
shopify_order ¶
stripe_webhook ¶
components.shop.public.enums ¶
ContactLensAddition ¶
ContactLensItemType ¶
ContactLensND ¶
ContactLensProductType ¶
Bases: AlanBaseEnum
This enum is used to store the product type of a contact lens.
contact_lens_bi_monthly
class-attribute
instance-attribute
¶
contact_lens_bifocal
class-attribute
instance-attribute
¶
contact_lens_colored
class-attribute
instance-attribute
¶
contact_lens_extended_wear
class-attribute
instance-attribute
¶
contact_lens_for_sport
class-attribute
instance-attribute
¶
contact_lens_monthly
class-attribute
instance-attribute
¶
contact_lens_multifocal
class-attribute
instance-attribute
¶
contact_lens_progressive
class-attribute
instance-attribute
¶
contact_lens_spherical
class-attribute
instance-attribute
¶
ContactLensSolutionType ¶
Bases: AlanBaseEnum
This enum is used to store the solution type of a contact lens.
solution_travel_kit
class-attribute
instance-attribute
¶
ContactLensStatus ¶
Bases: AlanBaseEnum
This enum is used to store the status of a contact lens.
InvoicingDocumentType ¶
Bases: AlanBaseEnum
This enum is used to store the type of invoice generation.
PrescriptionCheckProblemSeverity ¶
PrescriptionCheckProblemType ¶
Bases: AlanBaseEnum
This enum is used to store the type of a prescription check problem.
TransactionType ¶
UsageSource ¶
UsageStatus ¶
UsageType ¶
components.shop.public.events ¶
ShopTestimonialPublished
dataclass
¶
ShopTestimonialPublished(
testimonial,
rating,
product_id,
user_name,
app_user_id,
app_id,
external_order_id,
)
Bases: WebhookMessage
Event triggered when a ShopTestimonial has been published.
components.shop.public.flask_admin_configuration ¶
components.shop.public.globalization ¶
base_prescription_checker ¶
BasePrescriptionChecker ¶
Bases: ABC
Base class for prescription checkers, providing methods to implement the prescription checking logic.
Source code in components/shop/public/globalization/base_prescription_checker.py
check_contact_lens_prescription_content
abstractmethod
¶
check_contact_lens_prescription_content(
beneficiary_user_id,
content,
contact_lens_items,
order_date=None,
)
Check the contact lenses prescription content.
Source code in components/shop/public/globalization/base_prescription_checker.py
check_glasses_prescription_content
abstractmethod
¶
Check the glasses prescription content.
Source code in components/shop/public/globalization/base_prescription_checker.py
check_saleor_contact_lens_checkout_prescription_content
abstractmethod
¶
Check the SaleorCheckout prescription.
Source code in components/shop/public/globalization/base_prescription_checker.py
check_saleor_contact_lens_fulfillment_prescription
abstractmethod
¶
Check the SaleorOrder prescription.
Source code in components/shop/public/globalization/base_prescription_checker.py
document_content_is_of_type
abstractmethod
¶
Abstract method to check if the document content is of the given type.
Source code in components/shop/public/globalization/base_prescription_checker.py
retrieve_prescription_content
abstractmethod
¶
retrieve_prescription_content(
prescription_id,
compute_if_not_parsed_yet=False,
use_transcription=False,
automated_parsing_only=False,
)
Abstract method to retrieve the prescription content.
Source code in components/shop/public/globalization/base_prescription_checker.py
retrieve_prescription_transcription
abstractmethod
¶
Abstract method to retrieve the prescription transcription.
base_shop_adapter ¶
BaseShopAdapter ¶
Bases: ABC
Base class for shop adapters, providing methods to implement the Shop.
generate_credit_note
abstractmethod
¶
generate_order_invoice
abstractmethod
¶
generate_order_invoice(
order,
is_preview=False,
invoice_type=InvoicingDocumentType.regular_invoice,
)
Generate an invoice for an order.
Source code in components/shop/public/globalization/base_shop_adapter.py
get_coverage_usage_for_user
abstractmethod
¶
Return the remaining usage for a user.
get_order_invoice_url
abstractmethod
¶
Get the URL of the order invoice.
get_pending_claim_usages_for_user
abstractmethod
¶
Return the uninvoiced orders for a user.
return SaleorHelper().get_pending_claim_usages_for_user( app_id=AppName.ALAN_FR, user_id=user_id, usage_type=usage_type, )
Source code in components/shop/public/globalization/base_shop_adapter.py
get_prescription_checker
abstractmethod
¶
Return a prescription checker class.
is_prescription_locked_for_invoicing
abstractmethod
¶
Return True if the prescription is linked to a pending order not yet invoiced.
return SaleorHelper().is_prescription_locked_for_invoicing( app_id=AppName.ALAN_FR, prescription_id=prescription_id, )
Source code in components/shop/public/globalization/base_shop_adapter.py
tombstone_insurance_document
abstractmethod
¶
Tombstone (soft delete) an insurance document.
upload_invoicing_document
abstractmethod
¶
Upload invoicing document.
upload_order_invoice
abstractmethod
¶
Upload order invoice and create the corresponding care acts.
shop_adapter ¶
get_app_specific_shop_adapter ¶
Return an app-specific shop adapter based on the app ID or raise an error if not found.
Source code in components/shop/public/globalization/shop_adapter.py
get_app_specific_shop_adapter_or_none ¶
Return an app-specific shop adapter based on the app ID.
Source code in components/shop/public/globalization/shop_adapter.py
components.shop.public.services ¶
discounts ¶
create_shop_discount ¶
Create a discount to be used in the shop During the transition period, we create both a shopify discount code and a saleor voucher So the member will be able to find the discount in both places
Source code in components/shop/public/services/discounts.py
get_processed_orders_with_discounts ¶
Get orders with discounts processed after date from shopify