Back cart with GraphQL storage

This commit is contained in:
Ruslan Bakiev
2026-04-04 09:08:51 +07:00
parent f1ee0850c9
commit 264b88bcee
10 changed files with 644 additions and 68 deletions

View File

@@ -191,6 +191,28 @@ type Product {
availableInWarehouses: [ProductWarehouseBalance!]!
}
type CartItem {
id: ID!
productId: ID!
productName: String!
sku: String!
isCustomizable: Boolean!
quantity: Float!
parameters: JSON!
createdAt: DateTime!
updatedAt: DateTime!
}
type Cart {
id: ID!
userId: ID!
deliveryAddressId: ID
deliveryAddress: DeliveryAddress
items: [CartItem!]!
createdAt: DateTime!
updatedAt: DateTime!
}
type OrderItem {
id: ID!
productId: ID
@@ -266,6 +288,7 @@ type Query {
healthcheck: String!
me: User
myCounterpartyProfile: CounterpartyProfile
myCart: Cart!
myDeliveryAddresses: [DeliveryAddress!]!
myMessengerConnections: [MessengerConnection!]!
myNotificationHistory(channel: MessengerType!, limit: Int = 50): [NotificationHistoryItem!]!
@@ -340,6 +363,11 @@ input CreateMyDeliveryAddressInput {
fiasId: String
}
input UpdateCartItemQuantityInput {
productId: ID!
quantity: Float!
}
input ReadyOrderItemInput {
productId: ID!
quantity: Float!
@@ -400,6 +428,11 @@ type Mutation {
acceptInvitation(input: AcceptInvitationInput!): User!
connectMessenger(input: ConnectMessengerInput!): MessengerConnection!
upsertMyCounterpartyProfile(input: UpsertMyCounterpartyProfileInput!): CounterpartyProfile!
addProductToCart(productId: ID!): Cart!
updateCartItemQuantity(input: UpdateCartItemQuantityInput!): Cart!
removeCartItem(productId: ID!): Cart!
setCartDeliveryAddress(addressId: ID): Cart!
clearCart: Cart!
createMyDeliveryAddress(input: CreateMyDeliveryAddressInput!): DeliveryAddress!
setMyDefaultDeliveryAddress(addressId: ID!): DeliveryAddress!
deleteMyDeliveryAddress(addressId: ID!): Boolean!