advotracker: callback: update
Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
This commit is contained in:
@@ -12,9 +12,9 @@ use serde::Deserialize;
|
||||
use std::env;
|
||||
use std::{error::Error, process};
|
||||
use std::collections::HashMap;
|
||||
use tracing::{debug, trace, span, Level};
|
||||
use tracing::{debug, trace, Level};
|
||||
|
||||
use advotracker::data::{PolicyCode, PolicyList, PolicyDataList, PolicyData};
|
||||
use advotracker::data::structures::{PolicyCode, PolicyList, PolicyDataList, PolicyData};
|
||||
|
||||
// include modules
|
||||
mod parse_args;
|
||||
|
||||
@@ -7,10 +7,11 @@
|
||||
|
||||
use orbtk::prelude::*;
|
||||
|
||||
use crate::{
|
||||
//data::structures::PolicyList,
|
||||
data::keys::*
|
||||
};
|
||||
//use crate::data::keys;
|
||||
// use crate::{
|
||||
// //data::structures::PolicyList,
|
||||
// data::keys::*
|
||||
// };
|
||||
|
||||
/// Provides generic methods to handle states of datatypes (e.g. used in `PolicyList`).
|
||||
pub trait GlobalState {
|
||||
|
||||
@@ -7,17 +7,17 @@
|
||||
|
||||
use chrono::{Local, DateTime};
|
||||
use locales::t;
|
||||
use serde::Deserialize;
|
||||
use std::env;
|
||||
use std::{error::Error, process};
|
||||
//use serde::Deserialize;
|
||||
//use std::env;
|
||||
//use std::{error::Error, process};
|
||||
use std::collections::HashMap;
|
||||
use tracing::{debug, trace, Level};
|
||||
use tracing::{info, trace};
|
||||
|
||||
use crate::data::structures::{PolicyCode, PolicyDataList, PolicyData, PolicyList};
|
||||
use crate::data::structures::{PolicyCode, PolicyDataList};
|
||||
|
||||
/// validate a given policy number
|
||||
/// result will return true or false
|
||||
fn is_valid(policy_number: &usize, policy_list: &PolicyDataList,
|
||||
pub fn is_valid(policy_number: &usize, policy_list: &PolicyDataList,
|
||||
policy_numbers: &mut HashMap<usize, PolicyCode>, lang: &String)
|
||||
-> Result<bool, Box<dyn std::error::Error>> {
|
||||
|
||||
@@ -39,6 +39,7 @@ fn is_valid(policy_number: &usize, policy_list: &PolicyDataList,
|
||||
let res = t!("policy.validation.success", lang);
|
||||
println!("policy_number: {} ({:?})",
|
||||
policy_number, policy_code);
|
||||
info!("{} => {} ({:?})", res, policy_number, policy_code);
|
||||
result = true;
|
||||
trace!(target: "csv-test",
|
||||
policy_number = ?policy_number,
|
||||
@@ -48,6 +49,7 @@ fn is_valid(policy_number: &usize, policy_list: &PolicyDataList,
|
||||
_ => {
|
||||
let res = t!("policy.validation.failed", lang);
|
||||
println!("Noop! Number isn't valid!");
|
||||
info!("{} => {}", res, policy_number);
|
||||
trace!(target: "csv-test",
|
||||
policy_number = ?policy_number,
|
||||
validation = ?res);
|
||||
|
||||
@@ -5,14 +5,14 @@
|
||||
* SPDX-License-Identifier: (0BSD or MIT)
|
||||
*/
|
||||
|
||||
use chrono::{Local, DateTime};
|
||||
//use chrono::{Local, DateTime};
|
||||
use locales::t;
|
||||
//use serde::{Deserialize, Serialize};
|
||||
use serde::Deserialize;
|
||||
use std::env;
|
||||
use std::{error::Error, process};
|
||||
use std::{env, process};
|
||||
//use std::{error::Error, process};
|
||||
use std::collections::HashMap;
|
||||
use tracing::{debug, trace, span, Level};
|
||||
use tracing::{debug, trace, Level};
|
||||
|
||||
use orbtk::prelude::*;
|
||||
use orbtk::theme::DEFAULT_THEME_CSS;
|
||||
@@ -21,30 +21,6 @@ use orbtk::theme::DEFAULT_THEME_CSS;
|
||||
// The Main view
|
||||
use advotracker::widgets::main_view;
|
||||
|
||||
//use advotracker::services;
|
||||
//use advotracker::sercices::policy_check::{import};
|
||||
|
||||
// helper modules
|
||||
//pub mod base_state;
|
||||
//pub mod keys;
|
||||
|
||||
// the frontend
|
||||
//pub mod main_view;
|
||||
|
||||
// validation check of a policy data element given by its poliy code
|
||||
//pub mod policycheck_view;
|
||||
//ub mod policycheck_state;
|
||||
//pub mod policycheck_menu;
|
||||
|
||||
// // manage list of policy data structures
|
||||
// pub mod policylist_view;
|
||||
// pub mod policylist_state;
|
||||
|
||||
// // manage policy data elements
|
||||
// pub mod policydata_view;
|
||||
// pub mod policydata_state;
|
||||
// include modules
|
||||
|
||||
mod parse_args;
|
||||
|
||||
/// respect environment variables set in .env files
|
||||
@@ -74,10 +50,9 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
use tracing_subscriber::fmt;
|
||||
use viperus::Viperus;
|
||||
|
||||
use advotracker::services::policy_check::*;
|
||||
//use advotracker::callbacks::policy_check::is_valid;
|
||||
use advotracker::services::imports::allianzdirectcall::*;
|
||||
//use advotracker::data;
|
||||
use advotracker::data::structures::{PolicyCode, PolicyDataList, PolicyData, PolicyList};
|
||||
use advotracker::data::structures::{PolicyCode, PolicyDataList, PolicyList};
|
||||
|
||||
//static DEFAULT_FILTER: &str = concat!(module_path!(), "=", "trace");
|
||||
|
||||
|
||||
@@ -8,22 +8,7 @@
|
||||
use orbtk::prelude::*;
|
||||
|
||||
use crate::data::structures::PolicyCheck;
|
||||
use crate::widgets::policycheck_view;
|
||||
//use policycheck_view::PolicyCheckView::*;
|
||||
//data::{PolicyCheck, PolicyList, PolicyDataList},
|
||||
// policylist_view::PolicyListView,
|
||||
// policydata_view::PolicyDataView
|
||||
|
||||
//use advotracker::data::PolicyCheckView;
|
||||
|
||||
// use advotracker::{
|
||||
// //data::{PolicyList, PolicyData},
|
||||
// policycheck_view::*,
|
||||
// //policylist_view::*,
|
||||
// //PolicyListView,
|
||||
// //policydata_view::*,
|
||||
// //PolicyDataList
|
||||
//};
|
||||
use crate::widgets::policycheck_view::PolicyCheckView;
|
||||
|
||||
widget!(MainView {
|
||||
// policy_list_count: usize,
|
||||
@@ -55,7 +40,7 @@ impl Template for MainView {
|
||||
|
||||
self.name("MainView")
|
||||
//.policy_list_count(0)
|
||||
// //.policycheck_view(PolicyCheck::default())
|
||||
//.policycheck_view(PolicyCheck::default())
|
||||
// //.policycheck_view(0)
|
||||
// .policydata_view(policydata_view.0)
|
||||
// //.policylist_view(PolicyList::default())
|
||||
|
||||
Reference in New Issue
Block a user