Skip to content

Commit

Permalink
Update schema
Browse files Browse the repository at this point in the history
  • Loading branch information
danielgranhao authored and dleutenegger committed Dec 2, 2024
1 parent 796c7b9 commit 1d21033
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 136 deletions.
15 changes: 6 additions & 9 deletions crow/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -138,14 +137,12 @@ impl OfferManager {
referral_code: Option<String>,
) -> graphql::Result<FiatTopupSetupChallenge> {
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))?;
Expand Down
32 changes: 16 additions & 16 deletions graphql/schemas/operations.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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
}
}
147 changes: 36 additions & 111 deletions graphql/schemas/schema_wallet_read.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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'.
"""
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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"
"""
Expand Down Expand Up @@ -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 {
"""
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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!]
Expand All @@ -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!]
Expand All @@ -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!
Expand Down Expand Up @@ -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!]
Expand Down Expand Up @@ -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!]
Expand All @@ -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!
Expand Down Expand Up @@ -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!]
Expand Down Expand Up @@ -1596,3 +1520,4 @@ input wallet_acl_stream_cursor_value_input {
ownerWalletPubKeyId: uuid
role: String
}

0 comments on commit 1d21033

Please sign in to comment.