| | | 1 | | using Snacks.Domain.Abstractions; |
| | | 2 | | |
| | | 3 | | namespace Snacks.Domain.Models; |
| | | 4 | | |
| | | 5 | | public class DeliveryCondition : IDeliveryCondition |
| | | 6 | | { |
| | 104 | 7 | | public int Id { get; set; } = 0; |
| | 92 | 8 | | public decimal DistanceLimit { get; set; } = 0; |
| | 86 | 9 | | public decimal MinOrderPrice { get; set; } = 0; |
| | 86 | 10 | | public decimal MaxOrderPrice { get; set; } = 0; |
| | 88 | 11 | | public decimal DeliveryCosts { get; set; } = 0; |
| | 90 | 12 | | public int RestaurantId { get; set; } = 0; |
| | | 13 | | |
| | 108 | 14 | | public DeliveryCondition() { } |
| | 4 | 15 | | public DeliveryCondition(int id, decimal distanceLimit, decimal minOrderPrice, decimal maxOrderPrice, decimal delive |
| | 4 | 16 | | { |
| | 4 | 17 | | Id = id; |
| | 4 | 18 | | DistanceLimit = distanceLimit; |
| | 4 | 19 | | MinOrderPrice = minOrderPrice; |
| | 4 | 20 | | MaxOrderPrice = maxOrderPrice; |
| | 4 | 21 | | DeliveryCosts = deliveryCosts; |
| | 4 | 22 | | RestaurantId = restaurantId; |
| | 4 | 23 | | } |
| | | 24 | | public override string ToString() |
| | 2 | 25 | | { |
| | 2 | 26 | | return $"DeliveryCondition(id:{Id}, DistanceLimit:{DistanceLimit}, MinOrderPrice:{MinOrderPrice}, MaxOrderPrice: |
| | 2 | 27 | | } |
| | | 28 | | public int CompareTo(IDeliveryCondition? other) |
| | 0 | 29 | | { |
| | 0 | 30 | | if (other == null) return 1; |
| | 0 | 31 | | return this.Id.CompareTo(other.Id); |
| | 0 | 32 | | } |
| | | 33 | | |
| | | 34 | | } |