From 6bd77c8b3e513701d5e3f3a0a18b7dc85430a410 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rene=20Ka=C3=9Feb=C3=B6hmer?= Date: Thu, 10 Apr 2025 11:18:18 +0200 Subject: [PATCH] golden to asset working --- .../2_transform_via_script/LocationScript.py | 54 +- .../2_transform_via_script/mapping.csv | 647 ++++++++++++++++++ .../export.json | 6 +- .../command_dev.txt | 2 +- prepared_steps/7_upsert_assets/export.json | 11 +- run.bat | 28 + 6 files changed, 737 insertions(+), 11 deletions(-) create mode 100644 prepared_steps/2_transform_via_script/mapping.csv create mode 100644 run.bat diff --git a/prepared_steps/2_transform_via_script/LocationScript.py b/prepared_steps/2_transform_via_script/LocationScript.py index ff9e14b..879a9c8 100644 --- a/prepared_steps/2_transform_via_script/LocationScript.py +++ b/prepared_steps/2_transform_via_script/LocationScript.py @@ -1,4 +1,5 @@ import pandas as pd +from tqdm import tqdm country_mapping = { 'NL': 'Netherlands' @@ -55,6 +56,8 @@ merged_df_ib = pd.merge(df_ib, right_on='Id', how='left') +print(merged_df_ib.columns) + # If there are missing values (no match found), you can fill them with a placeholder merged_df_ib['PKey__c'].fillna('Not Found', inplace=True) @@ -160,10 +163,12 @@ child_df['LocationType'] = 'Site' merged_df_ib = merged_df_ib.drop('InstalledBaseLocation__c', axis=1) #merged_df_ib = merged_df_ib.drop('InstalledBaseLocation__r.Id', axis=1) merged_df_ib = merged_df_ib.drop('Id_y', axis=1) -print(merged_df_ib.columns) -merged_df_ib.columns = ['Product2.Product_Code__c', 'FSL_1st_Ignition_Date__c', 'Id', 'InstallDate', 'Name', 'Kind_of_Energy__c', 'Kind_of_Installation__c', 'Main_Product_Group__c', 'SerialNumber', 'Serialnumber_Exception__c', 'Location.ExternalReference'] -merged_df_ib = merged_df_ib.drop('Main_Product_Group__c', axis=1) +merged_df_ib = merged_df_ib.drop('Id_x', axis=1) +merged_df_ib = merged_df_ib.drop('ProductUnitClass__c', axis=1) +merged_df_ib = merged_df_ib.drop('ProductUnitType__c', axis=1) +merged_df_ib.columns = ['Name', 'FSL_1st_Ignition_Date__c', 'InstallDate', 'Kind_of_Energy__c', 'Product2.Product_Code__c', 'SerialNumber', 'Serialnumber_Exception__c', 'Location.ExternalReference'] +#merged_df_ib = merged_df_ib.drop('Main_Product_Group__c', axis=1) # assign Main_Product_Group__c based on product2 records merged_df_ib = pd.merge(merged_df_ib, df_product2[['Product_Code__c', 'Main_Product_Group__c']], @@ -173,8 +178,49 @@ merged_df_ib = pd.merge(merged_df_ib, merged_df_ib = merged_df_ib.drop('Product_Code__c', axis=1) -merged_df_ib = merged_df_ib.drop_duplicates(subset=['Id'], keep='first') +merged_df_ib = merged_df_ib.drop_duplicates(subset=['Name','SerialNumber'], keep='first') +#remove kind_of_energy__c and kind_of_installation if field dependency to main product group is not correct +# Create the mapping dictionary +kind_of_energy_mapping = { + '1': ['A2', 'A1', 'B2', 'B1', 'E1', '14', 'E3', '17'], + '2': ['A2', 'A1', 'B2', 'B1', 'E1', '14', 'E3', '17'], + 'G': ['A2', 'A1', 'B2', 'B1', 'E1', 'E3', '17'], + '6': ['B3', '11', '13', '14', '17'], + '8': ['B4'], + '7': ['13', 'E3', 'E2', 'F2', 'C1', 'F3', 'C9', 'F1', 'G2', 'A3', 'E4', 'D1'], + '9': ['E5', 'F6', 'C9', 'F1', 'G2', 'K1'] +} + +kind_of_installation_mapping = { + '001': ['A1', 'A4', '14'], + '002': ['A1', 'A4', '14'], + '003': ['A1', 'A4', '14'], + '004': ['A1', 'A4', '14'], + '005': ['A1', 'A4'], + '00D': ['B4'], + '00E': ['B4', '17'], + '00F': ['B4', '13', '14', '17'], + '00A': ['C2', '14'], + '00B': ['C2', '14'], + '00C': ['C2', '14'] +} + +# Convert the values to sets for faster lookup +mapping_sets = {k: set(v) for k, v in kind_of_energy_mapping.items()} + +# Iterate through each row and check if main_product_group__c is in the corresponding set +for index, row in tqdm(merged_df_ib.iterrows(), total=len(merged_df_ib)): + kind_energy = row['Kind_of_Energy__c'] + product_group = row['Main_Product_Group__c'] + + # Check if kind_energy exists in the mapping + if kind_energy in mapping_sets: + valid_groups = mapping_sets[kind_energy] + if product_group not in valid_groups: + merged_df_ib.loc[index, 'Kind_of_Energy__c'] = None # or set to empty string + +print(merged_df_ib) # Write each DataFrame to a separate CSV file address_df.to_csv('../3_upsert_address_and_parent_location/Address.csv', index=False) diff --git a/prepared_steps/2_transform_via_script/mapping.csv b/prepared_steps/2_transform_via_script/mapping.csv new file mode 100644 index 0000000..bf04548 --- /dev/null +++ b/prepared_steps/2_transform_via_script/mapping.csv @@ -0,0 +1,647 @@ +Product_Code__c,Main_Product_Group__c,ArticleNo__c,ProductUnitClass__c,ProductUnitType__c +,,,, +,,,01,011 +,,,01,012 +,,,02,021 +,,,02,022 +,,,04,041 +,,,05,051 +,,,05,053 +,,,05,054 +,,,06,061 +,,,07,071 +,,,07,072 +,,,07,073 +,,,07,076 +,,,08,081 +,,,08,084 +,,,10,102 +,,,10,103 +,,,10,106 +,,,10,107 +,,,11, +,,,11,114 +,,,12,121 +,,,12,122 +,,,40,409 +,,,99,999 +0010007402,A1,0010007402,, +308501,A1,308501,, +300161,A1,300161,, +308500,A1,308500,, +0010002664,A1,0010002664,, +300160,A1,300160,, +0010009493,A1,0010009493,, +0010009492,A1,0010009492,, +0010002628,A1,0010002628,, +0010004142,A1,0010004142,, +0010002627,A1,0010002627,, +0010002662,A1,0010002662,, +0010009494,A1,0010009494,, +0010009491,A1,0010009491,, +0010002661,A1,0010002661,, +0010004141,A1,0010004141,, +0010011721,A1,0010011721,, +0010011722,A1,0010011722,, +0010011731,A1,0010011731,, +0010002628,A1,0010002628,01,011 +0010021961,A1,0010021961,01,011 +0010021905,A1,0010021905,01,012 +0010021908,A1,0010021908,01,012 +0010018504,A1,0010018504,01,012 +0010021906,A1,0010021906,01,012 +0010011702,A1,0010011702,01,012 +0010021907,A1,0010021907,01,012 +0010011709,A1,0010011709,01,012 +0010018503,A1,0010018503,01,012 +0010011703,A1,0010011703,01,012 +0010021904,A1,0010021904,01,012 +0010004365,A1,0010004365,01,012 +0010020375,A1,0010020375,01,012 +0010008850,A1,0010008850,01,012 +0010011704,A1,0010011704,01,012 +0010017821,A1,0010017821,01,012 +0010011706,A1,0010011706,01,012 +2000465501,A1,2000465501,01,012 +0010008849,A1,0010008849,01,012 +0010015666,A1,0010015666,01,012 +0010017376,A1,0010017376,01,012 +0010018502,A1,0010018502,01,012 +0010020373,A1,0010020373,01,012 +0010018501,A1,0010018501,01,012 +0010008851,A1,0010008851,01,012 +0010009493,A1,0010009493,01,012 +0010021909,A1,0010021909,01,012 +0010005828,A1,0010005828,01,012 +0010005829,A1,0010005829,01,012 +0010017375,A1,0010017375,01,012 +2000465500,A1,2000465500,01,012 +0010011707,A1,0010011707,01,012 +0010015667,A1,0010015667,01,012 +0010025033,A1,0010025033,01,012 +0010020371,A1,0010020371,01,012 +LT95SG12,A1,LT95SG12,01,012 +0010014587,A1,0010014587,01,012 +2000465503,A1,2000465503,01,012 +0010025034,A1,0010025034,01,012 +0010025031,A1,0010025031,01,012 +0010021910,A1,0010021910,01,012 +0010025032,A1,0010025032,01,012 +2000465502,A1,2000465502,01,012 +0010004142,A1,0010004142,01,012 +0010008852,A1,0010008852,01,012 +0010017092,A1,0010017092,01,012 +0010002662,A1,0010002662,01,012 +0010002628,A1,0010002628,01,012 +0010018505,A1,0010018505,01,012 +0010017091,A1,0010017091,01,012 +0010020372,A1,0010020372,01,012 +0010017374,A1,0010017374,01,012 +0010002627,A1,0010002627,01,012 +0010017822,A1,0010017822,01,012 +308501,A1,308501,01,012 +0010002665,A1,0010002665,01,012 +0010015668,A1,0010015668,01,012 +0010009491,A1,0010009491,01,012 +0010020374,A1,0010020374,01,012 +308500,A1,308500,01,012 +0010010779,A1,0010010779,01,012 +0010003810,A1,0010003810,01,012 +0010011701,A1,0010011701,01,012 +0010002661,A1,0010002661,01,012 +0010009492,A1,0010009492,01,012 +0010011708,A1,0010011708,01,012 +0010009494,A1,0010009494,01,012 +0010007968,A1,0010007968,01,012 +0010025035,A1,0010025035,01,012 +0010021526,A1,0010021526,01,012 +2000465697,A1,2000465697,01,012 +0010010768,A1,0010010768,01,012 +0010010755,A1,0010010755,01,012 +0010011705,A1,0010011705,01,012 +0010002660,A1,0010002660,01,012 +0010021527,A1,0010021527,01,012 +300161,A1,300161,01,012 +0010016403,A1,0010016403,01,012 +2000465698,A1,2000465698,01,012 +0010002463,A1,0010002463,01,012 +0010029560,A1,0010029560,01,012 +0010029557,A1,0010029557,01,012 +0010004141,A1,0010004141,01,012 +0010016400,A1,0010016400,01,012 +0010029558,A1,0010029558,01,012 +0010029559,A1,0010029559,01,012 +0010002664,A1,0010002664,01,012 +300160,A1,300160,01,012 +305208,A1,305208,01,012 +305077,A1,305077,01,012 +305349,A1,305349,01,012 +305180,A1,305180,01,012 +0010024618,A1,0010024618,01,012 +0010024619,A1,0010024619,01,012 +0010024617,A1,0010024617,01,012 +0010025189,A1,0010025189,01,012 +0010024612,A1,0010024612,01,012 +0010029556,A1,0010029556,01,012 +0010024615,A1,0010024615,01,012 +0010024611,A1,0010024611,01,012 +0010022011,A1,0010022011,01,012 +0010024616,A1,0010024616,01,012 +0010024614,A1,0010024614,01,012 +0010043923,A1,0010043923,01,012 +0010043922,A1,0010043922,01,012 +0010043924,A1,0010043924,01,012 +0010043921,A1,0010043921,01,012 +0010024613,A1,0010024613,01,012 +0010016396,A1,0010016396,01,012 +0010016401,A1,0010016401,01,012 +0010016397,A1,0010016397,01,012 +0010016399,A1,0010016399,01,012 +0010015191,A1,0010015191,01,012 +0010016398,A1,0010016398,01,012 +0010016402,A1,0010016402,01,012 +0010011633,A1,0010011633,01,012 +0010021849,A1,0010021849,01,012 +0010002627,A1,0010002627,05,051 +0010021910,A1,0010021910,05,051 +0010021905,A1,0010021905,07,073 +0010011709,A1,0010011709,07,073 +0010011702,A1,0010011702,07,073 +0010018503,A1,0010018503,07,073 +0010021906,A1,0010021906,10,103 +0010021905,A1,0010021905,10,103 +0010025033,A1,0010025033,10,103 +0010025189,A1,0010025189,10,103 +0010024617,A1,0010024617,10,103 +0010024618,A1,0010024618,10,103 +0010043922,A1,0010043922,10,103 +0010014587,A1,0010014587,10,103 +0010011701,A1,0010011701,10,103 +0010011703,A1,0010011703,10,103 +0010011702,A1,0010011702,10,103 +0010011709,A1,0010011709,10,103 +0010020373,A1,0010020373,10,103 +0010024611,A1,0010024611,11,114 +0010007401,A1,0010007401,40,409 +0010006144,A2,0010006144,, +310150,A2,310150,, +310350,A2,310350,, +0010006145,A2,0010006145,, +0010006142,A2,0010006142,, +0010006146,A2,0010006146,, +0010003307,A2,0010003307,, +0010002713,A2,0010002713,, +0010003301,A2,0010003301,, +0010018749,A2,0010018749,01,011 +AG27SG12,A2,AG27SG12,01,011 +AH27SG12,A2,AH27SG12,01,011 +0010006144,A2,0010006144,01,011 +0010006142,A2,0010006142,01,011 +0010006145,A2,0010006145,01,011 +0010006146,A2,0010006146,01,011 +0010006143,A2,0010006143,01,011 +310350,A2,310350,01,012 +0010002654,A2,0010002654,01,012 +0010023690,A3,0010023690,11,114 +0010023695,A3,0010023695,11,114 +0010023693,A3,0010023693,11,114 +0010023691,A3,0010023691,11,114 +0010023697,A3,0010023697,11,114 +0010017269,A4,0010017269,01,012 +0010017268,A4,0010017268,01,012 +0010021772,B1,0010021772,02,022 +0010021775,B1,0010021775,02,022 +0010005727,B2,0010005727,01,012 +0010006324,C1,0010006324,, +0010019765,C1,0010019765,01,012 +0010016411,C1,0010016411,01,012 +0010016413,C1,0010016413,07,071 +0010021626,C1,0010021626,07,071 +0010016413,C1,0010016413,07,073 +0010019764,C1,0010019764,07,073 +0010019765,C1,0010019765,07,073 +0010016411,C1,0010016411,07,073 +0010016408,C1,0010016408,07,073 +0010019790,C1,0010019790,07,073 +0010021628,C1,0010021628,07,073 +0010009400,C1,0010009400,07,073 +0010021618,C1,0010021618,07,073 +0010016409,C1,0010016409,07,073 +0010021621,C1,0010021621,07,073 +0010021617,C1,0010021617,07,073 +0010021619,C1,0010021619,07,073 +0010016292,C1,0010016292,07,073 +0010021623,C1,0010021623,07,073 +0010013076,C1,0010013076,07,073 +0010021630,C1,0010021630,07,073 +0010021626,C1,0010021626,07,073 +0010021625,C1,0010021625,07,073 +0010005858,C1,0010005858,07,073 +0010002784,C1,0010002784,07,073 +0010005860,C1,0010005860,07,073 +0010002804,C1,0010002804,07,073 +0010005859,C1,0010005859,07,073 +0010021111,C1,0010021111,07,073 +308301,C1,308301,07,073 +0010021624,C1,0010021624,07,073 +0010031658,C1,0010031658,07,073 +0010021118,C1,0010021118,07,073 +0010021183,C1,0010021183,07,073 +0010036170,C1,0010036170,07,073 +0010036171,C1,0010036171,07,073 +0010021122,C1,0010021122,07,073 +0010036172,C1,0010036172,07,073 +0010036173,C1,0010036173,07,073 +0010039758,C1,0010039758,07,073 +0010039757,C1,0010039757,07,073 +0010039756,C1,0010039756,07,073 +0010019775,C1,0010019775,07,073 +0010014566,C1,0010014566,07,073 +0010021626,C1,0010021626,07,076 +0010021619,C1,0010021619,07,076 +0010021617,C1,0010021617,07,076 +0010021630,C1,0010021630,07,076 +0010019764,C1,0010019764,07,076 +0010021618,C1,0010021618,10,103 +0010021630,C1,0010021630,11,114 +0010019790,C1,0010019790,99,999 +0010022462,C2,0010022462,07,073 +0010016679,C2,0010016679,07,073 +0010013075,C2,0010013075,07,073 +0010016682,C2,0010016682,07,073 +0010016677,C2,0010016677,07,073 +0010016681,C2,0010016681,07,073 +0010016678,C2,0010016678,07,073 +0010002782,C2,0010002782,07,073 +0010016680,C2,0010016680,07,073 +0010009076,C2,0010009076,07,073 +0010016683,C2,0010016683,07,073 +0010016684,C2,0010016684,07,073 +0010002786,C2,0010002786,07,073 +0010002787,C2,0010002787,07,073 +0010002788,C2,0010002788,07,073 +0010002781,C2,0010002781,07,073 +0010002800,C2,0010002800,07,073 +0010002797,C2,0010002797,07,073 +0010002799,C2,0010002799,07,073 +0010002778,C2,0010002778,07,073 +0010002798,C2,0010002798,07,073 +0010009081,C2,0010009081,07,073 +0010009071,C2,0010009071,07,073 +0010018423,C2,0010018423,07,073 +0010009070,C2,0010009070,07,073 +0010009072,C2,0010009072,07,073 +0010009077,C2,0010009077,07,073 +0010009078,C2,0010009078,07,073 +0010009080,C2,0010009080,07,073 +0010016679,C2,0010016679,10,102 +0010016679,C2,0010016679,10,103 +0020180703,C9,0020180703,07,073 +0020180702,C9,0020180702,07,073 +0020180704,C9,0020180704,07,073 +0010016718,C9,0010016718,07,073 +0020146366,C9,0020146366,07,073 +0010022085,C9,0010022085,07,073 +0020126470,C9,0020126470,07,073 +0010023525,C9,0010023525,07,073 +0010042134,C9,0010042134,07,073 +0010038169,C9,0010038169,07,073 +0010019709,C9,0010019709,07,073 +0010038170,C9,0010038170,07,073 +0010019709,C9,0010019709,07,076 +0010023525,C9,0010023525,07,076 +0010023494,C9,0010023494,07,076 +0010022084,C9,0010022084,07,076 +0010023504,C9,0010023504,07,076 +0010022086,C9,0010022086,07,076 +0010022085,C9,0010022085,07,076 +0010023502,C9,0010023502,07,076 +0010022078,C9,0010022078,07,076 +0010023611,C9,0010023611,07,076 +0010039573,C9,0010039573,07,076 +0010039594,C9,0010039594,07,076 +0010031645,C9,0010031645,10,103 +0020146366,C9,0020146366,10,107 +0010000262,D1,0010000262,01,012 +0010000266,D1,0010000266,01,012 +0010013070,D1,0010013070,07,073 +0010022646,D1,0010022646,07,073 +0010022692,D1,0010022692,08,081 +0010022645,D1,0010022645,08,081 +0010022693,D1,0010022693,08,081 +0010022646,D1,0010022646,08,081 +0010000180,D1,0010000180,08,081 +0010000146,D1,0010000146,08,081 +0010000143,D1,0010000143,08,081 +0010000183,D1,0010000183,08,081 +0010000100,D1,0010000100,08,081 +0010000202,D1,0010000202,08,081 +0010000186,D1,0010000186,08,081 +0010005111,D1,0010005111,08,081 +0010005110,D1,0010005110,08,081 +0010005154,D1,0010005154,08,081 +0010005152,D1,0010005152,08,081 +0010000103,D1,0010000103,08,081 +0010005153,D1,0010005153,08,081 +0010005121,D1,0010005121,08,081 +0010006555,D1,0010006555,08,081 +0010005112,D1,0010005112,08,081 +0010005114,D1,0010005114,08,081 +0010006556,D1,0010006556,08,081 +0010005120,D1,0010005120,08,081 +0010000181,D1,0010000181,08,081 +0010000195,D1,0010000195,08,081 +0010005123,D1,0010005123,08,081 +0010022691,D1,0010022691,08,081 +0010022671,D1,0010022671,08,081 +0010022668,D1,0010022668,08,081 +0010022669,D1,0010022669,08,081 +0010022670,D1,0010022670,08,081 +0010022705,D1,0010022705,08,081 +0010022694,D1,0010022694,08,081 +0010022647,D1,0010022647,08,081 +0020251955,D1,0020251955,08,081 +0010022706,D1,0010022706,08,081 +0010022648,D1,0010022648,08,081 +0010022695,D1,0010022695,08,081 +0010000195,D1,0010000195,99,999 +0010005152,D1,0010005152,99,999 +0010005110,D1,0010005110,99,999 +0010005111,D1,0010005111,99,999 +0010005120,D1,0010005120,99,999 +0010022144,D2,0010022144,08,081 +0010035091,D2,0010035091,08,081 +0010035091,D2,0010035091,08,084 +0010005973,E1,0010005973,, +311430,E1,311430,, +304052,E1,304052,, +311555,E1,311555,, +311432,E1,311432,, +304050,E1,304050,, +0010012537,E1,0010012537,01,012 +0010012537,E1,0010012537,04,041 +0010022154,E1,0010022154,04,041 +311430,E1,311430,04,041 +0010006944,E1,0010006944,04,041 +0010022155,E1,0010022155,04,041 +0010022157,E1,0010022157,04,041 +0010006943,E1,0010006943,04,041 +0010006939,E1,0010006939,04,041 +304052,E1,304052,04,041 +311432,E1,311432,04,041 +0010012538,E1,0010012538,04,041 +304053,E1,304053,04,041 +311257,E1,311257,04,041 +0010006945,E1,0010006945,04,041 +0010022156,E1,0010022156,04,041 +0010006946,E1,0010006946,04,041 +311434,E1,311434,04,041 +0010022581,E1,0010022581,04,041 +0010022579,E1,0010022579,04,041 +311483,E1,311483,04,041 +311258,E1,311258,04,041 +311555,E1,311555,04,041 +311559,E1,311559,04,041 +0010022580,E1,0010022580,04,041 +0010022578,E1,0010022578,04,041 +0010022577,E1,0010022577,04,041 +311152,E1,311152,04,041 +0010005972,E1,0010005972,04,041 +311254,E1,311254,04,041 +0010024262,E1,0010024262,04,041 +311253,E1,311253,04,041 +0010024263,E1,0010024263,04,041 +0010024265,E1,0010024265,04,041 +0010024264,E1,0010024264,04,041 +311560,E1,311560,04,041 +304050,E1,304050,04,041 +311556,E1,311556,04,041 +311599,E1,311599,04,041 +311244,E1,311244,04,041 +0010005973,E1,0010005973,04,041 +304039,E1,304039,04,041 +311231,E1,311231,04,041 +311412,E1,311412,04,041 +311481,E1,311481,04,041 +0010002761,E3,0010002761,05,051 +0010002762,E3,0010002762,05,051 +0010002760,E3,0010002760,05,051 +0020019546,E3,0020019546,05,051 +0010003083,E3,0010003083,05,053 +0010021147,E3,0010021147,05,053 +0010016659,E3,0010016659,05,053 +0010003084,E3,0010003084,05,053 +0010016660,E3,0010016660,05,053 +0010019877,E3,0010019877,05,053 +0010016657,E3,0010016657,05,053 +0010006837,E3,0010006837,07,071 +0010004221,E3,0010004221,40,409 +0010026817,E4,0010026817,07,073 +0010026816,E4,0010026816,07,073 +0010026814,E4,0010026814,07,073 +0010026813,E4,0010026813,07,073 +0010026819,E4,0010026819,07,073 +0010026815,E4,0010026815,07,073 +0010026818,E4,0010026818,07,073 +0010047775,E4,0010047775,07,073 +0010047774,E4,0010047774,07,073 +0010021456,E5,0010021456,01,012 +0010015929,E5,0010015929,05,051 +0020197909,E5,0020197909,05,051 +0010020645,E5,0010020645,05,051 +0010020646,E5,0010020646,05,051 +0020170611,E5,0020170611,05,051 +0010020667,E5,0010020667,05,051 +0010015928,E5,0010015928,05,051 +0020214407,E5,0020214407,05,051 +0020170607,E5,0020170607,05,051 +0020170613,E5,0020170613,05,051 +0020170608,E5,0020170608,05,051 +0010015930,E5,0010015930,05,051 +0010020670,E5,0010020670,05,051 +0020170609,E5,0020170609,05,051 +0010015978,E5,0010015978,05,051 +0010020668,E5,0010020668,05,051 +0010020671,E5,0010020671,05,051 +0020080888,E5,0020080888,05,051 +0020170616,E5,0020170616,05,051 +0010025314,E5,0010025314,05,051 +0010003196,E5,0010003196,05,051 +0010015988,E5,0010015988,05,051 +0020170610,E5,0020170610,05,051 +0010021457,E5,0010021457,05,054 +0010021456,E5,0010021456,05,054 +0020080886,E5,0020080886,05,054 +0010034126,E5,0010034126,05,054 +8000015096,E5,8000015096,05,054 +0010017707,E5,0010017707,07,071 +0010017709,E5,0010017709,07,071 +0020145020,E5,0020145020,07,073 +0020053780,F1,0020053780,, +,F1,,, +0020028505,F1,0020028505,, +0020171320,F1,0020171320,, +,F1,,01,011 +,F1,,01,012 +0020053780,F1,0020053780,01,012 +,F1,,02,021 +,F1,,02,022 +,F1,,04,041 +,F1,,05,051 +,F1,,05,053 +,F1,,05,054 +,F1,,06,061 +,F1,,07,071 +,F1,,07,072 +0020117049,F1,0020117049,07,073 +,F1,,07,073 +0020231665,F1,0020231665,07,073 +0020260913,F1,0020260913,07,073 +,F1,,07,076 +,F1,,08,081 +,F1,,08,084 +,F1,,10,102 +0020018265,F1,0020018265,10,103 +0020197223,F1,0020197223,10,103 +,F1,,10,103 +0020124890,F1,0020124890,10,103 +0020184844,F1,0020184844,10,103 +0020139850,F1,0020139850,10,103 +0020184847,F1,0020184847,10,103 +0020242488,F1,0020242488,10,103 +0020108142,F1,0020108142,10,103 +0020171315,F1,0020171315,10,103 +0020116901,F1,0020116901,10,103 +0020231557,F1,0020231557,10,103 +0020231572,F1,0020231572,10,103 +0020260953,F1,0020260953,10,103 +0020118080,F1,0020118080,10,103 +0020231566,F1,0020231566,10,103 +0020171334,F1,0020171334,10,103 +0020260913,F1,0020260913,10,103 +0020218363,F1,0020218363,10,103 +307401,F1,307401,10,103 +0020040072,F1,0020040072,10,103 +0020028510,F1,0020028510,10,103 +0020028505,F1,0020028505,10,103 +0020108149,F1,0020108149,10,103 +0020129327,F1,0020129327,10,103 +0020092428,F1,0020092428,10,103 +0020260943,F1,0020260943,10,103 +0020260962,F1,0020260962,10,103 +0020108128,F1,0020108128,10,103 +0020260929,F1,0020260929,10,103 +0020092436,F1,0020092436,10,103 +0020260965,F1,0020260965,10,103 +0010038663,F1,0010038663,10,103 +0020242486,F1,0020242486,10,103 +0010037342,F1,0010037342,10,103 +0020260925,F1,0020260925,10,103 +0020260940,F1,0020260940,10,103 +0010035734,F1,0010035734,10,103 +0010035733,F1,0010035733,10,103 +0020116903,F1,0020116903,10,103 +0020108135,F1,0020108135,10,103 +0020129324,F1,0020129324,10,103 +0020118081,F1,0020118081,10,103 +0020129326,F1,0020129326,10,103 +0020116902,F1,0020116902,10,103 +,F1,,10,106 +,F1,,10,107 +,F1,,11, +,F1,,11,114 +,F1,,12,121 +,F1,,12,122 +,F1,,40,409 +,F1,,99,999 +0010005352,F2,0010005352,07,072 +0010005354,F2,0010005354,07,072 +0010002617,F2,0010002617,07,072 +0010002616,F2,0010002616,07,072 +0010005353,F2,0010005353,07,072 +0010024750,F3,0010024750,07,075 +0010024751,F3,0010024751,07,075 +0010024724,F3,0010024724,07,075 +0010006856,F6,0010006856,, +0010005835,F6,0010005835,, +0010013173,F6,0010013173,07,071 +0010013172,F6,0010013172,07,071 +0010013174,F6,0010013174,07,071 +0010038512,F6,0010038512,07,071 +0010038513,F6,0010038513,07,071 +0010005835,F6,0010005835,40,409 +0010006856,F6,0010006856,99,999 +0020266791,K1,0020266791,, +0020116885,K1,0020116885,, +0010002680,K1,0010002680,01,012 +0010014312,K1,0010014312,05,051 +0010014311,K1,0010014311,05,051 +0010007267,K1,0010007267,05,051 +0010014313,K1,0010014313,05,051 +0010014314,K1,0010014314,07,071 +0020071488,K1,0020071488,07,071 +0010017717,K1,0010017717,07,071 +0010017714,K1,0010017714,07,071 +0010014315,K1,0010014315,07,071 +0010016722,K1,0010016722,07,073 +0010016721,K1,0010016721,07,073 +0020252922,K1,0020252922,07,073 +0020191788,K1,0020191788,10,102 +0020191817,K1,0020191817,10,102 +0020197117,K1,0020197117,10,103 +0020252922,K1,0020252922,10,103 +0020139895,K1,0020139895,10,103 +0020116885,K1,0020116885,10,103 +0020235465,K1,0020235465,10,103 +0020197116,K1,0020197116,10,103 +0020088485,K1,0020088485,10,107 +0020146367,K1,0020146367,10,107 +336006,K1,336006,12,121 +031600,Q1,031600,01,012 +0010026270,Q1,0010026270,01,012 +0020040079,Q1,0020040079,10,103 +0010006227,V1,0010006227,01,012 +0010002828,XQ,0010002828,01,012 +0010005423,XQ,0010005423,02,022 +0010005425,XQ,0010005425,02,022 +0010002542,XQ,0010002542,02,022 +0010002543,XQ,0010002543,02,022 +0010005424,XQ,0010005424,02,022 +0010002541,XQ,0010002541,02,022 +0010002544,XQ,0010002544,02,022 +0010014402,XX,0010014402,, +0010021773,XX,0010021773,02,022 +0010014402,XX,0010014402,02,022 +0010014403,XX,0010014403,02,022 +0010014405,XX,0010014405,02,022 +,,0010018513,, +,,0010018514,, +,,0010003291,, +,,24KOVLN15,01,011 +,,310130,01,011 +,,1000026029,01,011 +,,300181,01,012 +,,306500,01,012 +,,306501,01,012 +,,300116,01,012 +,,305206,01,012 +,,0010002667,01,012 +,,0010002562,01,012 +,,300101,01,012 +,,0010002565,01,012 +,,0010003665,01,012 +,,085010,01,012 +,,1000026029,01,012 +,,0010014404,02,022 +,,0010003457,04,041 +,,0010003458,04,041 +,,304553,04,041 +,,0010014123,05,051 +,,0010011434,07,071 +,,0010016425,07,073 +,,0020128488,07,073 +,,0010000189,08,081 +,,0020203459,10,103 +,,0020116884,10,103 +,,0020093958,10,103 +,,0020128488,10,103 diff --git a/prepared_steps/4_fill_visitoraddress_on_parentlocation/export.json b/prepared_steps/4_fill_visitoraddress_on_parentlocation/export.json index ba7ea4f..dec725e 100644 --- a/prepared_steps/4_fill_visitoraddress_on_parentlocation/export.json +++ b/prepared_steps/4_fill_visitoraddress_on_parentlocation/export.json @@ -3,10 +3,12 @@ "objects": [ { "query": "SELECT Id, Pkey__c FROM Address WHERE CountryCode = 'NL' AND PKey__c != null", - "operation": "Readonly" + "operation": "Readonly", + "master": false },{ - "query": "SELECT Id, Name, VisitorAdressId FROM Location WHERE VisitorAddressId = null", + "query": "SELECT Id, Name, VisitorAddressId FROM Location WHERE VisitorAddressId = null", "operation": "Update", + "master": true, "beforeUpdateAddons": [ { "module": "core:RecordsTransform", diff --git a/prepared_steps/6_build_lookup_child_to_parent_location/command_dev.txt b/prepared_steps/6_build_lookup_child_to_parent_location/command_dev.txt index 4c22459..0389686 100644 --- a/prepared_steps/6_build_lookup_child_to_parent_location/command_dev.txt +++ b/prepared_steps/6_build_lookup_child_to_parent_location/command_dev.txt @@ -1 +1 @@ -sf sfdmu run --sourceusername csvfile --targetusername rene.kasseboehmer@vaillant.de.devrene \ No newline at end of file +sf sfdmu run --sourceusername rene.kasseboehmer@vaillant.de.devrene --targetusername rene.kasseboehmer@vaillant.de.devrene \ No newline at end of file diff --git a/prepared_steps/7_upsert_assets/export.json b/prepared_steps/7_upsert_assets/export.json index 7855644..60d158c 100644 --- a/prepared_steps/7_upsert_assets/export.json +++ b/prepared_steps/7_upsert_assets/export.json @@ -5,14 +5,17 @@ { "query": "SELECT ExternalReference FROM Location WHERE ExternalReference != null AND ParentLocation.VisitorAddress.CountryCode = 'NL'", "operation": "Readonly", - "externalId": "ExternalReference" + "externalId": "ExternalReference", + "master": false },{ "query": "SELECT Product_Code__c FROM Product2 WHERE Product_Code__c != null", "operation": "Readonly", - "externalId": "Product_Code__c " + "externalId": "Product_Code__c", + "master": false },{ - "query": "SELECT Product2Id,Id,InstallDate,Name,Kind_of_Energy__c,Kind_of_Installation__c,Main_Product_Group__c,SerialNumber,Serialnumber_Exception__c,LocationId FROM Asset", - "operation": "Insert" + "query": "SELECT Product2Id,InstallDate,Name,Kind_of_Energy__c,Main_Product_Group__c,SerialNumber,Serialnumber_Exception__c,LocationId FROM Asset", + "operation": "Insert", + "master": true } ] } \ No newline at end of file diff --git a/run.bat b/run.bat new file mode 100644 index 0000000..9a62441 --- /dev/null +++ b/run.bat @@ -0,0 +1,28 @@ +@echo off +setlocal enabledelayedexpansion + +:: Change directory to where prepared_steps is located +cd ..\..\prepared_steps + +:: Loop through all folders in prepared_steps +for /d %%f in (*.*) do ( + set "current_dir=%%f" + + :: Check if command.txt exists in the current folder + if exist "%current_dir%\command.txt" ( + echo Running command from %current_dir% + + :: Read the command from command.txt and execute it + for /f %%c in ('type "%current_dir%\command.txt"') do ( + start "" "%%c" + ) + + :: Pause after each command to see results + pause + ) else ( + echo No command.txt found in %current_dir% + ) +) + +:: Exit the script +goto :EOF \ No newline at end of file