diff --git a/apps/web/graphql/crm.schema.graphql b/apps/web/graphql/crm.schema.graphql index a04ef6e..f0ebe3e 100644 --- a/apps/web/graphql/crm.schema.graphql +++ b/apps/web/graphql/crm.schema.graphql @@ -7,40 +7,6 @@ directive @cost( multipliers: [MultiplierPath!] ) on FIELD_DEFINITION -""" -Direct the client to resolve this field locally, either from the cache or local resolvers. -""" -directive @client( - """ - When true, the client will never use the cache for this value. See - https://www.apollographql.com/docs/react/essentials/local-state/#forcing-resolvers-with-clientalways-true - """ - always: Boolean -) on FIELD | FRAGMENT_DEFINITION | INLINE_FRAGMENT - -""" -Export this locally resolved field as a variable to be used in the remainder of this query. See -https://www.apollographql.com/docs/react/essentials/local-state/#using-client-fields-as-variables -""" -directive @export( - """The variable name to export this field as.""" - as: String! -) on FIELD - -""" -Specify a custom store key for this result. See -https://www.apollographql.com/docs/react/advanced/caching/#the-connection-directive -""" -directive @connection( - """Specify the store key.""" - key: String! - - """ - An array of query argument names to include in the generated custom store key. - """ - filter: [String!] -) on FIELD - """ The multiplier path scalar represents a valid GraphQL multiplier path string. """ @@ -80,6 +46,8 @@ type Query { evo_currencychanges(evo_coursedate_param: DateParamInput, evo_ref_transactioncurrency: Uuid, statecode: Int): [evo_currencychange] evo_debtwork_contract(debtworkContractId: Uuid!): evo_debtwork_contract evo_debtwork_contracts(evo_accountid: Uuid, evo_statuscodeid: Uuid, statecode: Int): [evo_debtwork_contract] + evo_documenttype(evo_documenttypeid: Uuid!): evo_documenttype + evo_documenttypes(evo_code_wm: String, statecode: Int): [evo_documenttype] evo_equipments(evo_modelid: Uuid, statecode: Int): [evo_equipment] evo_external_supplier_codes(evo_id: String, statecode: Int): [evo_external_supplier_code] evo_external_system_request(evo_external_system_requestid: Uuid!): evo_external_system_request @@ -99,10 +67,12 @@ type Query { evo_models(evo_brandid: Uuid, evo_vehicle_type: Int, statecode: Int): [evo_model] evo_orglegalform(evo_orglegalformid: Uuid!): evo_orglegalform evo_orglegalforms(statecode: Int = 0): [evo_orglegalform] + evo_parking(evo_parkingid: Uuid!): evo_parking evo_paymentorders(evo_dds_1c: String, evo_name: String, evo_paydate_param: DateParamInput, evo_payment_number_1c: String, evo_paysum: Decimal, statecode: Int, statuscode: Int): [evo_paymentorder] evo_planpayments(evo_addproduct_typeid: Uuid, statecode: Int): [evo_planpayment] evo_product_risk(evo_product_riskid: Uuid!): evo_product_risk evo_product_risks(statecode: Int): [evo_product_risk] + evo_question_credit_committee(evo_question_credit_committeeid: Uuid!): evo_question_credit_committee evo_rate(evo_rateid: Uuid!): evo_rate evo_rates(evo_datefrom_param: DateParamInput, evo_dateto_param: DateParamInput, statecode: Int): [evo_rate] @@ -156,6 +126,7 @@ type Query { """Поставщики ЮЛ салона. statecode по умолчанию 0""" salon_providers(salonaccountid: Uuid!, statecode: Int): [account] + subjects: [subjectGraphQL] systemuser(domainname: String, systemuserid: Uuid): systemuser systemusers(domainname: String, evo_employee_id: String, isdisabled: Boolean = false): [systemuser] templates(description: String): [template] @@ -169,29 +140,24 @@ type Mutation { by(systemuserid: Uuid): MutationBy } -type evo_request_client { +type evo_typedocpackage { createdon: DateTime - evo_accountid: Uuid - evo_accountidData: account - evo_caseorigincode: Int - evo_caseorigincodename: String - evo_client_request_text: String - evo_comment: String - evo_documents: [evo_document] - evo_number: String - evo_owner_systemuserid: Uuid - evo_owner_systemuseridData: systemuser - evo_phonecallid: Uuid - evo_request_clientid: Uuid - evo_site_email: String - evo_site_name: String - evo_site_telephone: String - evo_site_text: String - evo_statuscodeid: Uuid - evo_statuscodeidData: evo_statuscode - evo_storage: String - incidents: [incidentGraphQL] - link: String + evo_account: Boolean + evo_addcontract: Boolean + evo_agency_agreement: Boolean + evo_contract: Boolean + evo_debtwork_contract: Boolean + evo_finegibdd: Boolean + evo_id: String + evo_incident: Boolean + evo_insurance_period: Boolean + evo_name: String + evo_opportunity: Boolean + evo_parking: Boolean + evo_programsolution: [Int!] + evo_request_client: Boolean + evo_request_payment: Boolean + evo_typedocpackageid: Uuid modifiedon: DateTime toObjectString: String } @@ -238,6 +204,142 @@ input GuidParamInput { """The built-in `Decimal` scalar type.""" scalar Decimal +type evo_debtwork_contract { + createdon: DateTime + evo_accountid: Uuid + evo_accountidData: account + evo_contractid: Uuid + evo_contractidData: evo_contract + evo_date_change_statuscode: DateTime + evo_db_region_com: String + evo_debtwork_contractid: Uuid + evo_debt_restruct_description: String + evo_documents: [evo_document] + evo_economic_security_com: String + evo_erroneous_pay_contractname: String + evo_inspection_done: Boolean + evo_inspection_impossible: Boolean + evo_inspection_impossible_reason: String + evo_inspection_link_report: String + evo_inspection_systemuserid: Uuid + evo_inspection_systemuseridData: systemuser + evo_insurance_case_dateend: DateTime + evo_leasingobjectid: Uuid + evo_leasingobjectidData: evo_leasingobject + evo_name: String + evo_non_payment_count: Decimal + evo_opportunityid: Uuid + evo_other_losses_amount: Decimal + evo_other_sanctions_amount: Decimal + evo_parkingid: Uuid + evo_parkingidData: evo_parking + evo_plan_date_transfer_pay: DateTime + evo_pl_estimated_value: Decimal + evo_redemption_com: String + evo_redemption_type: [Int!] + evo_result_debt_restruct: Boolean + evo_result_error_payment: Boolean + evo_result_inspection: Boolean + evo_result_insurance_case: Boolean + evo_result_redemption: Boolean + evo_result_termination: Boolean + evo_result_wait_payment: Boolean + evo_result_withdrawal: Boolean + evo_saldo_calculation_date: DateTime + evo_statuscodeid: Uuid + evo_statuscodeidData: evo_statuscode + evo_statuscode_reason: String + evo_storage: String + evo_termination_add_registry: Int + evo_termination_com: String + evo_termination_com_lawyer: String + evo_termination_date: DateTime + evo_termination_lawyer_systemuserid: Uuid + evo_termination_lawyer_systemuseridData: systemuser + evo_termination_notice_date: DateTime + evo_termination_reason_terms: Int + evo_termination_reason_terms_doc: String + evo_termination_reason_terms_text: String + evo_termination_send_notice: Boolean + evo_termination_send_notice_date: DateTime + evo_termination_send_notice_repeat: Boolean + evo_termination_solution: Int + evo_termination_status_work: Int + evo_termination_suspended_until: DateTime + evo_termination_unique_notice: Boolean + evo_term_act_keys: Boolean + evo_term_act_keys_systemuserid: Uuid + evo_term_act_keys_systemuseridData: systemuser + evo_term_act_keys_unload_date: DateTime + evo_term_act_personal_items: Boolean + evo_term_act_personal_items_systemuserid: Uuid + evo_term_act_personal_items_systemuseridData: systemuser + evo_term_act_personal_items_unload_date: DateTime + evo_term_act_storage_get: Boolean + evo_term_act_storage_get_date: DateTime + evo_term_act_storage_get_systemuserid: Uuid + evo_term_act_storage_get_systemuseridData: systemuser + evo_term_act_storage_get_type: Int + evo_term_act_storage_get_unload_date: DateTime + evo_term_act_withdrawal: Boolean + evo_term_act_withdrawal_pl_systemuserid: Uuid + evo_term_act_withdrawal_pl_systemuseridData: systemuser + evo_term_act_withdrawal_pl_unload_date: DateTime + evo_term_notice_inspection: Boolean + evo_term_notice_inspection_systemuserid: Uuid + evo_term_notice_inspection_systemuseridData: systemuser + evo_term_notice_inspection_unload_date: DateTime + evo_withdrawal_businessunitid: Uuid + evo_withdrawal_businessunitidData: businessunit + evo_withdrawal_done: Boolean + evo_withdrawal_fact_date: DateTime + evo_withdrawal_impossible: Boolean + evo_withdrawal_impossible_reason: String + evo_withdrawal_issue_agreed: Int + evo_withdrawal_issue_done: Int + evo_withdrawal_issue_done_date: DateTime + evo_withdrawal_parking_addressid: Uuid + evo_withdrawal_plan_date: DateTime + evo_withdrawal_systemuserid: Uuid + evo_withdrawal_systemuseridData: systemuser + link: String + modifiedon: DateTime + ownerid: Uuid + ownerid_systemuser: Uuid + ownerid_systemuserData: systemuser + ownerid_team: Uuid + toObjectString: String +} + +type evo_request_client { + createdon: DateTime + evo_accountid: Uuid + evo_accountidData: account + evo_caseorigincode: Int + evo_caseorigincodename: String + evo_client_request_text: String + evo_comment: String + evo_documents: [evo_document] + evo_from_account: Uuid + evo_from_contact: Uuid + evo_number: String + evo_owner_systemuserid: Uuid + evo_owner_systemuseridData: systemuser + evo_phonecallid: Uuid + evo_request_clientid: Uuid + evo_site_email: String + evo_site_name: String + evo_site_telephone: String + evo_site_text: String + evo_statuscodeid: Uuid + evo_statuscodeidData: evo_statuscode + evo_storage: String + incidents: [incidentGraphQL] + link: String + modifiedon: DateTime + toObjectString: String +} + type evo_subject_incident { createdon: DateTime evo_group: Int @@ -252,6 +354,14 @@ type evo_subject_incident { toObjectString: String } +type subjectGraphQL { + createdon: DateTime + modifiedon: DateTime + subjectid: Uuid + title: String + toObjectString: String +} + type incidentGraphQL { caseorigincode: Int createdon: DateTime @@ -286,6 +396,33 @@ type incidentGraphQL { toObjectString: String } +type evo_question_credit_committee { + createdon: DateTime + evo_accountid: Uuid + evo_confluence_file_referenceid: String + evo_description_general_solution: String + evo_opportunityid: Uuid + evo_ownerid_systemuser: Uuid + evo_question_credit_committeeid: Uuid + evo_statuscodeid: Uuid + evo_summary_judgment: Int + modifiedon: DateTime + quotes: [quote] + toObjectString: String +} + +type evo_parking { + createdon: DateTime + evo_address_legalid: Uuid + evo_address_legalidData: account + evo_documents: [evo_document] + evo_name: String + evo_parkingid: Uuid + evo_storage: String + modifiedon: DateTime + toObjectString: String +} + type entity_schema { entity_id: String entity_set_name: String @@ -297,83 +434,6 @@ type entity_schema { picklists: [picklist] } -type evo_debtwork_contract { - createdon: DateTime - evo_accountid: Uuid - evo_accountidData: account - evo_contractid: Uuid - evo_contractidData: evo_contract - evo_date_change_statuscode: DateTime - evo_db_region_com: String - evo_debtwork_contractid: Uuid - evo_debt_restruct_description: String - evo_documents: [evo_document] - evo_economic_security_com: String - evo_erroneous_pay_contractname: String - evo_inspection_done: Boolean - evo_inspection_impossible: Boolean - evo_inspection_impossible_reason: String - evo_inspection_link_report: String - evo_inspection_systemuserid: Uuid - evo_inspection_systemuseridData: systemuser - evo_insurance_case_dateend: DateTime - evo_leasingobjectid: Uuid - evo_leasingobjectidData: evo_leasingobject - evo_name: String - evo_non_payment_count: Decimal - evo_opportunityid: Uuid - evo_plan_date_transfer_pay: DateTime - evo_redemption_com: String - evo_redemption_type: [Int!] - evo_result_debt_restruct: Boolean - evo_result_error_payment: Boolean - evo_result_inspection: Boolean - evo_result_insurance_case: Boolean - evo_result_redemption: Boolean - evo_result_termination: Boolean - evo_result_wait_payment: Boolean - evo_result_withdrawal: Boolean - evo_statuscodeid: Uuid - evo_statuscodeidData: evo_statuscode - evo_statuscode_reason: String - evo_storage: String - evo_termination_add_registry: Int - evo_termination_com: String - evo_termination_com_lawyer: String - evo_termination_lawyer_systemuserid: Uuid - evo_termination_lawyer_systemuseridData: systemuser - evo_termination_reason_terms: Int - evo_termination_reason_terms_doc: String - evo_termination_reason_terms_text: String - evo_termination_send_notice: Boolean - evo_termination_send_notice_date: DateTime - evo_termination_send_notice_repeat: Boolean - evo_termination_solution: Int - evo_termination_status_work: Int - evo_termination_suspended_until: DateTime - evo_termination_unique_notice: Boolean - evo_withdrawal_businessunitid: Uuid - evo_withdrawal_businessunitidData: businessunit - evo_withdrawal_done: Boolean - evo_withdrawal_impossible: Boolean - evo_withdrawal_impossible_reason: String - evo_withdrawal_issue_agreed: Int - evo_withdrawal_issue_done: Int - evo_withdrawal_issue_done_date: DateTime - evo_withdrawal_parking_addressid: Uuid - evo_withdrawal_parking_addressidData: evo_address - evo_withdrawal_plan_date: DateTime - evo_withdrawal_systemuserid: Uuid - evo_withdrawal_systemuseridData: systemuser - link: String - modifiedon: DateTime - ownerid: Uuid - ownerid_systemuser: Uuid - ownerid_systemuserData: systemuser - ownerid_team: Uuid - toObjectString: String -} - type account { accountid: Uuid childcontacts(statecode: Int): [contact] @@ -404,7 +464,9 @@ type account { evo_div_12month: Boolean evo_documents(evo_documenttypeid_param: GuidParamInput, latestversion: Boolean = true): [evo_document] evo_economic_security_systemuserid: Uuid + evo_edos: [evo_edo] evo_employee_count: Int + evo_evokasko_access: Boolean evo_fingap_number_rules: Int evo_fin_department_accountid: Uuid evo_fin_department_accountidData: account @@ -448,9 +510,13 @@ type account { evo_state_liquidation_date: DateTime evo_state_registration_date: DateTime evo_state_status: Int + evo_state_status_code: String + evo_storage: String evo_subsidies(statecode: Int): [evo_subsidy] + evo_supplier_financing_accept: Boolean evo_supplier_type: Int evo_tax_system: Int + evo_telematic_provider_accountid: Uuid evo_type_ins_policy: [Int!] evo_unscrupulous_supplier: Boolean incidents: [incidentGraphQL] @@ -539,26 +605,36 @@ type evo_addproduct_type { evo_accountid: Uuid evo_addproduct_typeid: Uuid evo_addproduct_types: [evo_addproduct_type] + evo_brands: [evo_brand] evo_controls_program: [Int!] evo_cost_service_provider: Decimal evo_cost_service_provider_withoutnds: Decimal evo_datefrom: DateTime evo_dateto: DateTime evo_description: String + evo_equipment_1_name: String evo_equip_cost: Decimal + evo_evokasko_calc_type: Int evo_gibdd_region: Boolean evo_graph_price: Decimal evo_graph_price_withoutnds: Decimal evo_helpcard_type: Int evo_id: String evo_leasingobject_types(statecode: Int): [evo_leasingobject_type] + evo_loss_kv: Decimal evo_max_age: Int + evo_max_first_payment_perc: Decimal evo_max_period: Decimal + evo_max_price: Decimal evo_min_age: Int + evo_min_first_payment_perc: Decimal evo_min_period: Decimal + evo_min_price: Decimal + evo_models: [evo_model] evo_name: String evo_nsib_limit: Decimal evo_planpayments(statecode: Int): [evo_planpayment] + evo_price_service_provider_withoutnds: Decimal evo_prime_cost: Decimal evo_product_type: Int evo_pts_type: [Int!] @@ -570,6 +646,7 @@ type evo_addproduct_type { evo_visible_calc: Boolean evo_whom_register: Int evo_who_register: Int + link: String modifiedon: DateTime statecode: Int toObjectString: String @@ -592,6 +669,7 @@ type evo_baseproduct { evo_relation: [Int!] evo_sale_without_nds: Boolean evo_scoring_available: Boolean + evo_supplier_financing_accept: Boolean modifiedon: DateTime statecode: Int systemusers(statecode: Int): [systemuser] @@ -599,7 +677,7 @@ type evo_baseproduct { } type evo_graph { - createdon: DateTime! + createdon: DateTime evo_addcontractid: Uuid evo_contractid: Uuid evo_cost_equipment_sum: Decimal @@ -608,10 +686,11 @@ type evo_graph { evo_cost_price_telematics_withoutnds_sum: Decimal evo_cost_telematics_sum: Decimal evo_cost_telematics_withoutnds_sum: Decimal + evo_graf_date_approve: DateTime evo_graphid: Uuid evo_name: String evo_nds: Decimal - evo_planpayments: [evo_planpayment!] + evo_planpayments: [evo_planpayment] evo_quoteid: Uuid evo_sumpay_withnds: Decimal evo_sumpay_withoutnds: Decimal @@ -638,6 +717,7 @@ type evo_insurance_period { evo_elt_id: String evo_evokasko_price: Decimal evo_exp_drivers: Int + evo_fingap_listid: Uuid evo_franchise: Decimal evo_id: String evo_id_elt_calc: String @@ -658,6 +738,7 @@ type evo_insurance_period { evo_invoice_date: DateTime evo_kasko_price: Decimal evo_leasingobjectid: Uuid + evo_loss_kv: Decimal evo_mobile_discount: Boolean evo_mobile_discount_factor: Decimal evo_mobile_discount_rub: Decimal @@ -704,17 +785,33 @@ type evo_addproduct { evo_addproductnumberidData: evo_addproductnumber evo_addproduct_typeid: Uuid evo_addproduct_typeidData: evo_addproduct_type + evo_beacon1_imei: String + evo_beacon2_imei: String + evo_connect_telematics_evo_addproductid: Uuid + evo_contractid: Uuid + evo_cs_actualdate: DateTime + evo_date_instal: DateTime + evo_date_instal_cancel: DateTime evo_deactivation_date: DateTime evo_fuel_card_currency_limit_check: Boolean evo_fuel_card_limit_check: Boolean evo_fuel_card_limit_used: Decimal + evo_id_request_instal: String + evo_issue_date_plan: DateTime + evo_issue_owner_salon: String + evo_issue_tel_salon: String evo_leasingobjectid: Uuid evo_name: String evo_provider_accountid: Uuid evo_provider_accountidData: account + evo_provider_contact_info: String + evo_provider_phone_number: String evo_request_instal_message: String + evo_request_instal_path: String evo_service_contactid: Uuid + evo_setting_date: DateTime evo_telematics_number: String + evo_telematics_pin: String evo_validity_from: DateTime modifiedon: DateTime toObjectString: String @@ -772,6 +869,7 @@ type evo_leasingobject { evo_color: String evo_contractid: Uuid evo_create_contract_purchase: Boolean + evo_date_withdrawal: DateTime evo_delivery_time: Int evo_driving_axle: String evo_ecological_class: Int @@ -938,6 +1036,7 @@ type opportunity { evo_assignor_accountid: Uuid evo_businessunitid: Uuid evo_businessunitidData: businessunit + evo_cession_incidentid: Uuid evo_check_type: [Int!] evo_check_type_fact: [Int!] evo_client_riskid: Uuid @@ -980,6 +1079,7 @@ type opportunity { evo_programsolution: Int evo_report_year: Int evo_sfm_comment: [Int!] + evo_solution_agents_com: String evo_solution_average_cost: Int evo_solution_average_cost_com: String evo_solution_average_cost_reason: String @@ -1012,6 +1112,7 @@ type quote { customerid_account: Uuid customerid_contact: Uuid evo_accept_control_addproduct_typeid: Uuid + evo_accept_control_addproduct_typeidData: evo_addproduct_type evo_accept_period: Int evo_accept_quoteid: Uuid evo_acquisition_costs: Decimal @@ -1067,6 +1168,7 @@ type quote { evo_dealer_reward_conditionid: Uuid evo_dealer_reward_summ: Decimal evo_dealer_reward_total: Decimal + evo_decision_on_kp: String evo_declaration_knd: String evo_declaration_period: Int evo_declaration_profit: Decimal @@ -1095,8 +1197,11 @@ type quote { evo_equipmentid: Uuid evo_equip_price: Decimal evo_equity_capital: Decimal + evo_evokasko_insurer_accountid: Uuid + evo_evokasko_insurer_accountidData: account evo_evokasko_price: Decimal evo_exp_drivers: Int + evo_financing_with_own_funds: Boolean evo_fingap_accountid: Uuid evo_fingap_bonus_sum: Decimal evo_fingap_payer: Int @@ -1123,9 +1228,13 @@ type quote { evo_gender: Int evo_gps_brandid: Uuid evo_gps_modelid: Uuid - evo_graphs: [evo_graph!] + evo_graphs: [evo_graph] evo_graph_irr: Decimal evo_graph_type: Int + evo_guarantee_fl: Boolean + evo_guarantee_flname: String + evo_guarantee_ul: Boolean + evo_guarantee_ulname: String evo_guarantor1_another_peyments: Decimal evo_guarantor1_declaration_year: Int evo_guarantor1_equity_capital: Decimal @@ -1163,6 +1272,7 @@ type quote { evo_kasko_price: Decimal evo_kasko_price_leasperiod: Decimal evo_key_return: Boolean + evo_key_returnname: String evo_kilometrage_limit: Int evo_kilometrage_limit_period: Int evo_last_payment_calc: Int @@ -1178,8 +1288,12 @@ type quote { evo_legal_regionid: Uuid evo_legal_townid: Uuid evo_lessor_bank_detailsid: Uuid + evo_lessor_bank_detailsidData: evo_bank_details evo_loan_appraisalid: Uuid evo_logid: Uuid + evo_loss_kv: Decimal + evo_maximum_payment_day: Int + evo_maximum_percentage_av: Decimal evo_max_mass: Decimal evo_max_price_change: Decimal evo_max_speed: Decimal @@ -1222,7 +1336,7 @@ type quote { evo_price_without_nds_supplier_currency: Decimal evo_price_with_discount: Boolean evo_price_wthout_discount_nds_sup_currency: Decimal - evo_product_risks: [evo_product_risk!] + evo_product_risks: [evo_product_risk] evo_programsolution: Int evo_program_import_subsidyid: Uuid evo_program_import_subsidy_sum: Decimal @@ -1244,7 +1358,9 @@ type quote { evo_registration_regionid: Uuid evo_report_year: Int evo_req_telematic: Int + evo_req_telematicname: String evo_req_telematic_accept: Int + evo_req_telematic_acceptname: String evo_return_leasing: Boolean evo_risk: Int evo_risk_coefficientid: Uuid @@ -1261,7 +1377,9 @@ type quote { evo_subsidyid: Uuid evo_subsidy_summ: Decimal evo_supplier_accountid: Uuid + evo_supplier_accountidData: account evo_supplier_currency_price: Decimal + evo_supplier_financing: Boolean evo_supplier_type: Int evo_tarifid: Uuid evo_tax_period: Decimal @@ -1271,6 +1389,7 @@ type quote { evo_trailer: Boolean evo_transactioncurrencyid: Uuid evo_unlimit_drivers: Boolean + evo_untype_contract: Boolean evo_use_for: Int evo_vehicle_tax_approved: Decimal evo_vehicle_tax_period: Decimal @@ -1359,8 +1478,10 @@ type evo_subsidy { accounts: [account] createdon: DateTime evo_brands: [evo_brand] + evo_check_pts: Boolean evo_datefrom: DateTime evo_dateto: DateTime + evo_delivery_time: [Int!] evo_get_subsidy_payment: Int evo_leasingobject_types: [evo_leasingobject_type] evo_max_subsidy_summ: Decimal @@ -1468,8 +1589,11 @@ type evo_scheduled_call { evo_contact_jobtitle: String evo_contact_lastname: String evo_contact_name: String + evo_emailaddress1: String evo_inn: String evo_leadid: Uuid + evo_leadsource: Int + evo_mg_telephone: String evo_name: String evo_note: String evo_scheduled_callid: Uuid @@ -1477,6 +1601,11 @@ type evo_scheduled_call { evo_status: Int evo_telephone1: String evo_telephone2: String + evo_utm_campaign: String + evo_utm_content: String + evo_utm_medium: String + evo_utm_source: String + evo_utm_term: String modifiedon: DateTime ownerid: Uuid toObjectString: String @@ -1538,6 +1667,7 @@ type evo_request_payment { evo_finegibddidData: evo_finegibdd evo_id: String evo_inn: String + evo_insurance_addcontractid: Uuid evo_insurance_periodid: Uuid evo_insurance_policyid: Uuid evo_insurance_policyidData: evo_insurance_policy @@ -1567,6 +1697,7 @@ type evo_request_payment { evo_request_payment_type: Int evo_service_list: [Int!] evo_statuscodeid: Uuid + evo_statuscodeidData: evo_statuscode evo_storage: String evo_supplier_payment_type: Int evo_top_agency_agreementid: Uuid @@ -1578,6 +1709,32 @@ type evo_request_payment { toObjectString: String } +type evo_documenttype { + createdon: DateTime + evo_check_edo: Boolean + evo_code_wm: String + evo_comment: String + evo_documenttypeid: Uuid + evo_draftdoc: Boolean + evo_edit_namedoc: Boolean + evo_fill_docname: Boolean + evo_formalized: Boolean + evo_id: String + evo_name: String + evo_name_save_file: String + evo_original_id: String + evo_param_wm: String + evo_place_upload_doc: [Int!] + evo_remove_accept: Boolean + evo_sign_required: Boolean + evo_storagedoc: Int + evo_typedocpackages: [evo_typedocpackage] + evo_validitydoc: Int + modifiedon: DateTime + systemusers: [systemuser] + toObjectString: String +} + type evo_contract { createdon: DateTime emailaddress: String @@ -1597,6 +1754,7 @@ type evo_contract { evo_agent_reward: Decimal evo_agent_reward_conditionid: Uuid evo_agent_reward_summ: Decimal + evo_agent_reward_tech: Decimal evo_agent_service_list: [Int!] evo_approvallogs: [evo_approvallog] evo_balance_holder: Int @@ -1609,12 +1767,14 @@ type evo_contract { evo_broker_reward: Decimal evo_broker_reward_conditionid: Uuid evo_broker_reward_summ: Decimal + evo_broker_reward_tech: Decimal evo_broker_service_list: [Int!] evo_businessunitid: Uuid evo_calc_irr: Decimal evo_calc_profit: Decimal evo_cancel_contract: Boolean evo_card_bonus_summ: Decimal + evo_cession_opportunityid: Uuid evo_check_scan_comment: String evo_check_scan_result: Int evo_claim_pledge_agreementid: Uuid @@ -1629,12 +1789,14 @@ type evo_contract { evo_dateend: DateTime evo_date_of_pledge_claim: DateTime evo_date_of_pledge_leasobject: DateTime + evo_date_sor: DateTime evo_date_termination: DateTime evo_dealer_broker_accountid: Uuid evo_dealer_broker_request_paymentid: Uuid evo_dealer_broker_reward: Decimal evo_dealer_broker_reward_conditionid: Uuid evo_dealer_broker_reward_summ: Decimal + evo_dealer_broker_reward_tech: Decimal evo_dealer_broker_service_list: [Int!] evo_dealer_person_accountid: Uuid evo_dealer_person_accountidData: account @@ -1642,6 +1804,7 @@ type evo_contract { evo_dealer_person_reward: Decimal evo_dealer_person_reward_conditionid: Uuid evo_dealer_person_reward_summ: Decimal + evo_dealer_person_reward_tech: Decimal evo_dealer_person_service_list: [Int!] evo_debtwork_contractid: Uuid evo_debtwork_contractidData: evo_debtwork_contract @@ -1650,6 +1813,7 @@ type evo_contract { evo_debt_penalty_fee: Decimal evo_debt_total: Decimal evo_delay_days_count: Int + evo_delay_period: DateTime evo_director_bonus: Decimal evo_director_fingap_bonus: Decimal evo_director_nsib_bonus: Decimal @@ -1665,6 +1829,7 @@ type evo_contract { evo_double_agent_reward: Decimal evo_double_agent_reward_conditionid: Uuid evo_double_agent_reward_summ: Decimal + evo_double_agent_reward_tech: Decimal evo_double_agent_service_list: [Int!] evo_economic: Decimal evo_economic_actual: Decimal @@ -1673,6 +1838,7 @@ type evo_contract { evo_end_date_of_pledge_claim: DateTime evo_end_date_of_pledge_leasobject: DateTime evo_equip_price: Decimal + evo_evokasko_addproduct_typeid: Uuid evo_expinput_actual_date: DateTime evo_fedres_xml_date: DateTime evo_finegibdds: [evo_finegibdd] @@ -1684,6 +1850,7 @@ type evo_contract { evo_fin_department_reward: Decimal evo_fin_department_reward_conditionid: Uuid evo_fin_department_reward_summ: Decimal + evo_fin_department_reward_tech: Decimal evo_fin_department_service_list: [Int!] evo_first_payment_fact: Decimal evo_first_payment_fact_date: DateTime @@ -1730,6 +1897,7 @@ type evo_contract { evo_niatinception_msfo_actual: Decimal evo_ni_at_inception: Decimal evo_ni_at_inception_actual: Decimal + evo_ni_termination: Decimal evo_non_payment_count: Decimal evo_npvni_msfo: Decimal evo_npvni_msfo_final: Decimal @@ -1742,6 +1910,7 @@ type evo_contract { evo_payment_redemption_sum: Decimal evo_payment_redemption_sum_without_nds: Decimal evo_period: Int + evo_previous_accountid: Uuid evo_price_without_discount: Decimal evo_price_without_discount_supplier_currency: Decimal evo_price_wthout_discount_nds_sup_currency: Decimal @@ -1752,6 +1921,7 @@ type evo_contract { evo_rate: Decimal evo_rateid: Uuid evo_reason_change_account: Int + evo_redemption_archive_date: DateTime evo_ref_opportunityid: Uuid evo_region_director_bonus: Decimal evo_region_director_fingap_bonus: Decimal @@ -1759,6 +1929,7 @@ type evo_contract { evo_registration_addproductid: Uuid evo_registration_addproductidData: evo_addproduct evo_registration_addproduct_typeid: Uuid + evo_request_payments: [evo_request_payment] evo_return_leasing: Boolean evo_sale_without_nds: Boolean evo_signer_different_contactid: Uuid @@ -1767,15 +1938,20 @@ type evo_contract { evo_singdoc_systemuserid: Uuid evo_statuscodeid: Uuid evo_statuscodeidData: evo_statuscode + evo_step_statuscodeid: Uuid evo_storage: String evo_subsidyid: Uuid evo_subsidy_solution: Int + evo_subsidy_solution_com: String evo_subsidy_summ: Decimal evo_subsidy_validity_date: DateTime + evo_sumhold_date_sor: Decimal + evo_sumhold_month: Decimal evo_supplier_accountid: Uuid evo_supplier_bank_detailsid: Uuid evo_supplier_bank_detailsidData: evo_bank_details evo_supplier_currency_price: Decimal + evo_supplier_financing: Boolean evo_supplier_pay1_sum: Decimal evo_supplier_pay2_sum: Decimal evo_supplier_payfull_date: DateTime @@ -1916,6 +2092,7 @@ type evo_planpayment { evo_cost_price_telematics_withoutnds: Decimal evo_cost_telematics: Decimal evo_cost_telematics_withoutnds: Decimal + evo_credit_expenses: Decimal evo_early_repayment_sum: Decimal evo_fix_calc_sum: Decimal evo_graphid: Uuid @@ -2086,13 +2263,20 @@ type systemuser { businessunitid: Uuid businessunitidData: businessunit createdon: DateTime + defaultmailbox: Uuid domainname: String + evo_access_download_ni: Boolean + evo_access_exception_addcontract: Boolean evo_available_assignment_director: Boolean evo_baseproducts(statecode: Int): [evo_baseproduct] evo_callrecords_access: Boolean evo_can_export_cre: Boolean evo_can_import_sheduled_calls: Boolean evo_datebirth: DateTime + evo_editing_question_cc: Boolean + evo_edo: Boolean + evo_edo_department: [Int!] + evo_edo_departmentData: [picklist_value] evo_employee_id: String evo_fedresurs_rules: Boolean evo_identity_documents: [evo_identity_document] @@ -2240,6 +2424,7 @@ type evo_addcontract { evo_add_region_director_bonus: Decimal evo_agent_reward: Decimal evo_agent_reward_summ: Decimal + evo_agent_reward_tech: Decimal evo_age_drivers: Int evo_age_drivers_new: Int evo_approv_business_analyst: Boolean @@ -2255,6 +2440,7 @@ type evo_addcontract { evo_base_new: String evo_broker_reward: Decimal evo_broker_reward_summ: Decimal + evo_broker_reward_tech: Decimal evo_businessunitid: Uuid evo_calculation_method: Int evo_calculator_type: Int @@ -2292,6 +2478,7 @@ type evo_addcontract { evo_dealer_broker_reward_new: Decimal evo_dealer_broker_reward_summ: Decimal evo_dealer_broker_reward_summ_new: Decimal + evo_dealer_broker_reward_tech: Decimal evo_dealer_person_accountid: Uuid evo_dealer_person_accountid_new: Uuid evo_dealer_person_reward: Decimal @@ -2300,6 +2487,7 @@ type evo_addcontract { evo_dealer_person_reward_new: Decimal evo_dealer_person_reward_summ: Decimal evo_dealer_person_reward_summ_new: Decimal + evo_dealer_person_reward_tech: Decimal evo_deviation_investments_withoutnds: Decimal evo_deviation_irr: Decimal evo_dgo_price: Decimal @@ -2313,12 +2501,14 @@ type evo_addcontract { evo_dog_credit_new: Decimal evo_double_agent_reward: Decimal evo_double_agent_reward_summ: Decimal + evo_double_agent_reward_tech: Decimal evo_driving_axle: String evo_driving_axle_new: String evo_early_change_discount: Boolean evo_early_discount_perc: Decimal evo_early_partly_type: Int evo_early_redemption_change: Boolean + evo_early_sum: Decimal evo_ecological_class: Int evo_ecological_class_new: Int evo_economic: Decimal @@ -2337,6 +2527,9 @@ type evo_addcontract { evo_engine_volume_new: Decimal evo_equip_price: Decimal evo_equip_price_new: Decimal + evo_evokasko_addproduct_typeid: Uuid + evo_evokasko_addproduct_typeid_new: Uuid + evo_evokasko_price_new: Decimal evo_exp_drivers: Int evo_exp_drivers_new: Int evo_fin_department_reward: Decimal @@ -2345,6 +2538,7 @@ type evo_addcontract { evo_fin_department_reward_new: Decimal evo_fin_department_reward_summ: Decimal evo_fin_department_reward_summ_new: Decimal + evo_fin_department_reward_tech: Decimal evo_fix_last_payment: Boolean evo_franchise: Decimal evo_franchise_new: Decimal @@ -2362,6 +2556,8 @@ type evo_addcontract { evo_insurer_kasko_accountid_new: Uuid evo_insurer_osago_accountid: Uuid evo_insurer_osago_accountid_new: Uuid + evo_ins_period_evokasko_date: DateTime + evo_ins_period_evokasko_number: Int evo_ins_period_kasko_date: DateTime evo_ins_period_kasko_number: Int evo_ins_period_osago_date: DateTime @@ -2383,6 +2579,7 @@ type evo_addcontract { evo_leasingobject_specification_new: String evo_leasing_bonus_summ: Decimal evo_log_activdate_1c: String + evo_loss_kv: Decimal evo_maker: String evo_maker_new: String evo_max_mass: Decimal @@ -2436,6 +2633,8 @@ type evo_addcontract { evo_passport_seria_new: String evo_passport_type: Int evo_passport_type_new: Int + evo_payer_evokasko: Int + evo_payer_evokasko_new: Int evo_payer_kasko: Int evo_payer_kasko_new: Int evo_payer_osago: Int @@ -2545,6 +2744,7 @@ type email { regardingobjectid_evo_list: Uuid regardingobjectid_incident: Uuid regardingobjectid_opportunity: Uuid + statecode: Int statuscode: Int subject: String templateid: Uuid @@ -2564,6 +2764,7 @@ type evo_bank_details { evo_kbk: String evo_name: String evo_payment_account: String + link: String modifiedon: DateTime toObjectString: String } @@ -2588,27 +2789,6 @@ type template { toObjectString: String } -type evo_typedocpackage { - createdon: DateTime - evo_account: Boolean - evo_addcontract: Boolean - evo_agency_agreement: Boolean - evo_contract: Boolean - evo_debtwork_contract: Boolean - evo_finegibdd: Boolean - evo_id: String - evo_incident: Boolean - evo_insurance_period: Boolean - evo_name: String - evo_opportunity: Boolean - evo_programsolution: [Int!] - evo_request_client: Boolean - evo_request_payment: Boolean - evo_typedocpackageid: Uuid - modifiedon: DateTime - toObjectString: String -} - type MutationBy { associateBankDetailsAndAgencyAgreement_(evo_agency_agreementid: Uuid!, evo_bank_detailsid: Uuid!): Entity createEntity(data: EntityDataInput): Uuid! @@ -2618,33 +2798,6 @@ type MutationBy { updateEntity(data: EntityDataInput): Boolean! } -type evo_document { - createdon: DateTime - evo_accountid: Uuid - evo_changed_record_systemuserid: Uuid - evo_changed_record_systemuseridData: systemuser - evo_comment_original: String - evo_comment_previous: String - evo_comment_scan: String - evo_documentid: Uuid - evo_documenttypeid: Uuid - evo_documenttypeidData: evo_documenttype - evo_doc_number: String - evo_init_entity_id: String - evo_init_entity_name: String - evo_name: String - evo_original_correct: Boolean - evo_original_received: Boolean - evo_scan_correct: Boolean - evo_url: String - evo_validity_date: DateTime - evo_version: Int - modifiedon: DateTime - statecode: Int - statuscode: Int - toObjectString: String -} - """The `DateTime` scalar represents an ISO-8601 compliant date time type.""" scalar DateTime @@ -2666,24 +2819,12 @@ enum LogicOperation { OR } -type subjectGraphQL { - createdon: DateTime - modifiedon: DateTime - subjectid: Uuid - title: String - toObjectString: String -} - -type picklist { - name: String - values: [picklist_value] -} - type businessunit { businessunitid: Uuid createdon: DateTime evo_addressid: Uuid evo_boss_systemuserid: Uuid + evo_deputy_director_systemuserid: Uuid evo_director_systemuserid: Uuid evo_region_director_systgemuserid: Uuid evo_region_director_systgemuseridname: String @@ -2692,6 +2833,40 @@ type businessunit { toObjectString: String } +type evo_document { + createdon: DateTime + evo_accountid: Uuid + evo_changed_record_systemuserid: Uuid + evo_changed_record_systemuseridData: systemuser + evo_comment_original: String + evo_comment_previous: String + evo_comment_scan: String + evo_documentid: Uuid + evo_documenttypeid: Uuid + evo_documenttypeidData: evo_documenttype + evo_doc_number: String + evo_edoid: Uuid + evo_edoidData: evo_edo + evo_init_entity_id: String + evo_init_entity_name: String + evo_name: String + evo_original_correct: Boolean + evo_original_received: Boolean + evo_scan_correct: Boolean + evo_url: String + evo_validity_date: DateTime + evo_version: Int + modifiedon: DateTime + statecode: Int + statuscode: Int + toObjectString: String +} + +type picklist { + name: String + values: [picklist_value] +} + type team { createdon: DateTime evo_baseproducts(statecode: Int): [evo_baseproduct] @@ -2702,6 +2877,41 @@ type team { toObjectString: String } +type evo_edo { + createdon: DateTime + evo_accountid: Uuid + evo_accountidData: account + evo_activation_status: Int + evo_activation_statusname: String + evo_box_edoid: Uuid + evo_box_edoidData: evo_edo + evo_box_id: String + evo_box_name: String + evo_contractid: Uuid + evo_contractidData: evo_contract + evo_documentid: Uuid + evo_documenttypeid: Uuid + evo_edoid: Uuid + evo_edo_department: Int + evo_edo_status: Int + evo_edo_statusname: String + evo_edo_type: Int + evo_edo_typeename: String + evo_formalized: Boolean + evo_invite_crm_status: Int + evo_invite_crm_statusname: String + evo_legal_status: Int + evo_name: String + evo_project_documenttypeid: Uuid + evo_signer_systemuserid: Uuid + evo_sign_required: Boolean + evo_statuscodeid: Uuid + evo_statuscodeidData: evo_statuscode + evo_use_box: Boolean + modifiedon: DateTime + toObjectString: String +} + type evo_insurance_policy { createdon: DateTime evo_accountid: Uuid @@ -2775,6 +2985,7 @@ type tisa_phonecallprocessing { type role { createdon: DateTime + evo_connection_roleData: evo_connection_role evo_documenttypes: [evo_documenttype] modifiedon: DateTime name: String @@ -2782,6 +2993,13 @@ type role { toObjectString: String } +type picklist_value { + color: String + label: String + order: Int! + value: Int! +} + type activityparty { addressused: String createdon: DateTime @@ -2806,24 +3024,6 @@ type Entity { logical_name: String } -type evo_documenttype { - createdon: DateTime - evo_comment: String - evo_documenttypeid: Uuid - evo_draftdoc: Boolean - evo_edit_namedoc: Boolean - evo_fill_docname: Boolean - evo_id: String - evo_name: String - evo_name_save_file: String - evo_place_upload_doc: [Int!] - evo_storagedoc: Int - evo_typedocpackages: [evo_typedocpackage] - evo_validitydoc: Int - modifiedon: DateTime - toObjectString: String -} - enum FilterOperation { ISNULL EQUAL @@ -2835,11 +3035,12 @@ enum FilterOperation { LESSOREQUALTHEN } -type picklist_value { - color: String - label: String - order: Int! - value: Int! +type evo_connection_role { + createdon: DateTime + evo_connection_roleid: Uuid + evo_edo_department: Int + modifiedon: DateTime + toObjectString: String } input EntityFieldInput { diff --git a/apps/web/graphql/crm.types.ts b/apps/web/graphql/crm.types.ts index 7a262a6..ddfb8fb 100644 --- a/apps/web/graphql/crm.types.ts +++ b/apps/web/graphql/crm.types.ts @@ -231,6 +231,11 @@ export type GetQuoteUrlQueryVariables = Exact<{ export type GetQuoteUrlQuery = { __typename?: 'Query', entity: { __typename?: 'quote', link: string | null } | null }; +export type GetLeasingWithoutKaskoOptionsQueryVariables = Exact<{ [key: string]: never; }>; + + +export type GetLeasingWithoutKaskoOptionsQuery = { __typename?: 'Query', evo_addproduct_types: Array<{ __typename?: 'evo_addproduct_type', evo_product_type: number | null, evo_min_period: number | null, evo_max_period: number | null, evo_min_price: number | null, evo_max_price: number | null, evo_visible_calc: boolean | null, evo_min_first_payment_perc: number | null, evo_max_first_payment_perc: number | null, label: string | null, value: string | null, evo_leasingobject_types: Array<{ __typename?: 'evo_leasingobject_type', evo_leasingobject_typeid: string | null } | null> | null, evo_models: Array<{ __typename?: 'evo_model', evo_modelid: string | null } | null> | null } | null> | null }; + export type GetPaymentsDataFromQuoteQueryVariables = Exact<{ quoteId: Scalars['Uuid']; }>; diff --git a/apps/web/process/leasing-without-kasko/reactions/common.ts b/apps/web/process/leasing-without-kasko/reactions/common.ts index 17849b1..c617742 100644 --- a/apps/web/process/leasing-without-kasko/reactions/common.ts +++ b/apps/web/process/leasing-without-kasko/reactions/common.ts @@ -1,9 +1,41 @@ -import { reaction } from 'mobx'; +/* eslint-disable @typescript-eslint/naming-convention */ +import { gql } from '@apollo/client'; +import dayjs from 'dayjs'; +import utc from 'dayjs/plugin/utc'; +import type * as CRMTypes from 'graphql/crm.types'; +import { autorun, reaction } from 'mobx'; import type { ReactionsContext } from 'process/types'; import { uid } from 'radash'; +import { normalizeOptions } from 'tools'; import notification from 'ui/elements/notification'; +dayjs.extend(utc); + const NOTIFICATION_KEY = uid(7); + +const QUERY_GET_LEASING_WITHOUT_KASKO_OPTIONS = gql` + query GetLeasingWithoutKaskoOptions { + evo_addproduct_types(statecode: 0, evo_product_type: 100000007) { + label: evo_name + value: evo_addproduct_typeid + evo_product_type + evo_min_period + evo_max_period + evo_min_price + evo_max_price + evo_leasingobject_types { + evo_leasingobject_typeid + } + evo_visible_calc + evo_min_first_payment_perc + evo_max_first_payment_perc + evo_models { + evo_modelid + } + } + } +`; + export default function commonReactions({ store, apolloClient, queryClient }: ReactionsContext) { const { $calculation, $tables } = store; @@ -30,4 +62,50 @@ export default function commonReactions({ store, apolloClient, queryClient }: Re } } ); + + autorun(async () => { + const { + data: { evo_addproduct_types }, + } = await apolloClient.query< + CRMTypes.GetLeasingWithoutKaskoOptionsQuery, + CRMTypes.GetLeasingWithoutKaskoOptionsQueryVariables + >({ + query: QUERY_GET_LEASING_WITHOUT_KASKO_OPTIONS, + }); + + const { + plPriceRub, + discountRub, + importProgramSum, + leasingPeriod, + addEquipmentPrice, + leaseObjectType, + firstPaymentPerc, + model: modelId, + } = $calculation.$values.values; + + const options = evo_addproduct_types?.filter( + (x) => + x?.evo_max_period && + x.evo_max_period >= leasingPeriod && + x?.evo_min_period && + x.evo_min_period <= leasingPeriod && + x?.evo_max_price && + x.evo_max_price >= plPriceRub - discountRub - importProgramSum + addEquipmentPrice && + x?.evo_min_price && + x.evo_min_price <= plPriceRub - discountRub - importProgramSum + addEquipmentPrice && + x.evo_leasingobject_types?.find( + (evo_leasingobject_type) => + evo_leasingobject_type?.evo_leasingobject_typeid === leaseObjectType + ) && + x.evo_visible_calc && + x.evo_min_first_payment_perc && + x.evo_min_first_payment_perc <= firstPaymentPerc && + x.evo_max_first_payment_perc && + x.evo_max_first_payment_perc >= firstPaymentPerc && + !x.evo_models?.map((evo_model) => evo_model?.evo_modelid).includes(modelId) + ); + + $calculation.element('selectLeasingWithoutKasko').setOptions(normalizeOptions(options)); + }); }