10.18.2 • Published 6 months ago

@commercetools-test-data/cart v10.18.2

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

@commercetools-test-data/cart

This package provides the data model for the commercetools platform Cart representations

https://docs.commercetools.com/api/projects/carts#representations

Install

$ pnpm add -D @commercetools-test-data/cart

Usage

Cart

import {
  Cart,
  CartDraft,
  type TCart,
  type TCartDraft,
} from '@commercetools-test-data/cart';

const cart = Cart.random().build<TCart>();
const cartDraft = CartDraft.random().build<TCartDraft>();

// Presets
const emptyCartDraft = CartDraft.presets.empty().build<TCartDraft>();

CustomLineItem

import {
  CustomLineItemRest,
  CustomLineItemDraftRest,
  CustomLineItemGraphql,
  CustomLineItemDraftGraphql,
} from '@commercetools-test-data/cart';

const restCustomLineItem = CustomLineItemRest.random().build();
const graphqlCustomLineItem = CustomLineItemGraphql.random().build();

const restCustomLineItemDraft = CustomLineItemDraftRest.random().build();
const graphqlCustomLineItemDraft = CustomLineItemDraftGraphql.random().build();

LineItem

import {
  LineItemRest,
  LineItemDraftRest
  LineItemGraphql,
  LineItemDraftGraphql,
} from '@commercetools-test-data/cart';

const restLineItem = LineItemRest.random().build();
const graphqlLineItem = LineItemGraphql.random().build();

const restLineItemDraft = LineItemDraftRest.random().build();
const graphqlLineItemDraft = LineItemDraftGraphql.random().build()

// Presets
const restEmptyLineItemDraft = LineItemDraftRest.presets.empty().build();
const graphqlEmptyLineItemDraft = LineItemDraftGraphql.presets.empty().build()

TaxPortion

import {
  TaxPortionRest,
  TaxPortionDraftRest,
  TaxPortionGraphql,
  TaxPortionDraftGraphql,
} from '@commercetools-test-data/cart';

const restTaxPortion = TaxPortionRest.random().build();
const graphqlTaxPortion = TaxPortionGraphql.random().build();

const restTaxPortionDraft = TaxPortionDraftRest.random().build();
const graphqlTaxPortionDraft = TaxPortionDraftGraphql.random().build();

TaxedItemPrice

import {
  TaxedItemPriceRest,
  TaxedItemPriceGraphql,
} from '@commercetools-test-data/cart';

const restTaxedItemPrice = TaxedItemPriceRest.random().build();
const graphqlTaxedItemPrice = TaxedItemPriceGraphql.random().build();

ShippingInfo

import {
  ShippingInfoRest,
  ShippingInfoGraphql,
} from '@commercetools-test-data/cart';

const restShippingInfo = ShippingInfoRest.random().build();
const graphqlShippingInfo = ShippingInfoGraphql.random().build();

TaxedPrice

import {
  TaxedPriceRest,
  TaxedPriceGraphql,
} from '@commercetools-test-data/cart';

const restTaxedPrice = TaxedPriceRest.random().build();
const graphqlTaxedPrice = TaxedPriceGraphql.random().build();

DirectDiscount

import {
  DirectDiscountRest,
  DirectDiscountGraphql,
  DirectDiscountDraftRest,
  DirectDiscountDraftGraphql,
} from '@commercetools-test-data/cart';

const restDirectDiscount = DirectDiscountRest.random().build();
const graphqlDirectDiscount = DirectDiscountGraphql.random().build();

const restDirectDiscountDraft = DirectDiscountDraftRest.random().build();
const graphqlDirectDiscountDraft = DirectDiscountDraftGraphql.random().build();

DiscountedLineItemPortion

import {
  DiscountedLineItemPortionRest,
  DiscountedLineItemPortionGraphql,
  DiscountedLineItemPortionDraftRest,
  DiscountedLineItemPortionDraftGraphql,
} from '@commercetools-test-data/cart';

const restDiscountedLineItemPortion =
  DiscountedLineItemPortionRest.random().build();
const graphqlDiscountedLineItemPortion =
  DiscountedLineItemPortionGraphql.random().build();

const restDiscountedLineItemPortionDraft =
  DiscountedLineItemPortionDraftRest.random().build();
const graphqlDiscountedLineItemPortionDraft =
  DiscountedLineItemPortionDraftGraphql.random().build();

DiscountedLineItemPrice

import {
  DiscountedLineItemPriceRest,
  DiscountedLineItemPriceGraphql,
} from '@commercetools-test-data/cart';

const restDiscountedLineItemPrice =
  DiscountedLineItemPriceRest.random().build();
const graphqlDiscountedLineItemPrice =
  DiscountedLineItemPriceGraphql.random().build();

DiscountedLineItemPriceForQuantity

import {
  DiscountedLineItemPriceForQuantityRest,
  DiscountedLineItemPriceForQuantityGraphql,
} from '@commercetools-test-data/cart';

const restDiscountedLineItemPriceForQuantity =
  DiscountedLineItemPriceForQuantityRest.random().build();
const graphqlDiscountedLineItemPriceForQuantity =
  DiscountedLineItemPriceForQuantityGraphql.random().build();
10.11.1

10 months ago

10.11.2

10 months ago

10.11.0

10 months ago

10.12.0

9 months ago

10.10.0

11 months ago

10.10.1

11 months ago

10.15.1

7 months ago

10.15.2

7 months ago

10.15.0

7 months ago

10.15.3

7 months ago

10.16.0

6 months ago

10.13.0

8 months ago

10.9.1

12 months ago

10.9.2

12 months ago

10.9.3

12 months ago

10.14.2

7 months ago

10.14.0

8 months ago

10.14.1

7 months ago

10.17.0

6 months ago

10.18.2

6 months ago

10.18.0

6 months ago

10.18.1

6 months ago

10.9.0

12 months ago

10.8.0

1 year ago

10.8.1

1 year ago

10.7.1

1 year ago

10.2.0

1 year ago

10.4.0

1 year ago

10.3.0

1 year ago

10.6.0

1 year ago

10.6.1

1 year ago

10.5.0

1 year ago

10.5.1

1 year ago

10.5.2

1 year ago

10.7.0

1 year ago

9.0.7

1 year ago

9.0.6

1 year ago

9.0.5

1 year ago

9.0.4

1 year ago

9.0.3

1 year ago

10.0.0

1 year ago

9.0.2

1 year ago

9.0.1

1 year ago

9.0.0

1 year ago

8.4.0

1 year ago

8.3.0

1 year ago

10.1.4

1 year ago

10.1.0

1 year ago

10.1.1

1 year ago

10.1.2

1 year ago

10.1.3

1 year ago

8.5.0

1 year ago

8.2.3

1 year ago

8.2.2

1 year ago

8.2.1

1 year ago

8.2.0

1 year ago

8.1.0

1 year ago

8.1.1

1 year ago

8.0.0

1 year ago

7.11.0

2 years ago

7.10.0

2 years ago

7.9.1

2 years ago

7.9.0

2 years ago

7.8.0

2 years ago

7.6.0

2 years ago

7.7.1

2 years ago

7.7.0

2 years ago

7.5.0

2 years ago

7.4.0

2 years ago

7.3.0

2 years ago

7.2.13

2 years ago

7.2.12

2 years ago

7.2.11

2 years ago

7.2.10

2 years ago

7.2.9

2 years ago

7.2.8

2 years ago

7.2.7

2 years ago

7.2.6

2 years ago

7.2.5

2 years ago

7.2.4

2 years ago

7.2.3

2 years ago

7.2.2

2 years ago

7.2.1

2 years ago

7.1.1

2 years ago

7.1.0

2 years ago

7.2.0

2 years ago

7.0.0

2 years ago

6.11.0

2 years ago

6.10.0

2 years ago

6.9.0

2 years ago

6.8.1

2 years ago

6.8.0

2 years ago

6.1.0

2 years ago

6.1.1

2 years ago

6.5.0

2 years ago

5.11.2

2 years ago

5.11.1

2 years ago

5.11.0

2 years ago

6.6.0

2 years ago

5.8.2

2 years ago

5.8.1

2 years ago

5.8.0

2 years ago

6.2.0

2 years ago

6.3.4

2 years ago

6.3.3

2 years ago

6.3.6

2 years ago

6.3.5

2 years ago

6.3.8

2 years ago

6.3.7

2 years ago

5.9.0

2 years ago

6.3.0

2 years ago

6.3.2

2 years ago

6.3.1

2 years ago

6.4.2

2 years ago

6.0.0

2 years ago

6.4.1

2 years ago

6.4.0

2 years ago

5.10.1

2 years ago

5.10.0

2 years ago

5.7.0

2 years ago

5.5.1

2 years ago

5.5.0

2 years ago

5.6.0

2 years ago

5.4.1

2 years ago

5.4.0

2 years ago

5.3.6

2 years ago

5.3.5

2 years ago

5.3.3

2 years ago

5.3.2

2 years ago

5.3.1

2 years ago

5.3.0

2 years ago

5.1.1

2 years ago

5.1.0

2 years ago

5.2.0

2 years ago

5.0.0

2 years ago

5.3.4

2 years ago

4.11.0

3 years ago

4.11.1

3 years ago

4.10.0

3 years ago