Browse Source

Company: add address, email, phone

zinab_elgendy 1 month ago
parent
commit
da29f4e4f7

+ 30 - 30
MTWorkHR.API/Reports/ContractReport.Designer.cs

@@ -129,9 +129,11 @@
             DevExpress.DataAccess.Sql.RelationColumnInfo relationColumnInfo7 = new DevExpress.DataAccess.Sql.RelationColumnInfo();
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ContractReport));
             this.TopMargin = new DevExpress.XtraReports.UI.TopMarginBand();
+            this.xrLabel3 = new DevExpress.XtraReports.UI.XRLabel();
             this.xrLabel8 = new DevExpress.XtraReports.UI.XRLabel();
             this.BottomMargin = new DevExpress.XtraReports.UI.BottomMarginBand();
             this.Detail = new DevExpress.XtraReports.UI.DetailBand();
+            this.xrLabel51 = new DevExpress.XtraReports.UI.XRLabel();
             this.xrLabel50 = new DevExpress.XtraReports.UI.XRLabel();
             this.xrLabel49 = new DevExpress.XtraReports.UI.XRLabel();
             this.xrLabel48 = new DevExpress.XtraReports.UI.XRLabel();
@@ -182,8 +184,6 @@
             this.xrLabel1 = new DevExpress.XtraReports.UI.XRLabel();
             this.sqlDataSource1 = new DevExpress.DataAccess.Sql.SqlDataSource(this.components);
             this.ContractId = new DevExpress.XtraReports.Parameters.Parameter();
-            this.xrLabel51 = new DevExpress.XtraReports.UI.XRLabel();
-            this.xrLabel3 = new DevExpress.XtraReports.UI.XRLabel();
             this.xrControlStyle1 = new DevExpress.XtraReports.UI.XRControlStyle();
             ((System.ComponentModel.ISupportInitialize)(this)).BeginInit();
             // 
@@ -198,6 +198,17 @@
             this.TopMargin.StylePriority.UseBorders = false;
             this.TopMargin.StylePriority.UseBorderWidth = false;
             // 
+            // xrLabel3
+            // 
+            this.xrLabel3.Borders = DevExpress.XtraPrinting.BorderSide.None;
+            this.xrLabel3.ExpressionBindings.AddRange(new DevExpress.XtraReports.UI.ExpressionBinding[] {
+            new DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "Now()")});
+            this.xrLabel3.Multiline = true;
+            this.xrLabel3.Name = "xrLabel3";
+            this.xrLabel3.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
+            this.xrLabel3.StylePriority.UseBorders = false;
+            this.xrLabel3.StylePriority.UseFont = false;
+            // 
             // xrLabel8
             // 
             this.xrLabel8.Borders = DevExpress.XtraPrinting.BorderSide.None;
@@ -265,6 +276,14 @@
             this.xrLabel1});
             this.Detail.Name = "Detail";
             // 
+            // xrLabel51
+            // 
+            this.xrLabel51.ExpressionBindings.AddRange(new DevExpress.XtraReports.UI.ExpressionBinding[] {
+            new DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[NameEn]")});
+            this.xrLabel51.Multiline = true;
+            this.xrLabel51.Name = "xrLabel51";
+            this.xrLabel51.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
+            // 
             // xrLabel50
             // 
             this.xrLabel50.ExpressionBindings.AddRange(new DevExpress.XtraReports.UI.ExpressionBinding[] {
@@ -893,25 +912,6 @@
             this.ContractId.Type = typeof(int);
             this.ContractId.ValueInfo = "1";
             // 
-            // xrLabel51
-            // 
-            this.xrLabel51.ExpressionBindings.AddRange(new DevExpress.XtraReports.UI.ExpressionBinding[] {
-            new DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[NameEn]")});
-            this.xrLabel51.Multiline = true;
-            this.xrLabel51.Name = "xrLabel51";
-            this.xrLabel51.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
-            // 
-            // xrLabel3
-            // 
-            this.xrLabel3.Borders = DevExpress.XtraPrinting.BorderSide.None;
-            this.xrLabel3.ExpressionBindings.AddRange(new DevExpress.XtraReports.UI.ExpressionBinding[] {
-            new DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "Now()")});
-            this.xrLabel3.Multiline = true;
-            this.xrLabel3.Name = "xrLabel3";
-            this.xrLabel3.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
-            this.xrLabel3.StylePriority.UseBorders = false;
-            this.xrLabel3.StylePriority.UseFont = false;
-            // 
             // xrControlStyle1
             // 
             this.xrControlStyle1.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
@@ -963,7 +963,7 @@
             new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel14, "Default", "Text", "Name:"),
             new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel15, "Default", "Font", new DevExpress.Drawing.DXFont("Arial", 14F, DevExpress.Drawing.DXFontStyle.Bold)),
             new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel15, "Default", "LocationFloat", new DevExpress.Utils.PointFloat(21.66667F, 102.8333F)),
-            new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel15, "Default", "SizeF", new System.Drawing.SizeF(394.1667F, 23F)),
+            new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel15, "Default", "SizeF", new System.Drawing.SizeF(600F, 23F)),
             new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel15, "en-US", "SizeF", new System.Drawing.SizeF(618.3333F, 23F)),
             new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel15, "Default", "Text", "Employee Information:"),
             new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel16, "Default", "Font", new DevExpress.Drawing.DXFont("Arial", 9.75F, DevExpress.Drawing.DXFontStyle.Bold)),
@@ -978,7 +978,7 @@
             new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel18, "Default", "Font", new DevExpress.Drawing.DXFont("Arial", 9.75F, DevExpress.Drawing.DXFontStyle.Bold)),
             new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel18, "Default", "LocationFloat", new DevExpress.Utils.PointFloat(377.5F, 209F)),
             new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel18, "en-US", "LocationFloat", new DevExpress.Utils.PointFloat(355.8332F, 209F)),
-            new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel18, "Default", "SizeF", new System.Drawing.SizeF(100F, 23.00002F)),
+            new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel18, "Default", "SizeF", new System.Drawing.SizeF(51.66666F, 23.00003F)),
             new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel18, "en-US", "SizeF", new System.Drawing.SizeF(99.99994F, 23.00002F)),
             new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel18, "Default", "Text", "Email:"),
             new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel19, "Default", "Font", new DevExpress.Drawing.DXFont("Arial", 9.75F, DevExpress.Drawing.DXFontStyle.Bold)),
@@ -1007,9 +1007,9 @@
             new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel23, "en-US", "LocationFloat", new DevExpress.Utils.PointFloat(132.5F, 208.9999F)),
             new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel23, "Default", "SizeF", new System.Drawing.SizeF(100F, 23F)),
             new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel23, "Default", "Text", "xrLabel23"),
-            new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel24, "Default", "LocationFloat", new DevExpress.Utils.PointFloat(477.5F, 209F)),
+            new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel24, "Default", "LocationFloat", new DevExpress.Utils.PointFloat(433.3333F, 208.9999F)),
             new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel24, "en-US", "LocationFloat", new DevExpress.Utils.PointFloat(455.8331F, 209F)),
-            new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel24, "Default", "SizeF", new System.Drawing.SizeF(170F, 22.99998F)),
+            new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel24, "Default", "SizeF", new System.Drawing.SizeF(188.3334F, 22.99995F)),
             new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel24, "en-US", "SizeF", new System.Drawing.SizeF(194.1669F, 22.99998F)),
             new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel24, "Default", "Text", "xrLabel24"),
             new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel25, "Default", "LocationFloat", new DevExpress.Utils.PointFloat(158.3333F, 232.0001F)),
@@ -1027,12 +1027,12 @@
             new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel27, "Default", "Text", "xrLabel27"),
             new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel28, "Default", "Font", new DevExpress.Drawing.DXFont("Arial", 14F, DevExpress.Drawing.DXFontStyle.Bold)),
             new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel28, "Default", "LocationFloat", new DevExpress.Utils.PointFloat(21.66667F, 272.1669F)),
-            new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel28, "Default", "SizeF", new System.Drawing.SizeF(394.1667F, 23F)),
+            new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel28, "Default", "SizeF", new System.Drawing.SizeF(600F, 23F)),
             new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel28, "en-US", "SizeF", new System.Drawing.SizeF(618.3333F, 23F)),
             new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel28, "Default", "Text", "Job"),
             new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel29, "Default", "Font", new DevExpress.Drawing.DXFont("Arial", 12F, DevExpress.Drawing.DXFontStyle.Bold)),
             new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel29, "Default", "LocationFloat", new DevExpress.Utils.PointFloat(21.66667F, 364.8336F)),
-            new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel29, "Default", "SizeF", new System.Drawing.SizeF(394.1667F, 23F)),
+            new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel29, "Default", "SizeF", new System.Drawing.SizeF(600F, 23F)),
             new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel29, "en-US", "SizeF", new System.Drawing.SizeF(618.3333F, 23F)),
             new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel29, "Default", "Text", "Contract"),
             new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel3, "Default", "Font", new DevExpress.Drawing.DXFont("Arial", 9.75F)),
@@ -1095,7 +1095,7 @@
             new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel41, "Default", "Text", "Termination Notice Period:"),
             new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel42, "Default", "Font", new DevExpress.Drawing.DXFont("Arial", 14F, DevExpress.Drawing.DXFontStyle.Bold)),
             new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel42, "Default", "LocationFloat", new DevExpress.Utils.PointFloat(21.66667F, 530.667F)),
-            new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel42, "Default", "SizeF", new System.Drawing.SizeF(394.1667F, 23F)),
+            new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel42, "Default", "SizeF", new System.Drawing.SizeF(600F, 23F)),
             new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel42, "en-US", "SizeF", new System.Drawing.SizeF(618.3333F, 23F)),
             new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel42, "Default", "Text", "Work Time"),
             new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel43, "Default", "Font", new DevExpress.Drawing.DXFont("Arial", 9.75F, DevExpress.Drawing.DXFontStyle.Bold)),
@@ -1117,7 +1117,7 @@
             new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel46, "Default", "Text", "xrLabel46"),
             new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel47, "Default", "Font", new DevExpress.Drawing.DXFont("Arial", 14F, DevExpress.Drawing.DXFontStyle.Bold)),
             new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel47, "Default", "LocationFloat", new DevExpress.Utils.PointFloat(21.66667F, 601.0004F)),
-            new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel47, "Default", "SizeF", new System.Drawing.SizeF(394.1667F, 23F)),
+            new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel47, "Default", "SizeF", new System.Drawing.SizeF(600F, 23F)),
             new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel47, "en-US", "SizeF", new System.Drawing.SizeF(618.3333F, 23F)),
             new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel47, "Default", "Text", "Salary"),
             new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel48, "Default", "LocationFloat", new DevExpress.Utils.PointFloat(122.4999F, 638.6667F)),
@@ -1160,7 +1160,7 @@
             new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel8, "Default", "Text", "Employee Contract"),
             new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel9, "Default", "Font", new DevExpress.Drawing.DXFont("Arial", 12F, DevExpress.Drawing.DXFontStyle.Bold)),
             new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel9, "Default", "LocationFloat", new DevExpress.Utils.PointFloat(21.66667F, 0F)),
-            new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel9, "Default", "SizeF", new System.Drawing.SizeF(394.1667F, 23F)),
+            new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel9, "Default", "SizeF", new System.Drawing.SizeF(600F, 23F)),
             new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel9, "en-US", "SizeF", new System.Drawing.SizeF(618.3333F, 23F)),
             new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel9, "Default", "Text", "Company Information:")});
             this.Parameters.AddRange(new DevExpress.XtraReports.Parameters.Parameter[] {

+ 5 - 4
MTWorkHR.Application/Dtos/User/CompanyDto.cs

@@ -15,11 +15,12 @@ namespace MTWorkHR.Application.Models
 
         public string CRNumber { get; set; } //Commercial Registration
         public string? UserId { get; set; }
-        public int PhoneNumber { get; set; }
-        public int Address { get; set; }
-        public int Email { get; set; }
+        public string? PhoneNumber { get; set; }
+        public string? Address { get; set; }
+        public string? Email { get; set; }
+        public long? CountryId { get; set; }
+        public long? CityId { get; set; }
         public UserTypeEnum? UserType { get; set; }
-
         public CompanyUserDto? CompanyUser { get; set; }
         public IFormFile? ProfileImage { get; set; }
         public IFormFile? CommercialRegAttach { get; set; }

+ 6 - 2
MTWorkHR.Application/Services/User/CompanyService.cs

@@ -89,7 +89,7 @@ namespace MTWorkHR.Application.Services
             {
                 throw new AppException(ExceptionEnum.MapperIssue);
             }
-
+           
             var company = await _unitOfWork.Company.AddAsync(entity);
 
             UserCreated.CompanyId = company.Id;
@@ -101,7 +101,11 @@ namespace MTWorkHR.Application.Services
         public async Task<ApplicationUser> CreateCompanyUser(CompanyDto input)
         {
             var companyUser = MapperObject.Mapper.Map<UserDto>(input.CompanyUser);
-
+            input.Email = string.IsNullOrEmpty( input.Email)? input.CompanyUser?.Email : input.Email;
+            input.PhoneNumber = string.IsNullOrEmpty(input.PhoneNumber) ? input.CompanyUser?.PhoneNumber: input.PhoneNumber;
+            input.Address = string.IsNullOrEmpty(input.Address) ? input.CompanyUser?.UserAddress?.AddressDesc: input.Address;
+            input.CountryId = input.CountryId!=null && input.CountryId > 0 ?  input.CountryId : input.CompanyUser?.UserAddress?.CountryId;
+            input.CityId = input.CityId != null && input.CityId > 0 ?  input.CityId : input.CompanyUser?.UserAddress?.CityId;
             //UserDto companyUser = new UserDto
             //{
             //    UserType = UserTypeEnum.Business,

+ 14 - 3
MTWorkHR.Core/Entities/User/Company.cs

@@ -16,8 +16,19 @@ namespace MTWorkHR.Core.Entities
         [Filter]
         public string CRNumber { get; set; }
         public int TaxNumber { get; set; }
-        public int PhoneNumber { get; set; }
-        public int Address { get; set; }
-        public int Email { get; set; }
+        public string PhoneNumber { get; set; }
+        public string Address { get; set; }
+        public string Email { get; set; }
+
+        public long? CountryId { get; set; }
+        [ForeignKey("CountryId")]
+
+        public CountryLookup? Country { get; set; }
+
+        public long? CityId { get; set; }
+        [ForeignKey("CityId")]
+
+        public City? City { get; set; }
+
     }
 }

File diff suppressed because it is too large
+ 5663 - 0
MTWorkHR.Infrastructure/Migrations/20241030125620_altrCompanyTbl.Designer.cs


+ 129 - 0
MTWorkHR.Infrastructure/Migrations/20241030125620_altrCompanyTbl.cs

@@ -0,0 +1,129 @@
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace MTWorkHR.Infrastructure.Migrations
+{
+    /// <inheritdoc />
+    public partial class altrCompanyTbl : Migration
+    {
+        /// <inheritdoc />
+        protected override void Up(MigrationBuilder migrationBuilder)
+        {
+          
+
+            migrationBuilder.AlterColumn<string>(
+                name: "PhoneNumber",
+                table: "Companies",
+                type: "nvarchar(max)",
+                nullable: false,
+                oldClrType: typeof(int),
+                oldType: "int");
+
+            migrationBuilder.AlterColumn<string>(
+                name: "Email",
+                table: "Companies",
+                type: "nvarchar(max)",
+                nullable: false,
+                oldClrType: typeof(int),
+                oldType: "int");
+
+            migrationBuilder.AlterColumn<string>(
+                name: "Address",
+                table: "Companies",
+                type: "nvarchar(max)",
+                nullable: false,
+                oldClrType: typeof(int),
+                oldType: "int");
+
+            migrationBuilder.AddColumn<long>(
+                name: "CityId",
+                table: "Companies",
+                type: "bigint",
+                nullable: true);
+
+            migrationBuilder.AddColumn<long>(
+                name: "CountryId",
+                table: "Companies",
+                type: "bigint",
+                nullable: true);
+
+            migrationBuilder.CreateIndex(
+                name: "IX_Companies_CityId",
+                table: "Companies",
+                column: "CityId");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_Companies_CountryId",
+                table: "Companies",
+                column: "CountryId");
+
+            migrationBuilder.AddForeignKey(
+                name: "FK_Companies_Cities_CityId",
+                table: "Companies",
+                column: "CityId",
+                principalTable: "Cities",
+                principalColumn: "Id");
+
+            migrationBuilder.AddForeignKey(
+                name: "FK_Companies_CountryLookups_CountryId",
+                table: "Companies",
+                column: "CountryId",
+                principalTable: "CountryLookups",
+                principalColumn: "Id");
+        }
+
+        /// <inheritdoc />
+        protected override void Down(MigrationBuilder migrationBuilder)
+        {
+            migrationBuilder.DropForeignKey(
+                name: "FK_Companies_Cities_CityId",
+                table: "Companies");
+
+            migrationBuilder.DropForeignKey(
+                name: "FK_Companies_CountryLookups_CountryId",
+                table: "Companies");
+
+            migrationBuilder.DropIndex(
+                name: "IX_Companies_CityId",
+                table: "Companies");
+
+            migrationBuilder.DropIndex(
+                name: "IX_Companies_CountryId",
+                table: "Companies");
+
+            migrationBuilder.DropColumn(
+                name: "CityId",
+                table: "Companies");
+
+            migrationBuilder.DropColumn(
+                name: "CountryId",
+                table: "Companies");
+
+            migrationBuilder.AlterColumn<int>(
+                name: "PhoneNumber",
+                table: "Companies",
+                type: "int",
+                nullable: false,
+                oldClrType: typeof(string),
+                oldType: "nvarchar(max)");
+
+            migrationBuilder.AlterColumn<int>(
+                name: "Email",
+                table: "Companies",
+                type: "int",
+                nullable: false,
+                oldClrType: typeof(string),
+                oldType: "nvarchar(max)");
+
+            migrationBuilder.AlterColumn<int>(
+                name: "Address",
+                table: "Companies",
+                type: "int",
+                nullable: false,
+                oldClrType: typeof(string),
+                oldType: "nvarchar(max)");
+
+        }
+    }
+}

+ 34 - 13
MTWorkHR.Infrastructure/Migrations/HRDataContextModelSnapshot.cs

@@ -467,17 +467,24 @@ namespace MTWorkHR.Infrastructure.Migrations
 
                     SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));
 
-                    b.Property<int>("Address")
-                        .HasColumnType("int");
+                    b.Property<string>("Address")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
 
                     b.Property<string>("CRNumber")
                         .IsRequired()
                         .HasColumnType("nvarchar(max)");
 
+                    b.Property<long?>("CityId")
+                        .HasColumnType("bigint");
+
                     b.Property<string>("CompanyName")
                         .IsRequired()
                         .HasColumnType("nvarchar(max)");
 
+                    b.Property<long?>("CountryId")
+                        .HasColumnType("bigint");
+
                     b.Property<DateTime>("CreateDate")
                         .HasColumnType("datetime2")
                         .HasColumnOrder(3);
@@ -492,15 +499,17 @@ namespace MTWorkHR.Infrastructure.Migrations
                         .HasColumnType("nvarchar(450)")
                         .HasColumnOrder(8);
 
-                    b.Property<int>("Email")
-                        .HasColumnType("int");
+                    b.Property<string>("Email")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
 
                     b.Property<bool>("IsDeleted")
                         .HasColumnType("bit")
                         .HasColumnOrder(7);
 
-                    b.Property<int>("PhoneNumber")
-                        .HasColumnType("int");
+                    b.Property<string>("PhoneNumber")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
 
                     b.Property<int>("TaxNumber")
                         .HasColumnType("int");
@@ -520,6 +529,10 @@ namespace MTWorkHR.Infrastructure.Migrations
 
                     b.HasKey("Id");
 
+                    b.HasIndex("CityId");
+
+                    b.HasIndex("CountryId");
+
                     b.ToTable("Companies");
                 });
 
@@ -2324,13 +2337,6 @@ namespace MTWorkHR.Infrastructure.Migrations
                         },
                         new
                         {
-                            Id = 88L,
-                            CountryCode = "IL",
-                            NameAr = "إسرائيلي",
-                            NameEn = "Israeli"
-                        },
-                        new
-                        {
                             Id = 89L,
                             CountryCode = "IT",
                             NameAr = "إيطالي",
@@ -5216,6 +5222,21 @@ namespace MTWorkHR.Infrastructure.Migrations
                     b.Navigation("Country");
                 });
 
+            modelBuilder.Entity("MTWorkHR.Core.Entities.Company", b =>
+                {
+                    b.HasOne("MTWorkHR.Core.Entities.City", "City")
+                        .WithMany()
+                        .HasForeignKey("CityId");
+
+                    b.HasOne("MTWorkHR.Core.Entities.CountryLookup", "Country")
+                        .WithMany()
+                        .HasForeignKey("CountryId");
+
+                    b.Navigation("City");
+
+                    b.Navigation("Country");
+                });
+
             modelBuilder.Entity("MTWorkHR.Core.Entities.ContractAllowance", b =>
                 {
                     b.HasOne("MTWorkHR.Core.Entities.Contract", "Contract")