Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions dev/apollo-federation/supergraph.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -240,19 +240,17 @@ type Bank
type BankAccount
@join__type(graph: PUBLIC)
{
accountName: String!
accountName: String
accountNumber: String!
accountType: String!

"""Name of the bank institution"""
bank: String!
branchCode: String!
bankBranch: String!
bankName: String!

"""Account currency (e.g. JMD, USD)"""
currency: String!

"""ERPNext bank account identifier"""
id: ID!
id: ID
isDefault: Boolean!
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
meta {
name: latestAccountUpgradeRequest
type: graphql
seq: 10
}

post {
url: {{flashGraphqlUrl}}
body: graphql
auth: inherit
}

body:graphql {
query latestAccountUpgradeRequest {
latestAccountUpgradeRequest {
errors {
message
}
upgradeRequest {
name
fullName
email
phoneNumber
username
currentLevel
requestedLevel
status
idDocument
terminalsRequested
address {
title
line1
line2
city
state
postalCode
country
}
bankAccount {
id
accountName
bankName
bankBranch
accountNumber
accountType
currency
isDefault
}
}
}
}
}

settings {
encodeUrl: true
}
1 change: 1 addition & 0 deletions src/graphql/public/root/query/account-upgrade-request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const LatestAccountUpgradeRequestQuery = GT.Field({
)
if (result instanceof UpgradeRequestQueryError) return apolloErrorResponse(new InternalServerError({ message: result.message }))
if (result.length === 0) return apolloErrorResponse(new NotFoundError({ message: "No upgrade requests found for account." }))
console.log({ ...result }, "LatestAccountUpgradeRequestQuery result")
return { upgradeRequest: result[0] }
},
})
Expand Down
10 changes: 4 additions & 6 deletions src/graphql/public/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -219,19 +219,17 @@ type Bank {
}

type BankAccount {
accountName: String!
accountName: String
accountNumber: String!
accountType: String!

"""Name of the bank institution"""
bank: String!
branchCode: String!
bankBranch: String!
bankName: String!

"""Account currency (e.g. JMD, USD)"""
currency: String!

"""ERPNext bank account identifier"""
id: ID!
id: ID
isDefault: Boolean!
}

Expand Down
15 changes: 7 additions & 8 deletions src/graphql/public/types/object/bank-account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,25 @@ const GraphQLBankAccount: GraphQLObjectType<BankAccount> = GT.Object({
name: "BankAccount",
fields: () => ({
id: {
type: GT.NonNullID,
type: GT.ID,
description: "ERPNext bank account identifier",
resolve: (o) => o.name,
},
accountName: {
type: GT.NonNull(GT.String),
type: GT.String,
resolve: (o) => o.account_name,
},
bank: {
bankName: {
type: GT.NonNull(GT.String),
description: "Name of the bank institution",
resolve: (o) => o.bank,
},
accountNumber: {
bankBranch: {
type: GT.NonNull(GT.String),
resolve: (o) => o.bank_account_no,
resolve: (o) => o.branch_code,
},
branchCode: {
accountNumber: {
type: GT.NonNull(GT.String),
resolve: (o) => o.branch_code,
resolve: (o) => o.bank_account_no,
},
accountType: {
type: GT.NonNull(GT.String),
Expand Down
6 changes: 3 additions & 3 deletions src/services/ibex/webhook-server/routes/on-pay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ router.get(
if (account instanceof Error) {
return resp.status(404).json({ error: "User not found" })
}
const wallet = await WalletsRepository().listByAccountId(account.id)
if (!wallet || wallet instanceof Error || wallet.length === 0) {
const wallet = await WalletsRepository().findById(account.defaultWalletId)
if (!wallet || wallet instanceof Error) {
return resp.status(404).json({ error: "No wallet found for this user" })
}
const lnurlp = wallet[0].lnurlp
const lnurlp = wallet.lnurlp
if (!lnurlp)
return resp.status(404).json({ error: "No lnurlp found for this wallet" })

Expand Down