Add PaymentType column to Walks table in migration 20250706144607

- Introduced a new column 'PaymentType' of type INTEGER to the 'Walks' table.
- Set default value for 'PaymentType' to 0.
- Implemented migration methods to handle the addition and removal of the column.
This commit is contained in:
Max Mannstein 2025-07-14 14:01:34 +02:00
parent 4478fa2457
commit e6671d19fb
21 changed files with 1889 additions and 56 deletions

1
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1 @@
{}

View File

@ -352,7 +352,7 @@ namespace gehGassiApp.Core.Services
var json = JsonSerializer.Serialize(registerDto, _jsonOptions);
var stringContent = new StringContent(json, Encoding.UTF8, "application/json");
var serverResult = await _httpClient.PostAsync($"api/v2/Account/Register", stringContent, token).ConfigureAwait(false);
var serverResult = await _httpClient.PostAsync($"api/v3/Account/Register", stringContent, token).ConfigureAwait(false);
if (serverResult.IsSuccessStatusCode)
{
@ -453,7 +453,7 @@ namespace gehGassiApp.Core.Services
var json = JsonSerializer.Serialize(registerDto, _jsonOptions);
var stringContent = new StringContent(json, Encoding.UTF8, "application/json");
var serverResult = await _httpClient.PostAsync($"api/v2/Account/RegisterExternal", stringContent, token).ConfigureAwait(false);
var serverResult = await _httpClient.PostAsync($"api/v3/Account/RegisterExternal", stringContent, token).ConfigureAwait(false);
if (serverResult.IsSuccessStatusCode)
{
@ -5952,7 +5952,7 @@ namespace gehGassiApp.Core.Services
var json = JsonSerializer.Serialize(requestDto, _jsonOptions);
var stringContent = new StringContent(json, Encoding.UTF8, "application/json");
var serverResult = await _httpClient.PostAsync($"api/walks/AcceptPublicWalkRequest", stringContent, token).ConfigureAwait(false);
var serverResult = await _httpClient.PostAsync($"api/v2/walks/AcceptPublicWalkRequest", stringContent, token).ConfigureAwait(false);
if (serverResult.IsSuccessStatusCode)
{
@ -7499,7 +7499,7 @@ namespace gehGassiApp.Core.Services
var json = JsonSerializer.Serialize(requestDto, _jsonOptions);
var stringContent = new StringContent(json, Encoding.UTF8, "application/json");
var serverResult = await _httpClient.PostAsync($"api/walks/CancelWalk", stringContent, token).ConfigureAwait(false);
var serverResult = await _httpClient.PostAsync($"api/v2/walks/CancelWalk", stringContent, token).ConfigureAwait(false);
if (serverResult.IsSuccessStatusCode)
{
@ -7688,7 +7688,7 @@ namespace gehGassiApp.Core.Services
var json = JsonSerializer.Serialize(requestDto, _jsonOptions);
var stringContent = new StringContent(json, Encoding.UTF8, "application/json");
var serverResult = await _httpClient.PostAsync($"api/walks/ConfirmWalk", stringContent, token).ConfigureAwait(false);
var serverResult = await _httpClient.PostAsync($"api/v2/walks/ConfirmWalk", stringContent, token).ConfigureAwait(false);
if (serverResult.IsSuccessStatusCode)
{
@ -7754,7 +7754,7 @@ namespace gehGassiApp.Core.Services
var json = JsonSerializer.Serialize(requestDto, _jsonOptions);
var stringContent = new StringContent(json, Encoding.UTF8, "application/json");
var serverResult = await _httpClient.PostAsync($"api/walks/ConfirmWalkWithRating", stringContent, token).ConfigureAwait(false);
var serverResult = await _httpClient.PostAsync($"api/v2/walks/ConfirmWalkWithRating", stringContent, token).ConfigureAwait(false);
if (serverResult.IsSuccessStatusCode)
{
@ -7953,7 +7953,7 @@ namespace gehGassiApp.Core.Services
var stringContent = new StringContent(json, Encoding.UTF8, "application/json");
var serverResult = await _httpClient.PostAsync($"api/walks/CreateWalkDirect", stringContent, token).ConfigureAwait(false);
var serverResult = await _httpClient.PostAsync($"api/v2/walks/CreateWalkDirect", stringContent, token).ConfigureAwait(false);
if (serverResult.IsSuccessStatusCode)
{
@ -8032,7 +8032,7 @@ namespace gehGassiApp.Core.Services
var stringContent = new StringContent(json, Encoding.UTF8, "application/json");
var serverResult = await _httpClient.PostAsync($"api/walks/CreateWalkRequest", stringContent, token).ConfigureAwait(false);
var serverResult = await _httpClient.PostAsync($"api/v2/walks/CreateWalkRequest", stringContent, token).ConfigureAwait(false);
if (serverResult.IsSuccessStatusCode)
{
@ -8106,7 +8106,7 @@ namespace gehGassiApp.Core.Services
var json = JsonSerializer.Serialize(requestDto, _jsonOptions);
var stringContent = new StringContent(json, Encoding.UTF8, "application/json");
var serverResult = await _httpClient.PostAsync($"api/walks/AcceptWalk", stringContent, token).ConfigureAwait(false);
var serverResult = await _httpClient.PostAsync($"api/v2/walks/AcceptWalk", stringContent, token).ConfigureAwait(false);
if (serverResult.IsSuccessStatusCode)
{

View File

@ -1,6 +1,11 @@

migrations:
dotnet ef migrations add XXX --project gehGassiApp.Data --startup-project gehGassiApp.DbConfig
dotnet ef database update --project gehGassiApp.Data --startup-project gehGassiApp.DbConfig
add-migration xxx -Project gehGassiApp.Data -StartupProject gehGassiApp.DbConfig
add-migration Initial -Project gehGassiApp.Data -StartupProject gehGassiApp.DbConfig

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,29 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace gehGassiApp.Data.Migrations
{
/// <inheritdoc />
public partial class Walk_PaymentType_Added : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "PaymentType",
table: "Walks",
type: "INTEGER",
nullable: false,
defaultValue: 0);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "PaymentType",
table: "Walks");
}
}
}

View File

@ -15,7 +15,7 @@ namespace gehGassiApp.Data.Migrations
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "7.0.2");
modelBuilder.HasAnnotation("ProductVersion", "8.0.12");
modelBuilder.Entity("gehGassiApp.Domain.Common.Rating", b =>
{
@ -1345,6 +1345,9 @@ namespace gehGassiApp.Data.Migrations
b.Property<int>("PaymentStatus")
.HasColumnType("INTEGER");
b.Property<int>("PaymentType")
.HasColumnType("INTEGER");
b.Property<double>("PickupAddressLat")
.HasColumnType("REAL");

View File

@ -130,7 +130,20 @@ namespace gehGassiApp.Domain.Common
/// </summary>
GehGassi = 10
}
/// <summary>
/// Zahlungsart für einen Walk
/// </summary>
public enum WalkPaymentType
{
/// <summary>
/// Mit MangoPay bezahlen (z.B. Kreditkarte)
/// </summary>
MangoPay = 1,
/// <summary>
/// Barzahlung
/// </summary>
Cash = 10
}
/// <summary>
/// Zahlungsstatus in der App
/// </summary>

View File

@ -176,7 +176,11 @@ namespace gehGassiApp.Domain.Walks
/// </summary>
[Required]
public PaymentStatus PaymentStatus { get; set; }
/// <summary>
/// Welche Art von Bezahlung wurde verwendet
/// </summary>
[Required]
public WalkPaymentType PaymentType { get; set; }
/// <summary>
/// Datum der Erstellung des Walks
/// </summary>
@ -437,7 +441,11 @@ namespace gehGassiApp.Domain.Walks
/// Zahlungsstatus des Walks
/// </summary>
public PaymentStatus PaymentStatus { get; set; }
/// <summary>
/// Welche Art von Bezahlung wurde verwendet
/// </summary>
[Required]
public WalkPaymentType PaymentType { get; set; }
/// <summary>
/// Id des Gutscheins der verwendet wurde, wenn einer verwendet wurde
/// </summary>

View File

@ -103,7 +103,7 @@ public static class MauiProgram
fonts.AddFont("Inter-Medium.ttf", "InterMedium");
fonts.AddFont("Inter-SemiBold.ttf", "InterSemiBold");
fonts.AddFont("icomoon.ttf", "IconMoon");
fonts.AddFont("MaterialIcons-Regular.ttf", "IconFont");
fonts.AddFont("MaterialIcons-Regular.ttf", "MaterialIconsRegular");
}).UseLocalNotifications()
.ConfigureMauiHandlers((handlers) =>
{

View File

@ -27,8 +27,6 @@
<string>Assets.xcassets/appicon.appiconset</string>
<key>CFBundleIdentifier</key>
<string></string>
<key>CFBundleShortVersionString</key>
<string>1.271</string>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
@ -69,7 +67,5 @@
<array>
<string>remote-notification</string>
</array>
<key>CFBundleVersion</key>
<string>271</string>
</dict>
</plist>

View File

@ -184,7 +184,7 @@
<Image.Source>
<FontImageSource
x:Name="homeImageSource"
FontFamily="IconFont"
FontFamily="MaterialIconsRegular"
Glyph="home"
Color="{StaticResource Primary_DarkBlue}" />
</Image.Source>
@ -217,7 +217,7 @@
<Image.Source>
<FontImageSource
x:Name="homeWalkerImageSource"
FontFamily="IconFont"
FontFamily="MaterialIconsRegular"
Glyph="home"
Color="{StaticResource Primary_DarkBlue}" />
</Image.Source>
@ -505,7 +505,7 @@
Background="Transparent"
Command="{TemplateBinding BindingContext.NavigateBackCommand}"
FontAttributes="Bold"
FontFamily="IconFont"
FontFamily="MaterialIconsRegular"
FontSize="40"
HorizontalOptions="End"
Text="close"

View File

@ -77,7 +77,7 @@
WidthRequest="40">
<Button.ImageSource>
<FontImageSource
FontFamily="IconFont"
FontFamily="MaterialIconsRegular"
Glyph="photo_camera"
Size="20"
Color="{StaticResource Primary_White}" />

View File

@ -76,7 +76,7 @@
WidthRequest="40">
<Button.ImageSource>
<FontImageSource
FontFamily="IconFont"
FontFamily="MaterialIconsRegular"
Glyph="photo_camera"
Size="20"
Color="{StaticResource Primary_White}" />

View File

@ -136,7 +136,7 @@
BorderWidth="1"
Command="{Binding PreviousStepCommand}"
CornerRadius="30"
FontFamily="IconFont"
FontFamily="MaterialIconsRegular"
FontSize="40"
HeightRequest="60"
HorizontalOptions="Start"
@ -158,7 +158,7 @@
BorderWidth="1"
Command="{Binding NextStepCommand}"
CornerRadius="30"
FontFamily="IconFont"
FontFamily="MaterialIconsRegular"
FontSize="40"
HeightRequest="60"
HorizontalOptions="End"

View File

@ -36,7 +36,7 @@
Background="Transparent"
Command="{Binding DeclineCommand}"
FontAttributes="Bold"
FontFamily="IconFont"
FontFamily="MaterialIconsRegular"
FontSize="40"
HorizontalOptions="End"
Text="close"
@ -53,7 +53,7 @@
<!-- Icon - Gestapelte Napf-Icons -->
<Image
Margin="0,0,0,-10"
Margin="0,0,0,-20"
HeightRequest="120"
HorizontalOptions="Center"
Source="coins.png"
@ -109,7 +109,7 @@
<!-- Action Button -->
<Button
Grid.Row="2"
Margin="30,0,30,30"
Margin="30,0,30,20"
BackgroundColor="{AppThemeBinding Light={StaticResource Primary_DarkBlue},
Dark={StaticResource Primary_DarkBlue_Dark}}"
Command="{Binding AcceptCommand}"

View File

@ -36,7 +36,7 @@
BackgroundColor="Transparent"
Command="{Binding CloseCommand}"
FontAttributes="Bold"
FontFamily="IconFont"
FontFamily="MaterialIconsRegular"
FontSize="40"
HorizontalOptions="End"
Style="{StaticResource LinkButton}"

View File

@ -89,7 +89,7 @@
WidthRequest="40">
<Button.ImageSource>
<FontImageSource
FontFamily="IconFont"
FontFamily="MaterialIconsRegular"
Glyph="photo_camera"
Size="20"
Color="{StaticResource Primary_White}" />

View File

@ -95,7 +95,7 @@
WidthRequest="40">
<Button.ImageSource>
<FontImageSource
FontFamily="IconFont"
FontFamily="MaterialIconsRegular"
Glyph="photo_camera"
Size="20"
Color="{StaticResource Primary_White}" />

View File

@ -51,7 +51,7 @@
<Button
Margin="0,0,-5,-35"
Command="{Binding NavigateBackCommand}"
FontFamily="IconFont"
FontFamily="MaterialIconsRegular"
FontSize="30"
HorizontalOptions="End"
Style="{StaticResource LinkButton}"

View File

@ -22,8 +22,8 @@
<ApplicationIdGuid>284D2BDB-7FFC-485A-968F-8440A92578FE</ApplicationIdGuid>
<!-- Versions -->
<ApplicationDisplayVersion>1.271</ApplicationDisplayVersion>
<ApplicationVersion>271</ApplicationVersion>
<ApplicationDisplayVersion>1.273</ApplicationDisplayVersion>
<ApplicationVersion>273</ApplicationVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">29.0</SupportedOSPlatformVersion>
@ -45,16 +45,12 @@
<GenerateSatelliteAssembliesForCore>True</GenerateSatelliteAssembliesForCore>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net8.0-android|AnyCPU'">
<ApplicationDisplayVersion>1.271</ApplicationDisplayVersion>
<ApplicationVersion>271</ApplicationVersion>
<AndroidUseAapt2>True</AndroidUseAapt2>
<AndroidCreatePackagePerAbi>False</AndroidCreatePackagePerAbi>
<AndroidPackageFormat>apk</AndroidPackageFormat>
<ApplicationId>com.gehgassi.local</ApplicationId>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='DebugStaging|net8.0-android|AnyCPU'">
<ApplicationDisplayVersion>1.271</ApplicationDisplayVersion>
<ApplicationVersion>271</ApplicationVersion>
<AndroidUseAapt2>True</AndroidUseAapt2>
<AndroidCreatePackagePerAbi>False</AndroidCreatePackagePerAbi>
<AndroidPackageFormat>apk</AndroidPackageFormat>
@ -62,8 +58,6 @@
<ApplicationId>com.gehgassi.local</ApplicationId>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net8.0-android|AnyCPU'">
<ApplicationDisplayVersion>1.271</ApplicationDisplayVersion>
<ApplicationVersion>271</ApplicationVersion>
<EmbedAssembliesIntoApk>True</EmbedAssembliesIntoApk>
<RunAOTCompilation>True</RunAOTCompilation>
<PublishTrimmed>True</PublishTrimmed>
@ -73,8 +67,6 @@
<ApplicationId>com.gehgassi.gehgassi</ApplicationId>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Staging|net8.0-android|AnyCPU'">
<ApplicationDisplayVersion>1.271</ApplicationDisplayVersion>
<ApplicationVersion>271</ApplicationVersion>
<EmbedAssembliesIntoApk>True</EmbedAssembliesIntoApk>
<RunAOTCompilation>True</RunAOTCompilation>
<PublishTrimmed>True</PublishTrimmed>
@ -84,8 +76,6 @@
<ApplicationId>com.gehgassi.local</ApplicationId>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net8.0-ios|AnyCPU'">
<ApplicationDisplayVersion>1.271</ApplicationDisplayVersion>
<ApplicationVersion>271</ApplicationVersion>
<ApplicationId>com.gehgassi.local</ApplicationId>
<MtouchDebug>True</MtouchDebug>
<MtouchLink>None</MtouchLink>
@ -94,16 +84,12 @@
<ForceSimulatorX64ArchitectureInIDE>true</ForceSimulatorX64ArchitectureInIDE>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='DebugStaging|net8.0-ios|AnyCPU'">
<ApplicationDisplayVersion>1.271</ApplicationDisplayVersion>
<ApplicationVersion>271</ApplicationVersion>
<ApplicationId>com.gehgassi.local</ApplicationId>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net8.0-ios|AnyCPU'">
<UseInterpreter>True</UseInterpreter>
<ApplicationDisplayVersion>1.271</ApplicationDisplayVersion>
<ApplicationVersion>271</ApplicationVersion>
<CodesignEntitlements>Platforms\iOS\Entitlements.production.plist</CodesignEntitlements>
<CodesignKey></CodesignKey>
<CodesignProvision></CodesignProvision>
@ -113,8 +99,6 @@
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Staging|net8.0-ios|AnyCPU'">
<ApplicationDisplayVersion>1.271</ApplicationDisplayVersion>
<ApplicationVersion>271</ApplicationVersion>
<ApplicationId>com.gehgassi.local</ApplicationId>
</PropertyGroup>
@ -140,8 +124,13 @@
<MauiImage Include="Resources\Images\*" />
<!-- Custom Fonts -->
<MauiFont Include="Resources\Fonts\*" />
<!-- <MauiFont Include="Resources\Fonts\*" /> -->
<!-- Durch akuellen Bug müssen alle Fonts einzeln referenziert werden: https://learn.microsoft.com/en-us/answers/questions/1684493/custom-fonts-not-working-when-uploading-maui-andro -->
<MauiFont Include="Resources\Fonts\icomoon.ttf" Alias="IconMoon" />
<MauiFont Include="Resources\Fonts\Inter-Medium.ttf" Alias="InterMedium" />
<MauiFont Include="Resources\Fonts\Inter-Regular.ttf" Alias="InterRegular" />
<MauiFont Include="Resources\Fonts\Inter-SemiBold.ttf" Alias="InterSemiBold" />
<MauiFont Include="Resources\Fonts\MaterialIcons-Regular.ttf" Alias="MaterialIconsRegular" />
<!-- Raw Assets (also remove the "Resources\Raw" prefix) -->
<!-- https://github.com/dotnet/maui/issues/14044 -->
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
@ -158,10 +147,6 @@
<None Remove="Platforms\Android\google-services_Live.json" />
<None Remove="Platforms\Android\Resources\drawable\appiconpush2.svg" />
<None Remove="Platforms\Android\Resources\xml\auto_backup_rules.xml" />
<None Remove="Resources\Fonts\icomoon.ttf" />
<None Remove="Resources\Fonts\Inter-Medium.ttf" />
<None Remove="Resources\Fonts\Inter-Regular.ttf" />
<None Remove="Resources\Fonts\Inter-SemiBold.ttf" />
<None Remove="Resources\Images\aggression_level_high.svg" />
<None Remove="Resources\Images\aggression_level_low.svg" />
<None Remove="Resources\Images\aggression_level_medium.svg" />