mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2024-11-06 02:56:32 +01:00
47 lines
1.6 KiB
C#
47 lines
1.6 KiB
C#
|
using System;
|
||
|
using System.Runtime.Serialization;
|
||
|
using Newtonsoft.Json;
|
||
|
|
||
|
namespace ShareeBike.Repository.Response
|
||
|
{
|
||
|
[DataContract]
|
||
|
[JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)]
|
||
|
public class BikeInfoReservedOrBooked : BikeInfoBase, IEquatable<BikeInfoReservedOrBooked>
|
||
|
{
|
||
|
/// <summary>
|
||
|
/// Date from when bike was reserved from/ booked from.
|
||
|
/// Format: 2017-11-28 11:01:51.637747+01
|
||
|
/// </summary>
|
||
|
[DataMember]
|
||
|
public string start_time { get; private set; }
|
||
|
|
||
|
/// <summary> Booking code if bike is BC-bike.</summary>
|
||
|
[DataMember]
|
||
|
public string timeCode { get; private set; }
|
||
|
|
||
|
[DataMember]
|
||
|
/// <summary> Seed used to generate key for connecting to bluetooth lock.</summary>
|
||
|
public string K_seed { get; private set; }
|
||
|
|
||
|
[DataMember]
|
||
|
/// <summary> Key for connect to bluetooth lock as user.</summary>
|
||
|
public string K_u { get; private set; }
|
||
|
|
||
|
[DataMember]
|
||
|
/// <summary> Key for connect to bluetooth lock as admin.</summary>
|
||
|
public string K_a { get; private set; }
|
||
|
|
||
|
public static bool operator ==(BikeInfoReservedOrBooked first, BikeInfoReservedOrBooked second)
|
||
|
=> JsonConvert.SerializeObject(first) == JsonConvert.SerializeObject(second);
|
||
|
|
||
|
public static bool operator !=(BikeInfoReservedOrBooked first, BikeInfoReservedOrBooked second)
|
||
|
=> !(first == second);
|
||
|
|
||
|
public override bool Equals(object obj) => obj is BikeInfoReservedOrBooked target && target == this;
|
||
|
|
||
|
public override int GetHashCode() => JsonConvert.SerializeObject(this).GetHashCode();
|
||
|
|
||
|
public bool Equals(BikeInfoReservedOrBooked other) => other == this;
|
||
|
}
|
||
|
}
|