diff --git a/app/components/ui/AppHeader.vue b/app/components/ui/AppHeader.vue index fe6dae3..4164761 100644 --- a/app/components/ui/AppHeader.vue +++ b/app/components/ui/AppHeader.vue @@ -1,6 +1,7 @@ @@ -45,7 +49,7 @@ async function reviewWithdrawal() {
← Назад к бонусам -
+
Загружаем заявку на вывод...
@@ -57,7 +61,9 @@ async function reviewWithdrawal() {

Вывод

Проверка заявки на вывод

-

Пользователь: {{ currentWithdrawal.requesterId }} · Сумма: {{ currentWithdrawal.amount }}

+

+ {{ currentWithdrawal.requesterFullName }} · {{ currentWithdrawal.requesterEmail }} · Сумма: {{ currentWithdrawal.amount }} +

diff --git a/app/utils/roles.ts b/app/utils/roles.ts new file mode 100644 index 0000000..edc6ab9 --- /dev/null +++ b/app/utils/roles.ts @@ -0,0 +1,5 @@ +import { UserRole } from '~/composables/graphql/generated'; + +export function hasManagerAccess(role?: UserRole | null) { + return role === UserRole.Manager || role === UserRole.SuperManager; +} diff --git a/graphql/operations/manager/manager-withdrawal-requests.graphql b/graphql/operations/manager/manager-withdrawal-requests.graphql new file mode 100644 index 0000000..5b12b65 --- /dev/null +++ b/graphql/operations/manager/manager-withdrawal-requests.graphql @@ -0,0 +1,15 @@ +query ManagerWithdrawalRequests($status: WithdrawalStatus) { + managerWithdrawalRequests(status: $status) { + id + requesterId + requesterEmail + requesterFullName + companyName + amount + status + reviewedById + reviewComment + createdAt + updatedAt + } +} diff --git a/graphql/schema.graphql b/graphql/schema.graphql index f8a8e87..957163f 100644 --- a/graphql/schema.graphql +++ b/graphql/schema.graphql @@ -4,6 +4,7 @@ scalar JSON enum UserRole { CLIENT MANAGER + SUPER_MANAGER } enum MessengerType { @@ -306,6 +307,20 @@ type ManagerBonusBalance { transactionsCount: Int! } +type ManagerWithdrawalRequest { + id: ID! + requesterId: ID! + requesterEmail: String! + requesterFullName: String! + companyName: String + amount: Float! + status: WithdrawalStatus! + reviewedById: ID + reviewComment: String + createdAt: DateTime! + updatedAt: DateTime! +} + type Query { healthcheck: String! me: User @@ -321,6 +336,7 @@ type Query { managerUsers: [ManagerUser!]! managerOrders(status: OrderStatus): [Order!]! managerBonusBalances: [ManagerBonusBalance!]! + managerWithdrawalRequests(status: WithdrawalStatus): [ManagerWithdrawalRequest!]! registrationRequests(status: RegistrationStatus): [RegistrationRequest!]! referralStats: ReferralStats! }