| | | 1 | | using Snacks.Domain.Abstractions; |
| | | 2 | | |
| | | 3 | | namespace Snacks.Domain.Models; |
| | | 4 | | |
| | | 5 | | public class Restaurant : IRestaurant |
| | | 6 | | { |
| | 118 | 7 | | public int Id { get; set; } = 0; |
| | 102 | 8 | | public string? Name { get; set; } = null; |
| | 96 | 9 | | public decimal MaxDistance { get; set; } = 0; |
| | 88 | 10 | | public byte[] Picture { get; set; } = null!; |
| | 94 | 11 | | public string? Webhook { get; set; } = null; |
| | 94 | 12 | | public int AddressId { get; set; } = 0; |
| | | 13 | | |
| | 114 | 14 | | public Restaurant() { } |
| | 6 | 15 | | public Restaurant(int id, string? name, decimal maxDistance, byte[] picture, string? webhook, int addressId) |
| | 6 | 16 | | { |
| | 6 | 17 | | Id = id; |
| | 6 | 18 | | Name = name; |
| | 6 | 19 | | MaxDistance = maxDistance; |
| | 6 | 20 | | Picture = picture; |
| | 6 | 21 | | Webhook = webhook; |
| | 6 | 22 | | AddressId = addressId; |
| | 6 | 23 | | } |
| | | 24 | | public override string ToString() |
| | 2 | 25 | | { |
| | 2 | 26 | | return $"Restaurant(id:{Id}, Name:{Name}, MaxDistance:{MaxDistance}, Webhook:{Webhook}, AdressId: {AddressId} )" |
| | 2 | 27 | | } |
| | | 28 | | |
| | | 29 | | public int CompareTo(IRestaurant? other) |
| | 0 | 30 | | { |
| | 0 | 31 | | if (other == null) return 1; |
| | 0 | 32 | | return this.Id.CompareTo(other.Id); |
| | 0 | 33 | | } |
| | | 34 | | |
| | | 35 | | } |