| 
						
						
						
					 | 
					 | 
					@ -1,16 +1,14 @@ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					/* © SRSoftware 2025 */ | 
					 | 
					 | 
					 | 
					/* © SRSoftware 2025 */ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					package de.srsoftware.umbrella.core.model; | 
					 | 
					 | 
					 | 
					package de.srsoftware.umbrella.core.model; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					import static de.srsoftware.tools.Optionals.emptyIfNull; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import static de.srsoftware.umbrella.core.Constants.*; | 
					 | 
					 | 
					 | 
					import static de.srsoftware.umbrella.core.Constants.*; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import static de.srsoftware.umbrella.core.Field.*; | 
					 | 
					 | 
					 | 
					import static de.srsoftware.umbrella.core.Field.*; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import static de.srsoftware.umbrella.core.exceptions.UmbrellaException.missingFieldException; | 
					 | 
					 | 
					 | 
					import static de.srsoftware.umbrella.core.exceptions.UmbrellaException.missingFieldException; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import de.srsoftware.tools.Mappable; | 
					 | 
					 | 
					 | 
					import de.srsoftware.tools.Mappable; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import de.srsoftware.umbrella.core.exceptions.UmbrellaException; | 
					 | 
					 | 
					 | 
					import de.srsoftware.umbrella.core.exceptions.UmbrellaException; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import java.util.HashSet; | 
					 | 
					 | 
					 | 
					import java.util.*; | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import java.util.Map; | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import java.util.Objects; | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import java.util.Set; | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import org.json.JSONObject; | 
					 | 
					 | 
					 | 
					import org.json.JSONObject; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					public final class Customer implements Mappable { | 
					 | 
					 | 
					 | 
					public final class Customer implements Mappable { | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -73,7 +71,7 @@ public final class Customer implements Mappable { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							if (!json.has(ID) || !(json.get(ID) instanceof String id)) throw missingFieldException(ID); | 
					 | 
					 | 
					 | 
							if (!json.has(ID) || !(json.get(ID) instanceof String id)) throw missingFieldException(ID); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							if (!json.has(NAME) || !(json.get(NAME) instanceof String name)) throw missingFieldException(NAME); | 
					 | 
					 | 
					 | 
							if (!json.has(NAME) || !(json.get(NAME) instanceof String name)) throw missingFieldException(NAME); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							if (!json.has(EMAIL) || !(json.get(EMAIL) instanceof String email)) throw missingFieldException(EMAIL); | 
					 | 
					 | 
					 | 
							if (!json.has(EMAIL) || !(json.get(EMAIL) instanceof String email)) throw missingFieldException(EMAIL); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							if (!json.has(TAX_ID) || !(json.get(TAX_ID) instanceof String taxId)) throw missingFieldException(TAX_ID); | 
					 | 
					 | 
					 | 
							var taxId = json.has(TAX_ID) && json.get(TAX_ID) instanceof String tid ? tid : null; | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							var lang = json.has(LANGUAGE) && json.get(LANGUAGE) instanceof String l ? l : FALLBACK_LANG; | 
					 | 
					 | 
					 | 
							var lang = json.has(LANGUAGE) && json.get(LANGUAGE) instanceof String l ? l : FALLBACK_LANG; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							return new Customer(id,name,email,taxId,lang); | 
					 | 
					 | 
					 | 
							return new Customer(id,name,email,taxId,lang); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						} | 
					 | 
					 | 
					 | 
						} | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -104,11 +102,11 @@ public final class Customer implements Mappable { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						@Override | 
					 | 
					 | 
					 | 
						@Override | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						public Map<String, Object> toMap() { | 
					 | 
					 | 
					 | 
						public Map<String, Object> toMap() { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							return Map.of( | 
					 | 
					 | 
					 | 
							var map = new HashMap<String,Object>(); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									"id", id, | 
					 | 
					 | 
					 | 
							map.put("id", id); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									"name", name, | 
					 | 
					 | 
					 | 
							map.put("name", name); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									"email", email, | 
					 | 
					 | 
					 | 
							map.put("email", email); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									"tax_id", taxNumber | 
					 | 
					 | 
					 | 
							map.put("tax_id", emptyIfNull(taxNumber)); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							); | 
					 | 
					 | 
					 | 
							return map; | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						} | 
					 | 
					 | 
					 | 
						} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					} | 
					 | 
					 | 
					 | 
					} | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
					 | 
					 | 
					
  |