Version 3.0.239

This commit is contained in:
Oliver Hauff 2021-07-12 19:30:14 +02:00
parent 2a2d814243
commit 553eaaa4e0
15 changed files with 773 additions and 180 deletions

View file

@ -149,6 +149,9 @@ namespace TINK.Repository
}
} ";
/// <summary>
/// Holds three rented bc- bikes.
/// </summary>
const string BIKES_OCCUPIED_REQUEST_SET01_001_FILE = @"
{
""shareejson"" : {
@ -186,6 +189,9 @@ namespace TINK.Repository
}
}";
/// <summary>
/// Two rented bc bikes.
/// </summary>
const string BIKES_OCCUPIED_REQUEST_SET02_001_FILE = @"
{
""shareejson"": {
@ -217,6 +223,9 @@ namespace TINK.Repository
}
}";
/// <summary>
/// One reserved and two rented bikes.
/// </summary>
const string BIKES_OCCUPIED_REQUEST_SET02_002_FILE = @"
{
""shareejson"": {
@ -257,6 +266,9 @@ namespace TINK.Repository
}
}";
/// <summary>
/// Three rented bikes.
/// </summary>
const string BIKES_OCCUPIED_REQUEST_SET02_003_FILE = @"
{
""shareejson"": {
@ -297,6 +309,9 @@ namespace TINK.Repository
}
}";
/// <summary>
/// Two rented bikes.
/// </summary>
const string BIKES_OCCUPIED_REQUEST_SHAREEFR01_SET1_FILE = @"
{
""shareejson"": {
@ -375,7 +390,127 @@ namespace TINK.Repository
""copri_version"" : ""4.1.0.0""
}
}";
/// <summary>
/// One reserved and two rented bikes.
/// </summary>
/// <remarks>
/// Response from BIKES_OCCUPIED_REQUEST_SHAREEFR01_SET2_FILE taken (does not yet contain uri_operator) and reserved bike added.
/// </remarks>
const string BIKES_OCCUPIED_REQUEST_SHAREEFR01_SET2_FILE = @"
{
""shareejson"": {
""privacy_html"": ""site/privacy.html"",
""response"": ""user_bikes_occupied"",
""apiserver"": ""https://shareeapp-fr01.copri.eu"",
""authcookie"": ""5781_d47fc786e740ef77d85a24bcb6f0ff97_oiF2kahH"",
""impress_html"": ""site/impress.html"",
""tariff_info_html"": ""site/tariff_info.html"",
""bikes_occupied"": {
""155776"": {
""K_a"": ""[-83, 104, 55, -74, 16, -105, 124, -103, -68, -17, -127, -113, 56, 43, -61, -86, 124, -54, 63, 57, 0, 0, 0, 0]"",
""real_hours"": ""49.3"",
""bike"": ""1545"",
""tariff_description"": {
""eur_per_hour"" : ""2.50"",
""number"" : ""5494"",
""name"" : ""Tester Basic"",
""max_eur_per_day"" : ""10.00""
},
""lock_state"": ""unlocked"",
""total_price"": ""23.75"",
""station"" : ""103"",
""gps"" : { ""latitude"": ""47.9980383301154"", ""longitude"": ""7.78496129438281"" },
""system"": ""Ilockit"",
""end_time"": ""2020-11-08 19:11:27"",
""bike_group"" : [ ""300029"" ],
""Ilockit_ID"": ""ISHAREIT-2200545"",
""start_time"": ""2020-11-06 17:53:22.784681+01"",
""unit_price"": ""2.50"",
""request_time"": ""2020-11-06 17:52:56.832138+01"",
""state"": ""occupied"",
""Ilockit_GUID"": ""00000000-0000-0000-0000-e38bf9d32234"",
""computed_hours"": ""9.50"",
""K_u"": ""[53, 92, -55, -109, 112, 38, -35, 43, -18, 122, 115, 50, -85, -57, 62, -57, -112, 2, 117, -47, 0, 0, 0, 0]"",
""description"": ""Tester-bike (Ilockit)"",
""K_seed"": ""[119, -47, -91, -36, -29, -17, 35, 47, -80, -112, -55, 2, 70, -45, 60, -62]""
},
""155744"": {
""Ilockit_GUID"": ""00000000-0000-0000-0000-d589a8023487"",
""unit_price"": ""2.50"",
""start_time"": ""2020-10-12 08:38:30.401679+02"",
""request_time"": ""2020-10-12 08:38:12.374231+02"",
""state"": ""occupied"",
""K_u"": ""[93, -45, -89, -38, 50, 107, 21, -119, -26, -90, -15, 99, 17, 44, -20, 24, 34, -111, 125, -31, 0, 0, 0, 0]"",
""computed_hours"": ""112"",
""K_seed"": ""[24, 69, -21, 52, 55, 3, -71, 30, -71, 43, 108, -100, 15, 126, -117, 40]"",
""description"": ""Oliver (Ilockit)"",
""tariff_description"": {
""eur_per_hour"" : ""2.50"",
""number"" : ""5494"",
""name"" : ""Tester Basic"",
""max_eur_per_day"" : ""10.00""
},
""bike"": ""1537"",
""uri_operator"" : ""https://shareeapp-fr01.copri.eu"",
""real_hours"": ""659.55"",
""lock_state"": ""locked"",
""K_a"": ""[109, 35, -55, 78, -65, 87, -43, -4, -90, -104, -16, -45, -80, -80, 106, -25, -77, 111, -79, 58, 0, 0, 0, 0]"",
""system"": ""Ilockit"",
""gps"" : { ""latitude"": ""47.9977741744369"", ""longitude"": ""7.78484562411904"" },
""station"" : ""103"",
""total_price"": ""280.00"",
""Ilockit_ID"": ""ISHAREIT-2200537"",
""bike_group"" : [ ""300029"" ],
""end_time"": ""2020-11-08 19:11:25""
},
""156350"" : {
""total_price"" : ""0.00"",
""description"" : ""Tester-bike Oliver 2"",
""K_u"" : ""[-72, 88, 96, -80, -2, 82, 36, -67, 48, 101, -55, 127, -85, 95, -83, -77, 14, -103, -14, -47, 0, 0, 0, 0]"",
""real_hours"" : ""0"",
""state"" : ""requested"",
""tariff_description"" : {
""eur_per_hour"" : ""3.00"",
""max_eur_per_day"" : ""10.00"",
""number"" : ""5494"",
""name"" : ""Tester Basic""
},
""station"" : ""FR_103"",
""Ilockit_ID"" : ""ISHAREIT-2302373"",
""K_seed"" : ""[-93, -36, 49, -84, 65, 107, 74, 125, -91, -59, 43, 45, 85, -126, 91, -27]"",
""K_a"" : ""[-76, 86, 39, -62, 89, 76, 23, -37, 108, -4, 4, -36, -48, 26, -110, -75, 96, -101, -26, -51, 0, 0, 0, 0]"",
""end_time"" : ""2021-07-04 17:46:00+02"",
""system"" : ""Ilockit"",
""computed_hours"" : ""0"",
""bike"" : ""FR_1004"",
""uri_operator"" : ""https://shareeapp-fr01.copri.eu"",
""start_time"" : ""2021-07-04 17:46:36.237404+02"",
""bike_group"" : [
""FR_300029""
],
""gps"" : {
""latitude"" : ""47.9978876"",
""longitude"" : ""7.7849563""
},
""unit_price"" : ""3.00"",
""lock_state"" : ""locked"",
""Ilockit_GUID"" : ""00000000-0000-0000-0000-fe3962c08bcc"",
""request_time"" : ""2021-07-04 17:46:36.237404+02""
}
},
""bike_info_html"": ""site/bike_info.html"",
""agb_html"": ""site/agb.html"",
""agb_checked"": ""1"",
""user_id"": ""ohauff@posteo.de"",
""response_state"": ""OK: nothing todo "",
""lang"": ""DE"",
""user_group"": [ ""300029"", ""300001"" ],
""debuglevel"": ""1"",
""copri_version"" : ""4.1.0.0""
}
}";
const string BIKES_AVAILABLE_SET01_001_FILE = @"
{
""shareejson"" : {
@ -734,6 +869,9 @@ namespace TINK.Repository
}
}";
/// <summary>
/// Five available bikes.
/// </summary>
const string BIKES_AVAILABLE_REQUEST_SHAREEFR01_SET1_FILE = @"
{
""shareejson"": {
@ -1222,12 +1360,12 @@ namespace TINK.Repository
/// <summary>
/// Gets a list of bikes reserved/ booked by acctive user from Copri.
/// </summary>
/// <param name="p_strSessionCookie">Cookie to authenticate user.</param>
/// <param name="sessionCookie">Cookie to authenticate user.</param>
/// <param name="SampleSet">Sample set to use.</param>
/// <param name="p_lStageIndex">Index of the stage.</param>
/// <returns>Response holding list of bikes.</returns>
public static BikesReservedOccupiedResponse GetBikesOccupied(
string p_strSessionCookie = null,
string sessionCookie = null,
SampleSets sampleSet = DEFAULT_SAMPLE_SET,
long stageIndex = DEFAULT_STAGE_INDEX)
{
@ -1275,6 +1413,9 @@ namespace TINK.Repository
response = CopriCallsStatic.DeserializeResponse<BikesReservedOccupiedResponse>(BIKES_OCCUPIED_REQUEST_SHAREEFR01_SET1_FILE);
break;
case 2:
response = CopriCallsStatic.DeserializeResponse<BikesReservedOccupiedResponse>(BIKES_OCCUPIED_REQUEST_SHAREEFR01_SET2_FILE);
break;
default:
return null;
@ -1288,9 +1429,9 @@ namespace TINK.Repository
return null;
}
return p_strSessionCookie == null || response?.authcookie == p_strSessionCookie
return sessionCookie == null || response?.authcookie == sessionCookie
? response
: ResponseHelper.GetBikesOccupiedNone(p_strSessionCookie);
: ResponseHelper.GetBikesOccupiedNone(sessionCookie);
}