- update inter id matching
- make full import returns recipe struct
This commit is contained in:
Pakin 2025-10-16 09:00:05 +07:00
parent 4670c5f89a
commit acda791675
2 changed files with 5 additions and 3 deletions

View file

@ -153,7 +153,7 @@ pub fn change_prefix_by_country(
if check_allowed_change_mat_prefix(eled.clone().materialPathId) { if check_allowed_change_mat_prefix(eled.clone().materialPathId) {
let curr_id = eled.clone().materialPathId.as_i64().unwrap_or(0); let curr_id = eled.clone().materialPathId.as_i64().unwrap_or(0);
let new_f = if curr_id > 99999 { let new_f = if curr_id > 300000 {
// is from inter // is from inter
// TODO: reset first // TODO: reset first
@ -187,7 +187,7 @@ pub fn change_prefix_by_country(
if check_allowed_change_mat_prefix(eled.clone().materialPathId) { if check_allowed_change_mat_prefix(eled.clone().materialPathId) {
let curr_id = eled.clone().materialPathId.as_i64().unwrap_or(0); let curr_id = eled.clone().materialPathId.as_i64().unwrap_or(0);
let new_f = if curr_id > 99999 { let new_f = if curr_id > 300000 {
// is from inter // is from inter
// TODO: reset first // TODO: reset first

View file

@ -603,7 +603,7 @@ pub fn generate_recipe_sheet_table(country_name: &str, into_version: usize) {
/// - MaterialCode /// - MaterialCode
/// - Topping /// - Topping
/// ///
pub fn full_import_data(source: Recipe, mut import_target: Recipe) { pub fn full_import_data(source: Recipe, mut import_target: Recipe) -> Recipe {
// import menus // import menus
source.Recipe01.iter().for_each(|r01| { source.Recipe01.iter().for_each(|r01| {
if !import_target.Recipe01.contains(r01) { if !import_target.Recipe01.contains(r01) {
@ -635,4 +635,6 @@ pub fn full_import_data(source: Recipe, mut import_target: Recipe) {
import_target.Topping.ToppingGroup.push(tg.clone()); import_target.Topping.ToppingGroup.push(tg.clone());
} }
}); });
import_target
} }