Add delivery addresses to profile, cart, and orders

This commit is contained in:
Ruslan Bakiev
2026-04-03 10:26:47 +07:00
parent 0aad9177f8
commit 4c82c2437a
11 changed files with 757 additions and 41 deletions

View File

@@ -4,6 +4,7 @@ query MyOrders {
code
kind
status
deliveryAddress
totalPrice
deliveryTerms
createdAt

View File

@@ -0,0 +1,11 @@
mutation CreateMyDeliveryAddress($input: CreateMyDeliveryAddressInput!) {
createMyDeliveryAddress(input: $input) {
id
label
address
unrestrictedValue
fiasId
isDefault
updatedAt
}
}

View File

@@ -0,0 +1,3 @@
mutation DeleteMyDeliveryAddress($addressId: ID!) {
deleteMyDeliveryAddress(addressId: $addressId)
}

View File

@@ -0,0 +1,11 @@
query MyDeliveryAddresses {
myDeliveryAddresses {
id
label
address
unrestrictedValue
fiasId
isDefault
updatedAt
}
}

View File

@@ -0,0 +1,11 @@
mutation SetMyDefaultDeliveryAddress($addressId: ID!) {
setMyDefaultDeliveryAddress(addressId: $addressId) {
id
label
address
unrestrictedValue
fiasId
isDefault
updatedAt
}
}

View File

@@ -86,6 +86,18 @@ type CounterpartyProfile {
updatedAt: DateTime!
}
type DeliveryAddress {
id: ID!
userId: ID!
label: String
address: String!
unrestrictedValue: String
fiasId: String
isDefault: Boolean!
createdAt: DateTime!
updatedAt: DateTime!
}
type AuthCodeRequestResult {
challengeToken: String!
channel: LoginChannel!
@@ -191,6 +203,7 @@ type Order {
kind: OrderKind!
status: OrderStatus!
customerId: ID!
deliveryAddress: String
managerId: ID
clientApproved: Boolean
managerApproved: Boolean
@@ -244,6 +257,7 @@ type Query {
healthcheck: String!
me: User
myCounterpartyProfile: CounterpartyProfile
myDeliveryAddresses: [DeliveryAddress!]!
myMessengerConnections: [MessengerConnection!]!
myNotificationHistory(channel: MessengerType!, limit: Int = 50): [NotificationHistoryItem!]!
managerNotificationHistory(userId: ID!, channel: MessengerType!, limit: Int = 50): [NotificationHistoryItem!]!
@@ -310,6 +324,13 @@ input UpsertMyCounterpartyProfileInput {
signerBasis: String!
}
input CreateMyDeliveryAddressInput {
label: String
address: String!
unrestrictedValue: String
fiasId: String
}
input ReadyOrderItemInput {
productId: ID!
quantity: Float!
@@ -317,12 +338,14 @@ input ReadyOrderItemInput {
input SubmitReadyOrderInput {
items: [ReadyOrderItemInput!]!
deliveryAddressId: ID
}
input SubmitCalculationOrderInput {
productName: String!
quantity: Float!
parameters: JSON!
deliveryAddressId: ID
}
input SetOrderOfferInput {
@@ -368,6 +391,9 @@ type Mutation {
acceptInvitation(input: AcceptInvitationInput!): User!
connectMessenger(input: ConnectMessengerInput!): MessengerConnection!
upsertMyCounterpartyProfile(input: UpsertMyCounterpartyProfileInput!): CounterpartyProfile!
createMyDeliveryAddress(input: CreateMyDeliveryAddressInput!): DeliveryAddress!
setMyDefaultDeliveryAddress(addressId: ID!): DeliveryAddress!
deleteMyDeliveryAddress(addressId: ID!): Boolean!
sendTestMessengerMessage(type: MessengerType!, channelId: String, message: String): MessengerDispatchResult!
submitReadyOrder(input: SubmitReadyOrderInput!): Order!