Browse Source

docs(core): Add some documentation to Order entity/type

Michael Bromley 6 years ago
parent
commit
fc796e191d

+ 0 - 2
packages/core/e2e/shop-promotion.e2e-spec.ts

@@ -331,8 +331,6 @@ describe('Shop orders', () => {
                 couponCode,
             });
 
-            // expect(applyCouponCode!.adjustments.length).toBe(1);
-            //  expect(applyCouponCode!.adjustments[0].description).toBe('50% off sale items');
             expect(applyCouponCode!.total).toBe(1920);
 
             await deletePromotion(promotion.id);

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

@@ -2,18 +2,22 @@ type Order implements Node {
     id: ID!
     createdAt: DateTime!
     updatedAt: DateTime!
+    "A unique code for the Order"
     code: String!
     state: String!
+    "An order is active as long as the payment process has not been completed"
     active: Boolean!
     customer: Customer
     shippingAddress: OrderAddress
     billingAddress: OrderAddress
     lines: [OrderLine!]!
+    "Order-level adjustments to the order total, such as discounts from promotions"
     adjustments: [Adjustment!]!
     couponCodes: [String!]!
     payments: [Payment!]
     fulfillments: [Fulfillment!]
     subTotalBeforeTax: Int!
+    "The subTotal is the total of the OrderLines, before order-level promotions and shipping has been applied."
     subTotal: Int!
     currencyCode: CurrencyCode!
     shipping: Int!

+ 5 - 0
packages/core/src/entity/order/order.entity.ts

@@ -64,6 +64,11 @@ export class Order extends VendureEntity implements HasCustomFields {
 
     @Column() subTotalBeforeTax: number;
 
+    /**
+     * @description
+     * The subTotal is the total of the OrderLines, before order-level promotions
+     * and shipping has been applied.
+     */
     @Column() subTotal: number;
 
     @EntityId({ nullable: true })