Преглед изворни кода

chore(core): Remove deprecated Order, OrderLine, ProductVariant fields

Michael Bromley пре 4 година
родитељ
комит
84ea95c1aa

+ 0 - 14
packages/admin-ui/src/lib/core/src/common/generated-types.ts

@@ -1605,11 +1605,6 @@ export type Order = Node & {
    * methods.
    */
   surcharges: Array<Surcharge>;
-  /**
-   * Order-level adjustments to the order total, such as discounts from promotions
-   * @deprecated Use `discounts` instead
-   */
-  adjustments: Array<Adjustment>;
   discounts: Array<Discount>;
   /** An array of all coupon codes applied to the Order */
   couponCodes: Array<Scalars['String']>;
@@ -2114,8 +2109,6 @@ export type ProductVariant = Node & {
   assets: Array<Asset>;
   price: Scalars['Int'];
   currencyCode: CurrencyCode;
-  /** @deprecated price now always excludes tax */
-  priceIncludesTax: Scalars['Boolean'];
   priceWithTax: Scalars['Int'];
   stockLevel: Scalars['String'];
   taxRateApplied: TaxRate;
@@ -4162,8 +4155,6 @@ export type OrderItem = Node & {
   /** The proratedUnitPrice including tax */
   proratedUnitPriceWithTax: Scalars['Int'];
   unitTax: Scalars['Int'];
-  /** @deprecated `unitPrice` is now always without tax */
-  unitPriceIncludesTax: Scalars['Boolean'];
   taxRate: Scalars['Float'];
   adjustments: Array<Adjustment>;
   taxLines: Array<TaxLine>;
@@ -4207,8 +4198,6 @@ export type OrderLine = Node & {
   proratedUnitPriceWithTax: Scalars['Int'];
   quantity: Scalars['Int'];
   items: Array<OrderItem>;
-  /** @deprecated Use `linePriceWithTax` instead */
-  totalPrice: Scalars['Int'];
   taxRate: Scalars['Float'];
   /** The total price of the line excluding tax and discounts. */
   linePrice: Scalars['Int'];
@@ -4228,8 +4217,6 @@ export type OrderLine = Node & {
   proratedLinePriceWithTax: Scalars['Int'];
   /** The total tax on this line */
   lineTax: Scalars['Int'];
-  /** @deprecated Use `discounts` instead */
-  adjustments: Array<Adjustment>;
   discounts: Array<Discount>;
   taxLines: Array<TaxLine>;
   order: Order;
@@ -4847,7 +4834,6 @@ export type ProductVariantFilterParameter = {
   name?: Maybe<StringOperators>;
   price?: Maybe<NumberOperators>;
   currencyCode?: Maybe<StringOperators>;
-  priceIncludesTax?: Maybe<BooleanOperators>;
   priceWithTax?: Maybe<NumberOperators>;
   stockLevel?: Maybe<StringOperators>;
 };

+ 0 - 14
packages/asset-server-plugin/e2e/graphql/generated-e2e-asset-server-plugin-types.ts

@@ -1396,11 +1396,6 @@ export type Order = Node & {
      * methods.
      */
     surcharges: Array<Surcharge>;
-    /**
-     * Order-level adjustments to the order total, such as discounts from promotions
-     * @deprecated Use `discounts` instead
-     */
-    adjustments: Array<Adjustment>;
     discounts: Array<Discount>;
     /** An array of all coupon codes applied to the Order */
     couponCodes: Array<Scalars['String']>;
@@ -1910,8 +1905,6 @@ export type ProductVariant = Node & {
     assets: Array<Asset>;
     price: Scalars['Int'];
     currencyCode: CurrencyCode;
-    /** @deprecated price now always excludes tax */
-    priceIncludesTax: Scalars['Boolean'];
     priceWithTax: Scalars['Int'];
     stockLevel: Scalars['String'];
     taxRateApplied: TaxRate;
@@ -3901,8 +3894,6 @@ export type OrderItem = Node & {
     /** The proratedUnitPrice including tax */
     proratedUnitPriceWithTax: Scalars['Int'];
     unitTax: Scalars['Int'];
-    /** @deprecated `unitPrice` is now always without tax */
-    unitPriceIncludesTax: Scalars['Boolean'];
     taxRate: Scalars['Float'];
     adjustments: Array<Adjustment>;
     taxLines: Array<TaxLine>;
@@ -3945,8 +3936,6 @@ export type OrderLine = Node & {
     proratedUnitPriceWithTax: Scalars['Int'];
     quantity: Scalars['Int'];
     items: Array<OrderItem>;
-    /** @deprecated Use `linePriceWithTax` instead */
-    totalPrice: Scalars['Int'];
     taxRate: Scalars['Float'];
     /** The total price of the line excluding tax and discounts. */
     linePrice: Scalars['Int'];
@@ -3966,8 +3955,6 @@ export type OrderLine = Node & {
     proratedLinePriceWithTax: Scalars['Int'];
     /** The total tax on this line */
     lineTax: Scalars['Int'];
-    /** @deprecated Use `discounts` instead */
-    adjustments: Array<Adjustment>;
     discounts: Array<Discount>;
     taxLines: Array<TaxLine>;
     order: Order;
@@ -4555,7 +4542,6 @@ export type ProductVariantFilterParameter = {
     name?: Maybe<StringOperators>;
     price?: Maybe<NumberOperators>;
     currencyCode?: Maybe<StringOperators>;
-    priceIncludesTax?: Maybe<BooleanOperators>;
     priceWithTax?: Maybe<NumberOperators>;
     stockLevel?: Maybe<StringOperators>;
 };

+ 0 - 14
packages/common/src/generated-shop-types.ts

@@ -1905,11 +1905,6 @@ export type Order = Node & {
      * methods.
      */
     surcharges: Array<Surcharge>;
-    /**
-     * Order-level adjustments to the order total, such as discounts from promotions
-     * @deprecated Use `discounts` instead
-     */
-    adjustments: Array<Adjustment>;
     discounts: Array<Discount>;
     /** An array of all coupon codes applied to the Order */
     couponCodes: Array<Scalars['String']>;
@@ -2031,8 +2026,6 @@ export type OrderItem = Node & {
     /** The proratedUnitPrice including tax */
     proratedUnitPriceWithTax: Scalars['Int'];
     unitTax: Scalars['Int'];
-    /** @deprecated `unitPrice` is now always without tax */
-    unitPriceIncludesTax: Scalars['Boolean'];
     taxRate: Scalars['Float'];
     adjustments: Array<Adjustment>;
     taxLines: Array<TaxLine>;
@@ -2076,8 +2069,6 @@ export type OrderLine = Node & {
     proratedUnitPriceWithTax: Scalars['Int'];
     quantity: Scalars['Int'];
     items: Array<OrderItem>;
-    /** @deprecated Use `linePriceWithTax` instead */
-    totalPrice: Scalars['Int'];
     taxRate: Scalars['Float'];
     /** The total price of the line excluding tax and discounts. */
     linePrice: Scalars['Int'];
@@ -2097,8 +2088,6 @@ export type OrderLine = Node & {
     proratedLinePriceWithTax: Scalars['Int'];
     /** The total tax on this line */
     lineTax: Scalars['Int'];
-    /** @deprecated Use `discounts` instead */
-    adjustments: Array<Adjustment>;
     discounts: Array<Discount>;
     taxLines: Array<TaxLine>;
     order: Order;
@@ -2324,8 +2313,6 @@ export type ProductVariant = Node & {
     assets: Array<Asset>;
     price: Scalars['Int'];
     currencyCode: CurrencyCode;
-    /** @deprecated price now always excludes tax */
-    priceIncludesTax: Scalars['Boolean'];
     priceWithTax: Scalars['Int'];
     stockLevel: Scalars['String'];
     taxRateApplied: TaxRate;
@@ -2856,7 +2843,6 @@ export type ProductVariantFilterParameter = {
     name?: Maybe<StringOperators>;
     price?: Maybe<NumberOperators>;
     currencyCode?: Maybe<StringOperators>;
-    priceIncludesTax?: Maybe<BooleanOperators>;
     priceWithTax?: Maybe<NumberOperators>;
     stockLevel?: Maybe<StringOperators>;
 };

+ 0 - 14
packages/common/src/generated-types.ts

@@ -1568,11 +1568,6 @@ export type Order = Node & {
    * methods.
    */
   surcharges: Array<Surcharge>;
-  /**
-   * Order-level adjustments to the order total, such as discounts from promotions
-   * @deprecated Use `discounts` instead
-   */
-  adjustments: Array<Adjustment>;
   discounts: Array<Discount>;
   /** An array of all coupon codes applied to the Order */
   couponCodes: Array<Scalars['String']>;
@@ -2077,8 +2072,6 @@ export type ProductVariant = Node & {
   assets: Array<Asset>;
   price: Scalars['Int'];
   currencyCode: CurrencyCode;
-  /** @deprecated price now always excludes tax */
-  priceIncludesTax: Scalars['Boolean'];
   priceWithTax: Scalars['Int'];
   stockLevel: Scalars['String'];
   taxRateApplied: TaxRate;
@@ -4124,8 +4117,6 @@ export type OrderItem = Node & {
   /** The proratedUnitPrice including tax */
   proratedUnitPriceWithTax: Scalars['Int'];
   unitTax: Scalars['Int'];
-  /** @deprecated `unitPrice` is now always without tax */
-  unitPriceIncludesTax: Scalars['Boolean'];
   taxRate: Scalars['Float'];
   adjustments: Array<Adjustment>;
   taxLines: Array<TaxLine>;
@@ -4169,8 +4160,6 @@ export type OrderLine = Node & {
   proratedUnitPriceWithTax: Scalars['Int'];
   quantity: Scalars['Int'];
   items: Array<OrderItem>;
-  /** @deprecated Use `linePriceWithTax` instead */
-  totalPrice: Scalars['Int'];
   taxRate: Scalars['Float'];
   /** The total price of the line excluding tax and discounts. */
   linePrice: Scalars['Int'];
@@ -4190,8 +4179,6 @@ export type OrderLine = Node & {
   proratedLinePriceWithTax: Scalars['Int'];
   /** The total tax on this line */
   lineTax: Scalars['Int'];
-  /** @deprecated Use `discounts` instead */
-  adjustments: Array<Adjustment>;
   discounts: Array<Discount>;
   taxLines: Array<TaxLine>;
   order: Order;
@@ -4809,7 +4796,6 @@ export type ProductVariantFilterParameter = {
   name?: Maybe<StringOperators>;
   price?: Maybe<NumberOperators>;
   currencyCode?: Maybe<StringOperators>;
-  priceIncludesTax?: Maybe<BooleanOperators>;
   priceWithTax?: Maybe<NumberOperators>;
   stockLevel?: Maybe<StringOperators>;
 };

+ 1 - 1
packages/core/e2e/fixtures/test-order-item-price-calculation-strategy.ts

@@ -20,7 +20,7 @@ export class TestOrderItemPriceCalculationStrategy implements OrderItemPriceCalc
         }
         return {
             price,
-            priceIncludesTax: productVariant.priceIncludesTax,
+            priceIncludesTax: productVariant.listPriceIncludesTax,
         };
     }
 }

+ 0 - 14
packages/core/e2e/graphql/generated-e2e-admin-types.ts

@@ -1396,11 +1396,6 @@ export type Order = Node & {
      * methods.
      */
     surcharges: Array<Surcharge>;
-    /**
-     * Order-level adjustments to the order total, such as discounts from promotions
-     * @deprecated Use `discounts` instead
-     */
-    adjustments: Array<Adjustment>;
     discounts: Array<Discount>;
     /** An array of all coupon codes applied to the Order */
     couponCodes: Array<Scalars['String']>;
@@ -1910,8 +1905,6 @@ export type ProductVariant = Node & {
     assets: Array<Asset>;
     price: Scalars['Int'];
     currencyCode: CurrencyCode;
-    /** @deprecated price now always excludes tax */
-    priceIncludesTax: Scalars['Boolean'];
     priceWithTax: Scalars['Int'];
     stockLevel: Scalars['String'];
     taxRateApplied: TaxRate;
@@ -3901,8 +3894,6 @@ export type OrderItem = Node & {
     /** The proratedUnitPrice including tax */
     proratedUnitPriceWithTax: Scalars['Int'];
     unitTax: Scalars['Int'];
-    /** @deprecated `unitPrice` is now always without tax */
-    unitPriceIncludesTax: Scalars['Boolean'];
     taxRate: Scalars['Float'];
     adjustments: Array<Adjustment>;
     taxLines: Array<TaxLine>;
@@ -3945,8 +3936,6 @@ export type OrderLine = Node & {
     proratedUnitPriceWithTax: Scalars['Int'];
     quantity: Scalars['Int'];
     items: Array<OrderItem>;
-    /** @deprecated Use `linePriceWithTax` instead */
-    totalPrice: Scalars['Int'];
     taxRate: Scalars['Float'];
     /** The total price of the line excluding tax and discounts. */
     linePrice: Scalars['Int'];
@@ -3966,8 +3955,6 @@ export type OrderLine = Node & {
     proratedLinePriceWithTax: Scalars['Int'];
     /** The total tax on this line */
     lineTax: Scalars['Int'];
-    /** @deprecated Use `discounts` instead */
-    adjustments: Array<Adjustment>;
     discounts: Array<Discount>;
     taxLines: Array<TaxLine>;
     order: Order;
@@ -4555,7 +4542,6 @@ export type ProductVariantFilterParameter = {
     name?: Maybe<StringOperators>;
     price?: Maybe<NumberOperators>;
     currencyCode?: Maybe<StringOperators>;
-    priceIncludesTax?: Maybe<BooleanOperators>;
     priceWithTax?: Maybe<NumberOperators>;
     stockLevel?: Maybe<StringOperators>;
 };

+ 0 - 22
packages/core/e2e/graphql/generated-e2e-shop-types.ts

@@ -1851,11 +1851,6 @@ export type Order = Node & {
      * methods.
      */
     surcharges: Array<Surcharge>;
-    /**
-     * Order-level adjustments to the order total, such as discounts from promotions
-     * @deprecated Use `discounts` instead
-     */
-    adjustments: Array<Adjustment>;
     discounts: Array<Discount>;
     /** An array of all coupon codes applied to the Order */
     couponCodes: Array<Scalars['String']>;
@@ -1971,8 +1966,6 @@ export type OrderItem = Node & {
     /** The proratedUnitPrice including tax */
     proratedUnitPriceWithTax: Scalars['Int'];
     unitTax: Scalars['Int'];
-    /** @deprecated `unitPrice` is now always without tax */
-    unitPriceIncludesTax: Scalars['Boolean'];
     taxRate: Scalars['Float'];
     adjustments: Array<Adjustment>;
     taxLines: Array<TaxLine>;
@@ -2015,8 +2008,6 @@ export type OrderLine = Node & {
     proratedUnitPriceWithTax: Scalars['Int'];
     quantity: Scalars['Int'];
     items: Array<OrderItem>;
-    /** @deprecated Use `linePriceWithTax` instead */
-    totalPrice: Scalars['Int'];
     taxRate: Scalars['Float'];
     /** The total price of the line excluding tax and discounts. */
     linePrice: Scalars['Int'];
@@ -2036,8 +2027,6 @@ export type OrderLine = Node & {
     proratedLinePriceWithTax: Scalars['Int'];
     /** The total tax on this line */
     lineTax: Scalars['Int'];
-    /** @deprecated Use `discounts` instead */
-    adjustments: Array<Adjustment>;
     discounts: Array<Discount>;
     taxLines: Array<TaxLine>;
     order: Order;
@@ -2244,8 +2233,6 @@ export type ProductVariant = Node & {
     assets: Array<Asset>;
     price: Scalars['Int'];
     currencyCode: CurrencyCode;
-    /** @deprecated price now always excludes tax */
-    priceIncludesTax: Scalars['Boolean'];
     priceWithTax: Scalars['Int'];
     stockLevel: Scalars['String'];
     taxRateApplied: TaxRate;
@@ -2740,7 +2727,6 @@ export type ProductVariantFilterParameter = {
     name?: Maybe<StringOperators>;
     price?: Maybe<NumberOperators>;
     currencyCode?: Maybe<StringOperators>;
-    priceIncludesTax?: Maybe<BooleanOperators>;
     priceWithTax?: Maybe<NumberOperators>;
     stockLevel?: Maybe<StringOperators>;
 };
@@ -3083,7 +3069,6 @@ export type GetActiveOrderWithPriceDataQuery = {
                     | 'linePriceWithTax'
                 > & {
                     items: Array<Pick<OrderItem, 'id' | 'unitPrice' | 'unitPriceWithTax' | 'taxRate'>>;
-                    adjustments: Array<Pick<Adjustment, 'amount' | 'type'>>;
                     taxLines: Array<Pick<TaxLine, 'taxRate' | 'description'>>;
                 }
             >;
@@ -3599,13 +3584,6 @@ export namespace GetActiveOrderWithPriceData {
             >['items']
         >[number]
     >;
-    export type Adjustments = NonNullable<
-        NonNullable<
-            NonNullable<
-                NonNullable<NonNullable<GetActiveOrderWithPriceDataQuery['activeOrder']>['lines']>[number]
-            >['adjustments']
-        >[number]
-    >;
     export type TaxLines = NonNullable<
         NonNullable<
             NonNullable<

+ 0 - 4
packages/core/e2e/graphql/shop-definitions.ts

@@ -341,10 +341,6 @@ export const GET_ACTIVE_ORDER_WITH_PRICE_DATA = gql`
                     unitPriceWithTax
                     taxRate
                 }
-                adjustments {
-                    amount
-                    type
-                }
                 taxLines {
                     taxRate
                     description

+ 0 - 5
packages/core/src/api/schema/common/order.type.graphql

@@ -23,8 +23,6 @@ type Order implements Node {
     methods.
     """
     surcharges: [Surcharge!]!
-    "Order-level adjustments to the order total, such as discounts from promotions"
-    adjustments: [Adjustment!]! @deprecated(reason: "Use `discounts` instead")
     discounts: [Discount!]!
     "An array of all coupon codes applied to the Order"
     couponCodes: [String!]!
@@ -140,7 +138,6 @@ type OrderItem implements Node {
     "The proratedUnitPrice including tax"
     proratedUnitPriceWithTax: Int!
     unitTax: Int!
-    unitPriceIncludesTax: Boolean! @deprecated(reason: "`unitPrice` is now always without tax")
     taxRate: Float!
     adjustments: [Adjustment!]!
     taxLines: [TaxLine!]!
@@ -187,7 +184,6 @@ type OrderLine implements Node {
     proratedUnitPriceWithTax: Int!
     quantity: Int!
     items: [OrderItem!]!
-    totalPrice: Int! @deprecated(reason: "Use `linePriceWithTax` instead")
     taxRate: Float!
     """
     The total price of the line excluding tax and discounts.
@@ -211,7 +207,6 @@ type OrderLine implements Node {
     proratedLinePriceWithTax: Int!
     "The total tax on this line"
     lineTax: Int!
-    adjustments: [Adjustment!]! @deprecated(reason: "Use `discounts` instead")
     discounts: [Discount!]!
     taxLines: [TaxLine!]!
     order: Order!

+ 0 - 1
packages/core/src/api/schema/common/product.type.graphql

@@ -48,7 +48,6 @@ type ProductVariant implements Node {
     assets: [Asset!]!
     price: Int!
     currencyCode: CurrencyCode!
-    priceIncludesTax: Boolean! @deprecated(reason: "price now always excludes tax")
     priceWithTax: Int!
     stockLevel: String!
     taxRateApplied: TaxRate!

+ 0 - 3
packages/core/src/entity/product-variant/product-variant.entity.ts

@@ -51,9 +51,6 @@ export class ProductVariant
     @Column()
     sku: string;
 
-    // TODO: Remove as deprecated
-    priceIncludesTax = false;
-
     /**
      * Calculated at run-time
      */

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

@@ -160,7 +160,7 @@ export class OrderModifier {
                 newOrderItems.push(
                     new OrderItem({
                         listPrice: orderLine.productVariant.price,
-                        listPriceIncludesTax: orderLine.productVariant.priceIncludesTax,
+                        listPriceIncludesTax: orderLine.productVariant.listPriceIncludesTax,
                         adjustments: [],
                         taxLines: [],
                         lineId: orderLine.id,

+ 0 - 14
packages/elasticsearch-plugin/e2e/graphql/generated-e2e-elasticsearch-plugin-types.ts

@@ -1396,11 +1396,6 @@ export type Order = Node & {
      * methods.
      */
     surcharges: Array<Surcharge>;
-    /**
-     * Order-level adjustments to the order total, such as discounts from promotions
-     * @deprecated Use `discounts` instead
-     */
-    adjustments: Array<Adjustment>;
     discounts: Array<Discount>;
     /** An array of all coupon codes applied to the Order */
     couponCodes: Array<Scalars['String']>;
@@ -1910,8 +1905,6 @@ export type ProductVariant = Node & {
     assets: Array<Asset>;
     price: Scalars['Int'];
     currencyCode: CurrencyCode;
-    /** @deprecated price now always excludes tax */
-    priceIncludesTax: Scalars['Boolean'];
     priceWithTax: Scalars['Int'];
     stockLevel: Scalars['String'];
     taxRateApplied: TaxRate;
@@ -3901,8 +3894,6 @@ export type OrderItem = Node & {
     /** The proratedUnitPrice including tax */
     proratedUnitPriceWithTax: Scalars['Int'];
     unitTax: Scalars['Int'];
-    /** @deprecated `unitPrice` is now always without tax */
-    unitPriceIncludesTax: Scalars['Boolean'];
     taxRate: Scalars['Float'];
     adjustments: Array<Adjustment>;
     taxLines: Array<TaxLine>;
@@ -3945,8 +3936,6 @@ export type OrderLine = Node & {
     proratedUnitPriceWithTax: Scalars['Int'];
     quantity: Scalars['Int'];
     items: Array<OrderItem>;
-    /** @deprecated Use `linePriceWithTax` instead */
-    totalPrice: Scalars['Int'];
     taxRate: Scalars['Float'];
     /** The total price of the line excluding tax and discounts. */
     linePrice: Scalars['Int'];
@@ -3966,8 +3955,6 @@ export type OrderLine = Node & {
     proratedLinePriceWithTax: Scalars['Int'];
     /** The total tax on this line */
     lineTax: Scalars['Int'];
-    /** @deprecated Use `discounts` instead */
-    adjustments: Array<Adjustment>;
     discounts: Array<Discount>;
     taxLines: Array<TaxLine>;
     order: Order;
@@ -4555,7 +4542,6 @@ export type ProductVariantFilterParameter = {
     name?: Maybe<StringOperators>;
     price?: Maybe<NumberOperators>;
     currencyCode?: Maybe<StringOperators>;
-    priceIncludesTax?: Maybe<BooleanOperators>;
     priceWithTax?: Maybe<NumberOperators>;
     stockLevel?: Maybe<StringOperators>;
 };

Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
schema-admin.json


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
schema-shop.json


Неке датотеке нису приказане због велике количине промена