Build Nuxt 4 manager cabinet workflows
This commit is contained in:
10
graphql/operations/auth/register-self.graphql
Normal file
10
graphql/operations/auth/register-self.graphql
Normal file
@@ -0,0 +1,10 @@
|
||||
mutation RegisterSelf($input: RegisterSelfInput!) {
|
||||
registerSelf(input: $input) {
|
||||
id
|
||||
companyName
|
||||
contactName
|
||||
email
|
||||
status
|
||||
createdAt
|
||||
}
|
||||
}
|
||||
17
graphql/operations/catalog/client-products.graphql
Normal file
17
graphql/operations/catalog/client-products.graphql
Normal file
@@ -0,0 +1,17 @@
|
||||
query ClientProducts {
|
||||
clientProducts {
|
||||
id
|
||||
sku
|
||||
name
|
||||
description
|
||||
isCustomizable
|
||||
availableInWarehouses {
|
||||
availableQty
|
||||
warehouse {
|
||||
id
|
||||
code
|
||||
name
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
9
graphql/operations/manager/add-bonus-transaction.graphql
Normal file
9
graphql/operations/manager/add-bonus-transaction.graphql
Normal file
@@ -0,0 +1,9 @@
|
||||
mutation AddBonusTransaction($input: AddBonusTransactionInput!) {
|
||||
addBonusTransaction(input: $input) {
|
||||
id
|
||||
userId
|
||||
amount
|
||||
reason
|
||||
createdAt
|
||||
}
|
||||
}
|
||||
7
graphql/operations/manager/block-order.graphql
Normal file
7
graphql/operations/manager/block-order.graphql
Normal file
@@ -0,0 +1,7 @@
|
||||
mutation BlockOrder($input: BlockOrderInput!) {
|
||||
blockOrder(input: $input) {
|
||||
id
|
||||
status
|
||||
blockReason
|
||||
}
|
||||
}
|
||||
9
graphql/operations/manager/create-invitation.graphql
Normal file
9
graphql/operations/manager/create-invitation.graphql
Normal file
@@ -0,0 +1,9 @@
|
||||
mutation CreateInvitation($input: CreateInvitationInput!) {
|
||||
createInvitation(input: $input) {
|
||||
id
|
||||
token
|
||||
email
|
||||
companyName
|
||||
expiresAt
|
||||
}
|
||||
}
|
||||
8
graphql/operations/manager/create-referral.graphql
Normal file
8
graphql/operations/manager/create-referral.graphql
Normal file
@@ -0,0 +1,8 @@
|
||||
mutation CreateReferral($input: CreateReferralInput!) {
|
||||
createReferral(input: $input) {
|
||||
id
|
||||
referrerId
|
||||
refereeId
|
||||
createdAt
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
mutation ManagerFinalizeOrder($orderId: ID!, $decision: Decision!) {
|
||||
managerFinalizeOrder(orderId: $orderId, decision: $decision) {
|
||||
id
|
||||
status
|
||||
managerApproved
|
||||
}
|
||||
}
|
||||
17
graphql/operations/manager/manager-orders.graphql
Normal file
17
graphql/operations/manager/manager-orders.graphql
Normal file
@@ -0,0 +1,17 @@
|
||||
query ManagerOrders($status: OrderStatus) {
|
||||
managerOrders(status: $status) {
|
||||
id
|
||||
code
|
||||
status
|
||||
kind
|
||||
customerId
|
||||
deliveryTerms
|
||||
totalPrice
|
||||
createdAt
|
||||
items {
|
||||
id
|
||||
productName
|
||||
quantity
|
||||
}
|
||||
}
|
||||
}
|
||||
10
graphql/operations/manager/registration-requests.graphql
Normal file
10
graphql/operations/manager/registration-requests.graphql
Normal file
@@ -0,0 +1,10 @@
|
||||
query RegistrationRequests($status: RegistrationStatus) {
|
||||
registrationRequests(status: $status) {
|
||||
id
|
||||
companyName
|
||||
contactName
|
||||
email
|
||||
status
|
||||
createdAt
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
mutation ReviewRegistrationRequest($input: ReviewRegistrationRequestInput!) {
|
||||
reviewRegistrationRequest(input: $input) {
|
||||
id
|
||||
status
|
||||
rejectionReason
|
||||
reviewedById
|
||||
}
|
||||
}
|
||||
8
graphql/operations/manager/review-withdrawal.graphql
Normal file
8
graphql/operations/manager/review-withdrawal.graphql
Normal file
@@ -0,0 +1,8 @@
|
||||
mutation ReviewRewardWithdrawal($input: ReviewRewardWithdrawalInput!) {
|
||||
reviewRewardWithdrawal(input: $input) {
|
||||
id
|
||||
status
|
||||
reviewComment
|
||||
reviewedById
|
||||
}
|
||||
}
|
||||
9
graphql/operations/manager/set-order-offer.graphql
Normal file
9
graphql/operations/manager/set-order-offer.graphql
Normal file
@@ -0,0 +1,9 @@
|
||||
mutation ManagerSetOrderOffer($input: SetOrderOfferInput!) {
|
||||
managerSetOrderOffer(input: $input) {
|
||||
id
|
||||
code
|
||||
status
|
||||
deliveryTerms
|
||||
totalPrice
|
||||
}
|
||||
}
|
||||
14
graphql/operations/orders/my-current-orders.graphql
Normal file
14
graphql/operations/orders/my-current-orders.graphql
Normal file
@@ -0,0 +1,14 @@
|
||||
query MyCurrentOrders {
|
||||
myCurrentOrders {
|
||||
id
|
||||
code
|
||||
kind
|
||||
status
|
||||
createdAt
|
||||
items {
|
||||
id
|
||||
productName
|
||||
quantity
|
||||
}
|
||||
}
|
||||
}
|
||||
16
graphql/operations/orders/my-orders.graphql
Normal file
16
graphql/operations/orders/my-orders.graphql
Normal file
@@ -0,0 +1,16 @@
|
||||
query MyOrders {
|
||||
myOrders {
|
||||
id
|
||||
code
|
||||
kind
|
||||
status
|
||||
totalPrice
|
||||
deliveryTerms
|
||||
createdAt
|
||||
items {
|
||||
id
|
||||
productName
|
||||
quantity
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
mutation SubmitCalculationOrder($input: SubmitCalculationOrderInput!) {
|
||||
submitCalculationOrder(input: $input) {
|
||||
id
|
||||
code
|
||||
status
|
||||
createdAt
|
||||
}
|
||||
}
|
||||
8
graphql/operations/orders/submit-ready-order.graphql
Normal file
8
graphql/operations/orders/submit-ready-order.graphql
Normal file
@@ -0,0 +1,8 @@
|
||||
mutation SubmitReadyOrder($input: SubmitReadyOrderInput!) {
|
||||
submitReadyOrder(input: $input) {
|
||||
id
|
||||
code
|
||||
status
|
||||
createdAt
|
||||
}
|
||||
}
|
||||
8
graphql/operations/profile/connect-messenger.graphql
Normal file
8
graphql/operations/profile/connect-messenger.graphql
Normal file
@@ -0,0 +1,8 @@
|
||||
mutation ConnectMessenger($input: ConnectMessengerInput!) {
|
||||
connectMessenger(input: $input) {
|
||||
id
|
||||
type
|
||||
channelId
|
||||
isActive
|
||||
}
|
||||
}
|
||||
294
graphql/schema.graphql
Normal file
294
graphql/schema.graphql
Normal file
@@ -0,0 +1,294 @@
|
||||
scalar DateTime
|
||||
scalar JSON
|
||||
|
||||
enum UserRole {
|
||||
CLIENT
|
||||
MANAGER
|
||||
}
|
||||
|
||||
enum MessengerType {
|
||||
TELEGRAM
|
||||
MAX
|
||||
}
|
||||
|
||||
enum RegistrationStatus {
|
||||
PENDING
|
||||
APPROVED
|
||||
REJECTED
|
||||
}
|
||||
|
||||
enum OrderKind {
|
||||
READY
|
||||
CALCULATION
|
||||
}
|
||||
|
||||
enum OrderStatus {
|
||||
NEW
|
||||
MANAGER_PROCESSING
|
||||
WAITING_DOUBLE_CONFIRM
|
||||
CLIENT_REJECTED
|
||||
MANAGER_REJECTED
|
||||
MANAGER_BLOCKED
|
||||
CONFIRMED
|
||||
IN_PROGRESS
|
||||
COMPLETED
|
||||
}
|
||||
|
||||
enum WithdrawalStatus {
|
||||
PENDING
|
||||
APPROVED
|
||||
REJECTED
|
||||
}
|
||||
|
||||
enum Decision {
|
||||
APPROVE
|
||||
REJECT
|
||||
}
|
||||
|
||||
type Company {
|
||||
id: ID!
|
||||
name: String!
|
||||
inn: String
|
||||
}
|
||||
|
||||
type User {
|
||||
id: ID!
|
||||
email: String!
|
||||
fullName: String!
|
||||
role: UserRole!
|
||||
company: Company
|
||||
}
|
||||
|
||||
type Invitation {
|
||||
id: ID!
|
||||
token: String!
|
||||
email: String!
|
||||
companyName: String!
|
||||
managerId: ID!
|
||||
acceptedById: ID
|
||||
expiresAt: DateTime!
|
||||
acceptedAt: DateTime
|
||||
createdAt: DateTime!
|
||||
}
|
||||
|
||||
type RegistrationRequest {
|
||||
id: ID!
|
||||
companyName: String!
|
||||
inn: String
|
||||
contactName: String!
|
||||
email: String!
|
||||
status: RegistrationStatus!
|
||||
rejectionReason: String
|
||||
reviewedById: ID
|
||||
createdAt: DateTime!
|
||||
updatedAt: DateTime!
|
||||
}
|
||||
|
||||
type MessengerConnection {
|
||||
id: ID!
|
||||
userId: ID!
|
||||
type: MessengerType!
|
||||
channelId: String!
|
||||
isActive: Boolean!
|
||||
}
|
||||
|
||||
type Warehouse {
|
||||
id: ID!
|
||||
code: String!
|
||||
name: String!
|
||||
}
|
||||
|
||||
type ProductWarehouseBalance {
|
||||
warehouse: Warehouse!
|
||||
availableQty: Float!
|
||||
}
|
||||
|
||||
type Product {
|
||||
id: ID!
|
||||
sku: String!
|
||||
name: String!
|
||||
description: String
|
||||
isCustomizable: Boolean!
|
||||
isActive: Boolean!
|
||||
availableInWarehouses: [ProductWarehouseBalance!]!
|
||||
}
|
||||
|
||||
type OrderItem {
|
||||
id: ID!
|
||||
productId: ID
|
||||
productName: String!
|
||||
quantity: Float!
|
||||
}
|
||||
|
||||
type OrderStatusEvent {
|
||||
id: ID!
|
||||
status: OrderStatus!
|
||||
actorUserId: ID!
|
||||
note: String
|
||||
createdAt: DateTime!
|
||||
}
|
||||
|
||||
type Order {
|
||||
id: ID!
|
||||
code: String!
|
||||
kind: OrderKind!
|
||||
status: OrderStatus!
|
||||
customerId: ID!
|
||||
managerId: ID
|
||||
clientApproved: Boolean
|
||||
managerApproved: Boolean
|
||||
blockReason: String
|
||||
deliveryTerms: String
|
||||
deliveryFee: Float
|
||||
totalPrice: Float
|
||||
calculationPayload: JSON
|
||||
items: [OrderItem!]!
|
||||
history: [OrderStatusEvent!]!
|
||||
createdAt: DateTime!
|
||||
updatedAt: DateTime!
|
||||
}
|
||||
|
||||
type ReferralLink {
|
||||
id: ID!
|
||||
referrerId: ID!
|
||||
refereeId: ID!
|
||||
createdAt: DateTime!
|
||||
}
|
||||
|
||||
type BonusTransaction {
|
||||
id: ID!
|
||||
userId: ID!
|
||||
amount: Float!
|
||||
reason: String!
|
||||
orderId: ID
|
||||
createdAt: DateTime!
|
||||
}
|
||||
|
||||
type RewardWithdrawalRequest {
|
||||
id: ID!
|
||||
requesterId: ID!
|
||||
amount: Float!
|
||||
status: WithdrawalStatus!
|
||||
reviewedById: ID
|
||||
reviewComment: String
|
||||
createdAt: DateTime!
|
||||
updatedAt: DateTime!
|
||||
}
|
||||
|
||||
type ReferralStats {
|
||||
referrerId: ID!
|
||||
availableBalance: Float!
|
||||
referralsCount: Int!
|
||||
transactions: [BonusTransaction!]!
|
||||
pendingWithdrawals: [RewardWithdrawalRequest!]!
|
||||
}
|
||||
|
||||
type Query {
|
||||
healthcheck: String!
|
||||
me: User
|
||||
clientProducts: [Product!]!
|
||||
myOrders: [Order!]!
|
||||
myCurrentOrders: [Order!]!
|
||||
managerOrders(status: OrderStatus): [Order!]!
|
||||
registrationRequests(status: RegistrationStatus): [RegistrationRequest!]!
|
||||
referralStats: ReferralStats!
|
||||
}
|
||||
|
||||
input RegisterSelfInput {
|
||||
companyName: String!
|
||||
inn: String
|
||||
contactName: String!
|
||||
email: String!
|
||||
}
|
||||
|
||||
input ReviewRegistrationRequestInput {
|
||||
requestId: ID!
|
||||
decision: Decision!
|
||||
rejectionReason: String
|
||||
}
|
||||
|
||||
input CreateInvitationInput {
|
||||
email: String!
|
||||
companyName: String!
|
||||
expiresInDays: Int = 7
|
||||
}
|
||||
|
||||
input AcceptInvitationInput {
|
||||
token: String!
|
||||
fullName: String!
|
||||
}
|
||||
|
||||
input ConnectMessengerInput {
|
||||
type: MessengerType!
|
||||
channelId: String!
|
||||
}
|
||||
|
||||
input ReadyOrderItemInput {
|
||||
productId: ID!
|
||||
quantity: Float!
|
||||
}
|
||||
|
||||
input SubmitReadyOrderInput {
|
||||
items: [ReadyOrderItemInput!]!
|
||||
}
|
||||
|
||||
input SubmitCalculationOrderInput {
|
||||
productName: String!
|
||||
quantity: Float!
|
||||
parameters: JSON!
|
||||
}
|
||||
|
||||
input SetOrderOfferInput {
|
||||
orderId: ID!
|
||||
deliveryTerms: String!
|
||||
deliveryFee: Float!
|
||||
totalPrice: Float!
|
||||
}
|
||||
|
||||
input BlockOrderInput {
|
||||
orderId: ID!
|
||||
reason: String!
|
||||
}
|
||||
|
||||
input CreateReferralInput {
|
||||
refereeUserId: ID!
|
||||
}
|
||||
|
||||
input AddBonusTransactionInput {
|
||||
userId: ID!
|
||||
amount: Float!
|
||||
reason: String!
|
||||
orderId: ID
|
||||
}
|
||||
|
||||
input RequestRewardWithdrawalInput {
|
||||
amount: Float!
|
||||
}
|
||||
|
||||
input ReviewRewardWithdrawalInput {
|
||||
withdrawalId: ID!
|
||||
decision: Decision!
|
||||
reviewComment: String
|
||||
}
|
||||
|
||||
type Mutation {
|
||||
registerSelf(input: RegisterSelfInput!): RegistrationRequest!
|
||||
reviewRegistrationRequest(input: ReviewRegistrationRequestInput!): RegistrationRequest!
|
||||
createInvitation(input: CreateInvitationInput!): Invitation!
|
||||
acceptInvitation(input: AcceptInvitationInput!): User!
|
||||
connectMessenger(input: ConnectMessengerInput!): MessengerConnection!
|
||||
|
||||
submitReadyOrder(input: SubmitReadyOrderInput!): Order!
|
||||
submitCalculationOrder(input: SubmitCalculationOrderInput!): Order!
|
||||
managerSetOrderOffer(input: SetOrderOfferInput!): Order!
|
||||
clientReviewOrder(orderId: ID!, decision: Decision!): Order!
|
||||
managerFinalizeOrder(orderId: ID!, decision: Decision!): Order!
|
||||
blockOrder(input: BlockOrderInput!): Order!
|
||||
startOrderWork(orderId: ID!): Order!
|
||||
completeOrder(orderId: ID!): Order!
|
||||
|
||||
createReferral(input: CreateReferralInput!): ReferralLink!
|
||||
addBonusTransaction(input: AddBonusTransactionInput!): BonusTransaction!
|
||||
requestRewardWithdrawal(input: RequestRewardWithdrawalInput!): RewardWithdrawalRequest!
|
||||
reviewRewardWithdrawal(input: ReviewRewardWithdrawalInput!): RewardWithdrawalRequest!
|
||||
}
|
||||
Reference in New Issue
Block a user