@@ -5,35 +5,21 @@ namespace CargoHub.Models
5
5
{
6
6
public class Warehouse : BaseModel , IContainsClassification
7
7
{
8
- [ JsonPropertyName ( "code" ) ]
9
-
10
- public string ? Code { get ; set ; }
11
- [ JsonPropertyName ( "name" ) ]
12
-
13
- public string ? Name { get ; set ; }
14
- [ JsonPropertyName ( "address" ) ]
15
-
16
- public string ? Address { get ; set ; }
17
- [ JsonPropertyName ( "zip" ) ]
18
-
19
- public string ? Zip { get ; set ; }
20
- [ JsonPropertyName ( "city" ) ]
21
-
22
- public string ? City { get ; set ; }
23
- [ JsonPropertyName ( "province" ) ]
24
-
25
- public string ? Province { get ; set ; }
26
- [ JsonPropertyName ( "country" ) ]
27
-
28
- public string ? Country { get ; set ; }
8
+ public required string Code { get ; set ; }
9
+ public required string Name { get ; set ; }
10
+ public required string Address { get ; set ; }
11
+ public required string Zip { get ; set ; }
12
+ public required string City { get ; set ; }
13
+ public required string Province { get ; set ; }
14
+ public required string Country { get ; set ; }
29
15
[ JsonIgnore ]
30
- public string ? ContactName { get ; set ; }
16
+ public string ContactName { get ; set ; } = string . Empty ;
31
17
32
18
[ JsonIgnore ]
33
- public string ? ContactPhone { get ; set ; }
19
+ public string ContactPhone { get ; set ; } = string . Empty ;
34
20
35
21
[ JsonIgnore ]
36
- public string ? ContactEmail { get ; set ; }
22
+ public string ContactEmail { get ; set ; } = string . Empty ;
37
23
38
24
[ NotMapped ]
39
25
// Contact dictionary for JSON serialization/deserialization
@@ -58,14 +44,9 @@ public class Warehouse : BaseModel, IContainsClassification
58
44
}
59
45
}
60
46
61
-
47
+ [ JsonIgnore ]
48
+ public ICollection < Location > Locations { get ; } = [ ] ;
62
49
[ JsonIgnore ]
63
50
public List < Classification > Classifications { get ; set ; } = [ ] ;
64
- // Metadata
65
- [ JsonPropertyName ( "created_at" ) ]
66
- public DateTime CreatedAt { get ; set ; }
67
-
68
- // [JsonPropertyName("updated_at")]
69
- // public DateTime UpdatedAt { get; set; }
70
51
}
71
52
}
0 commit comments