Browse Source

Allowance update paymentType

zinab_elgendy 3 months ago
parent
commit
2a6e0f18a2

+ 1 - 1
MTWorkHR.Application/Dtos/Contract/ContractAllowanceDto.cs

@@ -19,7 +19,7 @@ namespace MTWorkHR.Application.Models
         public string? AllowanceDesc { get; set; }
         public decimal EntitlementPercent { get; set; }// اختيار (مبلغ – يكتب المبلغ)    أو  (نسبة من الراتب – ويظهر المبلغ توماتك)      
         public decimal EntitlementAmount { get; set; }
-        public PaymentType PaymentType { get; set; }
+        public string? PaymentType { get; set; } // PaymentTypeEnum
 
     }
 }

+ 2 - 0
MTWorkHR.Application/Dtos/Contract/ContractDto.cs

@@ -1,6 +1,7 @@
 using MTWorkHR.Application.Models;
 using MTWorkHR.Core.Entities.Base;
 using MTWorkHR.Core.Global;
+using Newtonsoft.Json;
 using System;
 using System.Collections.Generic;
 using System.ComponentModel.DataAnnotations;
@@ -33,6 +34,7 @@ namespace MTWorkHR.Application.Models
         public string? JobNumber { get; set; } //ثابت و مأخوذ من المنصة
         //----------------Contract data -------------------------
         public DateTime? StartDate { get; set; }
+        [JsonProperty(Required = Required.AllowNull)]
         public DateTime? EndDate { get; set; }
         public ContractDurationEnum ContractDurationId { get; set; } //:  اختيار: شهري – ربعي – نصف سنوي – 3 ارباع – سنوي
         public TypeOfWork TypeOfWork { get; set; } //: :   اختيار: عقد بدوام كامل -  عقد دوام جزئي   

+ 1 - 1
MTWorkHR.Core/Entities/Contract/ContractAllowance.cs

@@ -21,7 +21,7 @@ namespace MTWorkHR.Core.Entities
         public string? AllowanceDesc { get; set; }
         public decimal EntitlementPercent { get; set; }// اختيار (مبلغ – يكتب المبلغ)    أو  (نسبة من الراتب – ويظهر المبلغ توماتك)      
         public decimal EntitlementAmount { get; set; }
-        public PaymentType PaymentType { get; set; }
+        public string? PaymentType { get; set; }
 
     }
 }

File diff suppressed because it is too large
+ 5701 - 0
MTWorkHR.Infrastructure/Migrations/20241119221720_altrAllow.Designer.cs


+ 36 - 0
MTWorkHR.Infrastructure/Migrations/20241119221720_altrAllow.cs

@@ -0,0 +1,36 @@
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace MTWorkHR.Infrastructure.Migrations
+{
+    /// <inheritdoc />
+    public partial class altrAllow : Migration
+    {
+        /// <inheritdoc />
+        protected override void Up(MigrationBuilder migrationBuilder)
+        {
+            migrationBuilder.AlterColumn<string>(
+                name: "PaymentType",
+                table: "ContractAllowance",
+                type: "nvarchar(max)",
+                nullable: true,
+                oldClrType: typeof(int),
+                oldType: "int");
+        }
+
+        /// <inheritdoc />
+        protected override void Down(MigrationBuilder migrationBuilder)
+        {
+            migrationBuilder.AlterColumn<int>(
+                name: "PaymentType",
+                table: "ContractAllowance",
+                type: "int",
+                nullable: false,
+                defaultValue: 0,
+                oldClrType: typeof(string),
+                oldType: "nvarchar(max)",
+                oldNullable: true);
+        }
+    }
+}

+ 2 - 2
MTWorkHR.Infrastructure/Migrations/HRDataContextModelSnapshot.cs

@@ -713,8 +713,8 @@ namespace MTWorkHR.Infrastructure.Migrations
                     b.Property<decimal>("EntitlementPercent")
                         .HasColumnType("decimal(18,2)");
 
-                    b.Property<int>("PaymentType")
-                        .HasColumnType("int");
+                    b.Property<string>("PaymentType")
+                        .HasColumnType("nvarchar(max)");
 
                     b.Property<DateTime?>("UpdateDate")
                         .HasColumnType("datetime2")