spree_api 6.0.0.beta4 → 6.0.0.rc1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Rakefile +4 -31
- data/app/controllers/concerns/spree/api/v3/admin/email_template_lookup.rb +139 -0
- data/app/controllers/concerns/spree/api/v3/admin/store_context.rb +1 -1
- data/app/controllers/concerns/spree/api/v3/admin/subclassed_resource.rb +1 -1
- data/app/controllers/concerns/spree/api/v3/cart_resolvable.rb +7 -0
- data/app/controllers/concerns/spree/api/v3/channel_resolution.rb +2 -2
- data/app/controllers/concerns/spree/api/v3/current_password_confirmation.rb +1 -1
- data/app/controllers/concerns/spree/api/v3/error_handler.rb +7 -2
- data/app/controllers/concerns/spree/api/v3/http_caching.rb +44 -11
- data/app/controllers/concerns/spree/api/v3/idempotent.rb +20 -5
- data/app/controllers/concerns/spree/api/v3/items_payload.rb +1 -1
- data/app/controllers/concerns/spree/api/v3/order_lock.rb +2 -2
- data/app/controllers/concerns/spree/api/v3/orders/delivery_actions.rb +1 -5
- data/app/controllers/concerns/spree/api/v3/orders/fulfillment_actions.rb +2 -10
- data/app/controllers/concerns/spree/api/v3/orders/post_sale_actions.rb +2 -10
- data/app/controllers/concerns/spree/api/v3/orders/shipping_label_actions.rb +4 -8
- data/app/controllers/concerns/spree/api/v3/permission_serialization.rb +9 -1
- data/app/controllers/concerns/spree/api/v3/seller/seller_context.rb +1 -1
- data/app/controllers/concerns/spree/api/v3/store/storefront_products.rb +5 -4
- data/app/controllers/concerns/spree/api/v3/storefront_gating.rb +11 -5
- data/app/controllers/spree/api/v3/admin/admin_users_controller.rb +0 -5
- data/app/controllers/spree/api/v3/admin/api_keys_controller.rb +1 -1
- data/app/controllers/spree/api/v3/admin/catalogs/order_minimums_controller.rb +0 -6
- data/app/controllers/spree/api/v3/admin/catalogs/quantity_rules_controller.rb +0 -4
- data/app/controllers/spree/api/v3/admin/catalogs_controller.rb +1 -1
- data/app/controllers/spree/api/v3/admin/channels_controller.rb +0 -4
- data/app/controllers/spree/api/v3/admin/collections/products_controller.rb +1 -2
- data/app/controllers/spree/api/v3/admin/commission_rates_controller.rb +2 -2
- data/app/controllers/spree/api/v3/admin/companies/addresses_controller.rb +0 -4
- data/app/controllers/spree/api/v3/admin/companies/invitations_controller.rb +1 -5
- data/app/controllers/spree/api/v3/admin/companies/memberships_controller.rb +0 -4
- data/app/controllers/spree/api/v3/admin/companies/tax_exemption_certificates_controller.rb +1 -9
- data/app/controllers/spree/api/v3/admin/companies/tax_identifiers_controller.rb +0 -4
- data/app/controllers/spree/api/v3/admin/companies_controller.rb +0 -4
- data/app/controllers/spree/api/v3/admin/countries_controller.rb +1 -1
- data/app/controllers/spree/api/v3/admin/coupon_codes_controller.rb +0 -4
- data/app/controllers/spree/api/v3/admin/custom_field_definitions_controller.rb +9 -1
- data/app/controllers/spree/api/v3/admin/custom_fields_controller.rb +0 -4
- data/app/controllers/spree/api/v3/admin/customer_groups_controller.rb +0 -4
- data/app/controllers/spree/api/v3/admin/customers/addresses_controller.rb +0 -4
- data/app/controllers/spree/api/v3/admin/customers/credit_cards_controller.rb +0 -4
- data/app/controllers/spree/api/v3/admin/customers/store_credits_controller.rb +0 -4
- data/app/controllers/spree/api/v3/admin/customers_controller.rb +2 -2
- data/app/controllers/spree/api/v3/admin/delivery_methods/rules_controller.rb +1 -1
- data/app/controllers/spree/api/v3/admin/delivery_methods_controller.rb +3 -5
- data/app/controllers/spree/api/v3/admin/delivery_profiles_controller.rb +1 -6
- data/app/controllers/spree/api/v3/admin/email_templates/drafts_controller.rb +40 -0
- data/app/controllers/spree/api/v3/admin/email_templates/previews_controller.rb +30 -0
- data/app/controllers/spree/api/v3/admin/email_templates/publications_controller.rb +30 -0
- data/app/controllers/spree/api/v3/admin/email_templates/restorations_controller.rb +34 -0
- data/app/controllers/spree/api/v3/admin/email_templates/revisions_controller.rb +35 -0
- data/app/controllers/spree/api/v3/admin/email_templates/sample_records_controller.rb +33 -0
- data/app/controllers/spree/api/v3/admin/email_templates/test_emails_controller.rb +40 -0
- data/app/controllers/spree/api/v3/admin/email_templates_controller.rb +46 -0
- data/app/controllers/spree/api/v3/admin/imports_controller.rb +1 -2
- data/app/controllers/spree/api/v3/admin/invitations_controller.rb +0 -7
- data/app/controllers/spree/api/v3/admin/me_controller.rb +1 -1
- data/app/controllers/spree/api/v3/admin/media_library_controller.rb +5 -5
- data/app/controllers/spree/api/v3/admin/order_routing_rules_controller.rb +0 -4
- data/app/controllers/spree/api/v3/admin/orders/deliveries_controller.rb +1 -5
- data/app/controllers/spree/api/v3/admin/orders/discount_codes_controller.rb +1 -1
- data/app/controllers/spree/api/v3/admin/orders/discounts_controller.rb +1 -1
- data/app/controllers/spree/api/v3/admin/orders/fulfillments_controller.rb +18 -16
- data/app/controllers/spree/api/v3/admin/orders/gift_cards_controller.rb +3 -3
- data/app/controllers/spree/api/v3/admin/orders/labels_controller.rb +2 -10
- data/app/controllers/spree/api/v3/admin/orders/payments_controller.rb +2 -14
- data/app/controllers/spree/api/v3/admin/orders/refunds_controller.rb +1 -5
- data/app/controllers/spree/api/v3/admin/orders_controller.rb +3 -3
- data/app/controllers/spree/api/v3/admin/password_resets_controller.rb +9 -7
- data/app/controllers/spree/api/v3/admin/price_lists_controller.rb +6 -53
- data/app/controllers/spree/api/v3/admin/prices_controller.rb +0 -4
- data/app/controllers/spree/api/v3/admin/products/digital_assets_controller.rb +2 -6
- data/app/controllers/spree/api/v3/admin/products/variants_controller.rb +0 -4
- data/app/controllers/spree/api/v3/admin/products_controller.rb +1 -1
- data/app/controllers/spree/api/v3/admin/promotion_actions_controller.rb +0 -4
- data/app/controllers/spree/api/v3/admin/promotion_rules_controller.rb +0 -4
- data/app/controllers/spree/api/v3/admin/purchase_orders_controller.rb +1 -1
- data/app/controllers/spree/api/v3/admin/resource_controller.rb +1 -1
- data/app/controllers/spree/api/v3/admin/seller_payouts_controller.rb +1 -9
- data/app/controllers/spree/api/v3/admin/seller_requirement_submissions_controller.rb +2 -10
- data/app/controllers/spree/api/v3/admin/seller_transfers_controller.rb +0 -4
- data/app/controllers/spree/api/v3/admin/sellers/invitations_controller.rb +1 -1
- data/app/controllers/spree/api/v3/admin/sellers/payouts_controller.rb +1 -1
- data/app/controllers/spree/api/v3/admin/sellers_controller.rb +2 -10
- data/app/controllers/spree/api/v3/admin/setup_controller.rb +3 -11
- data/app/controllers/spree/api/v3/admin/stock_transfers_controller.rb +1 -1
- data/app/controllers/spree/api/v3/admin/store_controller.rb +6 -1
- data/app/controllers/spree/api/v3/admin/tags_controller.rb +8 -5
- data/app/controllers/spree/api/v3/admin/webhook_endpoints_controller.rb +17 -12
- data/app/controllers/spree/api/v3/admin/webhook_events_controller.rb +25 -0
- data/app/controllers/spree/api/v3/base_controller.rb +10 -0
- data/app/controllers/spree/api/v3/resource_controller.rb +44 -1
- data/app/controllers/spree/api/v3/seller/auth_controller.rb +2 -2
- data/app/controllers/spree/api/v3/seller/countries_controller.rb +1 -1
- data/app/controllers/spree/api/v3/seller/exports_controller.rb +3 -3
- data/app/controllers/spree/api/v3/seller/invitation_acceptances_controller.rb +3 -3
- data/app/controllers/spree/api/v3/seller/invitations_controller.rb +1 -1
- data/app/controllers/spree/api/v3/seller/me_controller.rb +1 -1
- data/app/controllers/spree/api/v3/seller/orders/labels_controller.rb +1 -1
- data/app/controllers/spree/api/v3/seller/password_resets_controller.rb +10 -11
- data/app/controllers/spree/api/v3/seller/products_controller.rb +2 -1
- data/app/controllers/spree/api/v3/seller/requirement_submissions_controller.rb +1 -1
- data/app/controllers/spree/api/v3/seller/team_controller.rb +1 -1
- data/app/controllers/spree/api/v3/store/carts/discount_codes_controller.rb +1 -1
- data/app/controllers/spree/api/v3/store/carts/fulfillments_controller.rb +3 -11
- data/app/controllers/spree/api/v3/store/carts/gift_cards_controller.rb +5 -3
- data/app/controllers/spree/api/v3/store/carts/items_controller.rb +6 -2
- data/app/controllers/spree/api/v3/store/carts/payment_sessions_controller.rb +1 -1
- data/app/controllers/spree/api/v3/store/carts/payments_controller.rb +5 -3
- data/app/controllers/spree/api/v3/store/carts/po_documents_controller.rb +2 -2
- data/app/controllers/spree/api/v3/store/carts/store_credits_controller.rb +2 -0
- data/app/controllers/spree/api/v3/store/carts_controller.rb +9 -6
- data/app/controllers/spree/api/v3/store/companies/addresses_controller.rb +0 -4
- data/app/controllers/spree/api/v3/store/companies/invitations_controller.rb +1 -5
- data/app/controllers/spree/api/v3/store/company_invitations_controller.rb +1 -1
- data/app/controllers/spree/api/v3/store/customer/addresses_controller.rb +0 -4
- data/app/controllers/spree/api/v3/store/customer/credit_cards_controller.rb +0 -4
- data/app/controllers/spree/api/v3/store/customer/data_requests_controller.rb +0 -5
- data/app/controllers/spree/api/v3/store/customer/digital_links_controller.rb +0 -4
- data/app/controllers/spree/api/v3/store/customer/gift_cards_controller.rb +0 -4
- data/app/controllers/spree/api/v3/store/customer/orders_controller.rb +0 -4
- data/app/controllers/spree/api/v3/store/customer/password_resets_controller.rb +8 -6
- data/app/controllers/spree/api/v3/store/customer/payment_setup_sessions_controller.rb +0 -4
- data/app/controllers/spree/api/v3/store/customer/store_credits_controller.rb +0 -5
- data/app/controllers/spree/api/v3/store/data_request_downloads_controller.rb +1 -1
- data/app/controllers/spree/api/v3/store/delivery_methods_controller.rb +1 -1
- data/app/controllers/spree/api/v3/store/newsletter_subscribers_controller.rb +5 -14
- data/app/controllers/spree/api/v3/store/orders/claims_controller.rb +1 -5
- data/app/controllers/spree/api/v3/store/orders/returns_controller.rb +1 -5
- data/app/controllers/spree/api/v3/store/wishlist_items_controller.rb +0 -4
- data/app/serializers/spree/api/v3/admin/address_serializer.rb +5 -7
- data/app/serializers/spree/api/v3/admin/api_key_serializer.rb +2 -6
- data/app/serializers/spree/api/v3/admin/catalog_assignment_serializer.rb +1 -3
- data/app/serializers/spree/api/v3/admin/catalog_order_minimum_serializer.rb +1 -7
- data/app/serializers/spree/api/v3/admin/catalog_product_term_serializer.rb +1 -3
- data/app/serializers/spree/api/v3/admin/catalog_quantity_rule_serializer.rb +1 -3
- data/app/serializers/spree/api/v3/admin/channel_serializer.rb +5 -6
- data/app/serializers/spree/api/v3/admin/claim_reason_serializer.rb +1 -3
- data/app/serializers/spree/api/v3/admin/commission_rule_serializer.rb +1 -3
- data/app/serializers/spree/api/v3/admin/coupon_code_serializer.rb +1 -7
- data/app/serializers/spree/api/v3/admin/credit_card_serializer.rb +1 -7
- data/app/serializers/spree/api/v3/admin/custom_field_definition_serializer.rb +6 -2
- data/app/serializers/spree/api/v3/admin/customer_serializer.rb +2 -10
- data/app/serializers/spree/api/v3/admin/data_request_serializer.rb +2 -6
- data/app/serializers/spree/api/v3/admin/delivery_method_serializer.rb +8 -22
- data/app/serializers/spree/api/v3/admin/delivery_origin_group_serializer.rb +1 -3
- data/app/serializers/spree/api/v3/admin/delivery_serializer.rb +1 -3
- data/app/serializers/spree/api/v3/admin/delivery_zone_serializer.rb +1 -7
- data/app/serializers/spree/api/v3/admin/digital_asset_serializer.rb +4 -2
- data/app/serializers/spree/api/v3/admin/email_template_draft_serializer.rb +19 -0
- data/app/serializers/spree/api/v3/admin/email_template_preview_serializer.rb +38 -0
- data/app/serializers/spree/api/v3/admin/email_template_revision_serializer.rb +18 -0
- data/app/serializers/spree/api/v3/admin/email_template_sample_record_serializer.rb +13 -0
- data/app/serializers/spree/api/v3/admin/email_template_serializer.rb +61 -0
- data/app/serializers/spree/api/v3/admin/exchange_serializer.rb +1 -3
- data/app/serializers/spree/api/v3/admin/export_serializer.rb +1 -7
- data/app/serializers/spree/api/v3/admin/fulfillment_item_serializer.rb +1 -7
- data/app/serializers/spree/api/v3/admin/fulfillment_serializer.rb +1 -7
- data/app/serializers/spree/api/v3/admin/gift_card_serializer.rb +1 -7
- data/app/serializers/spree/api/v3/admin/line_item_serializer.rb +2 -6
- data/app/serializers/spree/api/v3/admin/market_serializer.rb +4 -2
- data/app/serializers/spree/api/v3/admin/media_serializer.rb +1 -3
- data/app/serializers/spree/api/v3/admin/order_cancellation_reason_serializer.rb +1 -3
- data/app/serializers/spree/api/v3/admin/order_group_serializer.rb +3 -9
- data/app/serializers/spree/api/v3/admin/order_routing_rule_serializer.rb +1 -3
- data/app/serializers/spree/api/v3/admin/order_serializer.rb +5 -15
- data/app/serializers/spree/api/v3/admin/package_type_serializer.rb +1 -3
- data/app/serializers/spree/api/v3/admin/payment_method_serializer.rb +7 -1
- data/app/serializers/spree/api/v3/admin/payment_serializer.rb +2 -7
- data/app/serializers/spree/api/v3/admin/permission_serializer.rb +4 -4
- data/app/serializers/spree/api/v3/admin/price_rule_serializer.rb +1 -3
- data/app/serializers/spree/api/v3/admin/product_serializer.rb +2 -10
- data/app/serializers/spree/api/v3/admin/product_submission_serializer.rb +2 -10
- data/app/serializers/spree/api/v3/admin/product_type_serializer.rb +1 -3
- data/app/serializers/spree/api/v3/admin/promotion_action_serializer.rb +1 -3
- data/app/serializers/spree/api/v3/admin/promotion_rule_serializer.rb +1 -3
- data/app/serializers/spree/api/v3/admin/purchase_order_item_serializer.rb +2 -15
- data/app/serializers/spree/api/v3/admin/purchase_order_serializer.rb +2 -15
- data/app/serializers/spree/api/v3/admin/refund_reason_serializer.rb +1 -3
- data/app/serializers/spree/api/v3/admin/refund_serializer.rb +4 -1
- data/app/serializers/spree/api/v3/admin/return_line_item_serializer.rb +1 -0
- data/app/serializers/spree/api/v3/admin/return_reason_serializer.rb +1 -3
- data/app/serializers/spree/api/v3/admin/return_serializer.rb +3 -11
- data/app/serializers/spree/api/v3/admin/saved_report_serializer.rb +1 -3
- data/app/serializers/spree/api/v3/admin/seller_payout_serializer.rb +4 -2
- data/app/serializers/spree/api/v3/admin/seller_requirement_status_serializer.rb +2 -6
- data/app/serializers/spree/api/v3/admin/seller_requirement_submission_serializer.rb +1 -7
- data/app/serializers/spree/api/v3/admin/seller_serializer.rb +5 -15
- data/app/serializers/spree/api/v3/admin/seller_transfer_serializer.rb +4 -2
- data/app/serializers/spree/api/v3/admin/shipping_label_serializer.rb +6 -19
- data/app/serializers/spree/api/v3/admin/stock_level_serializer.rb +1 -3
- data/app/serializers/spree/api/v3/admin/stock_location_serializer.rb +1 -3
- data/app/serializers/spree/api/v3/admin/stock_movement_serializer.rb +1 -3
- data/app/serializers/spree/api/v3/admin/stock_receipt_item_serializer.rb +1 -7
- data/app/serializers/spree/api/v3/admin/stock_receipt_serializer.rb +1 -3
- data/app/serializers/spree/api/v3/admin/stock_reservation_serializer.rb +1 -3
- data/app/serializers/spree/api/v3/admin/stock_transfer_item_serializer.rb +1 -3
- data/app/serializers/spree/api/v3/admin/store_credit_event_serializer.rb +1 -3
- data/app/serializers/spree/api/v3/admin/store_credit_serializer.rb +4 -18
- data/app/serializers/spree/api/v3/admin/store_serializer.rb +24 -6
- data/app/serializers/spree/api/v3/admin/supplier_serializer.rb +1 -3
- data/app/serializers/spree/api/v3/admin/tax_exemption_certificate_serializer.rb +3 -9
- data/app/serializers/spree/api/v3/admin/tax_identifier_serializer.rb +1 -3
- data/app/serializers/spree/api/v3/admin/tax_line_serializer.rb +5 -1
- data/app/serializers/spree/api/v3/admin/tax_rate_serializer.rb +1 -7
- data/app/serializers/spree/api/v3/admin/variant_serializer.rb +6 -7
- data/app/serializers/spree/api/v3/admin/webhook_delivery_serializer.rb +1 -3
- data/app/serializers/spree/api/v3/admin/webhook_event_serializer.rb +23 -0
- data/app/serializers/spree/api/v3/applied_promotion_serializer.rb +2 -4
- data/app/serializers/spree/api/v3/base_serializer.rb +20 -0
- data/app/serializers/spree/api/v3/cart_serializer.rb +17 -45
- data/app/serializers/spree/api/v3/category_serializer.rb +5 -15
- data/app/serializers/spree/api/v3/claim_line_item_serializer.rb +11 -26
- data/app/serializers/spree/api/v3/claim_serializer.rb +2 -15
- data/app/serializers/spree/api/v3/collection_serializer.rb +1 -3
- data/app/serializers/spree/api/v3/company_serializer.rb +1 -3
- data/app/serializers/spree/api/v3/custom_field_serializer.rb +1 -2
- data/app/serializers/spree/api/v3/delivery_rate_serializer.rb +3 -23
- data/app/serializers/spree/api/v3/digital_asset_serializer.rb +1 -3
- data/app/serializers/spree/api/v3/digital_link_serializer.rb +3 -9
- data/app/serializers/spree/api/v3/discount_serializer.rb +1 -12
- data/app/serializers/spree/api/v3/exchange_line_item_serializer.rb +9 -27
- data/app/serializers/spree/api/v3/exchange_serializer.rb +2 -15
- data/app/serializers/spree/api/v3/export_serializer.rb +1 -3
- data/app/serializers/spree/api/v3/fee_serializer.rb +2 -10
- data/app/serializers/spree/api/v3/fulfillment_serializer.rb +4 -11
- data/app/serializers/spree/api/v3/gift_card_batch_serializer.rb +1 -3
- data/app/serializers/spree/api/v3/gift_card_serializer.rb +5 -17
- data/app/serializers/spree/api/v3/import_row_serializer.rb +2 -6
- data/app/serializers/spree/api/v3/import_serializer.rb +3 -14
- data/app/serializers/spree/api/v3/invitation_serializer.rb +2 -19
- data/app/serializers/spree/api/v3/line_item_serializer.rb +6 -20
- data/app/serializers/spree/api/v3/media_event_serializer.rb +1 -3
- data/app/serializers/spree/api/v3/media_serializer.rb +1 -3
- data/app/serializers/spree/api/v3/newsletter_subscriber_request_event_serializer.rb +35 -0
- data/app/serializers/spree/api/v3/newsletter_subscriber_serializer.rb +2 -6
- data/app/serializers/spree/api/v3/option_value_serializer.rb +1 -3
- data/app/serializers/spree/api/v3/order_group_serializer.rb +2 -23
- data/app/serializers/spree/api/v3/order_serializer.rb +12 -38
- data/app/serializers/spree/api/v3/password_reset_requested_event_serializer.rb +29 -0
- data/app/serializers/spree/api/v3/payment_method_serializer.rb +2 -6
- data/app/serializers/spree/api/v3/payment_serializer.rb +5 -10
- data/app/serializers/spree/api/v3/payment_session_serializer.rb +3 -9
- data/app/serializers/spree/api/v3/payment_setup_session_serializer.rb +3 -11
- data/app/serializers/spree/api/v3/policy_serializer.rb +1 -3
- data/app/serializers/spree/api/v3/price_history_serializer.rb +1 -3
- data/app/serializers/spree/api/v3/price_serializer.rb +1 -3
- data/app/serializers/spree/api/v3/product_publication_serializer.rb +1 -7
- data/app/serializers/spree/api/v3/product_serializer.rb +7 -21
- data/app/serializers/spree/api/v3/product_submission_serializer.rb +26 -0
- data/app/serializers/spree/api/v3/purchase_order_event_serializer.rb +23 -4
- data/app/serializers/spree/api/v3/refund_serializer.rb +3 -11
- data/app/serializers/spree/api/v3/return_line_item_serializer.rb +12 -19
- data/app/serializers/spree/api/v3/return_serializer.rb +6 -15
- data/app/serializers/spree/api/v3/saved_report_event_serializer.rb +23 -0
- data/app/serializers/spree/api/v3/seller/delivery_method_serializer.rb +1 -7
- data/app/serializers/spree/api/v3/seller/delivery_rate_serializer.rb +1 -7
- data/app/serializers/spree/api/v3/seller/delivery_serializer.rb +1 -3
- data/app/serializers/spree/api/v3/seller/delivery_zone_serializer.rb +1 -3
- data/app/serializers/spree/api/v3/seller/exchange_serializer.rb +1 -3
- data/app/serializers/spree/api/v3/seller/fulfillment_item_serializer.rb +1 -7
- data/app/serializers/spree/api/v3/seller/fulfillment_serializer.rb +2 -6
- data/app/serializers/spree/api/v3/seller/invitation_serializer.rb +1 -3
- data/app/serializers/spree/api/v3/seller/order_line_item_serializer.rb +7 -13
- data/app/serializers/spree/api/v3/seller/order_serializer.rb +4 -25
- data/app/serializers/spree/api/v3/seller/payout_serializer.rb +4 -2
- data/app/serializers/spree/api/v3/seller/product_serializer.rb +1 -7
- data/app/serializers/spree/api/v3/seller/product_submission_serializer.rb +1 -21
- data/app/serializers/spree/api/v3/seller/profile_serializer.rb +2 -6
- data/app/serializers/spree/api/v3/seller/requirement_status_serializer.rb +3 -9
- data/app/serializers/spree/api/v3/seller/return_serializer.rb +3 -15
- data/app/serializers/spree/api/v3/seller/transfer_serializer.rb +4 -2
- data/app/serializers/spree/api/v3/seller_serializer.rb +1 -3
- data/app/serializers/spree/api/v3/shipping_label_event_serializer.rb +22 -4
- data/app/serializers/spree/api/v3/stock_level_serializer.rb +1 -7
- data/app/serializers/spree/api/v3/stock_movement_serializer.rb +1 -3
- data/app/serializers/spree/api/v3/stock_receipt_event_serializer.rb +20 -4
- data/app/serializers/spree/api/v3/stock_transfer_serializer.rb +1 -7
- data/app/serializers/spree/api/v3/store_credit_event_serializer.rb +2 -11
- data/app/serializers/spree/api/v3/store_credit_serializer.rb +2 -24
- data/app/serializers/spree/api/v3/supplier_event_serializer.rb +6 -4
- data/app/serializers/spree/api/v3/tax_line_serializer.rb +10 -20
- data/app/serializers/spree/api/v3/variant_serializer.rb +7 -21
- data/app/serializers/spree/api/v3/wishlist_item_serializer.rb +1 -11
- data/app/serializers/spree/api/v3/wishlist_serializer.rb +2 -6
- data/app/subscribers/spree/webhook_event_subscriber.rb +3 -10
- data/config/initializers/pagy.rb +1 -1
- data/config/initializers/typelizer.rb +6 -8
- data/config/locales/ar.yml +15 -0
- data/config/locales/be.yml +15 -0
- data/config/locales/bg.yml +15 -0
- data/config/locales/ca.yml +15 -0
- data/config/locales/cs.yml +15 -0
- data/config/locales/da.yml +15 -0
- data/config/locales/de-CH.yml +11 -0
- data/config/locales/de.yml +15 -0
- data/config/locales/el.yml +15 -0
- data/config/locales/en.yml +5 -40
- data/config/locales/es-CL.yml +10 -0
- data/config/locales/es-EC.yml +11 -0
- data/config/locales/es-MX.yml +12 -0
- data/config/locales/es.yml +15 -0
- data/config/locales/et.yml +15 -0
- data/config/locales/fa.yml +15 -0
- data/config/locales/fi.yml +15 -0
- data/config/locales/fr.yml +15 -0
- data/config/locales/hu.yml +15 -0
- data/config/locales/id.yml +15 -0
- data/config/locales/it.yml +15 -0
- data/config/locales/ja.yml +15 -0
- data/config/locales/km.yml +15 -0
- data/config/locales/ko.yml +15 -0
- data/config/locales/ku.yml +15 -0
- data/config/locales/lt.yml +15 -0
- data/config/locales/lv.yml +15 -0
- data/config/locales/nb.yml +15 -0
- data/config/locales/ne.yml +15 -0
- data/config/locales/nl.yml +15 -0
- data/config/locales/pl.yml +15 -0
- data/config/locales/pt-BR.yml +13 -0
- data/config/locales/pt.yml +15 -0
- data/config/locales/ro.yml +15 -0
- data/config/locales/ru.yml +15 -0
- data/config/locales/sk.yml +15 -0
- data/config/locales/sl-SI.yml +15 -0
- data/config/locales/sv.yml +15 -0
- data/config/locales/th.yml +15 -0
- data/config/locales/tr.yml +15 -0
- data/config/locales/uk.yml +15 -0
- data/config/locales/vi.yml +15 -0
- data/config/locales/zh-CN.yml +15 -0
- data/config/locales/zh-TW.yml +15 -0
- data/config/routes.rb +49 -99
- data/lib/spree/api/dependencies.rb +53 -274
- data/lib/spree/api/openapi/schema_helper.rb +1 -1
- data/lib/spree/api/typelizer_generation.rb +35 -0
- data/lib/spree/api/webhook_event_types.rb +140 -0
- data/lib/spree/api.rb +0 -2
- metadata +71 -36
- data/config/i18n-tasks.yml +0 -40
- data/config/initializers/alba.rb +0 -5
|
@@ -9,21 +9,13 @@ module Spree
|
|
|
9
9
|
|
|
10
10
|
attributes :status, :external_id, :external_client_secret, :external_data
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
session.payment_method&.prefixed_id
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
attribute :payment_source_id do |session|
|
|
17
|
-
session.payment_source&.prefixed_id
|
|
18
|
-
end
|
|
12
|
+
prefixed_id_attributes :payment_method, :payment_source
|
|
19
13
|
|
|
20
14
|
attribute :payment_source_type do |session|
|
|
21
|
-
session.payment_source_type
|
|
15
|
+
Spree::Base.polymorphic_api_type(session.payment_source_type)
|
|
22
16
|
end
|
|
23
17
|
|
|
24
|
-
|
|
25
|
-
session.customer&.prefixed_id
|
|
26
|
-
end
|
|
18
|
+
prefixed_id_attributes :customer
|
|
27
19
|
|
|
28
20
|
one :payment_method, resource: proc { Spree.api.payment_method_serializer }
|
|
29
21
|
end
|
|
@@ -11,9 +11,7 @@ module Spree
|
|
|
11
11
|
Spree::RichTextHelper.to_plain_text(policy.body)
|
|
12
12
|
end
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
policy.body_html
|
|
16
|
-
end
|
|
14
|
+
attributes :body_html
|
|
17
15
|
|
|
18
16
|
# The one timestamp a store serializer carries. When a legal document
|
|
19
17
|
# last changed is what a shopper is entitled to see on the page —
|
|
@@ -12,9 +12,7 @@ module Spree
|
|
|
12
12
|
|
|
13
13
|
attributes :amount, :amount_in_cents, :currency
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
price_history.display_amount
|
|
17
|
-
end
|
|
15
|
+
attributes :display_amount
|
|
18
16
|
|
|
19
17
|
attribute :recorded_at do |price_history|
|
|
20
18
|
price_history.recorded_at&.iso8601
|
|
@@ -9,13 +9,7 @@ module Spree
|
|
|
9
9
|
|
|
10
10
|
attributes published_at: :iso8601, unpublished_at: :iso8601
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
publication.product&.prefixed_id
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
attribute :channel_id do |publication|
|
|
17
|
-
publication.channel&.prefixed_id
|
|
18
|
-
end
|
|
12
|
+
prefixed_id_attributes :product, :channel
|
|
19
13
|
end
|
|
20
14
|
end
|
|
21
15
|
end
|
|
@@ -24,27 +24,17 @@ module Spree
|
|
|
24
24
|
:variant_count,
|
|
25
25
|
available_on: :iso8601, preorder_ships_at: :iso8601
|
|
26
26
|
|
|
27
|
-
attribute :purchasable
|
|
28
|
-
product.purchasable?
|
|
29
|
-
end
|
|
27
|
+
attribute :purchasable, &:purchasable?
|
|
30
28
|
|
|
31
29
|
# True when this product is currently offered as a pre-order on the
|
|
32
30
|
# requesting channel.
|
|
33
|
-
attribute :preorder
|
|
34
|
-
product.preorder?
|
|
35
|
-
end
|
|
31
|
+
attribute :preorder, &:preorder?
|
|
36
32
|
|
|
37
|
-
attribute :in_stock
|
|
38
|
-
product.in_stock?
|
|
39
|
-
end
|
|
33
|
+
attribute :in_stock, &:in_stock?
|
|
40
34
|
|
|
41
|
-
attribute :backorderable
|
|
42
|
-
product.backorderable?
|
|
43
|
-
end
|
|
35
|
+
attribute :backorderable, &:backorderable?
|
|
44
36
|
|
|
45
|
-
attribute :available
|
|
46
|
-
product.available?
|
|
47
|
-
end
|
|
37
|
+
attribute :available, &:available?
|
|
48
38
|
|
|
49
39
|
attribute :description do |product|
|
|
50
40
|
next if product.description.blank?
|
|
@@ -60,9 +50,7 @@ module Spree
|
|
|
60
50
|
# buy-box winner: that moves with price and stock, and a client that
|
|
61
51
|
# cached or linked this id must not find it pointing at a different
|
|
62
52
|
# row tomorrow. On a single-seller catalog the two coincide anyway.
|
|
63
|
-
|
|
64
|
-
product.default_variant&.prefixed_id
|
|
65
|
-
end
|
|
53
|
+
prefixed_id_attributes :default_variant
|
|
66
54
|
|
|
67
55
|
# The offer a storefront should lead with when several sellers share
|
|
68
56
|
# the listing — the buy-box winner in the request's currency. Nil when
|
|
@@ -109,9 +97,7 @@ module Spree
|
|
|
109
97
|
# Nil on the marketplace's own first-party products. The id is always
|
|
110
98
|
# present so a storefront can group or link by seller without paying
|
|
111
99
|
# for the expand; `?expand=seller` adds the public profile.
|
|
112
|
-
|
|
113
|
-
product.seller&.prefixed_id
|
|
114
|
-
end
|
|
100
|
+
prefixed_id_attributes :seller
|
|
115
101
|
|
|
116
102
|
# Conditional associations
|
|
117
103
|
one :seller,
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
module Spree
|
|
2
|
+
module Api
|
|
3
|
+
module V3
|
|
4
|
+
# The marketplace's answer on a listing, as the seller sees it and as
|
|
5
|
+
# the `product_submission.*` webhook events carry it.
|
|
6
|
+
#
|
|
7
|
+
# The reviewer's identity is deliberately absent: a seller needs to
|
|
8
|
+
# know what to change, not which member of the marketplace's staff
|
|
9
|
+
# decided (docs/plans/6.0-seller-product-submission.md).
|
|
10
|
+
class ProductSubmissionSerializer < BaseSerializer
|
|
11
|
+
typelize status: [:string, enum: Spree::ProductSubmission.statuses, enum_type_name: 'ProductSubmissionStatus'],
|
|
12
|
+
product_id: :string,
|
|
13
|
+
review_note: [:string, nullable: true],
|
|
14
|
+
reviewed_at: [:string, nullable: true]
|
|
15
|
+
|
|
16
|
+
attributes :status, :review_note,
|
|
17
|
+
reviewed_at: :iso8601,
|
|
18
|
+
created_at: :iso8601
|
|
19
|
+
|
|
20
|
+
# A subscriber holding only the submission id would otherwise have to
|
|
21
|
+
# fetch the row back to learn which product was decided on.
|
|
22
|
+
prefixed_id_attributes :product
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -1,10 +1,29 @@
|
|
|
1
1
|
module Spree
|
|
2
2
|
module Api
|
|
3
3
|
module V3
|
|
4
|
-
# Payload of the purchase_order.* events.
|
|
5
|
-
#
|
|
6
|
-
#
|
|
7
|
-
class PurchaseOrderEventSerializer <
|
|
4
|
+
# Payload of the purchase_order.* events. What was bought and what it
|
|
5
|
+
# costs stay behind the Admin API: an integration reads them there with
|
|
6
|
+
# a key scoped to purchasing.
|
|
7
|
+
class PurchaseOrderEventSerializer < BaseSerializer
|
|
8
|
+
typelize number: :string,
|
|
9
|
+
status: :string,
|
|
10
|
+
supplier_id: [:string, nullable: true],
|
|
11
|
+
destination_location_id: [:string, nullable: true],
|
|
12
|
+
ordered_at: [:string, nullable: true],
|
|
13
|
+
received_at: [:string, nullable: true],
|
|
14
|
+
closed_short_at: [:string, nullable: true]
|
|
15
|
+
|
|
16
|
+
attributes :number, :status,
|
|
17
|
+
ordered_at: :iso8601, received_at: :iso8601, closed_short_at: :iso8601,
|
|
18
|
+
created_at: :iso8601, updated_at: :iso8601
|
|
19
|
+
|
|
20
|
+
attribute :supplier_id do |purchase_order|
|
|
21
|
+
purchase_order.supplier&.prefixed_id
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
attribute :destination_location_id do |purchase_order|
|
|
25
|
+
purchase_order.destination_location&.prefixed_id
|
|
26
|
+
end
|
|
8
27
|
end
|
|
9
28
|
end
|
|
10
29
|
end
|
|
@@ -14,22 +14,14 @@ module Spree
|
|
|
14
14
|
refund.amount&.to_s
|
|
15
15
|
end
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
refund.payment&.prefixed_id
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
attribute :refund_reason_id do |refund|
|
|
22
|
-
refund.reason&.prefixed_id
|
|
23
|
-
end
|
|
17
|
+
prefixed_id_attributes :payment, refund_reason_id: :reason
|
|
24
18
|
|
|
25
19
|
# What triggered this refund — a Return, Exchange or Claim; nil for a
|
|
26
20
|
# manual refund.
|
|
27
|
-
|
|
28
|
-
refund.originator&.prefixed_id
|
|
29
|
-
end
|
|
21
|
+
prefixed_id_attributes :originator
|
|
30
22
|
|
|
31
23
|
attribute :originator_type do |refund|
|
|
32
|
-
refund.originator_type
|
|
24
|
+
Spree::Base.polymorphic_api_type(refund.originator_type)
|
|
33
25
|
end
|
|
34
26
|
end
|
|
35
27
|
end
|
|
@@ -9,31 +9,24 @@ module Spree
|
|
|
9
9
|
resellable: :boolean,
|
|
10
10
|
pre_tax_amount: :string,
|
|
11
11
|
display_pre_tax_amount: :string,
|
|
12
|
+
included_tax_total: :string,
|
|
13
|
+
additional_tax_total: :string,
|
|
14
|
+
tax_total: :string,
|
|
15
|
+
display_tax_total: :string,
|
|
16
|
+
refund_amount: :string,
|
|
17
|
+
display_refund_amount: :string,
|
|
12
18
|
variant_id: [:string, nullable: true],
|
|
13
19
|
line_item_id: [:string, nullable: true],
|
|
14
20
|
fulfillment_item_id: [:string, nullable: true]
|
|
15
21
|
|
|
16
22
|
attributes :quantity, :received_quantity, :resellable
|
|
17
23
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
attribute :variant_id do |line|
|
|
27
|
-
line.variant&.prefixed_id
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
attribute :line_item_id do |line|
|
|
31
|
-
line.line_item&.prefixed_id
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
attribute :fulfillment_item_id do |line|
|
|
35
|
-
line.fulfillment_item&.prefixed_id
|
|
36
|
-
end
|
|
24
|
+
attributes pre_tax_amount: :string, display_pre_tax_amount: :string, included_tax_total: :string,
|
|
25
|
+
additional_tax_total: :string, tax_total: :string, display_tax_total: :string
|
|
26
|
+
# What the line refunds, tax included — for the units that arrived
|
|
27
|
+
# once the warehouse has counted.
|
|
28
|
+
attributes refund_amount: :string, display_refund_amount: :string
|
|
29
|
+
prefixed_id_attributes :variant, :line_item, :fulfillment_item
|
|
37
30
|
|
|
38
31
|
one :variant, resource: proc { Spree.api.variant_serializer }, if: proc { expand?('variant') }
|
|
39
32
|
end
|
|
@@ -12,6 +12,8 @@ module Spree
|
|
|
12
12
|
reason_id: [:string, nullable: true],
|
|
13
13
|
refund_total: :string,
|
|
14
14
|
display_refund_total: :string,
|
|
15
|
+
refund_tax_total: :string,
|
|
16
|
+
display_refund_tax_total: :string,
|
|
15
17
|
approved_at: [:string, nullable: true],
|
|
16
18
|
received_at: [:string, nullable: true],
|
|
17
19
|
refunded_at: [:string, nullable: true],
|
|
@@ -19,22 +21,11 @@ module Spree
|
|
|
19
21
|
|
|
20
22
|
attributes :number, :status
|
|
21
23
|
|
|
22
|
-
|
|
23
|
-
return_record.order&.prefixed_id
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
attribute :reason_id do |return_record|
|
|
27
|
-
return_record.reason&.prefixed_id
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
attribute :refund_total do |return_record|
|
|
31
|
-
return_record.refund_total.to_s
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
attribute :display_refund_total do |return_record|
|
|
35
|
-
return_record.display_refund_total.to_s
|
|
36
|
-
end
|
|
24
|
+
prefixed_id_attributes :order, :reason
|
|
37
25
|
|
|
26
|
+
attributes refund_total: :string, display_refund_total: :string
|
|
27
|
+
# The tax inside refund_total.
|
|
28
|
+
attributes refund_tax_total: :string, display_refund_tax_total: :string
|
|
38
29
|
attribute :approved_at do |return_record|
|
|
39
30
|
return_record.approved_at&.iso8601
|
|
40
31
|
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
module Spree
|
|
2
|
+
module Api
|
|
3
|
+
module V3
|
|
4
|
+
# The event shape for `saved_report.*`: the saved query and who owns it,
|
|
5
|
+
# without the author's name or email, which webhook payloads never carry.
|
|
6
|
+
class SavedReportEventSerializer < BaseSerializer
|
|
7
|
+
typelize name: :string,
|
|
8
|
+
description: [:string, nullable: true],
|
|
9
|
+
query: 'Record<string, unknown>',
|
|
10
|
+
seeded: :boolean,
|
|
11
|
+
user_id: [:string, nullable: true],
|
|
12
|
+
created_at: :string,
|
|
13
|
+
updated_at: :string
|
|
14
|
+
|
|
15
|
+
attributes :name, :description, :query, :seeded, :created_at, :updated_at
|
|
16
|
+
|
|
17
|
+
attribute :user_id do |report|
|
|
18
|
+
report.user&.prefixed_id
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -37,13 +37,7 @@ module Spree
|
|
|
37
37
|
record.seller_id.present?
|
|
38
38
|
end
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
record.delivery_profile&.prefixed_id
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
attribute :delivery_zone_id do |record|
|
|
45
|
-
record.delivery_zone&.prefixed_id
|
|
46
|
-
end
|
|
40
|
+
prefixed_id_attributes :delivery_profile, :delivery_zone
|
|
47
41
|
|
|
48
42
|
attribute :calculator_type do |record|
|
|
49
43
|
record.calculator&.class&.api_type
|
|
@@ -21,13 +21,7 @@ module Spree
|
|
|
21
21
|
attributes :name, :selected, :cost, :total,
|
|
22
22
|
:carrier, :service_level, :estimated_delivery_date
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
delivery_rate.display_cost.to_s
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
attribute :display_total do |delivery_rate|
|
|
29
|
-
delivery_rate.display_total.to_s
|
|
30
|
-
end
|
|
24
|
+
attributes display_cost: :string, display_total: :string
|
|
31
25
|
end
|
|
32
26
|
end
|
|
33
27
|
end
|
|
@@ -16,9 +16,7 @@ module Spree
|
|
|
16
16
|
|
|
17
17
|
# What the panel filters the picker by, so a zone is only offered
|
|
18
18
|
# under the profile it belongs to.
|
|
19
|
-
|
|
20
|
-
record.delivery_profile&.prefixed_id
|
|
21
|
-
end
|
|
19
|
+
prefixed_id_attributes :delivery_profile
|
|
22
20
|
end
|
|
23
21
|
end
|
|
24
22
|
end
|
|
@@ -14,9 +14,7 @@ module Spree
|
|
|
14
14
|
|
|
15
15
|
attributes :memo
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
exchange.stock_location&.prefixed_id
|
|
19
|
-
end
|
|
17
|
+
prefixed_id_attributes :stock_location
|
|
20
18
|
|
|
21
19
|
many :exchange_line_items,
|
|
22
20
|
resource: proc { Spree.api.seller_exchange_line_item_serializer },
|
|
@@ -17,13 +17,7 @@ module Spree
|
|
|
17
17
|
|
|
18
18
|
attributes :quantity
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
item.line_item&.prefixed_id
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
attribute :variant_id do |item|
|
|
25
|
-
item.variant&.prefixed_id
|
|
26
|
-
end
|
|
20
|
+
prefixed_id_attributes :line_item, :variant
|
|
27
21
|
|
|
28
22
|
attribute :name do |item|
|
|
29
23
|
item.line_item&.name
|
|
@@ -47,9 +47,7 @@ module Spree
|
|
|
47
47
|
|
|
48
48
|
# The id as well as the name, so a seller moving the parcel to
|
|
49
49
|
# another of their shelves can see which one it is on now.
|
|
50
|
-
|
|
51
|
-
fulfillment.stock_location&.prefixed_id
|
|
52
|
-
end
|
|
50
|
+
prefixed_id_attributes :stock_location
|
|
53
51
|
|
|
54
52
|
# Deliberately not `items`: the store's fulfillment answers with a
|
|
55
53
|
# manifest under that name, and the shared OpenAPI patch rewrites it
|
|
@@ -60,9 +58,7 @@ module Spree
|
|
|
60
58
|
|
|
61
59
|
# The consignments and labels on this parcel — what a seller adds
|
|
62
60
|
# when they ship it themselves.
|
|
63
|
-
|
|
64
|
-
fulfillment.selected_delivery_rate&.prefixed_id
|
|
65
|
-
end
|
|
61
|
+
prefixed_id_attributes :selected_delivery_rate
|
|
66
62
|
|
|
67
63
|
# What this parcel could be carried by from where it currently sits.
|
|
68
64
|
many :delivery_rates, resource: proc { Spree.api.seller_delivery_rate_serializer }
|
|
@@ -11,23 +11,17 @@ module Spree
|
|
|
11
11
|
# packing a box, and each of which would pull another serializer into
|
|
12
12
|
# this branch's generated types.
|
|
13
13
|
class OrderLineItemSerializer < V3::BaseSerializer
|
|
14
|
-
typelize name: :string,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
quantity: :number,
|
|
18
|
-
currency: :string,
|
|
19
|
-
variant_id: [:string, nullable: true],
|
|
20
|
-
thumbnail_url: [:string, nullable: true],
|
|
21
|
-
price: [:string, nullable: true], display_price: [:string, nullable: true],
|
|
22
|
-
total: [:string, nullable: true], display_total: [:string, nullable: true]
|
|
14
|
+
typelize name: :string, sku: [:string, nullable: true], options_text: [:string, nullable: true],
|
|
15
|
+
quantity: :number, currency: :string, variant_id: [:string, nullable: true],
|
|
16
|
+
thumbnail_url: [:string, nullable: true]
|
|
23
17
|
|
|
24
18
|
attributes :name, :options_text, :quantity, :currency
|
|
25
19
|
|
|
26
|
-
|
|
20
|
+
# The tax charged on top is what a claim refunds beside the goods.
|
|
21
|
+
money_attributes :price, :display_price, :discounted_amount, :display_discounted_amount,
|
|
22
|
+
:additional_tax_total, :total, :display_total
|
|
27
23
|
|
|
28
|
-
|
|
29
|
-
line_item.variant&.prefixed_id
|
|
30
|
-
end
|
|
24
|
+
prefixed_id_attributes :variant
|
|
31
25
|
|
|
32
26
|
# How a seller finds the item on their own shelf.
|
|
33
27
|
attribute :sku do |line_item|
|
|
@@ -21,34 +21,13 @@ module Spree
|
|
|
21
21
|
# the one contact detail that lets a marketplace's customer be taken
|
|
22
22
|
# off it, and it is not needed to pack, post or invoice.
|
|
23
23
|
class OrderSerializer < V3::BaseSerializer
|
|
24
|
-
typelize number: :string,
|
|
25
|
-
customer_note: [:string, nullable: true],
|
|
26
|
-
currency: :string,
|
|
24
|
+
typelize number: :string, customer_note: [:string, nullable: true], currency: :string,
|
|
27
25
|
total_quantity: :number,
|
|
28
26
|
fulfillment_status: [:string, nullable: true, enum: Spree::Order::FULFILLMENT_STATUSES],
|
|
29
27
|
payment_status: [:string, nullable: true, enum: Spree::Order::PAYMENT_STATUSES],
|
|
30
|
-
status: [:string, enum: Spree::Order::STATUSES],
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
discount_total: [:string, nullable: true], display_discount_total: [:string, nullable: true],
|
|
34
|
-
adjustment_total: [:string, nullable: true], display_adjustment_total: [:string, nullable: true],
|
|
35
|
-
included_tax_total: [:string, nullable: true], display_included_tax_total: [:string, nullable: true],
|
|
36
|
-
additional_tax_total: [:string, nullable: true], display_additional_tax_total: [:string, nullable: true],
|
|
37
|
-
tax_total: [:string, nullable: true], display_tax_total: [:string, nullable: true],
|
|
38
|
-
total: [:string, nullable: true], display_total: [:string, nullable: true],
|
|
39
|
-
payment_total: [:string, nullable: true], display_payment_total: [:string, nullable: true],
|
|
40
|
-
amount_due: [:string, nullable: true], display_amount_due: [:string, nullable: true],
|
|
41
|
-
commission_amount_total: [:string, nullable: true],
|
|
42
|
-
display_commission_amount_total: [:string, nullable: true],
|
|
43
|
-
commission_tax_total: [:string, nullable: true],
|
|
44
|
-
display_commission_tax_total: [:string, nullable: true],
|
|
45
|
-
commission_total: [:string, nullable: true],
|
|
46
|
-
display_commission_total: [:string, nullable: true],
|
|
47
|
-
canceled_at: [:string, nullable: true],
|
|
48
|
-
cancel_reason_name: [:string, nullable: true],
|
|
49
|
-
cancel_note: [:string, nullable: true],
|
|
50
|
-
internal_note: [:string, nullable: true],
|
|
51
|
-
internal_note_html: [:string, nullable: true]
|
|
28
|
+
status: [:string, enum: Spree::Order::STATUSES], canceled_at: [:string, nullable: true],
|
|
29
|
+
cancel_reason_name: [:string, nullable: true], cancel_note: [:string, nullable: true],
|
|
30
|
+
internal_note: [:string, nullable: true], internal_note_html: [:string, nullable: true]
|
|
52
31
|
|
|
53
32
|
attributes :number, :customer_note, :currency, :total_quantity,
|
|
54
33
|
:status, :fulfillment_status, :payment_status,
|
|
@@ -6,7 +6,7 @@ module Spree
|
|
|
6
6
|
class PayoutSerializer < V3::BaseSerializer
|
|
7
7
|
typelize status: :string,
|
|
8
8
|
currency: :string,
|
|
9
|
-
provider: :string,
|
|
9
|
+
provider: [:string, comment: 'Payout provider. Built-in: system. Provider gems register more (e.g. stripe).'],
|
|
10
10
|
amount: :string,
|
|
11
11
|
display_amount: :string,
|
|
12
12
|
reference: 'string | null',
|
|
@@ -14,7 +14,7 @@ module Spree
|
|
|
14
14
|
period_end: 'string | null',
|
|
15
15
|
transfers_count: :number
|
|
16
16
|
|
|
17
|
-
attributes :status, :currency, :
|
|
17
|
+
attributes :status, :currency, :reference,
|
|
18
18
|
period_start: :iso8601, period_end: :iso8601,
|
|
19
19
|
created_at: :iso8601, updated_at: :iso8601
|
|
20
20
|
|
|
@@ -29,6 +29,8 @@ module Spree
|
|
|
29
29
|
|
|
30
30
|
counts ? counts.fetch(payout.id, 0) : payout.transfers.count
|
|
31
31
|
end
|
|
32
|
+
|
|
33
|
+
api_type_attributes :provider
|
|
32
34
|
end
|
|
33
35
|
end
|
|
34
36
|
end
|
|
@@ -20,13 +20,7 @@ module Spree
|
|
|
20
20
|
|
|
21
21
|
attributes :status, :metadata, created_at: :iso8601, updated_at: :iso8601
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
product.product_type&.prefixed_id
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
attribute :delivery_profile_id do |product|
|
|
28
|
-
product.delivery_profile&.prefixed_id
|
|
29
|
-
end
|
|
23
|
+
prefixed_id_attributes :product_type, :delivery_profile
|
|
30
24
|
|
|
31
25
|
many :variants,
|
|
32
26
|
resource: proc { Spree.api.seller_variant_serializer },
|
|
@@ -2,27 +2,7 @@ module Spree
|
|
|
2
2
|
module Api
|
|
3
3
|
module V3
|
|
4
4
|
module Seller
|
|
5
|
-
|
|
6
|
-
#
|
|
7
|
-
# The reviewer's identity is deliberately absent: a seller needs to
|
|
8
|
-
# know what to change, not which member of the marketplace's staff
|
|
9
|
-
# decided (docs/plans/6.0-seller-product-submission.md).
|
|
10
|
-
class ProductSubmissionSerializer < BaseSerializer
|
|
11
|
-
typelize status: [:string, enum: Spree::ProductSubmission.statuses, enum_type_name: 'ProductSubmissionStatus'],
|
|
12
|
-
product_id: :string,
|
|
13
|
-
review_note: [:string, nullable: true],
|
|
14
|
-
reviewed_at: [:string, nullable: true]
|
|
15
|
-
|
|
16
|
-
attributes :status, :review_note,
|
|
17
|
-
reviewed_at: :iso8601,
|
|
18
|
-
created_at: :iso8601
|
|
19
|
-
|
|
20
|
-
# Carried for the event payload, which is this serializer's other
|
|
21
|
-
# job: a subscriber holding only the submission id would have to
|
|
22
|
-
# fetch the row back to learn which product was decided on.
|
|
23
|
-
attribute :product_id do |submission|
|
|
24
|
-
submission.product&.prefixed_id
|
|
25
|
-
end
|
|
5
|
+
class ProductSubmissionSerializer < V3::ProductSubmissionSerializer
|
|
26
6
|
end
|
|
27
7
|
end
|
|
28
8
|
end
|
|
@@ -40,13 +40,9 @@ module Spree
|
|
|
40
40
|
resource: proc { Spree.api.seller_policy_serializer },
|
|
41
41
|
if: proc { expand?('policies') }
|
|
42
42
|
|
|
43
|
-
attribute :on_holiday
|
|
44
|
-
seller.on_holiday?
|
|
45
|
-
end
|
|
43
|
+
attribute :on_holiday, &:on_holiday?
|
|
46
44
|
|
|
47
|
-
attribute :sellable
|
|
48
|
-
seller.sellable?
|
|
49
|
-
end
|
|
45
|
+
attribute :sellable, &:sellable?
|
|
50
46
|
|
|
51
47
|
# What this seller prices in. Theirs by way of the marketplace: a
|
|
52
48
|
# seller has no currency of their own, so the store's is the answer
|
|
@@ -18,9 +18,7 @@ module Spree
|
|
|
18
18
|
|
|
19
19
|
attributes :id, :kind, :name, :description, :required, :position, :status, :action_url, :blocker
|
|
20
20
|
|
|
21
|
-
attribute :blocking
|
|
22
|
-
status.blocking?
|
|
23
|
-
end
|
|
21
|
+
attribute :blocking, &:blocking?
|
|
24
22
|
|
|
25
23
|
attribute :accepts_submissions do |status|
|
|
26
24
|
status.requirement.class.accepts_submissions?
|
|
@@ -36,15 +34,11 @@ module Spree
|
|
|
36
34
|
|
|
37
35
|
# The document this line asks for, so the panel can offer to create
|
|
38
36
|
# exactly that policy. Null for every other kind.
|
|
39
|
-
|
|
40
|
-
status.required_policy_name
|
|
41
|
-
end
|
|
37
|
+
attributes :required_policy_name
|
|
42
38
|
|
|
43
39
|
# The marketplace terms this line asks the seller to accept. Null
|
|
44
40
|
# for every other kind, and null while nothing has been written.
|
|
45
|
-
|
|
46
|
-
status.terms_html
|
|
47
|
-
end
|
|
41
|
+
attributes :terms_html
|
|
48
42
|
|
|
49
43
|
one :submission,
|
|
50
44
|
resource: proc { Spree.api.seller_requirement_submission_serializer },
|