mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2025-06-21 21:46:27 +02:00
3.0.257 merged
This commit is contained in:
parent
de8d5f8414
commit
b6fb6394db
155 changed files with 805 additions and 5751 deletions
|
@ -122,13 +122,13 @@ namespace TINK.Model.Connector
|
|||
Log.ForContext<Command>().Error("Unexpected booking request detected. No user logged in.");
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
public async Task<BookingFinishedModel> DoReturn(
|
||||
public async Task<MiniSurveyModel> DoReturn(
|
||||
Bikes.Bike.BluetoothLock.IBikeInfoMutable bike,
|
||||
LocationDto location,
|
||||
ISmartDevice smartDevice)
|
||||
{
|
||||
Log.ForContext<Command>().Error("Unexpected returning request detected. No user logged in.");
|
||||
return await Task.FromResult(new BookingFinishedModel());
|
||||
return await Task.FromResult(new MiniSurveyModel());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -248,7 +248,7 @@ namespace TINK.Model.Connector
|
|||
/// <param name="bike">Bike to return.</param>
|
||||
/// <param name="locaton">Position of the bike.</param>
|
||||
/// <param name="smartDevice">Provides info about hard and software.</param>
|
||||
public async Task<BookingFinishedModel> DoReturn(
|
||||
public async Task<MiniSurveyModel> DoReturn(
|
||||
Bikes.Bike.BluetoothLock.IBikeInfoMutable bike,
|
||||
LocationDto location,
|
||||
ISmartDevice smartDevice)
|
||||
|
@ -258,7 +258,7 @@ namespace TINK.Model.Connector
|
|||
throw new ArgumentNullException("Can not return bike. No bike object available.");
|
||||
}
|
||||
|
||||
DoReturnResponse response;
|
||||
ReservationCancelReturnResponse response;
|
||||
try
|
||||
{
|
||||
response = (await CopriServer.DoReturn(bike.Id, location, smartDevice, bike.OperatorUri)).GetIsReturnBikeResponseOk(bike.Id);
|
||||
|
@ -270,7 +270,7 @@ namespace TINK.Model.Connector
|
|||
}
|
||||
|
||||
bike.Load(Bikes.Bike.BC.NotifyPropertyChangedLevel.None);
|
||||
return response?.Create() ?? new BookingFinishedModel();
|
||||
return response?.Create() ?? new MiniSurveyModel();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -50,7 +50,7 @@ namespace TINK.Model.Connector
|
|||
/// <param name="bike">Bike to return.</param>
|
||||
/// <param name="location">Geolocation of lock when returning bike.</param>
|
||||
/// <param name="smartDevice">Provides info about hard and software.</param>
|
||||
Task<BookingFinishedModel> DoReturn(Bikes.Bike.BluetoothLock.IBikeInfoMutable bike, LocationDto geolocation = null, ISmartDevice smartDevice = null);
|
||||
Task<MiniSurveyModel> DoReturn(Bikes.Bike.BluetoothLock.IBikeInfoMutable bike, LocationDto geolocation = null, ISmartDevice smartDevice = null);
|
||||
|
||||
/// <summary> True if connector has access to copri server, false if cached values are used. </summary>
|
||||
bool IsConnected { get; }
|
||||
|
|
|
@ -512,28 +512,22 @@ namespace TINK.Model.Connector
|
|||
};
|
||||
}
|
||||
|
||||
/// <summary> Creates a booking finished object from response.</summary>
|
||||
/// <summary> Creates a survey object from response.</summary>
|
||||
/// <param name="response">Response to create survey object from.</param>
|
||||
public static BookingFinishedModel Create(this DoReturnResponse response)
|
||||
public static MiniSurveyModel Create(this ReservationCancelReturnResponse response)
|
||||
{
|
||||
var bookingFinished = new BookingFinishedModel
|
||||
{
|
||||
Co2Saving = response?.co2saving
|
||||
};
|
||||
|
||||
if (response?.user_miniquery == null)
|
||||
|
||||
{
|
||||
return bookingFinished;
|
||||
return new MiniSurveyModel();
|
||||
}
|
||||
|
||||
var miniquery = response.user_miniquery;
|
||||
bookingFinished.MiniSurvey = new MiniSurveyModel
|
||||
{
|
||||
Title = miniquery.title,
|
||||
Subtitle = miniquery.subtitle,
|
||||
Footer = miniquery.footer
|
||||
};
|
||||
var survey = new MiniSurveyModel
|
||||
{
|
||||
Title = miniquery.title,
|
||||
Subtitle = miniquery.subtitle,
|
||||
Footer = miniquery.footer
|
||||
};
|
||||
|
||||
foreach (var question in miniquery?.questions?.OrderBy(x => x.Key) ?? new Dictionary<string, MiniSurveyResponse.Question>().OrderBy(x => x.Key))
|
||||
{
|
||||
|
@ -544,12 +538,12 @@ namespace TINK.Model.Connector
|
|||
continue;
|
||||
}
|
||||
|
||||
bookingFinished.MiniSurvey.Questions.Add(
|
||||
survey.Questions.Add(
|
||||
question.Key,
|
||||
new MiniSurveyModel.QuestionModel());
|
||||
}
|
||||
|
||||
return bookingFinished;
|
||||
return survey;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,9 +3,6 @@
|
|||
namespace TINK.Model.MiniSurvey
|
||||
|
||||
{
|
||||
/// <summary>
|
||||
/// Holds mini survey.
|
||||
/// </summary>
|
||||
public class MiniSurveyModel
|
||||
{
|
||||
public enum Type
|
||||
|
@ -15,17 +12,21 @@ namespace TINK.Model.MiniSurvey
|
|||
}
|
||||
public class QuestionModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Holds the query description.
|
||||
/// </summary>
|
||||
public QuestionModel()
|
||||
{
|
||||
PossibleAnswers = new Dictionary<string, string>();
|
||||
}
|
||||
|
||||
public string Text { get; set; }
|
||||
|
||||
public Type Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Holds the collection of possible answers.
|
||||
/// </summary>
|
||||
public Dictionary<string, string> PossibleAnswers { get; private set; } = new Dictionary<string, string>();
|
||||
public Dictionary<string, string> PossibleAnswers { get; private set; }
|
||||
}
|
||||
|
||||
public MiniSurveyModel()
|
||||
{
|
||||
Questions = new Dictionary<string, QuestionModel>();
|
||||
}
|
||||
|
||||
public string Title { get; set; }
|
||||
|
@ -34,6 +35,6 @@ namespace TINK.Model.MiniSurvey
|
|||
|
||||
public string Footer { get; set; }
|
||||
|
||||
public Dictionary<string, QuestionModel> Questions { get; } = new Dictionary<string, QuestionModel>();
|
||||
public Dictionary<string, QuestionModel> Questions { get; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -215,8 +215,16 @@ namespace TINK.Model
|
|||
GeolocationServices = geolocationServicesContainer
|
||||
?? throw new ArgumentException($"Can not instantiate {nameof(TinkApp)}- object. No geolocation services container object available.");
|
||||
|
||||
FilterGroupSetting = settings.GroupFilterSettings;
|
||||
GroupFilterMapPage = settings.GroupFilterMapPage;
|
||||
if (settings.ActiveUri == new Uri(CopriServerUriList.TINK_LIVE) ||
|
||||
settings.ActiveUri == new Uri(CopriServerUriList.TINK_DEVEL))
|
||||
{
|
||||
FilterGroupSetting = settings.GroupFilterSettings;
|
||||
GroupFilterMapPage = settings.GroupFilterMapPage;
|
||||
} else
|
||||
{
|
||||
FilterGroupSetting = new GroupFilterSettings();
|
||||
GroupFilterMapPage = new GroupFilterMapPage();
|
||||
}
|
||||
|
||||
CenterMapToCurrentLocation = settings.CenterMapToCurrentLocation;
|
||||
|
||||
|
|
|
@ -455,21 +455,9 @@ namespace TINK.Model
|
|||
AppResources.ChangeLog3_0_250 // Third-party components updated.
|
||||
},
|
||||
{
|
||||
new Version(3, 0, 260),
|
||||
new Version(3, 0, 257),
|
||||
// Same info as for version 3.0.251 and 3.0.252
|
||||
AppResources.ChangeLog3_0_231 // Minor improvements.
|
||||
},
|
||||
{
|
||||
new Version(3, 0, 263),
|
||||
AppResources.ChangeLog3_0_263
|
||||
},
|
||||
{
|
||||
new Version(3, 0, 264),
|
||||
AppResources.ChangeLog3_0_264
|
||||
},
|
||||
{
|
||||
new Version(3, 0, 265),
|
||||
AppResources.ChangeLog3_0_265
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue