Skip to content

Commit

Permalink
chore: rename payment status related types internally
Browse files Browse the repository at this point in the history
  • Loading branch information
dolcalmi committed Feb 9, 2024
1 parent 644f70e commit aa21f0a
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 12 deletions.
24 changes: 24 additions & 0 deletions apps/dashboard/services/graphql/generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -679,13 +679,19 @@ export type LnInvoicePaymentInput = {
readonly walletId: Scalars['WalletId']['input'];
};

export type LnInvoicePaymentStatusByHashInput = {
readonly paymentHash: Scalars['PaymentHash']['input'];
};

export type LnInvoicePaymentStatusInput = {
readonly paymentRequest: Scalars['LnPaymentRequest']['input'];
};

export type LnInvoicePaymentStatusPayload = {
readonly __typename: 'LnInvoicePaymentStatusPayload';
readonly errors: ReadonlyArray<Error>;
readonly paymentHash?: Maybe<Scalars['PaymentHash']['output']>;
readonly paymentRequest?: Maybe<Scalars['LnPaymentRequest']['output']>;
readonly status?: Maybe<InvoicePaymentStatus>;
};

Expand Down Expand Up @@ -1510,6 +1516,7 @@ export type Query = {
readonly currencyList: ReadonlyArray<Currency>;
readonly globals?: Maybe<Globals>;
readonly lnInvoicePaymentStatus: LnInvoicePaymentStatusPayload;
readonly lnInvoicePaymentStatusByHash: LnInvoicePaymentStatusPayload;
readonly me?: Maybe<User>;
readonly mobileVersions?: Maybe<ReadonlyArray<Maybe<MobileVersions>>>;
readonly onChainTxFee: OnChainTxFee;
Expand Down Expand Up @@ -1539,6 +1546,11 @@ export type QueryLnInvoicePaymentStatusArgs = {
};


export type QueryLnInvoicePaymentStatusByHashArgs = {
input: LnInvoicePaymentStatusByHashInput;
};


export type QueryOnChainTxFeeArgs = {
address: Scalars['OnChainAddress']['input'];
amount: Scalars['SatAmount']['input'];
Expand Down Expand Up @@ -1659,6 +1671,7 @@ export type SettlementViaOnChain = {
export type Subscription = {
readonly __typename: 'Subscription';
readonly lnInvoicePaymentStatus: LnInvoicePaymentStatusPayload;
readonly lnInvoicePaymentStatusByHash: LnInvoicePaymentStatusPayload;
readonly myUpdates: MyUpdatesPayload;
readonly price: PricePayload;
/** Returns the price of 1 satoshi */
Expand All @@ -1671,6 +1684,11 @@ export type SubscriptionLnInvoicePaymentStatusArgs = {
};


export type SubscriptionLnInvoicePaymentStatusByHashArgs = {
input: LnInvoicePaymentStatusByHashInput;
};


export type SubscriptionPriceArgs = {
input: PriceInput;
};
Expand Down Expand Up @@ -3349,6 +3367,7 @@ export type ResolversTypes = {
LnInvoiceFeeProbeInput: LnInvoiceFeeProbeInput;
LnInvoicePayload: ResolverTypeWrapper<LnInvoicePayload>;
LnInvoicePaymentInput: LnInvoicePaymentInput;
LnInvoicePaymentStatusByHashInput: LnInvoicePaymentStatusByHashInput;
LnInvoicePaymentStatusInput: LnInvoicePaymentStatusInput;
LnInvoicePaymentStatusPayload: ResolverTypeWrapper<LnInvoicePaymentStatusPayload>;
LnNoAmountInvoice: ResolverTypeWrapper<LnNoAmountInvoice>;
Expand Down Expand Up @@ -3564,6 +3583,7 @@ export type ResolversParentTypes = {
LnInvoiceFeeProbeInput: LnInvoiceFeeProbeInput;
LnInvoicePayload: LnInvoicePayload;
LnInvoicePaymentInput: LnInvoicePaymentInput;
LnInvoicePaymentStatusByHashInput: LnInvoicePaymentStatusByHashInput;
LnInvoicePaymentStatusInput: LnInvoicePaymentStatusInput;
LnInvoicePaymentStatusPayload: LnInvoicePaymentStatusPayload;
LnNoAmountInvoice: LnNoAmountInvoice;
Expand Down Expand Up @@ -4041,6 +4061,8 @@ export type LnInvoicePayloadResolvers<ContextType = any, ParentType extends Reso

export type LnInvoicePaymentStatusPayloadResolvers<ContextType = any, ParentType extends ResolversParentTypes['LnInvoicePaymentStatusPayload'] = ResolversParentTypes['LnInvoicePaymentStatusPayload']> = {
errors?: Resolver<ReadonlyArray<ResolversTypes['Error']>, ParentType, ContextType>;
paymentHash?: Resolver<Maybe<ResolversTypes['PaymentHash']>, ParentType, ContextType>;
paymentRequest?: Resolver<Maybe<ResolversTypes['LnPaymentRequest']>, ParentType, ContextType>;
status?: Resolver<Maybe<ResolversTypes['InvoicePaymentStatus']>, ParentType, ContextType>;
__isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
};
Expand Down Expand Up @@ -4341,6 +4363,7 @@ export type QueryResolvers<ContextType = any, ParentType extends ResolversParent
currencyList?: Resolver<ReadonlyArray<ResolversTypes['Currency']>, ParentType, ContextType>;
globals?: Resolver<Maybe<ResolversTypes['Globals']>, ParentType, ContextType>;
lnInvoicePaymentStatus?: Resolver<ResolversTypes['LnInvoicePaymentStatusPayload'], ParentType, ContextType, RequireFields<QueryLnInvoicePaymentStatusArgs, 'input'>>;
lnInvoicePaymentStatusByHash?: Resolver<ResolversTypes['LnInvoicePaymentStatusPayload'], ParentType, ContextType, RequireFields<QueryLnInvoicePaymentStatusByHashArgs, 'input'>>;
me?: Resolver<Maybe<ResolversTypes['User']>, ParentType, ContextType>;
mobileVersions?: Resolver<Maybe<ReadonlyArray<Maybe<ResolversTypes['MobileVersions']>>>, ParentType, ContextType>;
onChainTxFee?: Resolver<ResolversTypes['OnChainTxFee'], ParentType, ContextType, RequireFields<QueryOnChainTxFeeArgs, 'address' | 'amount' | 'speed' | 'walletId'>>;
Expand Down Expand Up @@ -4438,6 +4461,7 @@ export interface SignedDisplayMajorAmountScalarConfig extends GraphQLScalarTypeC

export type SubscriptionResolvers<ContextType = any, ParentType extends ResolversParentTypes['Subscription'] = ResolversParentTypes['Subscription']> = {
lnInvoicePaymentStatus?: SubscriptionResolver<ResolversTypes['LnInvoicePaymentStatusPayload'], "lnInvoicePaymentStatus", ParentType, ContextType, RequireFields<SubscriptionLnInvoicePaymentStatusArgs, 'input'>>;
lnInvoicePaymentStatusByHash?: SubscriptionResolver<ResolversTypes['LnInvoicePaymentStatusPayload'], "lnInvoicePaymentStatusByHash", ParentType, ContextType, RequireFields<SubscriptionLnInvoicePaymentStatusByHashArgs, 'input'>>;
myUpdates?: SubscriptionResolver<ResolversTypes['MyUpdatesPayload'], "myUpdates", ParentType, ContextType>;
price?: SubscriptionResolver<ResolversTypes['PricePayload'], "price", ParentType, ContextType, RequireFields<SubscriptionPriceArgs, 'input'>>;
realtimePrice?: SubscriptionResolver<ResolversTypes['RealtimePricePayload'], "realtimePrice", ParentType, ContextType, RequireFields<SubscriptionRealtimePriceArgs, 'input'>>;
Expand Down
35 changes: 35 additions & 0 deletions core/api/dev/apollo-federation/supergraph.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -1043,6 +1043,40 @@ type MapMarker
scalar Memo
@join__type(graph: PUBLIC)

type Merchant
@join__type(graph: PUBLIC)
{
"""
GPS coordinates for the merchant that can be used to place the related business on a map
"""
coordinates: Coordinates!
createdAt: Timestamp!
id: ID!
title: String!

"""The username of the merchant"""
username: Username!

"""Whether the merchant has been validated"""
validated: Boolean!
}

input MerchantMapSuggestInput
@join__type(graph: PUBLIC)
{
latitude: Float!
longitude: Float!
title: String!
username: Username!
}

type MerchantPayload
@join__type(graph: PUBLIC)
{
errors: [Error!]!
merchant: Merchant
}

"""(Positive) amount of minutes"""
scalar Minutes
@join__type(graph: PUBLIC)
Expand Down Expand Up @@ -1176,6 +1210,7 @@ type Mutation

"""Sends a payment to a lightning address."""
lnurlPaymentSend(input: LnurlPaymentSendInput!): PaymentSendPayload! @join__field(graph: PUBLIC)
merchantMapSuggest(input: MerchantMapSuggestInput!): MerchantPayload! @join__field(graph: PUBLIC)
onChainAddressCreate(input: OnChainAddressCreateInput!): OnChainAddressPayload! @join__field(graph: PUBLIC)
onChainAddressCurrent(input: OnChainAddressCurrentInput!): OnChainAddressPayload! @join__field(graph: PUBLIC)
onChainPaymentSend(input: OnChainPaymentSendInput!): PaymentSendPayload! @join__field(graph: PUBLIC)
Expand Down
4 changes: 2 additions & 2 deletions core/api/src/graphql/public/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import UsernameAvailableQuery from "@/graphql/public/root/query/username-availab
import BusinessMapMarkersQuery from "@/graphql/public/root/query/business-map-markers"
import AccountDefaultWalletQuery from "@/graphql/public/root/query/account-default-wallet"
import AccountDefaultWalletIdQuery from "@/graphql/public/root/query/account-default-wallet-id"
import LnInvoicePaymentStatusQuery from "@/graphql/public/root/query/ln-invoice-payment-status"
import LnInvoicePaymentStatusByRequestQuery from "@/graphql/public/root/query/ln-invoice-payment-status-by-request"
import LnInvoicePaymentStatusByHashQuery from "@/graphql/public/root/query/ln-invoice-payment-status-by-hash"

export const queryFields = {
Expand All @@ -27,7 +27,7 @@ export const queryFields = {
mobileVersions: MobileVersionsQuery,
realtimePrice: RealtimePriceQuery,
btcPriceList: BtcPriceListQuery,
lnInvoicePaymentStatus: LnInvoicePaymentStatusQuery,
lnInvoicePaymentStatus: LnInvoicePaymentStatusByRequestQuery,
lnInvoicePaymentStatusByHash: LnInvoicePaymentStatusByHashQuery,
},
authed: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import { WalletInvoiceStatus } from "@/domain/wallet-invoices"
import { GT } from "@/graphql/index"
import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map"
import LnInvoicePaymentStatusPayload from "@/graphql/public/types/payload/ln-invoice-payment-status"
import LnInvoicePaymentStatusInput from "@/graphql/public/types/object/ln-invoice-payment-status-input"
import LnInvoicePaymentStatusByRequestInput from "@/graphql/public/types/object/ln-invoice-payment-status-by-request-input"

const LnInvoicePaymentStatusQuery = GT.Field({
type: GT.NonNull(LnInvoicePaymentStatusPayload),
args: {
input: { type: GT.NonNull(LnInvoicePaymentStatusInput) },
input: { type: GT.NonNull(LnInvoicePaymentStatusByRequestInput) },
},
resolve: async (_, args) => {
const { paymentRequest } = args.input
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { baseLogger } from "@/services/logger"

import { GT } from "@/graphql/index"
import LnInvoicePaymentStatusPayload from "@/graphql/public/types/payload/ln-invoice-payment-status"
import LnInvoicePaymentStatusInput from "@/graphql/public/types/object/ln-invoice-payment-status-input"
import LnInvoicePaymentStatusByRequestInput from "@/graphql/public/types/object/ln-invoice-payment-status-by-request-input"
import { UnknownClientError } from "@/graphql/error"
import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map"
import { WalletInvoiceStatus } from "@/domain/wallet-invoices"
Expand All @@ -27,10 +27,10 @@ type LnInvoicePaymentResolveSource = {
paymentRequest?: EncodedPaymentRequest
}

const LnInvoicePaymentStatusSubscription = {
const LnInvoicePaymentStatusByRequestSubscription = {
type: GT.NonNull(LnInvoicePaymentStatusPayload),
args: {
input: { type: GT.NonNull(LnInvoicePaymentStatusInput) },
input: { type: GT.NonNull(LnInvoicePaymentStatusByRequestInput) },
},
resolve: async (source: LnInvoicePaymentResolveSource | undefined) => {
if (source === undefined) {
Expand Down Expand Up @@ -120,4 +120,4 @@ const LnInvoicePaymentStatusSubscription = {
},
}

export default LnInvoicePaymentStatusSubscription
export default LnInvoicePaymentStatusByRequestSubscription
4 changes: 2 additions & 2 deletions core/api/src/graphql/public/subscriptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { GT } from "@/graphql/index"
import PriceSubscription from "@/graphql/public/root/subscription/price"
import MyUpdatesSubscription from "@/graphql/public/root/subscription/my-updates"
import RealtimePriceSubscription from "@/graphql/public/root/subscription/realtime-price"
import LnInvoicePaymentStatusSubscription from "@/graphql/public/root/subscription/ln-invoice-payment-status"
import LnInvoicePaymentStatusByRequestSubscription from "@/graphql/public/root/subscription/ln-invoice-payment-status-by-request"
import LnInvoicePaymentStatusByHashSubscription from "@/graphql/public/root/subscription/ln-invoice-payment-status-by-hash"
import {
ACCOUNT_USERNAME,
Expand All @@ -15,7 +15,7 @@ const fields = {
myUpdates: MyUpdatesSubscription,
price: PriceSubscription,
realtimePrice: RealtimePriceSubscription,
lnInvoicePaymentStatus: LnInvoicePaymentStatusSubscription,
lnInvoicePaymentStatus: LnInvoicePaymentStatusByRequestSubscription,
lnInvoicePaymentStatusByHash: LnInvoicePaymentStatusByHashSubscription,
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { GT } from "@/graphql/index"
import LnPaymentRequest from "@/graphql/shared/types/scalar/ln-payment-request"

const LnInvoicePaymentStatusInput = GT.Input({
const LnInvoicePaymentStatusByRequestInput = GT.Input({
name: "LnInvoicePaymentStatusInput",
fields: () => ({
paymentRequest: { type: GT.NonNull(LnPaymentRequest) },
}),
})

export default LnInvoicePaymentStatusInput
export default LnInvoicePaymentStatusByRequestInput

0 comments on commit aa21f0a

Please sign in to comment.