Correct Typo of OrganizationSize and OrganizationName
This commit is contained in:
parent
8210e250a1
commit
3915e9b9d0
@ -10,6 +10,7 @@ using Marco.Pms.Model.Mail;
|
|||||||
using Marco.Pms.Model.Master;
|
using Marco.Pms.Model.Master;
|
||||||
using Marco.Pms.Model.Projects;
|
using Marco.Pms.Model.Projects;
|
||||||
using Marco.Pms.Model.Roles;
|
using Marco.Pms.Model.Roles;
|
||||||
|
using Marco.Pms.Model.TenantModel;
|
||||||
using Marco.Pms.Model.Utilities;
|
using Marco.Pms.Model.Utilities;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.AspNetCore.Identity;
|
using Microsoft.AspNetCore.Identity;
|
||||||
@ -130,7 +131,7 @@ namespace Marco.Pms.DataAccess.Data
|
|||||||
new Tenant
|
new Tenant
|
||||||
{
|
{
|
||||||
Id = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26"),
|
Id = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26"),
|
||||||
OragnizationSize = "100-200",
|
OrganizationSize = "100-200",
|
||||||
Email = "admin@marcoaiot.com",
|
Email = "admin@marcoaiot.com",
|
||||||
Name = "MarcoBMS",
|
Name = "MarcoBMS",
|
||||||
ContactName = "Admin",
|
ContactName = "Admin",
|
||||||
|
3550
Marco.Pms.DataAccess/Migrations/20250801111158_Fixed_Spelling_Mistake_In_Tenant_Table.Designer.cs
generated
Normal file
3550
Marco.Pms.DataAccess/Migrations/20250801111158_Fixed_Spelling_Mistake_In_Tenant_Table.Designer.cs
generated
Normal file
File diff suppressed because one or more lines are too long
@ -0,0 +1,28 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace Marco.Pms.DataAccess.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class Fixed_Spelling_Mistake_In_Tenant_Table : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.RenameColumn(
|
||||||
|
name: "OragnizationSize",
|
||||||
|
table: "Tenants",
|
||||||
|
newName: "OrganizationSize");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.RenameColumn(
|
||||||
|
name: "OrganizationSize",
|
||||||
|
table: "Tenants",
|
||||||
|
newName: "OragnizationSize");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
File diff suppressed because one or more lines are too long
@ -10,11 +10,11 @@
|
|||||||
public required string BillingAddress { get; set; }
|
public required string BillingAddress { get; set; }
|
||||||
public string? TaxId { get; set; }
|
public string? TaxId { get; set; }
|
||||||
public string? logoImage { get; set; }
|
public string? logoImage { get; set; }
|
||||||
public required string OragnizationName { get; set; }
|
public required string OrganizationName { get; set; }
|
||||||
public string? OfficeNumber { get; set; }
|
public string? OfficeNumber { get; set; }
|
||||||
public required string ContactNumber { get; set; }
|
public required string ContactNumber { get; set; }
|
||||||
public required DateTime OnBoardingDate { get; set; }
|
public required DateTime OnBoardingDate { get; set; }
|
||||||
public required string OragnizationSize { get; set; }
|
public required string OrganizationSize { get; set; }
|
||||||
public required Guid IndustryId { get; set; }
|
public required Guid IndustryId { get; set; }
|
||||||
public required string Reference { get; set; }
|
public required string Reference { get; set; }
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
|
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
||||||
namespace Marco.Pms.Model.Entitlements
|
namespace Marco.Pms.Model.TenantModel
|
||||||
{
|
{
|
||||||
public class Tenant
|
public class Tenant
|
||||||
{
|
{
|
||||||
@ -18,7 +18,7 @@ namespace Marco.Pms.Model.Entitlements
|
|||||||
public string? TaxId { get; set; }
|
public string? TaxId { get; set; }
|
||||||
public string? logoImage { get; set; } // Base64
|
public string? logoImage { get; set; } // Base64
|
||||||
public DateTime OnBoardingDate { get; set; }
|
public DateTime OnBoardingDate { get; set; }
|
||||||
public string? OragnizationSize { get; set; }
|
public string? OrganizationSize { get; set; }
|
||||||
public Guid? IndustryId { get; set; }
|
public Guid? IndustryId { get; set; }
|
||||||
|
|
||||||
[ForeignKey("IndustryId")]
|
[ForeignKey("IndustryId")]
|
@ -1,6 +1,6 @@
|
|||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using Marco.Pms.Model.TenantModel;
|
||||||
using Marco.Pms.Model.Entitlements;
|
|
||||||
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
|
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
||||||
namespace Marco.Pms.Model.Utilities
|
namespace Marco.Pms.Model.Utilities
|
||||||
{
|
{
|
||||||
|
@ -5,6 +5,7 @@ using Marco.Pms.Model.Employees;
|
|||||||
using Marco.Pms.Model.Entitlements;
|
using Marco.Pms.Model.Entitlements;
|
||||||
using Marco.Pms.Model.Projects;
|
using Marco.Pms.Model.Projects;
|
||||||
using Marco.Pms.Model.Roles;
|
using Marco.Pms.Model.Roles;
|
||||||
|
using Marco.Pms.Model.TenantModel;
|
||||||
using Marco.Pms.Model.Utilities;
|
using Marco.Pms.Model.Utilities;
|
||||||
using Marco.Pms.Model.ViewModels.Activities;
|
using Marco.Pms.Model.ViewModels.Activities;
|
||||||
using Marco.Pms.Model.ViewModels.Tenant;
|
using Marco.Pms.Model.ViewModels.Tenant;
|
||||||
@ -211,7 +212,7 @@ namespace Marco.Pms.Services.Controllers
|
|||||||
var _emailSender = scope.ServiceProvider.GetRequiredService<IEmailSender>();
|
var _emailSender = scope.ServiceProvider.GetRequiredService<IEmailSender>();
|
||||||
var _permissionService = scope.ServiceProvider.GetRequiredService<PermissionServices>();
|
var _permissionService = scope.ServiceProvider.GetRequiredService<PermissionServices>();
|
||||||
|
|
||||||
_logger.LogInfo("Attempting to create a new tenant with organization name: {OrganizationName}", model.OragnizationName);
|
_logger.LogInfo("Attempting to create a new tenant with organization name: {OrganizationName}", model.OrganizationName);
|
||||||
|
|
||||||
// 1. --- PERMISSION CHECK ---
|
// 1. --- PERMISSION CHECK ---
|
||||||
var loggedInEmployee = await _userHelper.GetCurrentEmployeeAsync();
|
var loggedInEmployee = await _userHelper.GetCurrentEmployeeAsync();
|
||||||
@ -314,7 +315,7 @@ namespace Marco.Pms.Services.Controllers
|
|||||||
// If user creation fails, roll back the transaction immediately and return the errors.
|
// If user creation fails, roll back the transaction immediately and return the errors.
|
||||||
await transaction.RollbackAsync();
|
await transaction.RollbackAsync();
|
||||||
var errors = result.Errors.Select(e => e.Description).ToList();
|
var errors = result.Errors.Select(e => e.Description).ToList();
|
||||||
_logger.LogWarning("Failed to create ApplicationUser for tenant {TenantName}. Errors: {Errors}", model.OragnizationName, string.Join(", ", errors));
|
_logger.LogWarning("Failed to create ApplicationUser for tenant {TenantName}. Errors: {Errors}", model.OrganizationName, string.Join(", ", errors));
|
||||||
return BadRequest(ApiResponse<object>.ErrorResponse("Failed to create user", errors, 400));
|
return BadRequest(ApiResponse<object>.ErrorResponse("Failed to create user", errors, 400));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -385,7 +386,7 @@ namespace Marco.Pms.Services.Controllers
|
|||||||
// Create a default project for the new tenant
|
// Create a default project for the new tenant
|
||||||
var project = new Project
|
var project = new Project
|
||||||
{
|
{
|
||||||
Name = $"{model.OragnizationName} - Default Project",
|
Name = $"{model.OrganizationName} - Default Project",
|
||||||
ProjectStatusId = Guid.Parse("b74da4c2-d07e-46f2-9919-e75e49b12731"), // Consider using a constant for this GUID
|
ProjectStatusId = Guid.Parse("b74da4c2-d07e-46f2-9919-e75e49b12731"), // Consider using a constant for this GUID
|
||||||
ProjectAddress = model.BillingAddress,
|
ProjectAddress = model.BillingAddress,
|
||||||
ContactPerson = tenant.ContactName,
|
ContactPerson = tenant.ContactName,
|
||||||
|
@ -2,10 +2,10 @@ using AutoMapper;
|
|||||||
using Marco.Pms.Model.Dtos.Project;
|
using Marco.Pms.Model.Dtos.Project;
|
||||||
using Marco.Pms.Model.Dtos.Tenant;
|
using Marco.Pms.Model.Dtos.Tenant;
|
||||||
using Marco.Pms.Model.Employees;
|
using Marco.Pms.Model.Employees;
|
||||||
using Marco.Pms.Model.Entitlements;
|
|
||||||
using Marco.Pms.Model.Master;
|
using Marco.Pms.Model.Master;
|
||||||
using Marco.Pms.Model.MongoDBModels;
|
using Marco.Pms.Model.MongoDBModels;
|
||||||
using Marco.Pms.Model.Projects;
|
using Marco.Pms.Model.Projects;
|
||||||
|
using Marco.Pms.Model.TenantModel;
|
||||||
using Marco.Pms.Model.ViewModels.Activities;
|
using Marco.Pms.Model.ViewModels.Activities;
|
||||||
using Marco.Pms.Model.ViewModels.Employee;
|
using Marco.Pms.Model.ViewModels.Employee;
|
||||||
using Marco.Pms.Model.ViewModels.Projects;
|
using Marco.Pms.Model.ViewModels.Projects;
|
||||||
@ -27,7 +27,7 @@ namespace Marco.Pms.Services.MappingProfiles
|
|||||||
)
|
)
|
||||||
.ForMember(
|
.ForMember(
|
||||||
dest => dest.Name,
|
dest => dest.Name,
|
||||||
opt => opt.MapFrom(src => src.OragnizationName)
|
opt => opt.MapFrom(src => src.OrganizationName)
|
||||||
);
|
);
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@ using Marco.Pms.Model.Employees;
|
|||||||
using Marco.Pms.Model.Entitlements;
|
using Marco.Pms.Model.Entitlements;
|
||||||
using Marco.Pms.Model.MongoDBModels;
|
using Marco.Pms.Model.MongoDBModels;
|
||||||
using Marco.Pms.Model.Projects;
|
using Marco.Pms.Model.Projects;
|
||||||
|
using Marco.Pms.Model.TenantModel;
|
||||||
using Marco.Pms.Model.Utilities;
|
using Marco.Pms.Model.Utilities;
|
||||||
using Marco.Pms.Model.ViewModels.Employee;
|
using Marco.Pms.Model.ViewModels.Employee;
|
||||||
using Marco.Pms.Model.ViewModels.Projects;
|
using Marco.Pms.Model.ViewModels.Projects;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user