Skip to content

Commit

Permalink
feat(quote): remove internal fields from schema (#2858)
Browse files Browse the repository at this point in the history
* feat(quote): remote internaly used fields

* test(quote): remove removed fields from resolvers response

* docs(bruno): remove internal fields

* feat(quote): add estimatedExchangeRate field

* docs(bruno): add estimatedExchangeRate to quote query

* feat(lint): everything

* fix(incoming-payment): service test

* fix(bruno): remove deprecated internal quote fields
  • Loading branch information
golobitch authored Aug 20, 2024
1 parent 3fd3b90 commit 8e96bc3
Show file tree
Hide file tree
Showing 19 changed files with 36 additions and 187 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@ body:graphql {
quote {
createdAt
expiresAt
highEstimatedExchangeRate
id
lowEstimatedExchangeRate
maxPacketAmount
minExchangeRate
walletAddressId
receiveAmount {
assetCode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@ body:graphql {
quote {
createdAt
expiresAt
highEstimatedExchangeRate
id
lowEstimatedExchangeRate
maxPacketAmount
minExchangeRate
walletAddressId
receiveAmount {
assetCode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,8 @@ body:graphql {
quote {
createdAt
expiresAt
highEstimatedExchangeRate
id
lowEstimatedExchangeRate
maxPacketAmount
minExchangeRate
estimatedExchangeRate
walletAddressId
receiveAmount {
assetCode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,9 @@ body:graphql {
quote {
createdAt
expiresAt
highEstimatedExchangeRate
id
lowEstimatedExchangeRate
maxPacketAmount
minExchangeRate
walletAddressId
estimatedExchangeRate
receiveAmount {
assetCode
assetScale
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,8 @@ body:graphql {
quote {
createdAt
expiresAt
highEstimatedExchangeRate
id
lowEstimatedExchangeRate
maxPacketAmount
minExchangeRate
estimatedExchangeRate
walletAddressId
receiveAmount {
assetCode
Expand Down
4 changes: 0 additions & 4 deletions bruno/collections/Rafiki/Rafiki Admin APIs/Create Quote.bru
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@ body:graphql {
quote {
createdAt
expiresAt
highEstimatedExchangeRate
id
lowEstimatedExchangeRate
maxPacketAmount
minExchangeRate
walletAddressId
receiveAmount {
assetCode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,9 @@ body:graphql {
quote {
createdAt
expiresAt
highEstimatedExchangeRate
id
lowEstimatedExchangeRate
maxPacketAmount
minExchangeRate
walletAddressId
estimatedExchangeRate
receiveAmount {
assetCode
assetScale
Expand Down
5 changes: 1 addition & 4 deletions bruno/collections/Rafiki/Rafiki Admin APIs/Get Quote.bru
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,10 @@ body:graphql {
query GetQuote($id: String!) {
quote(id: $id) {
createdAt
highEstimatedExchangeRate
expiresAt
id
lowEstimatedExchangeRate
maxPacketAmount
minExchangeRate
walletAddressId
estimatedExchangeRate
receiveAmount {
assetCode
assetScale
Expand Down
15 changes: 3 additions & 12 deletions localenv/mock-account-servicing-entity/generated/graphql.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

68 changes: 8 additions & 60 deletions packages/backend/src/graphql/generated/graphql.schema.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 3 additions & 12 deletions packages/backend/src/graphql/generated/graphql.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 4 additions & 10 deletions packages/backend/src/graphql/resolvers/outgoing_payment.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,7 @@ describe('OutgoingPayment Resolvers', (): void => {
metadata
quote {
id
maxPacketAmount
minExchangeRate
lowEstimatedExchangeRate
highEstimatedExchangeRate
estimatedExchangeRate
createdAt
expiresAt
}
Expand Down Expand Up @@ -245,14 +242,11 @@ describe('OutgoingPayment Resolvers', (): void => {
metadata,
quote: {
id: payment.quote.id,
maxPacketAmount: payment.quote.maxPacketAmount.toString(),
minExchangeRate: payment.quote.minExchangeRate.valueOf(),
lowEstimatedExchangeRate:
payment.quote.lowEstimatedExchangeRate.valueOf(),
highEstimatedExchangeRate:
payment.quote.highEstimatedExchangeRate.valueOf(),
createdAt: payment.quote.createdAt.toISOString(),
expiresAt: payment.quote.expiresAt.toISOString(),
estimatedExchangeRate: payment.quote.estimatedExchangeRate
? parseFloat(payment.quote.estimatedExchangeRate?.toString())
: undefined,
__typename: 'Quote'
},
createdAt: payment.createdAt.toISOString(),
Expand Down
8 changes: 0 additions & 8 deletions packages/backend/src/graphql/resolvers/quote.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,6 @@ describe('Quote Resolvers', (): void => {
assetCode
assetScale
}
maxPacketAmount
minExchangeRate
lowEstimatedExchangeRate
highEstimatedExchangeRate
createdAt
expiresAt
}
Expand Down Expand Up @@ -124,10 +120,6 @@ describe('Quote Resolvers', (): void => {
assetScale: quote.receiveAmount.assetScale,
__typename: 'Amount'
},
maxPacketAmount: quote.maxPacketAmount.toString(),
minExchangeRate: quote.minExchangeRate.valueOf(),
lowEstimatedExchangeRate: quote.lowEstimatedExchangeRate.valueOf(),
highEstimatedExchangeRate: quote.highEstimatedExchangeRate.valueOf(),
createdAt: quote.createdAt.toISOString(),
expiresAt: quote.expiresAt.toISOString(),
__typename: 'Quote'
Expand Down
7 changes: 2 additions & 5 deletions packages/backend/src/graphql/resolvers/quote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,8 @@ export function quoteToGraphql(quote: Quote): SchemaQuote {
receiver: quote.receiver,
debitAmount: quote.debitAmount,
receiveAmount: quote.receiveAmount,
maxPacketAmount: quote.maxPacketAmount,
minExchangeRate: quote.minExchangeRate.valueOf(),
lowEstimatedExchangeRate: quote.lowEstimatedExchangeRate.valueOf(),
highEstimatedExchangeRate: quote.highEstimatedExchangeRate.valueOf(),
createdAt: new Date(+quote.createdAt).toISOString(),
expiresAt: new Date(+quote.expiresAt).toISOString()
expiresAt: new Date(+quote.expiresAt).toISOString(),
estimatedExchangeRate: quote.estimatedExchangeRate?.valueOf()
}
}
10 changes: 2 additions & 8 deletions packages/backend/src/graphql/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -957,18 +957,12 @@ type Quote {
debitAmount: Amount!
"Amount to receive (fixed receive)"
receiveAmount: Amount!
"Maximum value per packet allowed on the possible routes"
maxPacketAmount: UInt64!
"Aggregate exchange rate the payment is guaranteed to meet"
minExchangeRate: Float!
"Lower bound of probed exchange rate"
lowEstimatedExchangeRate: Float!
"Upper bound of probed exchange rate"
highEstimatedExchangeRate: Float!
"Date-time of creation"
createdAt: String!
"Date-time of expiration"
expiresAt: String!
"Estimated exchange rate"
estimatedExchangeRate: Float
}

input AmountInput {
Expand Down
15 changes: 3 additions & 12 deletions packages/frontend/app/generated/graphql.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8e96bc3

Please sign in to comment.