Przeglądaj źródła

chore: Remove references to OrderItem from schema

Michael Bromley 2 lat temu
rodzic
commit
54953c5173
26 zmienionych plików z 41 dodań i 464 usunięć
  1. 2 42
      packages/admin-ui/src/lib/core/src/common/generated-types.ts
  2. 0 1
      packages/admin-ui/src/lib/core/src/common/introspection-result.ts
  3. 2 41
      packages/asset-server-plugin/e2e/graphql/generated-e2e-asset-server-plugin-types.ts
  4. 1 1
      packages/asset-server-plugin/src/s3-asset-storage-strategy.ts
  5. 2 39
      packages/common/src/generated-shop-types.ts
  6. 2 42
      packages/common/src/generated-types.ts
  7. 2 41
      packages/core/e2e/graphql/generated-e2e-admin-types.ts
  8. 2 38
      packages/core/e2e/graphql/generated-e2e-shop-types.ts
  9. 2 2
      packages/core/e2e/order-taxes.e2e-spec.ts
  10. 1 1
      packages/core/e2e/stock-control.e2e-spec.ts
  11. 0 3
      packages/core/src/api/schema/admin-api/stock-movement.type.graphql
  12. 2 38
      packages/core/src/api/schema/common/order.type.graphql
  13. 1 1
      packages/core/src/config/order/changed-price-handling-strategy.ts
  14. 1 1
      packages/core/src/config/order/order-item-price-calculation-strategy.ts
  15. 4 4
      packages/core/src/config/promotion/promotion-action.ts
  16. 1 1
      packages/core/src/config/tax/default-tax-line-calculation-strategy.ts
  17. 3 3
      packages/core/src/config/vendure-config.ts
  18. 2 3
      packages/core/src/service/helpers/order-calculator/order-calculator.ts
  19. 2 2
      packages/core/src/service/helpers/order-modifier/order-modifier.ts
  20. 1 1
      packages/core/src/service/services/order.service.ts
  21. 2 41
      packages/elasticsearch-plugin/e2e/graphql/generated-e2e-elasticsearch-plugin-types.ts
  22. 2 41
      packages/payments-plugin/e2e/graphql/generated-admin-types.ts
  23. 2 38
      packages/payments-plugin/e2e/graphql/generated-shop-types.ts
  24. 2 39
      packages/payments-plugin/src/mollie/graphql/generated-shop-types.ts
  25. 0 0
      schema-admin.json
  26. 0 0
      schema-shop.json

+ 2 - 42
packages/admin-ui/src/lib/core/src/common/generated-types.ts

@@ -3851,7 +3851,7 @@ export type Order = Node & {
   state: Scalars['String'];
   /**
    * The subTotal is the total of all OrderLines in the Order. This figure also includes any Order-level
-   * discounts which have been prorated (proportionally distributed) amongst the OrderItems.
+   * discounts which have been prorated (proportionally distributed) amongst the items of each OrderLine.
    * To get a total of all OrderLines which does not account for prorated discounts, use the
    * sum of `OrderLine.discountedLinePrice` values.
    */
@@ -3918,43 +3918,6 @@ export type OrderFilterParameter = {
   updatedAt?: InputMaybe<DateOperators>;
 };
 
-export type OrderItem = Node & {
-  __typename?: 'OrderItem';
-  adjustments: Array<Adjustment>;
-  cancelled: Scalars['Boolean'];
-  createdAt: Scalars['DateTime'];
-  /**
-   * The price of a single unit including discounts, excluding tax.
-   *
-   * If Order-level discounts have been applied, this will not be the
-   * actual taxable unit price (see `proratedUnitPrice`), but is generally the
-   * correct price to display to customers to avoid confusion
-   * about the internal handling of distributed Order-level discounts.
-   */
-  discountedUnitPrice: Scalars['Money'];
-  /** The price of a single unit including discounts and tax */
-  discountedUnitPriceWithTax: Scalars['Money'];
-  fulfillment?: Maybe<Fulfillment>;
-  id: Scalars['ID'];
-  /**
-   * The actual unit price, taking into account both item discounts _and_ prorated (proportionally-distributed)
-   * Order-level discounts. This value is the true economic value of the OrderItem, and is used in tax
-   * and refund calculations.
-   */
-  proratedUnitPrice: Scalars['Money'];
-  /** The proratedUnitPrice including tax */
-  proratedUnitPriceWithTax: Scalars['Money'];
-  refundId?: Maybe<Scalars['ID']>;
-  taxLines: Array<TaxLine>;
-  taxRate: Scalars['Float'];
-  /** The price of a single unit, excluding tax and discounts */
-  unitPrice: Scalars['Money'];
-  /** The price of a single unit, including tax but excluding discounts */
-  unitPriceWithTax: Scalars['Money'];
-  unitTax: Scalars['Money'];
-  updatedAt: Scalars['DateTime'];
-};
-
 /** Returned when the maximum order size limit has been reached. */
 export type OrderLimitError = ErrorResult & {
   __typename?: 'OrderLimitError';
@@ -4130,7 +4093,7 @@ export type OrderTaxSummary = {
   __typename?: 'OrderTaxSummary';
   /** A description of this tax */
   description: Scalars['String'];
-  /** The total net price or OrderItems to which this taxRate applies */
+  /** The total net price of OrderLines to which this taxRate applies */
   taxBase: Scalars['Money'];
   /** The taxRate as a percentage */
   taxRate: Scalars['Float'];
@@ -5434,7 +5397,6 @@ export type Release = Node & StockMovement & {
   __typename?: 'Release';
   createdAt: Scalars['DateTime'];
   id: Scalars['ID'];
-  orderItem: OrderItem;
   productVariant: ProductVariant;
   quantity: Scalars['Int'];
   type: StockMovementType;
@@ -5492,7 +5454,6 @@ export type Return = Node & StockMovement & {
   __typename?: 'Return';
   createdAt: Scalars['DateTime'];
   id: Scalars['ID'];
-  orderItem: OrderItem;
   productVariant: ProductVariant;
   quantity: Scalars['Int'];
   type: StockMovementType;
@@ -5549,7 +5510,6 @@ export type Sale = Node & StockMovement & {
   __typename?: 'Sale';
   createdAt: Scalars['DateTime'];
   id: Scalars['ID'];
-  orderItem: OrderItem;
   productVariant: ProductVariant;
   quantity: Scalars['Int'];
   type: StockMovementType;

+ 0 - 1
packages/admin-ui/src/lib/core/src/common/introspection-result.ts

@@ -161,7 +161,6 @@
       "HistoryEntry",
       "Job",
       "Order",
-      "OrderItem",
       "OrderLine",
       "OrderModification",
       "Payment",

+ 2 - 41
packages/asset-server-plugin/e2e/graphql/generated-e2e-asset-server-plugin-types.ts

@@ -3689,7 +3689,7 @@ export type Order = Node & {
   state: Scalars['String'];
   /**
    * The subTotal is the total of all OrderLines in the Order. This figure also includes any Order-level
-   * discounts which have been prorated (proportionally distributed) amongst the OrderItems.
+   * discounts which have been prorated (proportionally distributed) amongst the items of each OrderLine.
    * To get a total of all OrderLines which does not account for prorated discounts, use the
    * sum of `OrderLine.discountedLinePrice` values.
    */
@@ -3755,42 +3755,6 @@ export type OrderFilterParameter = {
   updatedAt?: InputMaybe<DateOperators>;
 };
 
-export type OrderItem = Node & {
-  adjustments: Array<Adjustment>;
-  cancelled: Scalars['Boolean'];
-  createdAt: Scalars['DateTime'];
-  /**
-   * The price of a single unit including discounts, excluding tax.
-   *
-   * If Order-level discounts have been applied, this will not be the
-   * actual taxable unit price (see `proratedUnitPrice`), but is generally the
-   * correct price to display to customers to avoid confusion
-   * about the internal handling of distributed Order-level discounts.
-   */
-  discountedUnitPrice: Scalars['Money'];
-  /** The price of a single unit including discounts and tax */
-  discountedUnitPriceWithTax: Scalars['Money'];
-  fulfillment?: Maybe<Fulfillment>;
-  id: Scalars['ID'];
-  /**
-   * The actual unit price, taking into account both item discounts _and_ prorated (proportionally-distributed)
-   * Order-level discounts. This value is the true economic value of the OrderItem, and is used in tax
-   * and refund calculations.
-   */
-  proratedUnitPrice: Scalars['Money'];
-  /** The proratedUnitPrice including tax */
-  proratedUnitPriceWithTax: Scalars['Money'];
-  refundId?: Maybe<Scalars['ID']>;
-  taxLines: Array<TaxLine>;
-  taxRate: Scalars['Float'];
-  /** The price of a single unit, excluding tax and discounts */
-  unitPrice: Scalars['Money'];
-  /** The price of a single unit, including tax but excluding discounts */
-  unitPriceWithTax: Scalars['Money'];
-  unitTax: Scalars['Money'];
-  updatedAt: Scalars['DateTime'];
-};
-
 /** Returned when the maximum order size limit has been reached. */
 export type OrderLimitError = ErrorResult & {
   errorCode: ErrorCode;
@@ -3956,7 +3920,7 @@ export type OrderStateTransitionError = ErrorResult & {
 export type OrderTaxSummary = {
   /** A description of this tax */
   description: Scalars['String'];
-  /** The total net price or OrderItems to which this taxRate applies */
+  /** The total net price of OrderLines to which this taxRate applies */
   taxBase: Scalars['Money'];
   /** The taxRate as a percentage */
   taxRate: Scalars['Float'];
@@ -5219,7 +5183,6 @@ export type RelationCustomFieldConfig = CustomField & {
 export type Release = Node & StockMovement & {
   createdAt: Scalars['DateTime'];
   id: Scalars['ID'];
-  orderItem: OrderItem;
   productVariant: ProductVariant;
   quantity: Scalars['Int'];
   type: StockMovementType;
@@ -5276,7 +5239,6 @@ export type RemoveStockLocationsFromChannelInput = {
 export type Return = Node & StockMovement & {
   createdAt: Scalars['DateTime'];
   id: Scalars['ID'];
-  orderItem: OrderItem;
   productVariant: ProductVariant;
   quantity: Scalars['Int'];
   type: StockMovementType;
@@ -5330,7 +5292,6 @@ export type RoleSortParameter = {
 export type Sale = Node & StockMovement & {
   createdAt: Scalars['DateTime'];
   id: Scalars['ID'];
-  orderItem: OrderItem;
   productVariant: ProductVariant;
   quantity: Scalars['Int'];
   type: StockMovementType;

+ 1 - 1
packages/asset-server-plugin/src/s3-asset-storage-strategy.ts

@@ -101,7 +101,7 @@ export interface S3Config {
  *       },
  *       nativeS3Configuration: {
  *         endpoint: process.env.MINIO_ENDPOINT ?? 'http://localhost:9000',
- *         s3ForcePathStyle: true,
+ *         forcePathStyle: true,
  *         signatureVersion: 'v4',
  *       },
  *     }),

+ 2 - 39
packages/common/src/generated-shop-types.ts

@@ -1916,7 +1916,7 @@ export type Order = Node & {
   state: Scalars['String'];
   /**
    * The subTotal is the total of all OrderLines in the Order. This figure also includes any Order-level
-   * discounts which have been prorated (proportionally distributed) amongst the OrderItems.
+   * discounts which have been prorated (proportionally distributed) amongst the items of each OrderLine.
    * To get a total of all OrderLines which does not account for prorated discounts, use the
    * sum of `OrderLine.discountedLinePrice` values.
    */
@@ -1980,43 +1980,6 @@ export type OrderFilterParameter = {
   updatedAt?: InputMaybe<DateOperators>;
 };
 
-export type OrderItem = Node & {
-  __typename?: 'OrderItem';
-  adjustments: Array<Adjustment>;
-  cancelled: Scalars['Boolean'];
-  createdAt: Scalars['DateTime'];
-  /**
-   * The price of a single unit including discounts, excluding tax.
-   *
-   * If Order-level discounts have been applied, this will not be the
-   * actual taxable unit price (see `proratedUnitPrice`), but is generally the
-   * correct price to display to customers to avoid confusion
-   * about the internal handling of distributed Order-level discounts.
-   */
-  discountedUnitPrice: Scalars['Money'];
-  /** The price of a single unit including discounts and tax */
-  discountedUnitPriceWithTax: Scalars['Money'];
-  fulfillment?: Maybe<Fulfillment>;
-  id: Scalars['ID'];
-  /**
-   * The actual unit price, taking into account both item discounts _and_ prorated (proportionally-distributed)
-   * Order-level discounts. This value is the true economic value of the OrderItem, and is used in tax
-   * and refund calculations.
-   */
-  proratedUnitPrice: Scalars['Money'];
-  /** The proratedUnitPrice including tax */
-  proratedUnitPriceWithTax: Scalars['Money'];
-  refundId?: Maybe<Scalars['ID']>;
-  taxLines: Array<TaxLine>;
-  taxRate: Scalars['Float'];
-  /** The price of a single unit, excluding tax and discounts */
-  unitPrice: Scalars['Money'];
-  /** The price of a single unit, including tax but excluding discounts */
-  unitPriceWithTax: Scalars['Money'];
-  unitTax: Scalars['Money'];
-  updatedAt: Scalars['DateTime'];
-};
-
 /** Returned when the maximum order size limit has been reached. */
 export type OrderLimitError = ErrorResult & {
   __typename?: 'OrderLimitError';
@@ -2155,7 +2118,7 @@ export type OrderTaxSummary = {
   __typename?: 'OrderTaxSummary';
   /** A description of this tax */
   description: Scalars['String'];
-  /** The total net price or OrderItems to which this taxRate applies */
+  /** The total net price of OrderLines to which this taxRate applies */
   taxBase: Scalars['Money'];
   /** The taxRate as a percentage */
   taxRate: Scalars['Float'];

+ 2 - 42
packages/common/src/generated-types.ts

@@ -3777,7 +3777,7 @@ export type Order = Node & {
   state: Scalars['String'];
   /**
    * The subTotal is the total of all OrderLines in the Order. This figure also includes any Order-level
-   * discounts which have been prorated (proportionally distributed) amongst the OrderItems.
+   * discounts which have been prorated (proportionally distributed) amongst the items of each OrderLine.
    * To get a total of all OrderLines which does not account for prorated discounts, use the
    * sum of `OrderLine.discountedLinePrice` values.
    */
@@ -3844,43 +3844,6 @@ export type OrderFilterParameter = {
   updatedAt?: InputMaybe<DateOperators>;
 };
 
-export type OrderItem = Node & {
-  __typename?: 'OrderItem';
-  adjustments: Array<Adjustment>;
-  cancelled: Scalars['Boolean'];
-  createdAt: Scalars['DateTime'];
-  /**
-   * The price of a single unit including discounts, excluding tax.
-   *
-   * If Order-level discounts have been applied, this will not be the
-   * actual taxable unit price (see `proratedUnitPrice`), but is generally the
-   * correct price to display to customers to avoid confusion
-   * about the internal handling of distributed Order-level discounts.
-   */
-  discountedUnitPrice: Scalars['Money'];
-  /** The price of a single unit including discounts and tax */
-  discountedUnitPriceWithTax: Scalars['Money'];
-  fulfillment?: Maybe<Fulfillment>;
-  id: Scalars['ID'];
-  /**
-   * The actual unit price, taking into account both item discounts _and_ prorated (proportionally-distributed)
-   * Order-level discounts. This value is the true economic value of the OrderItem, and is used in tax
-   * and refund calculations.
-   */
-  proratedUnitPrice: Scalars['Money'];
-  /** The proratedUnitPrice including tax */
-  proratedUnitPriceWithTax: Scalars['Money'];
-  refundId?: Maybe<Scalars['ID']>;
-  taxLines: Array<TaxLine>;
-  taxRate: Scalars['Float'];
-  /** The price of a single unit, excluding tax and discounts */
-  unitPrice: Scalars['Money'];
-  /** The price of a single unit, including tax but excluding discounts */
-  unitPriceWithTax: Scalars['Money'];
-  unitTax: Scalars['Money'];
-  updatedAt: Scalars['DateTime'];
-};
-
 /** Returned when the maximum order size limit has been reached. */
 export type OrderLimitError = ErrorResult & {
   __typename?: 'OrderLimitError';
@@ -4056,7 +4019,7 @@ export type OrderTaxSummary = {
   __typename?: 'OrderTaxSummary';
   /** A description of this tax */
   description: Scalars['String'];
-  /** The total net price or OrderItems to which this taxRate applies */
+  /** The total net price of OrderLines to which this taxRate applies */
   taxBase: Scalars['Money'];
   /** The taxRate as a percentage */
   taxRate: Scalars['Float'];
@@ -5356,7 +5319,6 @@ export type Release = Node & StockMovement & {
   __typename?: 'Release';
   createdAt: Scalars['DateTime'];
   id: Scalars['ID'];
-  orderItem: OrderItem;
   productVariant: ProductVariant;
   quantity: Scalars['Int'];
   type: StockMovementType;
@@ -5414,7 +5376,6 @@ export type Return = Node & StockMovement & {
   __typename?: 'Return';
   createdAt: Scalars['DateTime'];
   id: Scalars['ID'];
-  orderItem: OrderItem;
   productVariant: ProductVariant;
   quantity: Scalars['Int'];
   type: StockMovementType;
@@ -5471,7 +5432,6 @@ export type Sale = Node & StockMovement & {
   __typename?: 'Sale';
   createdAt: Scalars['DateTime'];
   id: Scalars['ID'];
-  orderItem: OrderItem;
   productVariant: ProductVariant;
   quantity: Scalars['Int'];
   type: StockMovementType;

+ 2 - 41
packages/core/e2e/graphql/generated-e2e-admin-types.ts

@@ -3689,7 +3689,7 @@ export type Order = Node & {
   state: Scalars['String'];
   /**
    * The subTotal is the total of all OrderLines in the Order. This figure also includes any Order-level
-   * discounts which have been prorated (proportionally distributed) amongst the OrderItems.
+   * discounts which have been prorated (proportionally distributed) amongst the items of each OrderLine.
    * To get a total of all OrderLines which does not account for prorated discounts, use the
    * sum of `OrderLine.discountedLinePrice` values.
    */
@@ -3755,42 +3755,6 @@ export type OrderFilterParameter = {
   updatedAt?: InputMaybe<DateOperators>;
 };
 
-export type OrderItem = Node & {
-  adjustments: Array<Adjustment>;
-  cancelled: Scalars['Boolean'];
-  createdAt: Scalars['DateTime'];
-  /**
-   * The price of a single unit including discounts, excluding tax.
-   *
-   * If Order-level discounts have been applied, this will not be the
-   * actual taxable unit price (see `proratedUnitPrice`), but is generally the
-   * correct price to display to customers to avoid confusion
-   * about the internal handling of distributed Order-level discounts.
-   */
-  discountedUnitPrice: Scalars['Money'];
-  /** The price of a single unit including discounts and tax */
-  discountedUnitPriceWithTax: Scalars['Money'];
-  fulfillment?: Maybe<Fulfillment>;
-  id: Scalars['ID'];
-  /**
-   * The actual unit price, taking into account both item discounts _and_ prorated (proportionally-distributed)
-   * Order-level discounts. This value is the true economic value of the OrderItem, and is used in tax
-   * and refund calculations.
-   */
-  proratedUnitPrice: Scalars['Money'];
-  /** The proratedUnitPrice including tax */
-  proratedUnitPriceWithTax: Scalars['Money'];
-  refundId?: Maybe<Scalars['ID']>;
-  taxLines: Array<TaxLine>;
-  taxRate: Scalars['Float'];
-  /** The price of a single unit, excluding tax and discounts */
-  unitPrice: Scalars['Money'];
-  /** The price of a single unit, including tax but excluding discounts */
-  unitPriceWithTax: Scalars['Money'];
-  unitTax: Scalars['Money'];
-  updatedAt: Scalars['DateTime'];
-};
-
 /** Returned when the maximum order size limit has been reached. */
 export type OrderLimitError = ErrorResult & {
   errorCode: ErrorCode;
@@ -3956,7 +3920,7 @@ export type OrderStateTransitionError = ErrorResult & {
 export type OrderTaxSummary = {
   /** A description of this tax */
   description: Scalars['String'];
-  /** The total net price or OrderItems to which this taxRate applies */
+  /** The total net price of OrderLines to which this taxRate applies */
   taxBase: Scalars['Money'];
   /** The taxRate as a percentage */
   taxRate: Scalars['Float'];
@@ -5219,7 +5183,6 @@ export type RelationCustomFieldConfig = CustomField & {
 export type Release = Node & StockMovement & {
   createdAt: Scalars['DateTime'];
   id: Scalars['ID'];
-  orderItem: OrderItem;
   productVariant: ProductVariant;
   quantity: Scalars['Int'];
   type: StockMovementType;
@@ -5276,7 +5239,6 @@ export type RemoveStockLocationsFromChannelInput = {
 export type Return = Node & StockMovement & {
   createdAt: Scalars['DateTime'];
   id: Scalars['ID'];
-  orderItem: OrderItem;
   productVariant: ProductVariant;
   quantity: Scalars['Int'];
   type: StockMovementType;
@@ -5330,7 +5292,6 @@ export type RoleSortParameter = {
 export type Sale = Node & StockMovement & {
   createdAt: Scalars['DateTime'];
   id: Scalars['ID'];
-  orderItem: OrderItem;
   productVariant: ProductVariant;
   quantity: Scalars['Int'];
   type: StockMovementType;

+ 2 - 38
packages/core/e2e/graphql/generated-e2e-shop-types.ts

@@ -1856,7 +1856,7 @@ export type Order = Node & {
   state: Scalars['String'];
   /**
    * The subTotal is the total of all OrderLines in the Order. This figure also includes any Order-level
-   * discounts which have been prorated (proportionally distributed) amongst the OrderItems.
+   * discounts which have been prorated (proportionally distributed) amongst the items of each OrderLine.
    * To get a total of all OrderLines which does not account for prorated discounts, use the
    * sum of `OrderLine.discountedLinePrice` values.
    */
@@ -1919,42 +1919,6 @@ export type OrderFilterParameter = {
   updatedAt?: InputMaybe<DateOperators>;
 };
 
-export type OrderItem = Node & {
-  adjustments: Array<Adjustment>;
-  cancelled: Scalars['Boolean'];
-  createdAt: Scalars['DateTime'];
-  /**
-   * The price of a single unit including discounts, excluding tax.
-   *
-   * If Order-level discounts have been applied, this will not be the
-   * actual taxable unit price (see `proratedUnitPrice`), but is generally the
-   * correct price to display to customers to avoid confusion
-   * about the internal handling of distributed Order-level discounts.
-   */
-  discountedUnitPrice: Scalars['Money'];
-  /** The price of a single unit including discounts and tax */
-  discountedUnitPriceWithTax: Scalars['Money'];
-  fulfillment?: Maybe<Fulfillment>;
-  id: Scalars['ID'];
-  /**
-   * The actual unit price, taking into account both item discounts _and_ prorated (proportionally-distributed)
-   * Order-level discounts. This value is the true economic value of the OrderItem, and is used in tax
-   * and refund calculations.
-   */
-  proratedUnitPrice: Scalars['Money'];
-  /** The proratedUnitPrice including tax */
-  proratedUnitPriceWithTax: Scalars['Money'];
-  refundId?: Maybe<Scalars['ID']>;
-  taxLines: Array<TaxLine>;
-  taxRate: Scalars['Float'];
-  /** The price of a single unit, excluding tax and discounts */
-  unitPrice: Scalars['Money'];
-  /** The price of a single unit, including tax but excluding discounts */
-  unitPriceWithTax: Scalars['Money'];
-  unitTax: Scalars['Money'];
-  updatedAt: Scalars['DateTime'];
-};
-
 /** Returned when the maximum order size limit has been reached. */
 export type OrderLimitError = ErrorResult & {
   errorCode: ErrorCode;
@@ -2086,7 +2050,7 @@ export type OrderStateTransitionError = ErrorResult & {
 export type OrderTaxSummary = {
   /** A description of this tax */
   description: Scalars['String'];
-  /** The total net price or OrderItems to which this taxRate applies */
+  /** The total net price of OrderLines to which this taxRate applies */
   taxBase: Scalars['Money'];
   /** The taxRate as a percentage */
   taxRate: Scalars['Float'];

+ 2 - 2
packages/core/e2e/order-taxes.e2e-spec.ts

@@ -204,7 +204,7 @@ describe('Order taxes', () => {
         });
 
         // https://github.com/vendure-ecommerce/vendure/issues/1216
-        it('re-calculates OrderItem prices when shippingAddress causes activeTaxZone change', async () => {
+        it('re-calculates OrderLine prices when shippingAddress causes activeTaxZone change', async () => {
             const { taxRates } = await adminClient.query<Codegen.GetTaxRateListQuery>(GET_TAX_RATE_LIST);
             // Set the TaxRates to Asia to 0%
             const taxRatesAsia = taxRates.items.filter(tr => tr.name.includes('Asia'));
@@ -253,7 +253,7 @@ describe('Order taxes', () => {
         });
 
         // https://github.com/vendure-ecommerce/vendure/issues/1216
-        it('re-calculates OrderItem prices when billingAddress causes activeTaxZone change', async () => {
+        it('re-calculates OrderLine prices when billingAddress causes activeTaxZone change', async () => {
             await shopClient.query<
                 CodegenShop.SetBillingAddressMutation,
                 CodegenShop.SetBillingAddressMutationVariables

+ 1 - 1
packages/core/e2e/stock-control.e2e-spec.ts

@@ -359,7 +359,7 @@ describe('Stock control', () => {
             expect(variant3.stockAllocated).toBe(0); // inherited untracked inventory
         });
 
-        it('creates a Release on cancelling an allocated OrderItem and updates stockAllocated', async () => {
+        it('creates a Release on cancelling an allocated order item and updates stockAllocated', async () => {
             const { order } = await adminClient.query<Codegen.GetOrderQuery, Codegen.GetOrderQueryVariables>(
                 GET_ORDER,
                 {

+ 0 - 3
packages/core/src/api/schema/admin-api/stock-movement.type.graphql

@@ -42,7 +42,6 @@ type Sale implements Node & StockMovement {
     productVariant: ProductVariant!
     type: StockMovementType!
     quantity: Int!
-    orderItem: OrderItem!
 }
 
 type Cancellation implements Node & StockMovement {
@@ -62,7 +61,6 @@ type Return implements Node & StockMovement {
     productVariant: ProductVariant!
     type: StockMovementType!
     quantity: Int!
-    orderItem: OrderItem!
 }
 
 type Release implements Node & StockMovement {
@@ -72,7 +70,6 @@ type Release implements Node & StockMovement {
     productVariant: ProductVariant!
     type: StockMovementType!
     quantity: Int!
-    orderItem: OrderItem!
 }
 
 union StockMovementItem = StockAdjustment | Allocation | Sale | Cancellation | Return | Release

+ 2 - 38
packages/core/src/api/schema/common/order.type.graphql

@@ -40,7 +40,7 @@ type Order implements Node {
     totalQuantity: Int!
     """
     The subTotal is the total of all OrderLines in the Order. This figure also includes any Order-level
-    discounts which have been prorated (proportionally distributed) amongst the OrderItems.
+    discounts which have been prorated (proportionally distributed) amongst the items of each OrderLine.
     To get a total of all OrderLines which does not account for prorated discounts, use the
     sum of `OrderLine.discountedLinePrice` values.
     """
@@ -75,7 +75,7 @@ type OrderTaxSummary {
     description: String!
     "The taxRate as a percentage"
     taxRate: Float!
-    "The total net price or OrderItems to which this taxRate applies"
+    "The total net price of OrderLines to which this taxRate applies"
     taxBase: Money!
     "The total tax being applied to the Order at this taxRate"
     taxTotal: Money!
@@ -117,42 +117,6 @@ type Discount {
     amountWithTax: Money!
 }
 
-type OrderItem implements Node {
-    id: ID!
-    createdAt: DateTime!
-    updatedAt: DateTime!
-    cancelled: Boolean!
-    "The price of a single unit, excluding tax and discounts"
-    unitPrice: Money!
-    "The price of a single unit, including tax but excluding discounts"
-    unitPriceWithTax: Money!
-    """
-    The price of a single unit including discounts, excluding tax.
-
-    If Order-level discounts have been applied, this will not be the
-    actual taxable unit price (see `proratedUnitPrice`), but is generally the
-    correct price to display to customers to avoid confusion
-    about the internal handling of distributed Order-level discounts.
-    """
-    discountedUnitPrice: Money!
-    "The price of a single unit including discounts and tax"
-    discountedUnitPriceWithTax: Money!
-    """
-    The actual unit price, taking into account both item discounts _and_ prorated (proportionally-distributed)
-    Order-level discounts. This value is the true economic value of the OrderItem, and is used in tax
-    and refund calculations.
-    """
-    proratedUnitPrice: Money!
-    "The proratedUnitPrice including tax"
-    proratedUnitPriceWithTax: Money!
-    unitTax: Money!
-    taxRate: Float!
-    adjustments: [Adjustment!]!
-    taxLines: [TaxLine!]!
-    fulfillment: Fulfillment
-    refundId: ID
-}
-
 type OrderLine implements Node {
     id: ID!
     createdAt: DateTime!

+ 1 - 1
packages/core/src/config/order/changed-price-handling-strategy.ts

@@ -6,7 +6,7 @@ import { OrderLine } from '../../entity/order-line/order-line.entity';
 
 /**
  * @description
- * This strategy defines how we handle the situation where an OrderItem exists in an Order, and
+ * This strategy defines how we handle the situation where an item exists in an Order, and
  * then later on another is added but in the meantime the price of the ProductVariant has changed.
  *
  * By default, the latest price will be used. Any price changes resulting from using a newer price

+ 1 - 1
packages/core/src/config/order/order-item-price-calculation-strategy.ts

@@ -6,7 +6,7 @@ import { ProductVariant } from '../../entity/product-variant/product-variant.ent
 
 /**
  * @description
- * The OrderItemPriceCalculationStrategy defines the price of an OrderItem. By default the
+ * The OrderItemPriceCalculationStrategy defines the listPrice of an OrderLine when adding an item to an Order. By default the
  * {@link DefaultOrderItemPriceCalculationStrategy} is used.
  *
  * ### When is the strategy invoked ?

+ 4 - 4
packages/core/src/config/promotion/promotion-action.ts

@@ -64,7 +64,7 @@ export type ConditionState<
 /**
  * @description
  * The function which is used by a PromotionItemAction to calculate the
- * discount on the OrderItem.
+ * discount on the OrderLine.
  *
  * @docsCategory promotions
  * @docsPage promotion-action
@@ -196,7 +196,7 @@ export interface PromotionItemActionConfig<T extends ConfigArgs, U extends Promo
      * @description
      * The function which contains the promotion calculation logic.
      * Should resolve to a number which represents the amount by which to discount
-     * the OrderItem, i.e. the number should be negative.
+     * the OrderLine, i.e. the number should be negative.
      */
     execute: ExecutePromotionItemActionFn<T, U>;
 }
@@ -298,11 +298,11 @@ export abstract class PromotionAction<
 
 /**
  * @description
- * Represents a PromotionAction which applies to individual {@link OrderItem}s.
+ * Represents a PromotionAction which applies to individual {@link OrderLine}s.
  *
  * @example
  * ```ts
- * // Applies a percentage discount to each OrderItem
+ * // Applies a percentage discount to each OrderLine
  * const itemPercentageDiscount = new PromotionItemAction({
  *     code: 'item_percentage_discount',
  *     args: { discount: 'percentage' },

+ 1 - 1
packages/core/src/config/tax/default-tax-line-calculation-strategy.ts

@@ -4,7 +4,7 @@ import { CalculateTaxLinesArgs, TaxLineCalculationStrategy } from './tax-line-ca
 
 /**
  * @description
- * The default {@link TaxLineCalculationStrategy} which applies a single TaxLine to the OrderItem
+ * The default {@link TaxLineCalculationStrategy} which applies a single TaxLine to the OrderLine
  * based on the applicable {@link TaxRate}.
  *
  * @docsCategory tax

+ 3 - 3
packages/core/src/config/vendure-config.ts

@@ -485,7 +485,7 @@ export interface OrderOptions {
     orderLineItemsLimit?: number;
     /**
      * @description
-     * Defines the logic used to calculate the unit price of an OrderItem when adding an
+     * Defines the logic used to calculate the unit price of an OrderLine when adding an
      * item to an Order.
      *
      * @default DefaultPriceCalculationStrategy
@@ -548,8 +548,8 @@ export interface OrderOptions {
     orderByCodeAccessStrategy?: OrderByCodeAccessStrategy;
     /**
      * @description
-     * Defines how we handle the situation where an OrderItem exists in an Order, and
-     * then later on another is added but in the mean time the price of the ProductVariant has changed.
+     * Defines how we handle the situation where an item exists in an Order, and
+     * then later on another is added but in the meantime the price of the ProductVariant has changed.
      *
      * By default, the latest price will be used. Any price changes resulting from using a newer price
      * will be reflected in the GraphQL `OrderLine.unitPrice[WithTax]ChangeSinceAdded` field.

+ 2 - 3
packages/core/src/service/helpers/order-calculator/order-calculator.ts

@@ -107,7 +107,7 @@ export class OrderCalculator {
 
     /**
      * @description
-     * Applies the correct TaxRate to each OrderItem in the order.
+     * Applies the correct TaxRate to each OrderLine in the order.
      */
     private async applyTaxes(ctx: RequestContext, order: Order, activeZone: Zone) {
         const getTaxRate = this.createTaxRateGetter(ctx, activeZone);
@@ -162,8 +162,7 @@ export class OrderCalculator {
 
     /**
      * @description
-     * Applies any eligible promotions to each OrderItem in the order. Returns an array of
-     * any OrderItems which had their Adjustments modified.
+     * Applies any eligible promotions to each OrderLine in the order.
      */
     private async applyPromotions(ctx: RequestContext, order: Order, promotions: Promotion[]): Promise<void> {
         await this.applyOrderItemPromotions(ctx, order, promotions);

+ 2 - 2
packages/core/src/service/helpers/order-modifier/order-modifier.ts

@@ -137,8 +137,8 @@ export class OrderModifier {
 
     /**
      * @description
-     * Returns the OrderLine to which a new OrderItem belongs, creating a new OrderLine
-     * if no existing line is found.
+     * Returns the OrderLine containing the given {@link ProductVariant}, taking into account any custom field values. If no existing
+     * OrderLine is found, a new OrderLine will be created.
      */
     async getOrCreateOrderLine(
         ctx: RequestContext,

+ 1 - 1
packages/core/src/service/services/order.service.ts

@@ -485,7 +485,7 @@ export class OrderService {
 
     /**
      * @description
-     * Adds an OrderItem to the Order, either creating a new OrderLine or
+     * Adds an item to the Order, either creating a new OrderLine or
      * incrementing an existing one.
      */
     async addItemToOrder(

+ 2 - 41
packages/elasticsearch-plugin/e2e/graphql/generated-e2e-elasticsearch-plugin-types.ts

@@ -3689,7 +3689,7 @@ export type Order = Node & {
   state: Scalars['String'];
   /**
    * The subTotal is the total of all OrderLines in the Order. This figure also includes any Order-level
-   * discounts which have been prorated (proportionally distributed) amongst the OrderItems.
+   * discounts which have been prorated (proportionally distributed) amongst the items of each OrderLine.
    * To get a total of all OrderLines which does not account for prorated discounts, use the
    * sum of `OrderLine.discountedLinePrice` values.
    */
@@ -3755,42 +3755,6 @@ export type OrderFilterParameter = {
   updatedAt?: InputMaybe<DateOperators>;
 };
 
-export type OrderItem = Node & {
-  adjustments: Array<Adjustment>;
-  cancelled: Scalars['Boolean'];
-  createdAt: Scalars['DateTime'];
-  /**
-   * The price of a single unit including discounts, excluding tax.
-   *
-   * If Order-level discounts have been applied, this will not be the
-   * actual taxable unit price (see `proratedUnitPrice`), but is generally the
-   * correct price to display to customers to avoid confusion
-   * about the internal handling of distributed Order-level discounts.
-   */
-  discountedUnitPrice: Scalars['Money'];
-  /** The price of a single unit including discounts and tax */
-  discountedUnitPriceWithTax: Scalars['Money'];
-  fulfillment?: Maybe<Fulfillment>;
-  id: Scalars['ID'];
-  /**
-   * The actual unit price, taking into account both item discounts _and_ prorated (proportionally-distributed)
-   * Order-level discounts. This value is the true economic value of the OrderItem, and is used in tax
-   * and refund calculations.
-   */
-  proratedUnitPrice: Scalars['Money'];
-  /** The proratedUnitPrice including tax */
-  proratedUnitPriceWithTax: Scalars['Money'];
-  refundId?: Maybe<Scalars['ID']>;
-  taxLines: Array<TaxLine>;
-  taxRate: Scalars['Float'];
-  /** The price of a single unit, excluding tax and discounts */
-  unitPrice: Scalars['Money'];
-  /** The price of a single unit, including tax but excluding discounts */
-  unitPriceWithTax: Scalars['Money'];
-  unitTax: Scalars['Money'];
-  updatedAt: Scalars['DateTime'];
-};
-
 /** Returned when the maximum order size limit has been reached. */
 export type OrderLimitError = ErrorResult & {
   errorCode: ErrorCode;
@@ -3956,7 +3920,7 @@ export type OrderStateTransitionError = ErrorResult & {
 export type OrderTaxSummary = {
   /** A description of this tax */
   description: Scalars['String'];
-  /** The total net price or OrderItems to which this taxRate applies */
+  /** The total net price of OrderLines to which this taxRate applies */
   taxBase: Scalars['Money'];
   /** The taxRate as a percentage */
   taxRate: Scalars['Float'];
@@ -5219,7 +5183,6 @@ export type RelationCustomFieldConfig = CustomField & {
 export type Release = Node & StockMovement & {
   createdAt: Scalars['DateTime'];
   id: Scalars['ID'];
-  orderItem: OrderItem;
   productVariant: ProductVariant;
   quantity: Scalars['Int'];
   type: StockMovementType;
@@ -5276,7 +5239,6 @@ export type RemoveStockLocationsFromChannelInput = {
 export type Return = Node & StockMovement & {
   createdAt: Scalars['DateTime'];
   id: Scalars['ID'];
-  orderItem: OrderItem;
   productVariant: ProductVariant;
   quantity: Scalars['Int'];
   type: StockMovementType;
@@ -5330,7 +5292,6 @@ export type RoleSortParameter = {
 export type Sale = Node & StockMovement & {
   createdAt: Scalars['DateTime'];
   id: Scalars['ID'];
-  orderItem: OrderItem;
   productVariant: ProductVariant;
   quantity: Scalars['Int'];
   type: StockMovementType;

+ 2 - 41
packages/payments-plugin/e2e/graphql/generated-admin-types.ts

@@ -3689,7 +3689,7 @@ export type Order = Node & {
   state: Scalars['String'];
   /**
    * The subTotal is the total of all OrderLines in the Order. This figure also includes any Order-level
-   * discounts which have been prorated (proportionally distributed) amongst the OrderItems.
+   * discounts which have been prorated (proportionally distributed) amongst the items of each OrderLine.
    * To get a total of all OrderLines which does not account for prorated discounts, use the
    * sum of `OrderLine.discountedLinePrice` values.
    */
@@ -3755,42 +3755,6 @@ export type OrderFilterParameter = {
   updatedAt?: InputMaybe<DateOperators>;
 };
 
-export type OrderItem = Node & {
-  adjustments: Array<Adjustment>;
-  cancelled: Scalars['Boolean'];
-  createdAt: Scalars['DateTime'];
-  /**
-   * The price of a single unit including discounts, excluding tax.
-   *
-   * If Order-level discounts have been applied, this will not be the
-   * actual taxable unit price (see `proratedUnitPrice`), but is generally the
-   * correct price to display to customers to avoid confusion
-   * about the internal handling of distributed Order-level discounts.
-   */
-  discountedUnitPrice: Scalars['Money'];
-  /** The price of a single unit including discounts and tax */
-  discountedUnitPriceWithTax: Scalars['Money'];
-  fulfillment?: Maybe<Fulfillment>;
-  id: Scalars['ID'];
-  /**
-   * The actual unit price, taking into account both item discounts _and_ prorated (proportionally-distributed)
-   * Order-level discounts. This value is the true economic value of the OrderItem, and is used in tax
-   * and refund calculations.
-   */
-  proratedUnitPrice: Scalars['Money'];
-  /** The proratedUnitPrice including tax */
-  proratedUnitPriceWithTax: Scalars['Money'];
-  refundId?: Maybe<Scalars['ID']>;
-  taxLines: Array<TaxLine>;
-  taxRate: Scalars['Float'];
-  /** The price of a single unit, excluding tax and discounts */
-  unitPrice: Scalars['Money'];
-  /** The price of a single unit, including tax but excluding discounts */
-  unitPriceWithTax: Scalars['Money'];
-  unitTax: Scalars['Money'];
-  updatedAt: Scalars['DateTime'];
-};
-
 /** Returned when the maximum order size limit has been reached. */
 export type OrderLimitError = ErrorResult & {
   errorCode: ErrorCode;
@@ -3956,7 +3920,7 @@ export type OrderStateTransitionError = ErrorResult & {
 export type OrderTaxSummary = {
   /** A description of this tax */
   description: Scalars['String'];
-  /** The total net price or OrderItems to which this taxRate applies */
+  /** The total net price of OrderLines to which this taxRate applies */
   taxBase: Scalars['Money'];
   /** The taxRate as a percentage */
   taxRate: Scalars['Float'];
@@ -5219,7 +5183,6 @@ export type RelationCustomFieldConfig = CustomField & {
 export type Release = Node & StockMovement & {
   createdAt: Scalars['DateTime'];
   id: Scalars['ID'];
-  orderItem: OrderItem;
   productVariant: ProductVariant;
   quantity: Scalars['Int'];
   type: StockMovementType;
@@ -5276,7 +5239,6 @@ export type RemoveStockLocationsFromChannelInput = {
 export type Return = Node & StockMovement & {
   createdAt: Scalars['DateTime'];
   id: Scalars['ID'];
-  orderItem: OrderItem;
   productVariant: ProductVariant;
   quantity: Scalars['Int'];
   type: StockMovementType;
@@ -5330,7 +5292,6 @@ export type RoleSortParameter = {
 export type Sale = Node & StockMovement & {
   createdAt: Scalars['DateTime'];
   id: Scalars['ID'];
-  orderItem: OrderItem;
   productVariant: ProductVariant;
   quantity: Scalars['Int'];
   type: StockMovementType;

+ 2 - 38
packages/payments-plugin/e2e/graphql/generated-shop-types.ts

@@ -1856,7 +1856,7 @@ export type Order = Node & {
   state: Scalars['String'];
   /**
    * The subTotal is the total of all OrderLines in the Order. This figure also includes any Order-level
-   * discounts which have been prorated (proportionally distributed) amongst the OrderItems.
+   * discounts which have been prorated (proportionally distributed) amongst the items of each OrderLine.
    * To get a total of all OrderLines which does not account for prorated discounts, use the
    * sum of `OrderLine.discountedLinePrice` values.
    */
@@ -1919,42 +1919,6 @@ export type OrderFilterParameter = {
   updatedAt?: InputMaybe<DateOperators>;
 };
 
-export type OrderItem = Node & {
-  adjustments: Array<Adjustment>;
-  cancelled: Scalars['Boolean'];
-  createdAt: Scalars['DateTime'];
-  /**
-   * The price of a single unit including discounts, excluding tax.
-   *
-   * If Order-level discounts have been applied, this will not be the
-   * actual taxable unit price (see `proratedUnitPrice`), but is generally the
-   * correct price to display to customers to avoid confusion
-   * about the internal handling of distributed Order-level discounts.
-   */
-  discountedUnitPrice: Scalars['Money'];
-  /** The price of a single unit including discounts and tax */
-  discountedUnitPriceWithTax: Scalars['Money'];
-  fulfillment?: Maybe<Fulfillment>;
-  id: Scalars['ID'];
-  /**
-   * The actual unit price, taking into account both item discounts _and_ prorated (proportionally-distributed)
-   * Order-level discounts. This value is the true economic value of the OrderItem, and is used in tax
-   * and refund calculations.
-   */
-  proratedUnitPrice: Scalars['Money'];
-  /** The proratedUnitPrice including tax */
-  proratedUnitPriceWithTax: Scalars['Money'];
-  refundId?: Maybe<Scalars['ID']>;
-  taxLines: Array<TaxLine>;
-  taxRate: Scalars['Float'];
-  /** The price of a single unit, excluding tax and discounts */
-  unitPrice: Scalars['Money'];
-  /** The price of a single unit, including tax but excluding discounts */
-  unitPriceWithTax: Scalars['Money'];
-  unitTax: Scalars['Money'];
-  updatedAt: Scalars['DateTime'];
-};
-
 /** Returned when the maximum order size limit has been reached. */
 export type OrderLimitError = ErrorResult & {
   errorCode: ErrorCode;
@@ -2086,7 +2050,7 @@ export type OrderStateTransitionError = ErrorResult & {
 export type OrderTaxSummary = {
   /** A description of this tax */
   description: Scalars['String'];
-  /** The total net price or OrderItems to which this taxRate applies */
+  /** The total net price of OrderLines to which this taxRate applies */
   taxBase: Scalars['Money'];
   /** The taxRate as a percentage */
   taxRate: Scalars['Float'];

+ 2 - 39
packages/payments-plugin/src/mollie/graphql/generated-shop-types.ts

@@ -1972,7 +1972,7 @@ export type Order = Node & {
   state: Scalars['String'];
   /**
    * The subTotal is the total of all OrderLines in the Order. This figure also includes any Order-level
-   * discounts which have been prorated (proportionally distributed) amongst the OrderItems.
+   * discounts which have been prorated (proportionally distributed) amongst the items of each OrderLine.
    * To get a total of all OrderLines which does not account for prorated discounts, use the
    * sum of `OrderLine.discountedLinePrice` values.
    */
@@ -2036,43 +2036,6 @@ export type OrderFilterParameter = {
   updatedAt?: InputMaybe<DateOperators>;
 };
 
-export type OrderItem = Node & {
-  __typename?: 'OrderItem';
-  adjustments: Array<Adjustment>;
-  cancelled: Scalars['Boolean'];
-  createdAt: Scalars['DateTime'];
-  /**
-   * The price of a single unit including discounts, excluding tax.
-   *
-   * If Order-level discounts have been applied, this will not be the
-   * actual taxable unit price (see `proratedUnitPrice`), but is generally the
-   * correct price to display to customers to avoid confusion
-   * about the internal handling of distributed Order-level discounts.
-   */
-  discountedUnitPrice: Scalars['Money'];
-  /** The price of a single unit including discounts and tax */
-  discountedUnitPriceWithTax: Scalars['Money'];
-  fulfillment?: Maybe<Fulfillment>;
-  id: Scalars['ID'];
-  /**
-   * The actual unit price, taking into account both item discounts _and_ prorated (proportionally-distributed)
-   * Order-level discounts. This value is the true economic value of the OrderItem, and is used in tax
-   * and refund calculations.
-   */
-  proratedUnitPrice: Scalars['Money'];
-  /** The proratedUnitPrice including tax */
-  proratedUnitPriceWithTax: Scalars['Money'];
-  refundId?: Maybe<Scalars['ID']>;
-  taxLines: Array<TaxLine>;
-  taxRate: Scalars['Float'];
-  /** The price of a single unit, excluding tax and discounts */
-  unitPrice: Scalars['Money'];
-  /** The price of a single unit, including tax but excluding discounts */
-  unitPriceWithTax: Scalars['Money'];
-  unitTax: Scalars['Money'];
-  updatedAt: Scalars['DateTime'];
-};
-
 /** Returned when the maximum order size limit has been reached. */
 export type OrderLimitError = ErrorResult & {
   __typename?: 'OrderLimitError';
@@ -2211,7 +2174,7 @@ export type OrderTaxSummary = {
   __typename?: 'OrderTaxSummary';
   /** A description of this tax */
   description: Scalars['String'];
-  /** The total net price or OrderItems to which this taxRate applies */
+  /** The total net price of OrderLines to which this taxRate applies */
   taxBase: Scalars['Money'];
   /** The taxRate as a percentage */
   taxRate: Scalars['Float'];

Plik diff jest za duży
+ 0 - 0
schema-admin.json


Plik diff jest za duży
+ 0 - 0
schema-shop.json


Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików