Skip to content

CartResponse

// RB2 Core Connect
using System.Dynamic;
using CoreConnect.Commerce.Catalog;
using CoreConnect.Commerce.Core;
using CoreConnect.Commerce.Customer;
using HotChocolate;
using HotChocolate.Types;
namespace CoreConnect.Commerce.Cart;
/// <summary>
/// The cart.
/// </summary>
public class CartResponse : CartRequest
{
/// <summary>
/// Gets or sets the customer id.
/// </summary>
public string? CustomerId { get; set; }
/// <summary>
/// Gets or sets the customer email.
/// </summary>
public string? CustomerEmail { get; set; }
/// <summary>
/// Gets or sets the country.
/// </summary>
public string? Country { get; set; }
/// <summary>
/// Gets or sets the shipping address
/// </summary>
public CartAddress? ShippingAddress { get; set; }
/// <summary>
/// Gets or sets the billing address
/// </summary>
public CartAddress? BillingAddress { get; set; }
/// <summary>
/// Gets or sets the line items.
/// </summary>
public required IEnumerable<CartLineItem> LineItems { get; set; }
/// <summary>
/// Gets or sets the ProductLineItems items.
/// </summary>
public IEnumerable<ProductLineItem>? ProductLineItems { get; set; }
/// <summary>
/// Gets or sets the created at.
/// </summary>
public DateTime CreatedAt { get; set; }
/// <summary>
/// Gets or sets the last modified at.
/// </summary>
public DateTime LastModifiedAt { get; set; }
/// <summary>
/// Gets or sets the tax total.
/// </summary>
public required Money TaxTotal { get; set; }
/// <summary>
/// Gets or sets the subtotal excl tax.
/// </summary>
public required Money SubtotalExclTax { get; set; }
/// <summary>
/// Gets or sets the subtotal incl tax.
/// </summary>
public required Money SubtotalInclTax { get; set; }
/// <summary>
/// Gets or sets the discount total.
/// </summary>
public required Money DiscountTotal { get; set; }
/// <summary>
/// Gets or sets the product discount total.
/// </summary>
public Money? ProductDiscountTotal { get; set; }
/// <summary>
/// Gets or sets the sale total.
/// </summary>
public Money? SaleTotal { get; set; }
/// <summary>
/// Gets or sets the shipping cost incl tax.
/// </summary>
public Money? ShippingCostInclTax { get; set; }
/// <summary>
/// Gets or sets the shipping cost excl tax.
/// </summary>
public Money? ShippingCostExclTax { get; set; }
/// <summary>
/// Id to identify anonymous user resources
/// </summary>
public string? AnonymousId { get; set; }
public bool? ContentHasChanged { get; set; }
public string? ShippingMethod { get; set; }
public string? DeliveryComments { get; set; }
/// <summary>
/// Customized according to different project business
/// </summary>
[GraphQLType(typeof(AnyType))]
public Dictionary<string, object>? CustomFields { get; set; }
public BusinessUnit? BusinessUnit { get; set; }
public string? StoreKey { get; set; }
public string? Locale { get; set; }
public IEnumerable<CartApplicablePromotion>? ApplicablePromotions { get; set; }
public string? DiscountId { get; set; }
/// <summary>
/// The sum of the items tax
/// </summary>
public Money? TotalItemTax { get; set; }
}
/// <summary>
/// The cart line item.
/// </summary>
public class CartLineItem
{
/// <summary>
/// Gets or sets the id.
/// </summary>
public required string Id { get; set; }
/// <summary>
/// Gets or sets the quantity.
/// </summary>
public long Quantity { get; set; }
/// <summary>
/// Gets or sets the total price excl tax.
/// </summary>
public required Money TotalPriceExclTax { get; set; }
/// <summary>
/// Gets or sets the total.
/// </summary>
public required Money TotalPriceInclTax { get; set; }
/// <summary>
/// Gets or sets the total old price excl tax.
/// </summary>
public required Money? TotalSalePriceExclTax { get; set; }
/// <summary>
/// Gets or sets the total old price incl tax.
/// </summary>
public required Money? TotalSalePriceInclTax { get; set; }
/// <summary>
/// Gets or sets the ProductLineItem
/// </summary>
public ProductLineItem? ProductLineItem { get; set; }
/// <summary>
/// Gets or sets the Inventory Mode
/// </summary>
public string? InventoryMode { get; set; }
/// <summary>
/// Gets or sets the Tax Rate
/// </summary>
public decimal? TaxRate { get; set; }
/// <summary>
/// Customized according to different project business
/// </summary>
[GraphQLType(typeof(AnyType))]
public ExpandoObject? Expand { get; set; }
/// <summary>
/// Custom fields
/// </summary>
[GraphQLType(typeof(AnyType))]
public Dictionary<string, object>? CustomFields { get; set; }
/// <summary>
/// Gets or sets the promotion identifier.
/// </summary>
public string? PromotionId { get; set; }
/// <summary>
/// Gets or sets the promotion type.
/// </summary>
public string? PromotionType { get; set; }
}
public class ProductLineItem
{
public required string Id { get; set; }
public required string ProductId { get; set; }
public required string Name { get; set; }
public required string Slug { get; set; }
public required ProductVariant Variant { get; set; }
public Money? PriceInclTax { get; set; }
public Money? PriceExclTax { get; set; }
public Money? SalePriceInclTax { get; set; }
public Money? SalePriceExclTax { get; set; }
public int Quantity { get; set; }
public IEnumerable<DiscountedLineItemPriceForQuantityCoreConnect>? DiscountedPricePerQuantity { get; set; }
public IEnumerable<MethodTaxRateCoreConnect>? perMethodTaxRate { get; set; }
public DateTime? AddedAt { get; set; }
public DateTime? LastModifiedAt { get; set; }
public Money? UnitPriceInclTax { get; set; }
public Money? UnitPriceExclTax { get; set; }
public Money? UnitSalePriceInclTax { get; set; }
public Money? UnitSalePriceExclTax { get; set; }
public IEnumerable<ProductVariant>? ProductVariants { get; set; }
}
public class MethodTaxRateCoreConnect
{
public string? Id { get; set; }
}
public class DiscountedLineItemPriceForQuantityCoreConnect
{
public string? Id { get; set; }
}
public class CartApplicablePromotion
{
public string? Type { get; set; }
public string? PromotionId { get; set; }
public IEnumerable<Product>? Products { get; set; }
}