process/configurator: fix selectRate value when load-kp
This commit is contained in:
parent
befa92fbce
commit
4f509aefdf
@ -159,6 +159,7 @@ query GetRates($currentDate: DateTime) {
|
||||
evo_tarifs {
|
||||
evo_tarifid
|
||||
}
|
||||
evo_rateid
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -196,7 +196,7 @@ export type GetRatesQueryVariables = Exact<{
|
||||
}>;
|
||||
|
||||
|
||||
export type GetRatesQuery = { __typename?: 'Query', evo_rates: Array<{ __typename?: 'evo_rate', evo_id: string | null, label: string | null, value: string | null, evo_tarifs: Array<{ __typename?: 'evo_tarif', evo_tarifid: string | null } | null> | null } | null> | null };
|
||||
export type GetRatesQuery = { __typename?: 'Query', evo_rates: Array<{ __typename?: 'evo_rate', evo_id: string | null, evo_rateid: string | null, label: string | null, value: string | null, evo_tarifs: Array<{ __typename?: 'evo_tarif', evo_tarifid: string | null } | null> | null } | null> | null };
|
||||
|
||||
export type GetRateQueryVariables = Exact<{
|
||||
rateId: Scalars['Uuid'];
|
||||
@ -502,7 +502,7 @@ export type GetQuoteConfiguratorDataQueryVariables = Exact<{
|
||||
}>;
|
||||
|
||||
|
||||
export type GetQuoteConfiguratorDataQuery = { __typename?: 'Query', quote: { __typename?: 'quote', evo_baseproductid: string | null, evo_client_typeid: string | null, evo_msfo_irr: number | null, evo_delivery_time: number | null, evo_first_payment_perc: number | null, evo_last_payment_perc: number | null, evo_leasingobject_typeid: string | null, evo_leasingobject_used: boolean | null, evo_period: number | null, evo_accept_period: number | null } | null };
|
||||
export type GetQuoteConfiguratorDataQuery = { __typename?: 'Query', quote: { __typename?: 'quote', evo_baseproductid: string | null, evo_client_typeid: string | null, evo_msfo_irr: number | null, evo_delivery_time: number | null, evo_first_payment_perc: number | null, evo_last_payment_perc: number | null, evo_leasingobject_typeid: string | null, evo_leasingobject_used: boolean | null, evo_period: number | null, evo_accept_period: number | null, evo_rateid: string | null } | null };
|
||||
|
||||
export type GetQuoteCreateKpDataQueryVariables = Exact<{
|
||||
quoteId: Scalars['Uuid'];
|
||||
@ -621,7 +621,7 @@ export const GetQuotesDocument = {"kind":"Document","definitions":[{"kind":"Oper
|
||||
export const GetQuoteDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetQuote"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"quote"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"quoteId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_baseproductid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_one_year_insurance"}},{"kind":"Field","name":{"kind":"Name","value":"evo_min_change_price"}},{"kind":"Field","name":{"kind":"Name","value":"evo_max_price_change"}},{"kind":"Field","name":{"kind":"Name","value":"evo_discount_supplier_currency"}},{"kind":"Field","name":{"kind":"Name","value":"evo_equip_price"}},{"kind":"Field","name":{"kind":"Name","value":"evo_program_import_subsidy_sum"}},{"kind":"Field","name":{"kind":"Name","value":"evo_nds_in_price_supplier_currency"}},{"kind":"Field","name":{"kind":"Name","value":"evo_supplier_currency_price"}},{"kind":"Field","name":{"kind":"Name","value":"evo_approved_first_payment"}},{"kind":"Field","name":{"kind":"Name","value":"evo_recalc_limit"}},{"kind":"Field","name":{"kind":"Name","value":"evo_max_mass"}},{"kind":"Field","name":{"kind":"Name","value":"evo_seats"}},{"kind":"Field","name":{"kind":"Name","value":"evo_year"}},{"kind":"Field","name":{"kind":"Name","value":"evo_last_payment_perc"}},{"kind":"Field","name":{"kind":"Name","value":"evo_maximum_percentage_av"}}]}}]}}]} as unknown as DocumentNode<GetQuoteQuery, GetQuoteQueryVariables>;
|
||||
export const GetTarifsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetTarifs"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"DateTime"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_tarifs"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}},{"kind":"Argument","name":{"kind":"Name","value":"evo_datefrom_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"lte"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}},{"kind":"Argument","name":{"kind":"Name","value":"evo_dateto_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"gte"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"evo_name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"evo_tarifid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_tarifid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_baseproductid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_min_period"}},{"kind":"Field","name":{"kind":"Name","value":"evo_max_period"}},{"kind":"Field","name":{"kind":"Name","value":"evo_delivery_time"}},{"kind":"Field","name":{"kind":"Name","value":"evo_min_first_payment"}},{"kind":"Field","name":{"kind":"Name","value":"evo_max_first_payment"}},{"kind":"Field","name":{"kind":"Name","value":"evo_min_last_payment"}},{"kind":"Field","name":{"kind":"Name","value":"evo_max_last_payment"}},{"kind":"Field","name":{"kind":"Name","value":"evo_used"}},{"kind":"Field","name":{"kind":"Name","value":"evo_leasingobject_types"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_leasingobject_typeid"}}]}},{"kind":"Field","name":{"kind":"Name","value":"evo_pl_use_type"}}]}}]}}]} as unknown as DocumentNode<GetTarifsQuery, GetTarifsQueryVariables>;
|
||||
export const GetTarifDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetTarif"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"tarifId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_tarif"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_tarifid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"tarifId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_irr"}},{"kind":"Field","name":{"kind":"Name","value":"evo_graphtype_exception"}},{"kind":"Field","name":{"kind":"Name","value":"evo_seasons_type_exception"}},{"kind":"Field","name":{"kind":"Name","value":"evo_min_decreasing_perc"}},{"kind":"Field","name":{"kind":"Name","value":"evo_min_irr"}},{"kind":"Field","name":{"kind":"Name","value":"evo_cut_irr_with_bonus_coefficient"}},{"kind":"Field","name":{"kind":"Name","value":"evo_max_irr"}},{"kind":"Field","name":{"kind":"Name","value":"evo_rates"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_datefrom"}},{"kind":"Field","name":{"kind":"Name","value":"evo_rateid"}}]}},{"kind":"Field","name":{"kind":"Name","value":"evo_irr_plan"}},{"kind":"Field","name":{"kind":"Name","value":"evo_margin_min"}}]}}]}}]} as unknown as DocumentNode<GetTarifQuery, GetTarifQueryVariables>;
|
||||
export const GetRatesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetRates"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"DateTime"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_rates"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}},{"kind":"Argument","name":{"kind":"Name","value":"evo_datefrom_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"lte"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}},{"kind":"Argument","name":{"kind":"Name","value":"evo_dateto_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"gte"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"evo_name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"evo_rateid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_id"}},{"kind":"Field","name":{"kind":"Name","value":"evo_tarifs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_tarifid"}}]}}]}}]}}]} as unknown as DocumentNode<GetRatesQuery, GetRatesQueryVariables>;
|
||||
export const GetRatesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetRates"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"DateTime"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_rates"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}},{"kind":"Argument","name":{"kind":"Name","value":"evo_datefrom_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"lte"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}},{"kind":"Argument","name":{"kind":"Name","value":"evo_dateto_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"gte"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"evo_name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"evo_rateid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_id"}},{"kind":"Field","name":{"kind":"Name","value":"evo_tarifs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_tarifid"}}]}},{"kind":"Field","name":{"kind":"Name","value":"evo_rateid"}}]}}]}}]} as unknown as DocumentNode<GetRatesQuery, GetRatesQueryVariables>;
|
||||
export const GetRateDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetRate"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"rateId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_rate"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_rateid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"rateId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_base_rate"}},{"kind":"Field","name":{"kind":"Name","value":"evo_credit_period"}},{"kind":"Field","name":{"kind":"Name","value":"evo_id"}}]}}]}}]} as unknown as DocumentNode<GetRateQuery, GetRateQueryVariables>;
|
||||
export const GetProductsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetProducts"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"DateTime"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_baseproducts"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}},{"kind":"Argument","name":{"kind":"Name","value":"evo_relation"},"value":{"kind":"ListValue","values":[{"kind":"IntValue","value":"100000000"}]}},{"kind":"Argument","name":{"kind":"Name","value":"evo_datefrom_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"lte"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}},{"kind":"Argument","name":{"kind":"Name","value":"evo_dateto_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"gte"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"evo_name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"evo_baseproductid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_baseproductid"}},{"kind":"Field","name":{"kind":"Name","value":"systemusers"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"systemuserid"}}]}}]}}]}}]} as unknown as DocumentNode<GetProductsQuery, GetProductsQueryVariables>;
|
||||
export const GetProductDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetProduct"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"productId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_baseproduct"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_baseproductid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"productId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_leasingobject_types"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_leasingobject_typeid"}}]}},{"kind":"Field","name":{"kind":"Name","value":"evo_calculation_method"}},{"kind":"Field","name":{"kind":"Name","value":"evo_baseproducts"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_baseproductid"}}]}},{"kind":"Field","name":{"kind":"Name","value":"evo_brands"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_brandid"}}]}},{"kind":"Field","name":{"kind":"Name","value":"evo_sale_without_nds"}},{"kind":"Field","name":{"kind":"Name","value":"evo_cut_proportion_bonus_director"}},{"kind":"Field","name":{"kind":"Name","value":"evo_cut_irr_with_bonus"}},{"kind":"Field","name":{"kind":"Name","value":"evo_sale_without_nds"}},{"kind":"Field","name":{"kind":"Name","value":"evo_id"}},{"kind":"Field","name":{"kind":"Name","value":"evo_supplier_financing_accept"}},{"kind":"Field","name":{"kind":"Name","value":"accounts"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"accountid"}}]}}]}}]}}]} as unknown as DocumentNode<GetProductQuery, GetProductQueryVariables>;
|
||||
@ -666,7 +666,7 @@ export const GetInsuranceCompaniesDocument = {"kind":"Document","definitions":[{
|
||||
export const GetRolesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetRoles"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"roleName"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"roles"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"name"},"value":{"kind":"Variable","name":{"kind":"Name","value":"roleName"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"systemusers"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"fullname"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"domainname"}}]}}]}}]}}]} as unknown as DocumentNode<GetRolesQuery, GetRolesQueryVariables>;
|
||||
export const GetQuoteAddProductDataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetQuoteAddProductData"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"quote"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"quoteId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_addproduct_types"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_product_type"}},{"kind":"Field","name":{"kind":"Name","value":"evo_addproduct_typeid"}}]}}]}}]}}]} as unknown as DocumentNode<GetQuoteAddProductDataQuery, GetQuoteAddProductDataQueryVariables>;
|
||||
export const GetQuoteBonusDataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetQuoteBonusData"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"quote"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"quoteId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_sale_bonus"}}]}}]}}]} as unknown as DocumentNode<GetQuoteBonusDataQuery, GetQuoteBonusDataQueryVariables>;
|
||||
export const GetQuoteConfiguratorDataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetQuoteConfiguratorData"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"quote"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"quoteId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_baseproductid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_client_typeid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_msfo_irr"}},{"kind":"Field","name":{"kind":"Name","value":"evo_delivery_time"}},{"kind":"Field","name":{"kind":"Name","value":"evo_first_payment_perc"}},{"kind":"Field","name":{"kind":"Name","value":"evo_last_payment_perc"}},{"kind":"Field","name":{"kind":"Name","value":"evo_leasingobject_typeid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_leasingobject_used"}},{"kind":"Field","name":{"kind":"Name","value":"evo_period"}},{"kind":"Field","name":{"kind":"Name","value":"evo_accept_period"}}]}}]}}]} as unknown as DocumentNode<GetQuoteConfiguratorDataQuery, GetQuoteConfiguratorDataQueryVariables>;
|
||||
export const GetQuoteConfiguratorDataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetQuoteConfiguratorData"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"quote"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"quoteId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_baseproductid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_client_typeid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_msfo_irr"}},{"kind":"Field","name":{"kind":"Name","value":"evo_delivery_time"}},{"kind":"Field","name":{"kind":"Name","value":"evo_first_payment_perc"}},{"kind":"Field","name":{"kind":"Name","value":"evo_last_payment_perc"}},{"kind":"Field","name":{"kind":"Name","value":"evo_leasingobject_typeid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_leasingobject_used"}},{"kind":"Field","name":{"kind":"Name","value":"evo_period"}},{"kind":"Field","name":{"kind":"Name","value":"evo_accept_period"}},{"kind":"Field","name":{"kind":"Name","value":"evo_rateid"}}]}}]}}]} as unknown as DocumentNode<GetQuoteConfiguratorDataQuery, GetQuoteConfiguratorDataQueryVariables>;
|
||||
export const GetQuoteCreateKpDataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetQuoteCreateKPData"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"quote"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"quoteId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_price_with_discount"}},{"kind":"Field","name":{"kind":"Name","value":"evo_price_without_discount_quote"}},{"kind":"Field","name":{"kind":"Name","value":"evo_cost_increace"}},{"kind":"Field","name":{"kind":"Name","value":"evo_insurance"}},{"kind":"Field","name":{"kind":"Name","value":"evo_registration_quote"}},{"kind":"Field","name":{"kind":"Name","value":"evo_card_quote"}},{"kind":"Field","name":{"kind":"Name","value":"evo_nsib_quote"}},{"kind":"Field","name":{"kind":"Name","value":"evo_redemption_graph"}},{"kind":"Field","name":{"kind":"Name","value":"evo_fingap_quote"}},{"kind":"Field","name":{"kind":"Name","value":"evo_contact_name"}},{"kind":"Field","name":{"kind":"Name","value":"evo_gender"}},{"kind":"Field","name":{"kind":"Name","value":"evo_last_payment_redemption"}}]}}]}}]} as unknown as DocumentNode<GetQuoteCreateKpDataQuery, GetQuoteCreateKpDataQueryVariables>;
|
||||
export const GetQuoteEltDataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetQuoteEltData"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"quote"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"quoteId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_kasko_accountid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_kasko_price"}},{"kind":"Field","name":{"kind":"Name","value":"evo_id_elt_kasko"}},{"kind":"Field","name":{"kind":"Name","value":"evo_id_kasko_calc"}},{"kind":"Field","name":{"kind":"Name","value":"evo_franchise"}},{"kind":"Field","name":{"kind":"Name","value":"evo_osago_accountid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_id_elt_osago"}},{"kind":"Field","name":{"kind":"Name","value":"evo_osago_price"}},{"kind":"Field","name":{"kind":"Name","value":"evo_leasingobject_typeid"}}]}}]}}]} as unknown as DocumentNode<GetQuoteEltDataQuery, GetQuoteEltDataQueryVariables>;
|
||||
export const GetQuoteFingapDataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetQuoteFingapData"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"quote"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"quoteId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_product_risks"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_addproduct_typeid"}}]}}]}}]}}]} as unknown as DocumentNode<GetQuoteFingapDataQuery, GetQuoteFingapDataQueryVariables>;
|
||||
|
||||
@ -19,6 +19,7 @@ const QUERY_GET_QUOTE_CONFIGURATOR_DATA = gql`
|
||||
evo_leasingobject_used
|
||||
evo_period
|
||||
evo_accept_period
|
||||
evo_rateid
|
||||
}
|
||||
}
|
||||
`;
|
||||
@ -41,7 +42,7 @@ export async function getKPData({
|
||||
? Math.min(quote?.evo_period ?? 0, quote?.evo_accept_period ?? 0)
|
||||
: quote?.evo_period ?? 0;
|
||||
|
||||
const { getTarifs } = helper({ apolloClient });
|
||||
const { getTarifs, getRates } = helper({ apolloClient });
|
||||
|
||||
let tarif = defaultValues.tarif;
|
||||
if (
|
||||
@ -71,11 +72,14 @@ export async function getKPData({
|
||||
}
|
||||
}
|
||||
|
||||
const { evo_rate } = await getRates({ tarif });
|
||||
|
||||
return {
|
||||
values: {
|
||||
IRR_Perc: quote?.evo_msfo_irr ?? defaultValues.IRR_Perc,
|
||||
clientType: quote?.evo_client_typeid,
|
||||
product: quote?.evo_baseproductid,
|
||||
rate: evo_rate?.evo_rateid ?? defaultValues.rate,
|
||||
tarif,
|
||||
},
|
||||
};
|
||||
|
||||
@ -2,6 +2,7 @@ import * as CRMTypes from '@/graphql/crm.types';
|
||||
import type { ProcessContext } from '@/process/types';
|
||||
import type { CalculationValues } from '@/stores/calculation/values/types';
|
||||
import dayjs from 'dayjs';
|
||||
import { first, sort } from 'radash';
|
||||
|
||||
type GetTarifInputValues = Pick<
|
||||
CalculationValues,
|
||||
@ -14,8 +15,55 @@ type GetTarifInputValues = Pick<
|
||||
| 'product'
|
||||
>;
|
||||
|
||||
type GetRatesInputValues = Pick<CalculationValues, 'tarif'>;
|
||||
|
||||
export default function helper({ apolloClient }: Pick<ProcessContext, 'apolloClient'>) {
|
||||
return {
|
||||
async getRates({ tarif: tarifId }: GetRatesInputValues) {
|
||||
const currentDate = dayjs().utc(false).toISOString();
|
||||
|
||||
const {
|
||||
data: { evo_rates },
|
||||
} = await apolloClient.query({
|
||||
fetchPolicy: 'network-only',
|
||||
query: CRMTypes.GetRatesDocument,
|
||||
variables: {
|
||||
currentDate,
|
||||
},
|
||||
});
|
||||
|
||||
if (!tarifId) {
|
||||
return {
|
||||
evo_rates,
|
||||
};
|
||||
}
|
||||
|
||||
const {
|
||||
data: { evo_tarif },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetTarifDocument,
|
||||
variables: { tarifId },
|
||||
});
|
||||
|
||||
const evo_tarif_evo_rate =
|
||||
evo_tarif?.evo_rates &&
|
||||
first(sort(evo_tarif?.evo_rates, (x) => dayjs(x?.evo_datefrom).date()));
|
||||
|
||||
if (evo_tarif_evo_rate) {
|
||||
return {
|
||||
evo_rate: evo_tarif_evo_rate,
|
||||
evo_rates,
|
||||
};
|
||||
}
|
||||
|
||||
const evo_rate = evo_rates?.find((x) => x?.evo_id === 'BASE');
|
||||
|
||||
return {
|
||||
evo_rate,
|
||||
evo_rates,
|
||||
};
|
||||
},
|
||||
|
||||
async getTarifs({
|
||||
deliveryTime,
|
||||
firstPaymentPerc,
|
||||
|
||||
@ -7,14 +7,13 @@ import { disposableReaction } from '@/utils/mobx';
|
||||
import dayjs from 'dayjs';
|
||||
import utc from 'dayjs/plugin/utc';
|
||||
import { comparer, reaction } from 'mobx';
|
||||
import { first, sort } from 'radash';
|
||||
|
||||
dayjs.extend(utc);
|
||||
|
||||
export default function valuesReactions({ store, apolloClient }: ProcessContext) {
|
||||
const { $calculation, $process } = store;
|
||||
|
||||
const { getTarifs } = helper({ apolloClient });
|
||||
const { getTarifs, getRates } = helper({ apolloClient });
|
||||
|
||||
disposableReaction(
|
||||
() => $process.has('LoadKP'),
|
||||
@ -70,44 +69,32 @@ export default function valuesReactions({ store, apolloClient }: ProcessContext)
|
||||
|
||||
reaction(
|
||||
() => $calculation.element('selectTarif').getValue(),
|
||||
async (tarifId) => {
|
||||
if (!tarifId) {
|
||||
async (tarif) => {
|
||||
if (!tarif) {
|
||||
$calculation.element('selectRate').resetOptions();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const { evo_rates } = await getRates({ tarif });
|
||||
|
||||
$calculation.element('selectRate').setOptions(normalizeOptions(evo_rates));
|
||||
}
|
||||
);
|
||||
|
||||
disposableReaction(
|
||||
() => $process.has('LoadKP'),
|
||||
() => $calculation.element('selectTarif').getValue(),
|
||||
async (tarif) => {
|
||||
if (!tarif) {
|
||||
$calculation.element('selectRate').resetValue();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const currentDate = dayjs().utc(false).toISOString();
|
||||
const { evo_rate } = await getRates({ tarif });
|
||||
|
||||
const {
|
||||
data: { evo_rates },
|
||||
} = await apolloClient.query({
|
||||
fetchPolicy: 'network-only',
|
||||
query: CRMTypes.GetRatesDocument,
|
||||
variables: {
|
||||
currentDate,
|
||||
},
|
||||
});
|
||||
|
||||
$calculation.element('selectRate').setOptions(normalizeOptions(evo_rates));
|
||||
|
||||
const {
|
||||
data: { evo_tarif },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetTarifDocument,
|
||||
variables: { tarifId },
|
||||
});
|
||||
|
||||
const targetRate =
|
||||
evo_tarif?.evo_rates &&
|
||||
first(sort(evo_tarif?.evo_rates, (x) => dayjs(x?.evo_datefrom).date()));
|
||||
|
||||
if (targetRate) {
|
||||
$calculation.element('selectRate').setValue(targetRate?.evo_rateid);
|
||||
} else {
|
||||
const baseRate = evo_rates?.find((x) => x?.evo_id === 'BASE');
|
||||
if (baseRate) $calculation.element('selectRate').setValue(baseRate?.value);
|
||||
}
|
||||
$calculation.element('selectRate').setValue(evo_rate?.evo_rateid || null);
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user