Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Move invoices to Orders API reference category (#12471)
Marcin Gębalabe06b9b569b0
diff --git a/saleor/graphql/core/doc_category.py b/saleor/graphql/core/doc_category.pyindex 19acaa6530..6f8ce26dc2 100644--- a/saleor/graphql/core/doc_category.py+++ b/saleor/graphql/core/doc_category.py@@ -35,6 +35,8 @@ DOC_CATEGORY_MAP = {"discount.VoucherChannelListing": DOC_CATEGORY_DISCOUNTS,"discount.Voucher": DOC_CATEGORY_DISCOUNTS,"discount.OrderDiscount": DOC_CATEGORY_DISCOUNTS,+ "invoice.Invoice": DOC_CATEGORY_ORDERS,+ "invoice.InvoiceEvent": DOC_CATEGORY_ORDERS,"giftcard.GiftCard": DOC_CATEGORY_GIFT_CARDS,"giftcard.GiftCardTag": DOC_CATEGORY_GIFT_CARDS,"giftcard.GiftEvent": DOC_CATEGORY_GIFT_CARDS,diff --git a/saleor/graphql/core/enums.py b/saleor/graphql/core/enums.pyindex f0e20019a2..bd30c941cb 100644--- a/saleor/graphql/core/enums.py+++ b/saleor/graphql/core/enums.py@@ -198,6 +198,7 @@ OrderErrorCode = graphene.Enum.from_enum(order_error_codes.OrderErrorCode)OrderErrorCode.doc_category = DOC_CATEGORY_ORDERSInvoiceErrorCode = graphene.Enum.from_enum(invoice_error_codes.InvoiceErrorCode)+InvoiceErrorCode.doc_category = DOC_CATEGORY_ORDERSPageErrorCode = graphene.Enum.from_enum(page_error_codes.PageErrorCode)PageErrorCode.doc_category = DOC_CATEGORY_PAGESdiff --git a/saleor/graphql/core/types/common.py b/saleor/graphql/core/types/common.pyindex e4278390e6..c5f764cf08 100644--- a/saleor/graphql/core/types/common.py+++ b/saleor/graphql/core/types/common.py@@ -331,6 +331,9 @@ class OrderError(Error):class InvoiceError(Error):code = InvoiceErrorCode(description="The error code.", required=True)+ class Meta:+ doc_category = DOC_CATEGORY_ORDERS+class PermissionGroupError(Error):code = PermissionGroupErrorCode(description="The error code.", required=True)diff --git a/saleor/graphql/invoice/mutations.py b/saleor/graphql/invoice/mutations.pyindex cb137752c9..f0b5ad6d37 100644--- a/saleor/graphql/invoice/mutations.py+++ b/saleor/graphql/invoice/mutations.py@@ -12,8 +12,9 @@ from ...order import events as order_eventsfrom ...permission.enums import OrderPermissionsfrom ..app.dataloaders import get_app_promisefrom ..core import ResolveInfo+from ..core.doc_category import DOC_CATEGORY_ORDERSfrom ..core.mutations import ModelDeleteMutation, ModelMutation-from ..core.types import InvoiceError+from ..core.types import BaseInputObjectType, InvoiceErrorfrom ..order.types import Orderfrom ..plugins.dataloaders import get_plugin_manager_promisefrom .types import Invoice@@ -109,10 +110,13 @@ class InvoiceRequest(ModelMutation):return InvoiceRequest(invoice=invoice, order=order)-class InvoiceCreateInput(graphene.InputObjectType):+class InvoiceCreateInput(BaseInputObjectType):number = graphene.String(required=True, description="Invoice number.")url = graphene.String(required=True, description="URL of an invoice to download.")+ class Meta:+ doc_category = DOC_CATEGORY_ORDERS+class InvoiceCreate(ModelMutation):class Arguments:@@ -247,10 +251,13 @@ class InvoiceDelete(ModelDeleteMutation):return response-class UpdateInvoiceInput(graphene.InputObjectType):+class UpdateInvoiceInput(BaseInputObjectType):number = graphene.String(description="Invoice number")url = graphene.String(description="URL of an invoice to download.")+ class Meta:+ doc_category = DOC_CATEGORY_ORDERS+class InvoiceUpdate(ModelMutation):class Arguments:diff --git a/saleor/graphql/schema.graphql b/saleor/graphql/schema.graphqlindex 968cf4843f..2bb80f00f7 100644--- a/saleor/graphql/schema.graphql+++ b/saleor/graphql/schema.graphql@@ -10724,7 +10724,7 @@ enum OrderAction @doc(category: "Payments") {}"""Represents an Invoice."""-type Invoice implements ObjectWithMetadata & Job & Node {+type Invoice implements ObjectWithMetadata & Job & Node @doc(category: "Orders") {"""List of private metadata items. Requires staff permissions to access."""privateMetadata: [MetadataItem!]!@@ -15198,7 +15198,7 @@ type Mutation {"""ID of the order related to invoice."""orderId: ID!- ): InvoiceRequest+ ): InvoiceRequest @doc(category: "Orders")"""Requests deletion of an invoice.@@ -15208,7 +15208,7 @@ type Mutation {invoiceRequestDelete("""ID of an invoice to request the deletion."""id: ID!- ): InvoiceRequestDelete+ ): InvoiceRequestDelete @doc(category: "Orders")"""Creates a ready to send invoice.@@ -15221,7 +15221,7 @@ type Mutation {"""ID of the order related to invoice."""orderId: ID!- ): InvoiceCreate+ ): InvoiceCreate @doc(category: "Orders")"""Deletes an invoice.@@ -15231,7 +15231,7 @@ type Mutation {invoiceDelete("""ID of an invoice to delete."""id: ID!- ): InvoiceDelete+ ): InvoiceDelete @doc(category: "Orders")"""Updates an invoice.@@ -15244,7 +15244,7 @@ type Mutation {"""Fields to use when updating an invoice."""input: UpdateInvoiceInput!- ): InvoiceUpdate+ ): InvoiceUpdate @doc(category: "Orders")"""Send an invoice notification to the customer.@@ -15254,7 +15254,7 @@ type Mutation {invoiceSendNotification("""ID of an invoice to be sent."""id: ID!- ): InvoiceSendNotification+ ): InvoiceSendNotification @doc(category: "Orders")"""Activate a gift card.@@ -22738,7 +22738,7 @@ Request an invoice for the order using plugin.Requires one of the following permissions: MANAGE_ORDERS."""-type InvoiceRequest {+type InvoiceRequest @doc(category: "Orders") {"""Order related to an invoice."""order: OrderinvoiceErrors: [InvoiceError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")@@ -22746,7 +22746,7 @@ type InvoiceRequest {invoice: Invoice}-type InvoiceError {+type InvoiceError @doc(category: "Orders") {"""Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field."""@@ -22760,7 +22760,7 @@ type InvoiceError {}"""An enumeration."""-enum InvoiceErrorCode {+enum InvoiceErrorCode @doc(category: "Orders") {REQUIREDNOT_READYURL_NOT_SET@@ -22776,7 +22776,7 @@ Requests deletion of an invoice.Requires one of the following permissions: MANAGE_ORDERS."""-type InvoiceRequestDelete {+type InvoiceRequestDelete @doc(category: "Orders") {invoiceErrors: [InvoiceError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [InvoiceError!]!invoice: Invoice@@ -22787,13 +22787,13 @@ Creates a ready to send invoice.Requires one of the following permissions: MANAGE_ORDERS."""-type InvoiceCreate {+type InvoiceCreate @doc(category: "Orders") {invoiceErrors: [InvoiceError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [InvoiceError!]!invoice: Invoice}-input InvoiceCreateInput {+input InvoiceCreateInput @doc(category: "Orders") {"""Invoice number."""number: String!@@ -22806,7 +22806,7 @@ Deletes an invoice.Requires one of the following permissions: MANAGE_ORDERS."""-type InvoiceDelete {+type InvoiceDelete @doc(category: "Orders") {invoiceErrors: [InvoiceError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [InvoiceError!]!invoice: Invoice@@ -22817,13 +22817,13 @@ Updates an invoice.Requires one of the following permissions: MANAGE_ORDERS."""-type InvoiceUpdate {+type InvoiceUpdate @doc(category: "Orders") {invoiceErrors: [InvoiceError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [InvoiceError!]!invoice: Invoice}-input UpdateInvoiceInput {+input UpdateInvoiceInput @doc(category: "Orders") {"""Invoice number"""number: String@@ -22836,7 +22836,7 @@ Send an invoice notification to the customer.Requires one of the following permissions: MANAGE_ORDERS."""-type InvoiceSendNotification {+type InvoiceSendNotification @doc(category: "Orders") {invoiceErrors: [InvoiceError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [InvoiceError!]!invoice: Invoice@@ -27604,7 +27604,7 @@ Added in Saleor 3.2.Note: this API is currently in Feature Preview and can be subject to changes at later point."""-type InvoiceRequested implements Event {+type InvoiceRequested implements Event @doc(category: "Orders") {"""Time of the event."""issuedAt: DateTime@@ -27635,7 +27635,7 @@ Added in Saleor 3.2.Note: this API is currently in Feature Preview and can be subject to changes at later point."""-type InvoiceDeleted implements Event {+type InvoiceDeleted implements Event @doc(category: "Orders") {"""Time of the event."""issuedAt: DateTime@@ -27666,7 +27666,7 @@ Added in Saleor 3.2.Note: this API is currently in Feature Preview and can be subject to changes at later point."""-type InvoiceSent implements Event {+type InvoiceSent implements Event @doc(category: "Orders") {"""Time of the event."""issuedAt: DateTime