vchikalkin 079446181a graphql: share common queries
packages: add @graphql-codegen/typed-document-node
2023-02-01 15:18:55 +03:00

123 lines
2.6 KiB
TypeScript

import { gql } from '@apollo/client';
export const QUERY_GET_TARIFS = gql`
query GetTarifs($currentDate: DateTime) {
evo_tarifs(
statecode: 0
evo_datefrom_param: { lte: $currentDate }
evo_dateto_param: { gte: $currentDate }
) {
label: evo_name
value: evo_tarifid
evo_tarifid
evo_baseproductid
evo_min_period
evo_max_period
evo_delivery_time
evo_min_first_payment
evo_max_first_payment
evo_min_last_payment
evo_max_last_payment
evo_used
}
}
`;
export const QUERY_GET_TARIF = gql`
query GetTarif($tarifId: Uuid!) {
evo_tarif(evo_tarifid: $tarifId) {
evo_irr
evo_graphtype_exception
evo_seasons_type_exception
evo_min_decreasing_perc
}
}
`;
export const QUERY_GET_TRANSACTION_CURRENCIES = gql`
query GetTransactionCurrencies {
transactioncurrencies {
label: currencyname
value: transactioncurrencyid
transactioncurrencyid
isocurrencycode
currencysymbol
}
}
`;
export const QUERY_GET_BRANDS = gql`
query GetBrands {
evo_brands(statecode: 0) {
label: evo_name
value: evo_brandid
evo_brandid
evo_vehicle_type
}
}
`;
export const QUERY_GET_PRODUCTS = gql`
query GetProducts($currentDate: DateTime) {
evo_baseproducts(
statecode: 0
evo_relation: [100000000]
evo_datefrom_param: { lte: $currentDate }
evo_dateto_param: { gte: $currentDate }
) {
label: evo_name
value: evo_baseproductid
evo_baseproductid
}
}
`;
export const QUERY_GET_LEASE_OBJECT_TYPES = gql`
query GetLeaseObjectTypes {
evo_leasingobject_types(statecode: 0) {
label: evo_name
value: evo_leasingobject_typeid
evo_leasingobject_typeid
}
}
`;
export const QUERY_GET_DEALERS = gql`
query GetDealers {
dealers: accounts(evo_account_type: [100000001], statecode: 0, evo_legal_form: 100000001) {
label: name
value: accountid
accountid
}
}
`;
export const QUERY_GET_DEALER_PERSON = gql`
query GetDealerPersons($dealerId: Uuid!) {
salon_providers(statecode: 0, salonaccountid: $dealerId) {
label: name
value: accountid
accountid
evo_inn
evo_kpp
}
}
`;
export const QUERY_GET_AGENT = gql`
query GetAgent($agentid: Uuid!) {
agent: account(accountid: $agentid) {
label: name
value: accountid
}
}
`;
export const QUERY_GET_DEALER_RETURN_LEASING = gql`
query GetDealerReturnLeasing($dealerId: Uuid!) {
dealer: account(accountid: $dealerId) {
evo_return_leasing_dealer
}
}
`;