Skip to content

Commit bb8ce1c

Browse files
committed
modify vechiles and some names
1 parent b7fec22 commit bb8ce1c

File tree

11 files changed

+27
-15
lines changed

11 files changed

+27
-15
lines changed

Pepsi.API/Data/Vehicles.json

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,37 @@
11
[
22
{
33
"Type": "truck",
4-
"Capacity": 15000.00,
4+
"Capacity": 7000.00,
5+
"UsedCapacity": 1000.00,
6+
"NotUsedCapacity": 6000.00,
57
"IsAvailable": true
68
},
79
{
810
"Type": "van",
911
"Capacity": 5000.00,
12+
"UsedCapacity": 5000.00,
13+
"NotUsedCapacity": 0.00,
1014
"IsAvailable": false
1115
},
1216
{
1317
"Type": "truck",
14-
"Capacity": 30000.00,
18+
"Capacity": 7000.00,
19+
"UsedCapacity": 1000.00,
20+
"NotUsedCapacity": 6000.00,
1521
"IsAvailable": true
1622
},
1723
{
1824
"Type": "van",
19-
"Capacity": 2000.00,
25+
"Capacity": 5000.00,
26+
"UsedCapacity": 1000.00,
27+
"NotUsedCapacity": 4000.00,
2028
"IsAvailable": true
2129
},
2230
{
2331
"Type": "van",
24-
"Capacity": 12000.00,
32+
"Capacity": 7000.00,
33+
"UsedCapacity": 7000.00,
34+
"NotUsedCapacity": 0.00,
2535
"IsAvailable": false
2636
}
2737
]

Pepsi.Core/DTOs/OrderDto.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ public class OrderDto : BaseDto
1010
public VehicleDto? Vehicle { get; set; }
1111
public IEnumerable<OrderItemDto> Items { get; set; } = new List<OrderItemDto>();
1212
public decimal TotalVolume { get; init; }
13+
public decimal TotalPrice { get; init; }
1314
public DateTime OrderDate { get; init; }
1415
public DateTime DeliveryDate { get; init; }
1516
public OrderStatus Status { get; init; }

Pepsi.Core/DTOs/OrderItemDto.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,4 @@ public class OrderItemDto : BaseDto
66
public int ProductId { get; init; }
77
public ProductDto? Product { get; init; }
88
public int Quantity { get; init; }
9-
public decimal UnitPrice { get; init; }
109
}

Pepsi.Core/DTOs/ProductDto.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ public class ProductDto : BaseDto
44
{
55
public string Name { get; init; } = string.Empty;
66
public decimal Price { get; init; }
7-
public decimal Weight { get; init; }
7+
public decimal Volume { get; init; }
88
}

Pepsi.Core/DTOs/VehicleDto.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ public class VehicleDto : BaseDto
66
public decimal Capacity { get; init; }
77
public decimal UsedCapacity { get; set; }
88
public decimal NotUsedCapacity { get; set; }
9-
public bool IsAvailable { get; init; }
9+
public bool IsAvailable { get; set; }
1010
}

Pepsi.Core/Entities/Order.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ public class Order : BaseEntity
88
public Vehicle? Vehicle { get; init; }
99
public IEnumerable<OrderItem> Items { get; init; } = new List<OrderItem>();
1010
public decimal TotalVolume { get; init; }
11+
public decimal TotalPrice { get; init; }
1112
public DateTime OrderDate { get; init; }
1213
public DateTime DeliveryDate { get; init; }
1314
public OrderStatus Status { get; set; }

Pepsi.Core/Entities/OrderItem.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,4 @@ public class OrderItem : BaseEntity
77
public int ProductId { get; init; }
88
public Product? Product { get; init; }
99
public int Quantity { get; init; }
10-
public decimal UnitPrice { get; init; }
1110
}

Pepsi.Core/Entities/Product.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ public class Product : BaseEntity
44
{
55
public string Name { get; init; } = string.Empty;
66
public decimal Price { get; init; }
7-
public decimal Weight { get; init; }
7+
public decimal Volume { get; init; }
88
public ProductStock? Stock { get; set; }
99
}

Pepsi.Core/Mappers/OrderItemMapper.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ public OrderItemDto MapToDto(OrderItem entity)
1818
ProductId = entity.ProductId,
1919
Product = entity.Product != null ? productMapper.MapToDto(entity.Product) : null,
2020
Quantity = entity.Quantity,
21-
UnitPrice = entity.UnitPrice
2221
};
2322
}
2423

@@ -31,7 +30,6 @@ public OrderItem MapToEntity(OrderItemDto dto)
3130
OrderId = dto.OrderId,
3231
ProductId = dto.ProductId,
3332
Quantity = dto.Quantity,
34-
UnitPrice = dto.UnitPrice
3533
};
3634
}
3735

Pepsi.Core/Mappers/ProductMapper.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public ProductDto MapToDto(Product entity)
1515
Id = entity.Id,
1616
Name = entity.Name,
1717
Price = entity.Price,
18-
Weight = entity.Weight
18+
Volume = entity.Volume
1919
};
2020
}
2121

@@ -27,7 +27,7 @@ public Product MapToEntity(ProductDto dto)
2727
Id = dto.Id,
2828
Name = dto.Name,
2929
Price = dto.Price,
30-
Weight = dto.Weight
30+
Volume = dto.Volume
3131
};
3232
}
3333

0 commit comments

Comments
 (0)