Add payment types for walks and update related models
This commit introduces new payment types, including "MangoPay" and "Cash", to the localization resource files for both German and English. A new enum `WalkPaymentType` is created to represent these payment types, and the `Walk` class is updated to include a required `PaymentType` property of this enum type. The database context is modified to add a `PaymentType` column to the `Walks` table, accompanied by a migration to implement this change and set a default value. The `WalkController` is updated to support filtering by the new `PaymentType` field, and the mapping profile is enhanced to include mappings for `WalkPaymentType` and its view model counterpart. View models are also updated to incorporate the new `PaymentType` and its display name. Front-end TypeScript files are adjusted to utilize the new `WalkPaymentType` enum and related properties, while the UI is enhanced to display the payment type in the details view of walks. Version numbers in various configuration files are incremented to reflect these changes.
This commit is contained in:
parent
ecb43012ac
commit
ada8b7a200
@ -3933,4 +3933,13 @@
|
||||
<data name="Subscription_MaxRegisteredDate" xml:space="preserve">
|
||||
<value>Max. Registrierungsdatum</value>
|
||||
</data>
|
||||
<data name="WalkPaymentType_MangoPay" xml:space="preserve">
|
||||
<value>Mangopay</value>
|
||||
</data>
|
||||
<data name="WalkPaymentType_Cash" xml:space="preserve">
|
||||
<value>Barzahlung</value>
|
||||
</data>
|
||||
<data name="Walk_PaymentType" xml:space="preserve">
|
||||
<value>Zahlungsart</value>
|
||||
</data>
|
||||
</root>
|
||||
@ -3935,4 +3935,13 @@
|
||||
<data name="Subscription_MaxRegisteredDate" xml:space="preserve">
|
||||
<value>Max. registered date</value>
|
||||
</data>
|
||||
<data name="WalkPaymentType_MangoPay" xml:space="preserve">
|
||||
<value>Mangopay</value>
|
||||
</data>
|
||||
<data name="WalkPaymentType_Cash" xml:space="preserve">
|
||||
<value>Cash</value>
|
||||
</data>
|
||||
<data name="Walk_PaymentType" xml:space="preserve">
|
||||
<value>Payment tye</value>
|
||||
</data>
|
||||
</root>
|
||||
@ -3934,4 +3934,13 @@
|
||||
<data name="Subscription_MaxRegisteredDate" xml:space="preserve">
|
||||
<value />
|
||||
</data>
|
||||
<data name="WalkPaymentType_MangoPay" xml:space="preserve">
|
||||
<value />
|
||||
</data>
|
||||
<data name="WalkPaymentType_Cash" xml:space="preserve">
|
||||
<value />
|
||||
</data>
|
||||
<data name="Walk_PaymentType" xml:space="preserve">
|
||||
<value />
|
||||
</data>
|
||||
</root>
|
||||
@ -303,6 +303,21 @@ namespace gehGassi.Domain.Common
|
||||
PayPal = 30
|
||||
}
|
||||
|
||||
/// <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
|
||||
/// </summary>
|
||||
|
||||
@ -178,6 +178,12 @@ namespace gehGassi.Domain.Walks
|
||||
[Required]
|
||||
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>
|
||||
@ -473,6 +479,11 @@ namespace gehGassi.Domain.Walks
|
||||
/// </summary>
|
||||
public PaymentStatus PaymentStatus { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Welche Art von Bezahlung wurde verwendet
|
||||
/// </summary>
|
||||
public WalkPaymentType PaymentType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Id des Gutscheins der verwendet wurde, wenn einer verwendet wurde
|
||||
/// </summary>
|
||||
|
||||
9478
gehGassi.Persistence/Migrations/20250630082853_Walk_PaymentType_Added.Designer.cs
generated
Normal file
9478
gehGassi.Persistence/Migrations/20250630082853_Walk_PaymentType_Added.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,65 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using System;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace gehGassi.Persistence.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class Walk_PaymentType_Added : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "PaymentType",
|
||||
table: "Walks",
|
||||
type: "int",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.Sql("Update Walks SET PaymentType = 1");
|
||||
|
||||
|
||||
var viewName = "tv_WalksWithNames";
|
||||
var sql = @"CREATE FUNCTION tv_WalksWithNames() RETURNS TABLE AS RETURN
|
||||
SELECT W.*,
|
||||
CONCAT(DW.FirstName, ' ' , DW.LastName) AS DogWalkerName, DW.Photo AS DogWalkerPhoto,
|
||||
IsNull(DW.Locked,0) AS DogWalkerLocked, CAST((SELECT CASE WHEN AUBDW.Id IS NOT NULL THEN 1 ELSE 0 END) AS BIT) AS DogWalkerBlocked,
|
||||
CONCAT(DO.FirstName, ' ' , DO.LastName) AS DogOwnerName, DO.Photo AS DogOwnerPhoto,
|
||||
IsNull(DO.Locked,0) AS DogOwnerLocked, CAST((SELECT CASE WHEN AUBDO.Id IS NOT NULL THEN 1 ELSE 0 END) AS BIT) AS DogOwnerBlocked
|
||||
FROM Walks W
|
||||
LEFT JOIN AppUsers DW ON W.DogWalkerId = DW.Id
|
||||
LEFT JOIN AppUsers DO ON W.DogOwnerId = DO.Id
|
||||
LEFT OUTER JOIN AppUserBlocks AUBDW ON AUBDW.BlockedAppUserId = DW.Id AND AUBDW.BlockingAppUserId = DO.Id
|
||||
LEFT OUTER JOIN AppUserBlocks AUBDO ON AUBDO.BlockedAppUserId = DO.Id AND AUBDO.BlockingAppUserId = DW.Id";
|
||||
|
||||
migrationBuilder.Sql($"IF(exists (SELECT 1 FROM sys.objects WHERE Name = '{viewName}')) BEGIN DROP FUNCTION [dbo].[{viewName}] END {Environment.NewLine} GO");
|
||||
migrationBuilder.Sql($"{sql} {Environment.NewLine} GO");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "PaymentType",
|
||||
table: "Walks");
|
||||
|
||||
var viewName = "tv_WalksWithNames";
|
||||
var sql = @"CREATE FUNCTION tv_WalksWithNames() RETURNS TABLE AS RETURN
|
||||
SELECT W.*,
|
||||
CONCAT(DW.FirstName, ' ' , DW.LastName) AS DogWalkerName, DW.Photo AS DogWalkerPhoto,
|
||||
IsNull(DW.Locked,0) AS DogWalkerLocked, CAST((SELECT CASE WHEN AUBDW.Id IS NOT NULL THEN 1 ELSE 0 END) AS BIT) AS DogWalkerBlocked,
|
||||
CONCAT(DO.FirstName, ' ' , DO.LastName) AS DogOwnerName, DO.Photo AS DogOwnerPhoto,
|
||||
IsNull(DO.Locked,0) AS DogOwnerLocked, CAST((SELECT CASE WHEN AUBDO.Id IS NOT NULL THEN 1 ELSE 0 END) AS BIT) AS DogOwnerBlocked
|
||||
FROM Walks W
|
||||
LEFT JOIN AppUsers DW ON W.DogWalkerId = DW.Id
|
||||
LEFT JOIN AppUsers DO ON W.DogOwnerId = DO.Id
|
||||
LEFT OUTER JOIN AppUserBlocks AUBDW ON AUBDW.BlockedAppUserId = DW.Id AND AUBDW.BlockingAppUserId = DO.Id
|
||||
LEFT OUTER JOIN AppUserBlocks AUBDO ON AUBDO.BlockedAppUserId = DO.Id AND AUBDO.BlockingAppUserId = DW.Id";
|
||||
|
||||
migrationBuilder.Sql($"IF(exists (SELECT 1 FROM sys.objects WHERE Name = '{viewName}')) BEGIN DROP FUNCTION [dbo].[{viewName}] END {Environment.NewLine} GO");
|
||||
migrationBuilder.Sql($"{sql} {Environment.NewLine} GO");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -7818,6 +7818,9 @@ namespace gehGassi.Persistence.Migrations
|
||||
b.Property<int>("PaymentStatus")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("PaymentType")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<Point>("PickupLocation")
|
||||
.HasColumnType("geography");
|
||||
|
||||
@ -8091,6 +8094,9 @@ namespace gehGassi.Persistence.Migrations
|
||||
b.Property<int>("PaymentStatus")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("PaymentType")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("PickupAddress_AddressLine1")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
|
||||
@ -98,6 +98,8 @@ namespace gehGassi.Web.Controllers
|
||||
whereFilterPredicate.value = (WalkStatus)((int)((long)whereFilterPredicate.value));
|
||||
if (whereFilterPredicate.Field == "paymentStatus")
|
||||
whereFilterPredicate.value = (PaymentStatus)((int)((long)whereFilterPredicate.value));
|
||||
if (whereFilterPredicate.Field == "paymentType")
|
||||
whereFilterPredicate.value = (WalkPaymentType)((int)((long)whereFilterPredicate.value));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -120,6 +122,7 @@ namespace gehGassi.Web.Controllers
|
||||
itemVm.ServiceTypeText = itemVm.ServiceType.GetDisplayName(AnnotationsLocalizer);
|
||||
itemVm.StatusText = itemVm.Status.GetDisplayName(AnnotationsLocalizer);
|
||||
itemVm.PaymentStatusText = itemVm.PaymentStatus.GetDisplayName(AnnotationsLocalizer);
|
||||
itemVm.PaymentTypeText = itemVm.PaymentType.GetDisplayName(AnnotationsLocalizer);
|
||||
}
|
||||
|
||||
//FilterPreview?
|
||||
|
||||
@ -135,6 +135,9 @@ namespace gehGassi.Web.Mapper
|
||||
CreateMap<PaymentStatus, PaymentStatusVm>();
|
||||
CreateMap<PaymentStatusVm, PaymentStatus>();
|
||||
|
||||
CreateMap<WalkPaymentType, WalkPaymentTypeVm>();
|
||||
CreateMap<WalkPaymentTypeVm, WalkPaymentType>();
|
||||
|
||||
CreateMap<OrderStatus, OrderStatusVm>();
|
||||
CreateMap<OrderStatusVm, OrderStatus>();
|
||||
|
||||
|
||||
@ -378,6 +378,23 @@ namespace gehGassi.Web.Models
|
||||
RefundendAndPayed = 60
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Zahlungsart für einen Walk
|
||||
/// </summary>
|
||||
public enum WalkPaymentTypeVm
|
||||
{
|
||||
/// <summary>
|
||||
/// Mit MangoPay bezahlen (z.B. Kreditkarte)
|
||||
/// </summary>
|
||||
[Display(Name = "WalkPaymentType_MangoPay")]
|
||||
MangoPay = 1,
|
||||
/// <summary>
|
||||
/// Barzahlung
|
||||
/// </summary>
|
||||
[Display(Name = "WalkPaymentType_Cash")]
|
||||
Cash = 10
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Status einer Bestellung
|
||||
/// </summary>
|
||||
|
||||
@ -220,6 +220,11 @@ namespace gehGassi.Web.Models
|
||||
/// </summary>
|
||||
public PaymentStatusVm PaymentStatus { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Zahlungsart des Walks
|
||||
/// </summary>
|
||||
public WalkPaymentTypeVm PaymentType { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
@ -380,6 +385,16 @@ namespace gehGassi.Web.Models
|
||||
/// </summary>
|
||||
public string PaymentStatusText { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Welche Art von Bezahlung wurde verwendet
|
||||
/// </summary>
|
||||
public WalkPaymentTypeVm PaymentType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Welche Art von Bezahlung wurde verwendet
|
||||
/// </summary>
|
||||
public string PaymentTypeText { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
|
||||
@ -229,7 +229,15 @@ export enum PaymentStatus {
|
||||
/**Entwertet */
|
||||
Voided = 50,
|
||||
/**Rückerstattet gehgassi */
|
||||
RefundendAndPayed = 60,
|
||||
RefundendAndPayed = 60
|
||||
}
|
||||
|
||||
/**Zahlungsarten Walk */
|
||||
export enum WalkPaymentType {
|
||||
/**MangoPay */
|
||||
MangoPay = 1,
|
||||
/**Cash */
|
||||
Cash = 10
|
||||
}
|
||||
|
||||
/**Geoeinschränkungen für Listungen und Werbungen */
|
||||
@ -2473,6 +2481,9 @@ export class WalkWithNamesListItem extends SyncEntity {
|
||||
/**Zahlungsstatus des Walks */
|
||||
paymentStatus: PaymentStatus;
|
||||
|
||||
/**Zahlungsart des Walks */
|
||||
paymentType: WalkPaymentType;
|
||||
|
||||
/**Datum der Erstellung des Walks */
|
||||
created: Date | string;
|
||||
}
|
||||
|
||||
@ -15,6 +15,7 @@ import WalkType = Models.WalkType;
|
||||
import WalkStatus = Models.WalkStatus;
|
||||
import WalkServiceType = Models.WalkServiceType;
|
||||
import PaymentStatus = Models.PaymentStatus;
|
||||
import WalkPaymentType = Models.WalkPaymentType;
|
||||
|
||||
|
||||
class WalksModule {
|
||||
@ -40,6 +41,9 @@ class WalksModule {
|
||||
private _paymentStatusList;
|
||||
private _filterPaymentStatus: DropDownList;
|
||||
|
||||
private _paymentTypeList;
|
||||
private _filterPaymentType: DropDownList;
|
||||
|
||||
constructor() {
|
||||
this._global = Global.getInstance();
|
||||
this._eventManager = EventManager.getInstance();
|
||||
@ -95,6 +99,10 @@ class WalksModule {
|
||||
{ value: PaymentStatus.Voided, text: self._localizationMananger.get("PaymentStatus_Voided") },
|
||||
{ value: PaymentStatus.RefundendAndPayed, text: self._localizationMananger.get("PaymentStatus_RefundendAndPayed") }];
|
||||
|
||||
self._paymentTypeList = [
|
||||
{ value: WalkPaymentType.MangoPay, text: self._localizationMananger.get("WalkPaymentType_MangoPay")},
|
||||
{ value: WalkPaymentType.Cash, text: self._localizationMananger.get("WalkPaymentType_Cash") }];
|
||||
|
||||
self._dataManager = new DataManager({
|
||||
url: <string>$(self.prefix("#jsGetUrl")).val(),
|
||||
adaptor: new UrlAdaptor(),
|
||||
@ -201,6 +209,32 @@ class WalksModule {
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: "paymentType", headerText: self._localizationMananger.get("Walk_PaymentType"), type: "number", template: "${paymentTypeText}",
|
||||
filter: {
|
||||
ui: {
|
||||
create: (args: { target: Element, column: Object }) => {
|
||||
let flValInput: HTMLElement = createElement("input", { className: "flm-input" });
|
||||
args.target.appendChild(flValInput);
|
||||
self._filterPaymentType = new DropDownList({
|
||||
dataSource: new DataManager(self._paymentTypeList),
|
||||
fields: { text: "text", value: "value" },
|
||||
placeholder: self._localizationMananger.get("Common_Select"),
|
||||
popupHeight: "200px"
|
||||
});
|
||||
self._filterPaymentType.appendTo(flValInput);
|
||||
},
|
||||
write: (args: {
|
||||
column: Object, target: Element, parent: any, filteredValue: number | string
|
||||
}) => {
|
||||
self._filterPaymentType.value = args.filteredValue;
|
||||
},
|
||||
read: (args: { target: Element, column: any, operator: string, fltrObj: Filter }) => {
|
||||
args.fltrObj.filterByColumn(args.column.field, args.operator, self._filterPaymentType.value);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: "paymentStatus", headerText: self._localizationMananger.get("Walk_PaymentStatus"), type: "number", template: "${paymentStatusText}",
|
||||
filter: {
|
||||
|
||||
@ -65,6 +65,13 @@
|
||||
<div class="h5 mb-1">@annotationsLocalizer["Walk_Status"]</div>
|
||||
@Model.Status.GetDisplayName(annotationsLocalizer)
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-sm-3">
|
||||
<div class="h5 mb-1">@annotationsLocalizer["Walk_PaymentType"]</div>
|
||||
@Model.PaymentType.GetDisplayName(annotationsLocalizer)
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<div class="h5 mb-1">@annotationsLocalizer["Walk_PaymentStatus"]</div>
|
||||
@Model.PaymentStatus.GetDisplayName(annotationsLocalizer)
|
||||
|
||||
@ -22,10 +22,10 @@
|
||||
"LicenseOptions": {
|
||||
"Address": "https://gehgassi.com",
|
||||
"Software": "gehgassi",
|
||||
"Version": "1.0.99"
|
||||
"Version": "1.0.100"
|
||||
},
|
||||
"SystemJsOptions": {
|
||||
"FileVersion": "1.0.99"
|
||||
"FileVersion": "1.0.100"
|
||||
},
|
||||
"SessionSettings": {
|
||||
"TimeOut": "60",
|
||||
|
||||
@ -23,10 +23,10 @@
|
||||
"LicenseOptions": {
|
||||
"Address": "https://creativeBITS.com",
|
||||
"Software": "gehgassi",
|
||||
"Version": "1.0.99"
|
||||
"Version": "1.0.100"
|
||||
},
|
||||
"SystemJsOptions": {
|
||||
"FileVersion": "1.0.99"
|
||||
"FileVersion": "1.0.100"
|
||||
},
|
||||
"SessionSettings": {
|
||||
"TimeOut": "60",
|
||||
|
||||
@ -22,10 +22,10 @@
|
||||
"LicenseOptions": {
|
||||
"Address": "https://gehGassi.creativeBITS.eu",
|
||||
"Software": "gehgassi",
|
||||
"Version": "1.0.99"
|
||||
"Version": "1.0.100"
|
||||
},
|
||||
"SystemJsOptions": {
|
||||
"FileVersion": "1.0.99"
|
||||
"FileVersion": "1.0.100"
|
||||
},
|
||||
"SessionSettings": {
|
||||
"TimeOut": "60",
|
||||
|
||||
@ -23,10 +23,10 @@
|
||||
"LicenseOptions": {
|
||||
"Address": "https://creativeBITS.com",
|
||||
"Software": "gehgassi",
|
||||
"Version": "1.0.99"
|
||||
"Version": "1.0.100"
|
||||
},
|
||||
"SystemJsOptions": {
|
||||
"FileVersion": "1.0.99"
|
||||
"FileVersion": "1.0.100"
|
||||
},
|
||||
"SessionSettings": {
|
||||
"TimeOut": "60",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user