@commercetools-test-data/cart
v10.7.1
Published
Data model for commercetools API Cart
Downloads
10,481
Readme
@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 {
CustomLineItem,
CustomLineItemDraft,
type TCustomLineItem,
type TCustomLineItemDraft,
} from '@commercetools-test-data/cart';
const customLineItem = CustomLineItem.random().build<TCustomLineItem>();
const customLineItemDraft =
CustomLineItemDraft.random().build<TCustomLineItemDraft>();
LineItem
import {
LineItem,
LineItemDraft,
type TLineItem,
type TLineItemDraft,
} from '@commercetools-test-data/cart';
const lineItem = LineItem.random().build<TLineItem>();
const lineItemDraft = LineItemDraft.random().build<TLineItemDraft>();
// Presets
const emptyLineItemDraft = LineItemDraft.presets
.empty()
.build<TLineItemDraft>();