From 1d210332fe8171f91a6789ccdef7c674838a29e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Granh=C3=A3o?= Date: Fri, 29 Nov 2024 16:40:37 +0000 Subject: [PATCH] Update schema --- crow/src/lib.rs | 15 +-- graphql/schemas/operations.graphql | 32 ++--- graphql/schemas/schema_wallet_read.graphql | 147 +++++---------------- 3 files changed, 58 insertions(+), 136 deletions(-) diff --git a/crow/src/lib.rs b/crow/src/lib.rs index d73c4f0..b245389 100644 --- a/crow/src/lib.rs +++ b/crow/src/lib.rs @@ -12,7 +12,6 @@ use std::time::SystemTime; use graphql::perro::runtime_error; use graphql::schema::complete_topup_setup::CompleteTopupSetupCompleteTopupSetup; -use graphql::schema::start_topup_setup::StartTopupSetupRequest; pub use isocountry::CountryCode; pub use isolanguage_1::LanguageCode; @@ -138,14 +137,12 @@ impl OfferManager { referral_code: Option, ) -> graphql::Result { let variables = start_topup_setup::Variables { - request: StartTopupSetupRequest { - node_pubkey, - provider, - source_iban, - user_currency, - email, - referral_code, - }, + email, + node_pubkey, + provider, + referral_code, + source_iban, + user_currency, }; let access_token = self.auth.query_token()?; let client = build_client(Some(&access_token))?; diff --git a/graphql/schemas/operations.graphql b/graphql/schemas/operations.graphql index 4b083be..0e77f0b 100644 --- a/graphql/schemas/operations.graphql +++ b/graphql/schemas/operations.graphql @@ -191,8 +191,8 @@ mutation EnableLightningAddresses($addresses: [String!]!) { enable_lightning_addresses(addresses: $addresses) } -mutation StartTopupSetup($request: StartTopupSetupRequest!) { - start_topup_setup(startTopupSetupRequest: $request) { +mutation StartTopupSetup($email: String, $node_pubkey: String!, $provider: String!, $referralCode: String, $source_iban: String!, $user_currency: String!) { + start_topup_setup(email: $email, node_pubkey: $node_pubkey, provider: $provider, referralCode: $referralCode, source_iban: $source_iban, user_currency: $user_currency) { id challenge } @@ -201,20 +201,20 @@ mutation StartTopupSetup($request: StartTopupSetupRequest!) { mutation CompleteTopupSetup($id: String!, $signedChallenge: String!, $sourceIban: String!) { complete_topup_setup(id: $id, signed_challenge: $signedChallenge, source_iban: $sourceIban) { id - debitor_iban - creditor_reference - creditor_iban - creditor_bank_name - creditor_bank_street - creditor_bank_postal_code - creditor_bank_town - creditor_bank_country - creditor_bank_bic - creditor_name - creditor_street - creditor_postal_code - creditor_town - creditor_country + debitorIban + creditorReference + creditorIban + creditorBankName + creditorBankStreet + creditorBankPostalCode + creditorBankTown + creditorBankCountry + creditorBankBic + creditorName + creditorStreet + creditorPostalCode + creditorTown + creditorCountry currency } } diff --git a/graphql/schemas/schema_wallet_read.graphql b/graphql/schemas/schema_wallet_read.graphql index 81f0da9..f94df6c 100644 --- a/graphql/schemas/schema_wallet_read.graphql +++ b/graphql/schemas/schema_wallet_read.graphql @@ -58,6 +58,25 @@ enum ChallengeSignatureType { SECP256K1 } +type CompleteTopupSetupResponse { + creditorBankBic: String! + creditorBankCountry: String! + creditorBankName: String! + creditorBankPostalCode: String! + creditorBankStreet: String! + creditorBankTown: String! + creditorCountry: String! + creditorIban: String! + creditorName: String! + creditorPostalCode: String! + creditorReference: String! + creditorStreet: String! + creditorTown: String! + currency: String! + debitorIban: String! + id: String! +} + type CreateBackupResponse { schemaName: String schemaVersion: String @@ -199,6 +218,11 @@ type SessionPermit { walletPubKeyId: String } +type StartTopupSetupResponse { + challenge: String! + id: String! +} + """ Boolean expression to compare columns of type "String". All fields are combined with logical 'AND'. """ @@ -316,7 +340,7 @@ unique or primary key constraints on table "accepted_terms_conditions" """ enum accepted_terms_conditions_constraint { """ - unique or primary key constraint on columns "id", "service" + unique or primary key constraint on columns "service", "id" """ accepted_terms_conditions_pkey } @@ -521,26 +545,6 @@ enum country_select_column { name } -""" -Streaming cursor of the table "country" -""" -input country_stream_cursor_input { - """Stream column input with initial value""" - initial_value: country_stream_cursor_value_input! - - """cursor ordering""" - ordering: cursor_ordering -} - -"""Initial value of the column from where the streaming should start""" -input country_stream_cursor_value_input { - callingCode: String - countryCode: String - currencyCode: bpchar - currencyName: String - name: String -} - """ columns and relationships of "currency" """ @@ -667,39 +671,6 @@ input lightning_address_stream_cursor_value_input { assignedAt: timestamptz } -input StartTopupSetupRequest { - node_pubkey: String! - provider: String! - source_iban: String! - user_currency: String! - email: String - referral_code: String -} - -type StartTopupSetupResponse { - id: String! - challenge: String! -} - -type CompleteTopupSetupResponse { - id: String! - debitor_iban: String! - creditor_reference: String! - creditor_iban: String! - creditor_bank_name: String! - creditor_bank_street: String! - creditor_bank_postal_code: String! - creditor_bank_town: String! - creditor_bank_country: String! - creditor_bank_bic: String! - creditor_name: String! - creditor_street: String! - creditor_postal_code: String! - creditor_town: String! - creditor_country: String! - currency: String! -} - """mutation root""" type mutation_root { """ @@ -762,14 +733,14 @@ type mutation_root { refresh_session(refreshToken: String!): TokenContainer refresh_session_v2(refreshToken: String!): SessionPermit register_notification_token(language: String!, notificationToken: String!): Token - register_topup(email: String, orderId: String!): RegisterTopupResponse + register_topup(email: String, orderId: String!, referralCode: String): RegisterTopupResponse report_payment_telemetry(events: PaymentTelemetryEventsInput, telemetryId: String!): ReportPaymentTelemetryResponse request_phone_number_verification(encryptedNumber: String!, number: String!): Void start_prepared_session(challenge: String!, challengeSignature: String!, challengeSignatureType: ChallengeSignatureType, preparedPermissionToken: String!): TokenContainer start_prepared_session_v2(challenge: String!, challengeSignature: String!, challengeSignatureType: ChallengeSignatureType, preparedPermissionToken: String!): SessionPermit start_session(authPubKey: String!, challenge: String!, challengeSignature: String!, challengeSignatureType: ChallengeSignatureType, signedAuthPubKey: String!, walletPubKey: String!): TokenContainer start_session_v2(authPubKey: String!, challenge: String!, challengeSignature: String!, challengeSignatureType: ChallengeSignatureType, signedAuthPubKey: String!, walletPubKey: String!): SessionPermit - start_topup_setup(startTopupSetupRequest: StartTopupSetupRequest!): StartTopupSetupResponse! + start_topup_setup(email: String, node_pubkey: String!, provider: String!, referralCode: String, source_iban: String!, user_currency: String!): StartTopupSetupResponse! submit_lnurl_pay_invoice(id: String!, invoice: String): Void verify_phone_number(number: String!, otp: String!): Void } @@ -836,9 +807,7 @@ type query_root { backup_service_version: String consumer_service_version: String - """ - fetch data from the table: "country" - """ + """Get information about all countries supported by lipa""" country( """distinct select on columns""" distinct_on: [country_select_column!] @@ -856,12 +825,10 @@ type query_root { where: country_bool_exp ): [country!]! - """fetch data from the table: "country" using primary key columns""" + """Get information about a specific country supported by lipa""" country_by_pk(countryCode: String!): country - """ - fetch data from the table: "currency" - """ + """Get exchange rates for all currencies supported by lipa""" currency( """distinct select on columns""" distinct_on: [currency_select_column!] @@ -879,7 +846,7 @@ type query_root { where: currency_bool_exp ): [currency!]! - """fetch data from the table: "currency" using primary key columns""" + """Get exchange rate for a specific currency supported by lipa""" currency_by_pk( """ISO 4217""" currencyCode: String! @@ -913,9 +880,7 @@ type query_root { prepare_wallet_session(challenge: String!, ownerPubKeyId: String!, signature: String!): String sms_service_version: String - """ - fetch data from the table: "token" - """ + """TEST COMMENT""" token( """distinct select on columns""" distinct_on: [token_select_column!] @@ -1036,46 +1001,7 @@ type subscription_root { where: accepted_terms_conditions_bool_exp ): [accepted_terms_conditions!]! - """ - fetch data from the table: "country" - """ - country( - """distinct select on columns""" - distinct_on: [country_select_column!] - - """limit the number of rows returned""" - limit: Int - - """skip the first n rows. Use only with order_by""" - offset: Int - - """sort the rows by one or more columns""" - order_by: [country_order_by!] - - """filter the rows returned""" - where: country_bool_exp - ): [country!]! - - """fetch data from the table: "country" using primary key columns""" - country_by_pk(countryCode: String!): country - - """ - fetch data from the table in a streaming manner: "country" - """ - country_stream( - """maximum number of rows returned in a single batch""" - batch_size: Int! - - """cursor to stream the results returned by the query""" - cursor: [country_stream_cursor_input]! - - """filter the rows returned""" - where: country_bool_exp - ): [country!]! - - """ - fetch data from the table: "currency" - """ + """Get exchange rates for all currencies supported by lipa""" currency( """distinct select on columns""" distinct_on: [currency_select_column!] @@ -1093,7 +1019,7 @@ type subscription_root { where: currency_bool_exp ): [currency!]! - """fetch data from the table: "currency" using primary key columns""" + """Get exchange rate for a specific currency supported by lipa""" currency_by_pk( """ISO 4217""" currencyCode: String! @@ -1147,9 +1073,7 @@ type subscription_root { where: lightning_address_bool_exp ): [lightning_address!]! - """ - fetch data from the table: "token" - """ + """TEST COMMENT""" token( """distinct select on columns""" distinct_on: [token_select_column!] @@ -1596,3 +1520,4 @@ input wallet_acl_stream_cursor_value_input { ownerWalletPubKeyId: uuid role: String } +