Fixed Confilt
This commit is contained in:
commit
dc9b696265
@ -10,8 +10,8 @@ namespace Marco.Pms.Model.Activities
|
|||||||
public long TaskAllocationId { get; set; }
|
public long TaskAllocationId { get; set; }
|
||||||
[ValidateNever]
|
[ValidateNever]
|
||||||
[ForeignKey(nameof(TaskAllocationId))]
|
[ForeignKey(nameof(TaskAllocationId))]
|
||||||
public TaskAllocation TaskAllocation { get; set; }
|
public TaskAllocation? TaskAllocation { get; set; }
|
||||||
|
|
||||||
public string ImagePath { get; set; }
|
public string? ImagePath { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
using Marco.Pms.Model.Dtos.Attendance;
|
using System.ComponentModel;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using Marco.Pms.Model.Dtos.Attendance;
|
||||||
using Marco.Pms.Model.Employees;
|
using Marco.Pms.Model.Employees;
|
||||||
using Marco.Pms.Model.Entitlements;
|
using Marco.Pms.Model.Entitlements;
|
||||||
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
|
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
|
||||||
using System.ComponentModel;
|
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
|
||||||
|
|
||||||
|
|
||||||
namespace Marco.Pms.Model.AttendanceModule
|
namespace Marco.Pms.Model.AttendanceModule
|
||||||
|
@ -2,9 +2,9 @@
|
|||||||
{
|
{
|
||||||
public class JwtSettings
|
public class JwtSettings
|
||||||
{
|
{
|
||||||
public string Key { get; set; }
|
public string? Key { get; set; }
|
||||||
public string Issuer { get; set; }
|
public string? Issuer { get; set; }
|
||||||
public string Audience { get; set; }
|
public string? Audience { get; set; }
|
||||||
public int ExpiresInMinutes { get; set; }
|
public int ExpiresInMinutes { get; set; }
|
||||||
public int RefreshTokenExpiresInDays { get; set; }
|
public int RefreshTokenExpiresInDays { get; set; }
|
||||||
}
|
}
|
||||||
|
@ -4,8 +4,8 @@
|
|||||||
{
|
{
|
||||||
public DateTime AssignmentDate { get; set; }
|
public DateTime AssignmentDate { get; set; }
|
||||||
public double PlannedTask { get; set; }
|
public double PlannedTask { get; set; }
|
||||||
public string Description { get; set; }
|
public string? Description { get; set; }
|
||||||
public List<int> TaskTeam { get; set; } //Employee Ids
|
public List<int>? TaskTeam { get; set; } //Employee Ids
|
||||||
public int WorkItemId { get; set; }
|
public int WorkItemId { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
using System.ComponentModel;
|
namespace Marco.Pms.Model.Dtos.Activities
|
||||||
|
|
||||||
namespace Marco.Pms.Model.Dtos.Activities
|
|
||||||
{
|
{
|
||||||
public class CreateActivityMasterDto
|
public class CreateActivityMasterDto
|
||||||
{
|
{
|
||||||
public string ActivityName { get; set; }
|
public string? ActivityName { get; set; }
|
||||||
public string UnitOfMeasurement { get; set; }
|
public string? UnitOfMeasurement { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
public long TaskAllocationId { get; set; }
|
public long TaskAllocationId { get; set; }
|
||||||
|
|
||||||
public DateTime CommentDate { get; set; }
|
public DateTime CommentDate { get; set; }
|
||||||
public string Comment { get; set; }
|
public string? Comment { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,6 @@
|
|||||||
public long Id { get; set; }
|
public long Id { get; set; }
|
||||||
public double CompletedTask { get; set; }
|
public double CompletedTask { get; set; }
|
||||||
public DateTime ReportedDate { get; set; }
|
public DateTime ReportedDate { get; set; }
|
||||||
public string Comment { get; set; }
|
public string? Comment { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,15 +5,15 @@ namespace Marco.Pms.Model.Dtos.Attendance
|
|||||||
public class RecordAttendanceDot
|
public class RecordAttendanceDot
|
||||||
{
|
{
|
||||||
public int? Id { get; set; }
|
public int? Id { get; set; }
|
||||||
public string Comment { get; set; }
|
public string? Comment { get; set; }
|
||||||
public int EmployeeID { get; set; }
|
public int EmployeeID { get; set; }
|
||||||
public int ProjectID { get; set; }
|
public int ProjectID { get; set; }
|
||||||
|
|
||||||
public DateTime Date { get; set; }
|
public DateTime Date { get; set; }
|
||||||
|
|
||||||
public string? MarkTime { get; set; }
|
public string? MarkTime { get; set; }
|
||||||
public string Latitude { get; set; }
|
public string? Latitude { get; set; }
|
||||||
public string Longitude { get; set; }
|
public string? Longitude { get; set; }
|
||||||
|
|
||||||
|
|
||||||
public ATTENDANCE_MARK_TYPE Action { get; set; }
|
public ATTENDANCE_MARK_TYPE Action { get; set; }
|
||||||
|
@ -7,27 +7,27 @@ namespace Marco.Pms.Model.Dtos.Employees
|
|||||||
{
|
{
|
||||||
public ApplicationUserDto() { }
|
public ApplicationUserDto() { }
|
||||||
public int? Id { get; set; }
|
public int? Id { get; set; }
|
||||||
public string FirstName { get; set; }
|
public string? FirstName { get; set; }
|
||||||
public string LastName { get; set; }
|
public string? LastName { get; set; }
|
||||||
public string? MiddleName { get; set; }
|
public string? MiddleName { get; set; }
|
||||||
public string? Email { get; set; }
|
public string? Email { get; set; }
|
||||||
|
|
||||||
public string Gender { get; set; }
|
public string? Gender { get; set; }
|
||||||
public DateTime? BirthDate { get; set; }
|
public DateTime? BirthDate { get; set; }
|
||||||
public DateTime? JoiningDate { get; set; }
|
public DateTime? JoiningDate { get; set; }
|
||||||
|
|
||||||
public string PermanentAddress { get; set; }
|
public string? PermanentAddress { get; set; }
|
||||||
public string CurrentAddress { get; set; }
|
public string? CurrentAddress { get; set; }
|
||||||
public string PhoneNumber { get; set; }
|
public string? PhoneNumber { get; set; }
|
||||||
|
|
||||||
public string EmergencyPhoneNumber { get; set; }
|
public string? EmergencyPhoneNumber { get; set; }
|
||||||
|
|
||||||
public string? AadharNumber { get; set; }
|
public string? AadharNumber { get; set; }
|
||||||
|
|
||||||
public string? PanNumber { get; set; }
|
public string? PanNumber { get; set; }
|
||||||
|
|
||||||
public IFormFile? Photo { get; set; } // To store the captured photo
|
public IFormFile? Photo { get; set; } // To store the captured photo
|
||||||
public List<IFormFile> Documents { get; set; }
|
public List<IFormFile>? Documents { get; set; }
|
||||||
public string? ApplicationUserId { get; set; }
|
public string? ApplicationUserId { get; set; }
|
||||||
|
|
||||||
public Guid RoleId { get; set; }
|
public Guid RoleId { get; set; }
|
||||||
|
@ -1,19 +1,8 @@
|
|||||||
using Marco.Pms.Model.Employees;
|
namespace Marco.Pms.Model.Dtos.Employees
|
||||||
using Marco.Pms.Model.Entitlements;
|
|
||||||
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Marco.Pms.Model.Dtos.Employees
|
|
||||||
{
|
{
|
||||||
public class AttendanceDto
|
public class AttendanceDto
|
||||||
{
|
{
|
||||||
public string Comment { get; set; }
|
public string? Comment { get; set; }
|
||||||
public int EmployeeID { get; set; }
|
public int EmployeeID { get; set; }
|
||||||
public DateTime? InTime { get; set; }
|
public DateTime? InTime { get; set; }
|
||||||
public DateTime? OutTime { get; set; }
|
public DateTime? OutTime { get; set; }
|
||||||
|
@ -1,30 +1,23 @@
|
|||||||
using Microsoft.AspNetCore.Http;
|
namespace Marco.Pms.Model.Dtos.Employees
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Marco.Pms.Model.Dtos.Employees
|
|
||||||
{
|
{
|
||||||
public class CreateUserDto
|
public class CreateUserDto
|
||||||
{
|
{
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
public string FirstName { get; set; }
|
public string? FirstName { get; set; }
|
||||||
public string LastName { get; set; }
|
public string? LastName { get; set; }
|
||||||
public string? MiddleName { get; set; }
|
public string? MiddleName { get; set; }
|
||||||
public string? Email { get; set; }
|
public string? Email { get; set; }
|
||||||
|
|
||||||
public string Gender { get; set; }
|
public string? Gender { get; set; }
|
||||||
public string? BirthDate { get; set; }
|
public string? BirthDate { get; set; }
|
||||||
public string JoiningDate { get; set; }
|
public string? JoiningDate { get; set; }
|
||||||
|
|
||||||
public string? PermanentAddress { get; set; }
|
public string? PermanentAddress { get; set; }
|
||||||
public string? CurrentAddress { get; set; }
|
public string? CurrentAddress { get; set; }
|
||||||
public string PhoneNumber { get; set; }
|
public string? PhoneNumber { get; set; }
|
||||||
|
|
||||||
public string EmergencyPhoneNumber { get; set; }
|
public string? EmergencyPhoneNumber { get; set; }
|
||||||
public string EmergencyContactPerson { get; set; }
|
public string? EmergencyContactPerson { get; set; }
|
||||||
|
|
||||||
public string? AadharNumber { get; set; }
|
public string? AadharNumber { get; set; }
|
||||||
|
|
||||||
@ -33,25 +26,25 @@ namespace Marco.Pms.Model.Dtos.Employees
|
|||||||
//public IFormFile? Photo { get; set; } // To store the captured photo
|
//public IFormFile? Photo { get; set; } // To store the captured photo
|
||||||
//public List<IFormFile>? Documents { get; set; }
|
//public List<IFormFile>? Documents { get; set; }
|
||||||
|
|
||||||
public string JobRoleId { get; set; }
|
public string? JobRoleId { get; set; }
|
||||||
|
|
||||||
// public int TenantId { get; set; }
|
// public int TenantId { get; set; }
|
||||||
}
|
}
|
||||||
public class CreateQuickUserDto
|
public class CreateQuickUserDto
|
||||||
{
|
{
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
public string FirstName { get; set; }
|
public string? FirstName { get; set; }
|
||||||
public string LastName { get; set; }
|
public string? LastName { get; set; }
|
||||||
|
|
||||||
public string Gender { get; set; }
|
public string? Gender { get; set; }
|
||||||
|
|
||||||
public string? CurrentAddress { get; set; }
|
public string? CurrentAddress { get; set; }
|
||||||
public string PhoneNumber { get; set; }
|
public string? PhoneNumber { get; set; }
|
||||||
|
|
||||||
public string EmergencyPhoneNumber { get; set; }
|
public string? EmergencyPhoneNumber { get; set; }
|
||||||
public string EmergencyContactPerson { get; set; }
|
public string? EmergencyContactPerson { get; set; }
|
||||||
|
|
||||||
public string JobRoleId { get; set; }
|
public string? JobRoleId { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,4 @@
|
|||||||
using System;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel.DataAnnotations;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Marco.Pms.Model.Dtos
|
namespace Marco.Pms.Model.Dtos
|
||||||
{
|
{
|
||||||
@ -11,6 +6,6 @@ namespace Marco.Pms.Model.Dtos
|
|||||||
{
|
{
|
||||||
[Required]
|
[Required]
|
||||||
[EmailAddress]
|
[EmailAddress]
|
||||||
public string Email { get; set; }
|
public string? Email { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,14 +1,8 @@
|
|||||||
using System;
|
namespace Marco.Pms.Model.Dtos
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Marco.Pms.Model.Dtos
|
|
||||||
{
|
{
|
||||||
public class LoginDto
|
public class LoginDto
|
||||||
{
|
{
|
||||||
public string Username { get; set; }
|
public string? Username { get; set; }
|
||||||
public string Password { get; set; }
|
public string? Password { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,6 @@
|
|||||||
namespace Marco.Pms.Model.Dtos
|
namespace Marco.Pms.Model.Dtos
|
||||||
{
|
{
|
||||||
public class LogoutDto
|
public class LogoutDto
|
||||||
{ public string RefreshToken { get; set; }
|
{ public string? RefreshToken { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,13 +1,5 @@
|
|||||||
using Marco.Pms.Model.Entitlements;
|
using System.ComponentModel;
|
||||||
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Marco.Pms.Model.Dtos.Project
|
namespace Marco.Pms.Model.Dtos.Project
|
||||||
{
|
{
|
||||||
@ -17,7 +9,7 @@ namespace Marco.Pms.Model.Dtos.Project
|
|||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
[Required]
|
[Required]
|
||||||
[DisplayName("Building Name")]
|
[DisplayName("Building Name")]
|
||||||
public string Name { get; set; }
|
public string? Name { get; set; }
|
||||||
public string? Description { get; set; }
|
public string? Description { get; set; }
|
||||||
public int ProjectId { get; set; }
|
public int ProjectId { get; set; }
|
||||||
|
|
||||||
|
@ -5,10 +5,10 @@ namespace Marco.Pms.Model.Dtos.Project
|
|||||||
public class BuildingVM
|
public class BuildingVM
|
||||||
{
|
{
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
public string Name { get; set; }
|
public string? Name { get; set; }
|
||||||
public string? Description { get; set; }
|
public string? Description { get; set; }
|
||||||
|
|
||||||
public List<FloorsVM> Floors { get; set; }
|
public List<FloorsVM>? Floors { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,15 +8,15 @@ namespace Marco.Pms.Model.Dtos.Project
|
|||||||
//public int Id { get; set; }
|
//public int Id { get; set; }
|
||||||
[Required(ErrorMessage = "Project Name is required!")]
|
[Required(ErrorMessage = "Project Name is required!")]
|
||||||
[DisplayName("Project Name")]
|
[DisplayName("Project Name")]
|
||||||
public string Name { get; set; }
|
public string? Name { get; set; }
|
||||||
|
|
||||||
[DisplayName("Project Address")]
|
[DisplayName("Project Address")]
|
||||||
[Required(ErrorMessage = "Project Address is required!")]
|
[Required(ErrorMessage = "Project Address is required!")]
|
||||||
public string ProjectAddress { get; set; }
|
public string? ProjectAddress { get; set; }
|
||||||
|
|
||||||
|
|
||||||
[DisplayName("Contact Person")]
|
[DisplayName("Contact Person")]
|
||||||
public string ContactPerson { get; set; }
|
public string? ContactPerson { get; set; }
|
||||||
|
|
||||||
|
|
||||||
public DateTime? StartDate { get; set; }
|
public DateTime? StartDate { get; set; }
|
||||||
|
@ -1,14 +1,5 @@
|
|||||||
using Marco.Pms.Model.Entitlements;
|
using System.ComponentModel;
|
||||||
using Marco.Pms.Model.Projects;
|
|
||||||
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Marco.Pms.Model.Dtos.Project
|
namespace Marco.Pms.Model.Dtos.Project
|
||||||
{
|
{
|
||||||
@ -18,7 +9,7 @@ namespace Marco.Pms.Model.Dtos.Project
|
|||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
[DisplayName("Floor Name")]
|
[DisplayName("Floor Name")]
|
||||||
public string FloorName { get; set; }
|
public string? FloorName { get; set; }
|
||||||
|
|
||||||
|
|
||||||
public int BuildingId { get; set; }
|
public int BuildingId { get; set; }
|
||||||
|
@ -1,10 +1,5 @@
|
|||||||
using System;
|
using System.ComponentModel;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Marco.Pms.Model.Dtos.Project
|
namespace Marco.Pms.Model.Dtos.Project
|
||||||
{
|
{
|
||||||
@ -14,9 +9,9 @@ namespace Marco.Pms.Model.Dtos.Project
|
|||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
[DisplayName("Floor Name")]
|
[DisplayName("Floor Name")]
|
||||||
public string FloorName { get; set; }
|
public string? FloorName { get; set; }
|
||||||
|
|
||||||
public List<WorkAreaVM> WorkAreas { get; set; }
|
public List<WorkAreaVM>? WorkAreas { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,4 @@
|
|||||||
using Marco.Pms.Model.Projects;
|
namespace Marco.Pms.Model.Dtos.Project
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Marco.Pms.Model.Dtos.Project
|
|
||||||
{
|
{
|
||||||
public class InfraDot
|
public class InfraDot
|
||||||
{
|
{
|
||||||
|
@ -1,14 +1,5 @@
|
|||||||
using Marco.Pms.Model.Entitlements;
|
using System.ComponentModel;
|
||||||
using Marco.Pms.Model.Projects;
|
|
||||||
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Marco.Pms.Model.Dtos.Project
|
namespace Marco.Pms.Model.Dtos.Project
|
||||||
{
|
{
|
||||||
@ -17,15 +8,15 @@ namespace Marco.Pms.Model.Dtos.Project
|
|||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
[Required(ErrorMessage = "Project Name is required!")]
|
[Required(ErrorMessage = "Project Name is required!")]
|
||||||
[DisplayName("Project Name")]
|
[DisplayName("Project Name")]
|
||||||
public string Name { get; set; }
|
public string? Name { get; set; }
|
||||||
|
|
||||||
[DisplayName("Project Address")]
|
[DisplayName("Project Address")]
|
||||||
[Required(ErrorMessage = "Project Address is required!")]
|
[Required(ErrorMessage = "Project Address is required!")]
|
||||||
public string ProjectAddress { get; set; }
|
public string? ProjectAddress { get; set; }
|
||||||
|
|
||||||
|
|
||||||
[DisplayName("Contact Person")]
|
[DisplayName("Contact Person")]
|
||||||
public string ContactPerson { get; set; }
|
public string? ContactPerson { get; set; }
|
||||||
|
|
||||||
|
|
||||||
public DateTime? StartDate { get; set; }
|
public DateTime? StartDate { get; set; }
|
||||||
|
@ -1,15 +1,8 @@
|
|||||||
using Marco.Pms.Model.Projects;
|
namespace Marco.Pms.Model.Dtos.Project
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Marco.Pms.Model.Dtos.Project
|
|
||||||
{
|
{
|
||||||
public class ProjectVM : ProjectDto
|
public class ProjectVM : ProjectDto
|
||||||
{
|
{
|
||||||
public List<BuildingVM> Buildings { get; set; }
|
public List<BuildingVM>? Buildings { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,15 +8,15 @@ namespace Marco.Pms.Model.Dtos.Project
|
|||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
[Required(ErrorMessage = "Project Name is required!")]
|
[Required(ErrorMessage = "Project Name is required!")]
|
||||||
[DisplayName("Project Name")]
|
[DisplayName("Project Name")]
|
||||||
public string Name { get; set; }
|
public string? Name { get; set; }
|
||||||
|
|
||||||
[DisplayName("Project Address")]
|
[DisplayName("Project Address")]
|
||||||
[Required(ErrorMessage = "Project Address is required!")]
|
[Required(ErrorMessage = "Project Address is required!")]
|
||||||
public string ProjectAddress { get; set; }
|
public string? ProjectAddress { get; set; }
|
||||||
|
|
||||||
|
|
||||||
[DisplayName("Contact Person")]
|
[DisplayName("Contact Person")]
|
||||||
public string ContactPerson { get; set; }
|
public string? ContactPerson { get; set; }
|
||||||
|
|
||||||
|
|
||||||
public DateTime? StartDate { get; set; }
|
public DateTime? StartDate { get; set; }
|
||||||
|
@ -1,14 +1,5 @@
|
|||||||
using Marco.Pms.Model.Entitlements;
|
using System.ComponentModel;
|
||||||
using Marco.Pms.Model.Projects;
|
|
||||||
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Marco.Pms.Model.Dtos.Project
|
namespace Marco.Pms.Model.Dtos.Project
|
||||||
{
|
{
|
||||||
@ -19,7 +10,7 @@ namespace Marco.Pms.Model.Dtos.Project
|
|||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
[DisplayName("Area Name")]
|
[DisplayName("Area Name")]
|
||||||
public string AreaName { get; set; }
|
public string? AreaName { get; set; }
|
||||||
|
|
||||||
public int FloorId { get; set; }
|
public int FloorId { get; set; }
|
||||||
|
|
||||||
|
@ -1,10 +1,5 @@
|
|||||||
using System;
|
using System.ComponentModel;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Marco.Pms.Model.Dtos.Project
|
namespace Marco.Pms.Model.Dtos.Project
|
||||||
{
|
{
|
||||||
@ -14,9 +9,9 @@ namespace Marco.Pms.Model.Dtos.Project
|
|||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
[DisplayName("Area Name")]
|
[DisplayName("Area Name")]
|
||||||
public string AreaName { get; set; }
|
public string? AreaName { get; set; }
|
||||||
|
|
||||||
public List<WorkItemVM> WorkItems { get; set; }
|
public List<WorkItemVM>? WorkItems { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,6 @@ namespace Marco.Pms.Model.Dtos.Project
|
|||||||
public class WorkItemVM
|
public class WorkItemVM
|
||||||
{
|
{
|
||||||
public int WorkItemId { get; set; }
|
public int WorkItemId { get; set; }
|
||||||
public WorkItem WorkItem { get; set; }
|
public WorkItem? WorkItem { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,14 +1,8 @@
|
|||||||
using System;
|
namespace Marco.Pms.Model.Dtos
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Marco.Pms.Model.Dtos
|
|
||||||
{
|
{
|
||||||
public class RefreshTokenDto
|
public class RefreshTokenDto
|
||||||
{
|
{
|
||||||
public string Token { get; set; }
|
public string? Token { get; set; }
|
||||||
public string RefreshToken { get; set; }
|
public string? RefreshToken { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,26 +1,21 @@
|
|||||||
using System;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel.DataAnnotations;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Marco.Pms.Model.Dtos
|
namespace Marco.Pms.Model.Dtos
|
||||||
{
|
{
|
||||||
public class RegisterDto
|
public class RegisterDto
|
||||||
{
|
{
|
||||||
[Required]
|
[Required]
|
||||||
public string Username { get; set; }
|
public string? Username { get; set; }
|
||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
[EmailAddress]
|
[EmailAddress]
|
||||||
public string Email { get; set; }
|
public string? Email { get; set; }
|
||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
[MinLength(6)]
|
[MinLength(6)]
|
||||||
public string Password { get; set; }
|
public string? Password { get; set; }
|
||||||
|
|
||||||
[Compare("Password", ErrorMessage = "Passwords do not match.")]
|
[Compare("Password", ErrorMessage = "Passwords do not match.")]
|
||||||
public string ConfirmPassword { get; set; }
|
public string? ConfirmPassword { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,13 +6,13 @@ namespace Marco.Pms.Model.Dtos
|
|||||||
{
|
{
|
||||||
[Required]
|
[Required]
|
||||||
[EmailAddress]
|
[EmailAddress]
|
||||||
public string Email { get; set; }
|
public string? Email { get; set; }
|
||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
public string Token { get; set; }
|
public string? Token { get; set; }
|
||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
[MinLength(6)]
|
[MinLength(6)]
|
||||||
public string NewPassword { get; set; }
|
public string? NewPassword { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,5 @@
|
|||||||
using Marco.Pms.Model.Entitlements;
|
using System.ComponentModel;
|
||||||
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
|
||||||
|
|
||||||
namespace Marco.Pms.Model.Dtos.Roles
|
namespace Marco.Pms.Model.Dtos.Roles
|
||||||
{
|
{
|
||||||
@ -11,13 +8,13 @@ namespace Marco.Pms.Model.Dtos.Roles
|
|||||||
[Required(ErrorMessage = "Role Name is required!")]
|
[Required(ErrorMessage = "Role Name is required!")]
|
||||||
[DisplayName("Name")]
|
[DisplayName("Name")]
|
||||||
|
|
||||||
public string Role { get; set; }
|
public string? Role { get; set; }
|
||||||
|
|
||||||
[Required(ErrorMessage = "Role Description is required!")]
|
[Required(ErrorMessage = "Role Description is required!")]
|
||||||
[DisplayName("Description")]
|
[DisplayName("Description")]
|
||||||
|
|
||||||
public string Description { get; set; }
|
public string? Description { get; set; }
|
||||||
|
|
||||||
public List<FeaturesPermissionDto> FeaturesPermission { get; set; } // Features assigned to this role
|
public List<FeaturesPermissionDto>? FeaturesPermission { get; set; } // Features assigned to this role
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,14 +1,8 @@
|
|||||||
using System;
|
namespace Marco.Pms.Model.Dtos.Roles
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Marco.Pms.Model.Dtos.Roles
|
|
||||||
{
|
{
|
||||||
public class CreateJobRoleDto
|
public class CreateJobRoleDto
|
||||||
{
|
{
|
||||||
public string Name { get; set; }
|
public string? Name { get; set; }
|
||||||
public string? Description { get; set; }
|
public string? Description { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
using Marco.Pms.Model.Entitlements;
|
using System.ComponentModel;
|
||||||
using System.ComponentModel;
|
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
namespace Marco.Pms.Model.Dtos.Roles
|
namespace Marco.Pms.Model.Dtos.Roles
|
||||||
@ -11,15 +10,15 @@ namespace Marco.Pms.Model.Dtos.Roles
|
|||||||
[Required(ErrorMessage = "Role Name is required!")]
|
[Required(ErrorMessage = "Role Name is required!")]
|
||||||
[DisplayName("Name")]
|
[DisplayName("Name")]
|
||||||
|
|
||||||
public string Role { get; set; }
|
public string? Role { get; set; }
|
||||||
|
|
||||||
[Required(ErrorMessage = "Role Description is required!")]
|
[Required(ErrorMessage = "Role Description is required!")]
|
||||||
[DisplayName("Description")]
|
[DisplayName("Description")]
|
||||||
|
|
||||||
public string Description { get; set; }
|
public string? Description { get; set; }
|
||||||
|
|
||||||
|
|
||||||
public List<FeaturesPermissionDto> FeaturesPermission { get; set; } // Features assigned to this role
|
public List<FeaturesPermissionDto>? FeaturesPermission { get; set; } // Features assigned to this role
|
||||||
}
|
}
|
||||||
|
|
||||||
public class FeaturesPermissionDto
|
public class FeaturesPermissionDto
|
||||||
|
@ -1,15 +1,9 @@
|
|||||||
using System;
|
namespace Marco.Pms.Model.Dtos.Roles
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Marco.Pms.Model.Dtos.Roles
|
|
||||||
{
|
{
|
||||||
public class UpdateJobRoleDto
|
public class UpdateJobRoleDto
|
||||||
{
|
{
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
public string Name { get; set; }
|
public string? Name { get; set; }
|
||||||
public string? Description { get; set; }
|
public string? Description { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,10 +2,10 @@
|
|||||||
{
|
{
|
||||||
public class EmailDot
|
public class EmailDot
|
||||||
{
|
{
|
||||||
public string ToEmail { get; set; }
|
public string? ToEmail { get; set; }
|
||||||
public string FromEmail { get; set; }
|
public string? FromEmail { get; set; }
|
||||||
public string MailBody { get; set; }
|
public string? MailBody { get; set; }
|
||||||
public string MailSubject { get; set; }
|
public string? MailSubject { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,4 @@
|
|||||||
using System;
|
namespace Marco.Pms.Model.Employees
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Marco.Pms.Model.Employees
|
|
||||||
{
|
{
|
||||||
public class EmployeeDetails : Employee
|
public class EmployeeDetails : Employee
|
||||||
{
|
{
|
||||||
|
@ -6,16 +6,16 @@ namespace Marco.Pms.Model.Employees
|
|||||||
public class EmployeeDocument
|
public class EmployeeDocument
|
||||||
{
|
{
|
||||||
public Guid Id { get; set; } // Unique identifier for the document
|
public Guid Id { get; set; } // Unique identifier for the document
|
||||||
public string FileName { get; set; } // Original file name
|
public string? FileName { get; set; } // Original file name
|
||||||
public string FilePath { get; set; } // Path to the stored file
|
public string? FilePath { get; set; } // Path to the stored file
|
||||||
public string FileType { get; set; } // Type of the document (e.g., PDF, JPG)
|
public string? FileType { get; set; } // Type of the document (e.g., PDF, JPG)
|
||||||
public long FileSize { get; set; } // File size in bytes
|
public long FileSize { get; set; } // File size in bytes
|
||||||
public DateTime UploadedAt { get; set; } // Timestamp of upload
|
public DateTime UploadedAt { get; set; } // Timestamp of upload
|
||||||
|
|
||||||
public Guid EmployeeId { get; set; } // Foreign key to Employee
|
public Guid EmployeeId { get; set; } // Foreign key to Employee
|
||||||
[ValidateNever]
|
[ValidateNever]
|
||||||
[ForeignKey(nameof(EmployeeId))]
|
[ForeignKey(nameof(EmployeeId))]
|
||||||
public Employee Employee { get; set; } // Navigation property to Employee
|
public Employee? Employee { get; set; } // Navigation property to Employee
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
using Marco.Pms.Model.Employees;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Marco.Pms.Model.Employees;
|
||||||
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
|
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
|
||||||
|
|
||||||
namespace Marco.Pms.Model.Entitlements
|
namespace Marco.Pms.Model.Entitlements
|
||||||
{
|
{
|
||||||
|
@ -2,8 +2,7 @@
|
|||||||
using Marco.Pms.Model.Dtos.Activities;
|
using Marco.Pms.Model.Dtos.Activities;
|
||||||
using Marco.Pms.Model.Entitlements;
|
using Marco.Pms.Model.Entitlements;
|
||||||
using Marco.Pms.Model.ViewModels.Activities;
|
using Marco.Pms.Model.ViewModels.Activities;
|
||||||
using Microsoft.Extensions.DependencyModel;
|
#nullable disable
|
||||||
|
|
||||||
namespace Marco.Pms.Model.Mapper
|
namespace Marco.Pms.Model.Mapper
|
||||||
{
|
{
|
||||||
public static class ActivitiesMapper
|
public static class ActivitiesMapper
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
using Marco.Pms.Model.Dtos.Roles;
|
using Marco.Pms.Model.Dtos.Roles;
|
||||||
using Marco.Pms.Model.Entitlements;
|
using Marco.Pms.Model.Entitlements;
|
||||||
using Marco.Pms.Model.ViewModels;
|
using Marco.Pms.Model.ViewModels;
|
||||||
|
#nullable disable
|
||||||
namespace Marco.Pms.Model.Mapper
|
namespace Marco.Pms.Model.Mapper
|
||||||
{
|
{
|
||||||
public static class ApplicationRoleMapper
|
public static class ApplicationRoleMapper
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
using Marco.Pms.Model.Dtos.Employees;
|
using Marco.Pms.Model.Dtos.Employees;
|
||||||
using Marco.Pms.Model.Dtos.Roles;
|
|
||||||
using Marco.Pms.Model.Entitlements;
|
using Marco.Pms.Model.Entitlements;
|
||||||
using Marco.Pms.Model.ViewModels;
|
|
||||||
|
|
||||||
namespace Marco.Pms.Model.Mapper
|
namespace Marco.Pms.Model.Mapper
|
||||||
{
|
{
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
using Marco.Pms.Model.Dtos.Roles;
|
using Marco.Pms.Model.Entitlements;
|
||||||
using Marco.Pms.Model.Entitlements;
|
|
||||||
using Marco.Pms.Model.ViewModels;
|
using Marco.Pms.Model.ViewModels;
|
||||||
|
|
||||||
namespace Marco.Pms.Model.Mapper
|
namespace Marco.Pms.Model.Mapper
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
using Marco.Pms.Model.Dtos.Project;
|
using Marco.Pms.Model.Dtos.Project;
|
||||||
using Marco.Pms.Model.Projects;
|
using Marco.Pms.Model.Projects;
|
||||||
using Marco.Pms.Model.ViewModels.Activities;
|
|
||||||
|
|
||||||
namespace Marco.Pms.Model.Mapper
|
namespace Marco.Pms.Model.Mapper
|
||||||
{
|
{
|
||||||
|
@ -25,9 +25,9 @@ namespace Marco.Pms.Model.Mapper
|
|||||||
{
|
{
|
||||||
return new Project
|
return new Project
|
||||||
{
|
{
|
||||||
ContactPerson = projectModel.ContactPerson,
|
ContactPerson = projectModel.ContactPerson ?? "",
|
||||||
ProjectAddress = projectModel.ProjectAddress,
|
ProjectAddress = projectModel.ProjectAddress ?? "",
|
||||||
Name = projectModel.Name,
|
Name = projectModel.Name ?? "",
|
||||||
EndDate = projectModel.EndDate,
|
EndDate = projectModel.EndDate,
|
||||||
StartDate = projectModel.StartDate,
|
StartDate = projectModel.StartDate,
|
||||||
TenantId = TenantId,
|
TenantId = TenantId,
|
||||||
@ -40,9 +40,9 @@ namespace Marco.Pms.Model.Mapper
|
|||||||
return new Project
|
return new Project
|
||||||
{
|
{
|
||||||
Id = id,
|
Id = id,
|
||||||
ContactPerson = projectModel.ContactPerson,
|
ContactPerson = projectModel.ContactPerson ?? "",
|
||||||
ProjectAddress = projectModel.ProjectAddress,
|
ProjectAddress = projectModel.ProjectAddress ?? "",
|
||||||
Name = projectModel.Name,
|
Name = projectModel.Name ?? "",
|
||||||
EndDate = projectModel.EndDate,
|
EndDate = projectModel.EndDate,
|
||||||
StartDate = projectModel.StartDate,
|
StartDate = projectModel.StartDate,
|
||||||
TenantId = TenantId,
|
TenantId = TenantId,
|
||||||
|
@ -7,12 +7,12 @@ namespace Marco.Pms.Model.Projects
|
|||||||
public class PhotoGallary
|
public class PhotoGallary
|
||||||
{
|
{
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
public string Description { get; set; }
|
public string? Description { get; set; }
|
||||||
public int ProjectId { get; set; }
|
public int ProjectId { get; set; }
|
||||||
[ValidateNever]
|
[ValidateNever]
|
||||||
[ForeignKey(nameof(ProjectId))]
|
[ForeignKey(nameof(ProjectId))]
|
||||||
public Project? Project { get; set; }
|
public Project? Project { get; set; }
|
||||||
public string AddedBy { get; set; }
|
public string? AddedBy { get; set; }
|
||||||
[ValidateNever]
|
[ValidateNever]
|
||||||
[ForeignKey(nameof(AddedBy))]
|
[ForeignKey(nameof(AddedBy))]
|
||||||
public ApplicationUser? ApplicationUser { get; set; }
|
public ApplicationUser? ApplicationUser { get; set; }
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
using Marco.Pms.Model.Employees;
|
using System.ComponentModel;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using Marco.Pms.Model.Employees;
|
||||||
using Marco.Pms.Model.Entitlements;
|
using Marco.Pms.Model.Entitlements;
|
||||||
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
|
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
|
||||||
using System.ComponentModel;
|
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
|
||||||
|
|
||||||
namespace Marco.Pms.Model.Projects
|
namespace Marco.Pms.Model.Projects
|
||||||
{
|
{
|
||||||
|
@ -1,14 +1,8 @@
|
|||||||
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
|
using System.ComponentModel;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Marco.Pms.Model.Entitlements;
|
using Marco.Pms.Model.Entitlements;
|
||||||
using Marco.Pms.Model.Activities;
|
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
|
||||||
|
|
||||||
namespace Marco.Pms.Model.Projects
|
namespace Marco.Pms.Model.Projects
|
||||||
{
|
{
|
||||||
|
@ -11,18 +11,18 @@ namespace Marco.Pms.Model.Projects
|
|||||||
public int WorkAreaId { get; set; }
|
public int WorkAreaId { get; set; }
|
||||||
[ForeignKey("WorkAreaId")]
|
[ForeignKey("WorkAreaId")]
|
||||||
[ValidateNever]
|
[ValidateNever]
|
||||||
public WorkArea WorkArea { get; set; }
|
public WorkArea? WorkArea { get; set; }
|
||||||
public int WorkItemId { get; set; }
|
public int WorkItemId { get; set; }
|
||||||
[ForeignKey("WorkItemId")]
|
[ForeignKey("WorkItemId")]
|
||||||
[ValidateNever]
|
[ValidateNever]
|
||||||
public WorkItem WorkItem { get; set; }
|
public WorkItem? WorkItem { get; set; }
|
||||||
|
|
||||||
[DisplayName("TenantId")]
|
[DisplayName("TenantId")]
|
||||||
public int TenantId { get; set; }
|
public int TenantId { get; set; }
|
||||||
|
|
||||||
[ValidateNever]
|
[ValidateNever]
|
||||||
[ForeignKey(nameof(TenantId))]
|
[ForeignKey(nameof(TenantId))]
|
||||||
public Tenant Tenant { get; set; }
|
public Tenant? Tenant { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,5 @@
|
|||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using System;
|
#nullable disable
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Marco.Pms.Model.Providers
|
namespace Marco.Pms.Model.Providers
|
||||||
{
|
{
|
||||||
public sealed class TenantProvider
|
public sealed class TenantProvider
|
||||||
|
@ -1,9 +1,4 @@
|
|||||||
using System;
|
#nullable disable
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Marco.Pms.Model.Utilities
|
namespace Marco.Pms.Model.Utilities
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -1,16 +1,10 @@
|
|||||||
using System;
|
namespace Marco.Pms.Model.Utilities
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Marco.Pms.Model.Utilities
|
|
||||||
{
|
{
|
||||||
public class AuthResponse
|
public class AuthResponse
|
||||||
{
|
{
|
||||||
public string AccessToken { get; set; }
|
public string? AccessToken { get; set; }
|
||||||
public string RefreshToken { get; set; }
|
public string? RefreshToken { get; set; }
|
||||||
public int ExpiresIn { get; set; }
|
public int ExpiresIn { get; set; }
|
||||||
public object User { get; set; }
|
public object? User { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,13 +9,13 @@ namespace Marco.Pms.Model.Utilities
|
|||||||
public class FileDetails
|
public class FileDetails
|
||||||
{
|
{
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
public byte[] FileData { get; set; } // Byte array for the file
|
public byte[]? FileData { get; set; } // Byte array for the file
|
||||||
public string FileName { get; set; }
|
public string? FileName { get; set; }
|
||||||
public string ContentType { get; set; }
|
public string? ContentType { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Name of the file as stored on disk
|
/// Name of the file as stored on disk
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string StoredName { get; set; }
|
public string? StoredName { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,17 +1,11 @@
|
|||||||
using System;
|
namespace Marco.Pms.Model.Utilities
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Marco.Pms.Model.Utilities
|
|
||||||
{
|
{
|
||||||
public class FileUploadModel
|
public class FileUploadModel
|
||||||
{
|
{
|
||||||
public string FileName { get; set; } // Name of the file (e.g., "image1.png")
|
public string? FileName { get; set; } // Name of the file (e.g., "image1.png")
|
||||||
public string Base64Data { get; set; } // Base64-encoded string of the file
|
public string? Base64Data { get; set; } // Base64-encoded string of the file
|
||||||
public string ContentType { get; set; } // MIME type (e.g., "image/png", "application/pdf")
|
public string? ContentType { get; set; } // MIME type (e.g., "image/png", "application/pdf")
|
||||||
public long FileSize { get; set; } // File size in bytes
|
public long FileSize { get; set; } // File size in bytes
|
||||||
public string Description { get; set; } // Optional: Description or purpose of the file
|
public string? Description { get; set; } // Optional: Description or purpose of the file
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
{
|
{
|
||||||
public class SmtpSettings
|
public class SmtpSettings
|
||||||
{
|
{
|
||||||
public string SmtpServer { get; set; }
|
public string? SmtpServer { get; set; }
|
||||||
public int Port { get; set; }
|
public int Port { get; set; }
|
||||||
public string SenderName { get; set; }
|
public string? SenderName { get; set; }
|
||||||
public string SenderEmail { get; set; }
|
public string? SenderEmail { get; set; }
|
||||||
public string Password { get; set; }
|
public string? Password { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ namespace Marco.Pms.Model.ViewModels.Activities
|
|||||||
|
|
||||||
public int WorkItemId { get; set; }
|
public int WorkItemId { get; set; }
|
||||||
public int TenantId { get; set; }
|
public int TenantId { get; set; }
|
||||||
public List<EmployeeVM> teamMembers { get; set; }
|
public List<EmployeeVM>? teamMembers { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@ namespace Marco.Pms.Model.ViewModels.Activities
|
|||||||
public long Id { get; set; }
|
public long Id { get; set; }
|
||||||
public long TaskAllocationId { get; set; }
|
public long TaskAllocationId { get; set; }
|
||||||
public DateTime CommentDate { get; set; }
|
public DateTime CommentDate { get; set; }
|
||||||
public string Comment { get; set; }
|
public string? Comment { get; set; }
|
||||||
public int CommentedBy { get; set; }
|
public int CommentedBy { get; set; }
|
||||||
public EmployeeVM? Employee { get; set; }
|
public EmployeeVM? Employee { get; set; }
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@ namespace Marco.Pms.Model.ViewModels.Activities
|
|||||||
public int WorkItemId { get; set; }
|
public int WorkItemId { get; set; }
|
||||||
public WorkItem? WorkItem { get; set; }
|
public WorkItem? WorkItem { get; set; }
|
||||||
public int TenantId { get; set; }
|
public int TenantId { get; set; }
|
||||||
public List<EmployeeVM> teamMembers { get; set; }
|
public List<EmployeeVM>? teamMembers { get; set; }
|
||||||
public List<CommentVM>? comments { get; set; }
|
public List<CommentVM>? comments { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,6 @@ namespace Marco.Pms.Model.ViewModels.Activities
|
|||||||
public int WorkItemId { get; set; }
|
public int WorkItemId { get; set; }
|
||||||
public int TenantId { get; set; }
|
public int TenantId { get; set; }
|
||||||
|
|
||||||
public List<CommentVM> Comments { get; set; }
|
public List<CommentVM>? Comments { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,11 +12,11 @@ namespace Marco.Pms.Model.ViewModels.Activities
|
|||||||
public double CompletedTask { get; set; }
|
public double CompletedTask { get; set; }
|
||||||
public DateTime? ReportedDate { get; set; }
|
public DateTime? ReportedDate { get; set; }
|
||||||
public string? Description { get; set; }
|
public string? Description { get; set; }
|
||||||
public string AssignBy { get; set; }
|
public string? AssignBy { get; set; }
|
||||||
public WorkItem WorkItem { get; set; }
|
public WorkItem? WorkItem { get; set; }
|
||||||
public string Tenant { get; set; }
|
public string? Tenant { get; set; }
|
||||||
|
|
||||||
public List<CommentVM> Comments { get; set; }
|
public List<CommentVM>? Comments { get; set; }
|
||||||
public List<EmployeeVM> TeamMembers { get; set; }
|
public List<EmployeeVM>? TeamMembers { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
public class TasksVM
|
public class TasksVM
|
||||||
{
|
{
|
||||||
public long Id { get; set; }
|
public long Id { get; set; }
|
||||||
public string ActivityName { get; set; }
|
public string? ActivityName { get; set; }
|
||||||
public double TotalPlannedTask { get; set; }
|
public double TotalPlannedTask { get; set; }
|
||||||
public double PlannedTask { get; set; }
|
public double PlannedTask { get; set; }
|
||||||
public double CompletedTask { get; set; }
|
public double CompletedTask { get; set; }
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
public class WorkItemVm
|
public class WorkItemVm
|
||||||
{
|
{
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
public string ActivityName { get; set; }
|
public string? ActivityName { get; set; }
|
||||||
public double PlannedWork { get; set; }
|
public double PlannedWork { get; set; }
|
||||||
public double CompletedWork { get; set; }
|
public double CompletedWork { get; set; }
|
||||||
public DateTime TaskDate { get; set; }
|
public DateTime TaskDate { get; set; }
|
||||||
|
@ -1,20 +1,10 @@
|
|||||||
using Marco.Pms.Model.Entitlements;
|
namespace Marco.Pms.Model.ViewModels
|
||||||
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Marco.Pms.Model.ViewModels
|
|
||||||
{
|
{
|
||||||
public class ApplicationRolesVM
|
public class ApplicationRolesVM
|
||||||
{
|
{
|
||||||
public Guid Id { get; set; }
|
public Guid Id { get; set; }
|
||||||
public string Role { get; set; }
|
public string? Role { get; set; }
|
||||||
public string Description { get; set; }
|
public string? Description { get; set; }
|
||||||
public ICollection<FeaturePermissionVM> FeaturePermission { get; set; }
|
public ICollection<FeaturePermissionVM>? FeaturePermission { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,9 +2,9 @@
|
|||||||
{
|
{
|
||||||
public class EmployeeProfile
|
public class EmployeeProfile
|
||||||
{
|
{
|
||||||
public EmployeeVM EmployeeInfo { get; set; }
|
public EmployeeVM? EmployeeInfo { get; set; }
|
||||||
public string[] Projects { get; set; }
|
public string[]? Projects { get; set; }
|
||||||
public string[] FeaturePermissions { get; set; }
|
public string[]? FeaturePermissions { get; set; }
|
||||||
public string[] Features { get; set; }
|
public string[]? Features { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,20 +3,20 @@
|
|||||||
public class EmployeeVM
|
public class EmployeeVM
|
||||||
{
|
{
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
public string FirstName { get; set; }
|
public string? FirstName { get; set; }
|
||||||
public string LastName { get; set; }
|
public string? LastName { get; set; }
|
||||||
public string? MiddleName { get; set; }
|
public string? MiddleName { get; set; }
|
||||||
public string? Email { get; set; }
|
public string? Email { get; set; }
|
||||||
|
|
||||||
public string Gender { get; set; }
|
public string? Gender { get; set; }
|
||||||
public DateTime? BirthDate { get; set; }
|
public DateTime? BirthDate { get; set; }
|
||||||
public DateTime? JoiningDate { get; set; }
|
public DateTime? JoiningDate { get; set; }
|
||||||
public string PermanentAddress { get; set; }
|
public string? PermanentAddress { get; set; }
|
||||||
public string CurrentAddress { get; set; }
|
public string? CurrentAddress { get; set; }
|
||||||
public string PhoneNumber { get; set; }
|
public string? PhoneNumber { get; set; }
|
||||||
|
|
||||||
public string EmergencyPhoneNumber { get; set; }
|
public string? EmergencyPhoneNumber { get; set; }
|
||||||
public string EmergencyContactPerson { get; set; }
|
public string? EmergencyContactPerson { get; set; }
|
||||||
|
|
||||||
public string? AadharNumber { get; set; }
|
public string? AadharNumber { get; set; }
|
||||||
|
|
||||||
@ -28,7 +28,7 @@
|
|||||||
public string? ApplicationUserId { get; set; }
|
public string? ApplicationUserId { get; set; }
|
||||||
|
|
||||||
public int? JobRoleId { get; set; }
|
public int? JobRoleId { get; set; }
|
||||||
public string JobRole { get; set; }
|
public string? JobRole { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,15 +1,12 @@
|
|||||||
using Marco.Pms.Model.Employees;
|
namespace Marco.Pms.Model.ViewModels
|
||||||
using Marco.Pms.Model.Entitlements;
|
|
||||||
|
|
||||||
namespace Marco.Pms.Model.ViewModels
|
|
||||||
{
|
{
|
||||||
public class EmployeeRolesVM
|
public class EmployeeRolesVM
|
||||||
{
|
{
|
||||||
public Guid Id { get; set; }
|
public Guid Id { get; set; }
|
||||||
public int EmployeeId { get; set; }
|
public int EmployeeId { get; set; }
|
||||||
public Guid RoleId { get; set; }
|
public Guid RoleId { get; set; }
|
||||||
public string Name { get; set; }
|
public string? Name { get; set; }
|
||||||
public string Description { get; set; }
|
public string? Description { get; set; }
|
||||||
public bool IsEnabled { get; set; }
|
public bool IsEnabled { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,13 +1,4 @@
|
|||||||
using Marco.Pms.Model.Entitlements;
|
namespace Marco.Pms.Model.ViewModels
|
||||||
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Marco.Pms.Model.ViewModels
|
|
||||||
{
|
{
|
||||||
public class FeaturePermissionVM
|
public class FeaturePermissionVM
|
||||||
{
|
{
|
||||||
@ -16,8 +7,8 @@ namespace Marco.Pms.Model.ViewModels
|
|||||||
|
|
||||||
public Guid FeatureId { get; set; } // Foreign key to Feature
|
public Guid FeatureId { get; set; } // Foreign key to Feature
|
||||||
|
|
||||||
public string Name { get; set; } // Feature name
|
public string? Name { get; set; } // Feature name
|
||||||
public string Description { get; set; } // Feature description
|
public string? Description { get; set; } // Feature description
|
||||||
|
|
||||||
public bool IsEnabled { get; set; } // Whether the feature is enabled for this role
|
public bool IsEnabled { get; set; } // Whether the feature is enabled for this role
|
||||||
|
|
||||||
|
@ -1,26 +1,17 @@
|
|||||||
using Marco.Pms.Model.Entitlements;
|
namespace Marco.Pms.Model.ViewModels
|
||||||
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Marco.Pms.Model.ViewModels
|
|
||||||
{
|
{
|
||||||
public class FeatureVM
|
public class FeatureVM
|
||||||
{
|
{
|
||||||
public Guid Id { get; set; } // Unique identifier for the permission
|
public Guid Id { get; set; } // Unique identifier for the permission
|
||||||
|
|
||||||
public string Name { get; set; } // Feature name
|
public string? Name { get; set; } // Feature name
|
||||||
public string Description { get; set; } // Feature description
|
public string? Description { get; set; } // Feature description
|
||||||
public bool IsActive { get; set; }
|
public bool IsActive { get; set; }
|
||||||
public int? ModuleId { get; set; }
|
public int? ModuleId { get; set; }
|
||||||
|
|
||||||
public string? ModuleName { get; set; }
|
public string? ModuleName { get; set; }
|
||||||
public string? ModuleKey { get; set; }
|
public string? ModuleKey { get; set; }
|
||||||
|
|
||||||
public ICollection<FeaturePermissionVM> FeaturePermissions { get; set; }
|
public ICollection<FeaturePermissionVM>? FeaturePermissions { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,4 @@
|
|||||||
using System;
|
using Marco.Pms.Model.Projects;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Marco.Pms.Model.Projects;
|
|
||||||
|
|
||||||
namespace Marco.Pms.Model.ViewModels
|
namespace Marco.Pms.Model.ViewModels
|
||||||
{
|
{
|
||||||
@ -12,6 +7,6 @@ namespace Marco.Pms.Model.ViewModels
|
|||||||
public Building? building { get; set; }
|
public Building? building { get; set; }
|
||||||
public Floor? floor { get; set; }
|
public Floor? floor { get; set; }
|
||||||
|
|
||||||
public WorkArea workArea { get; set; }
|
public WorkArea? workArea { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
public class JobRoleVM
|
public class JobRoleVM
|
||||||
{
|
{
|
||||||
|
|
||||||
public int Id { get; set; }
|
public int? Id { get; set; }
|
||||||
public string Name { get; set; }
|
public string? Name { get; set; }
|
||||||
public string? Description { get; set; }
|
public string? Description { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -6,14 +6,14 @@ namespace Marco.Pms.Model.ViewModels
|
|||||||
{
|
{
|
||||||
public class ProjectDetailsVM
|
public class ProjectDetailsVM
|
||||||
{
|
{
|
||||||
public Project project { get; set; }
|
public Project? project { get; set; }
|
||||||
public List<TaskAllocation> employeeAllocation { get; set; }
|
public List<TaskAllocation>? employeeAllocation { get; set; }
|
||||||
public List<EmployeeDetails> employees { get; set; }
|
public List<EmployeeDetails>? employees { get; set; }
|
||||||
|
|
||||||
public List<Building> buildings { get; set; }
|
public List<Building>? buildings { get; set; }
|
||||||
public List<Floor> floors { get; set; }
|
public List<Floor>? floors { get; set; }
|
||||||
|
|
||||||
public List<WorkArea> workAreas { get; set; }
|
public List<WorkArea>? workAreas { get; set; }
|
||||||
public List<WorkItem> workItems { get; set; }
|
public List<WorkItem>? workItems { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,13 +1,11 @@
|
|||||||
using Marco.Pms.Model.Entitlements;
|
namespace Marco.Pms.Model.ViewModels
|
||||||
|
|
||||||
namespace Marco.Pms.Model.ViewModels
|
|
||||||
{
|
{
|
||||||
|
|
||||||
public class RolesVM
|
public class RolesVM
|
||||||
{
|
{
|
||||||
public Guid Id { get; set; }
|
public Guid Id { get; set; }
|
||||||
public string Role { get; set; }
|
public string? Role { get; set; }
|
||||||
|
|
||||||
public ICollection<FeaturePermissionVM> FeaturePermissions { get; set; }
|
public ICollection<FeaturePermissionVM>? FeaturePermissions { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -47,7 +47,7 @@ namespace MarcoBMS.Services.Controllers
|
|||||||
|
|
||||||
List<AttendanceLog> lstAttendance = await _context.AttendanceLogs.Where(c => c.AttendanceId == attendanceid && c.TenantId == TenantId).ToListAsync();
|
List<AttendanceLog> lstAttendance = await _context.AttendanceLogs.Where(c => c.AttendanceId == attendanceid && c.TenantId == TenantId).ToListAsync();
|
||||||
|
|
||||||
return Ok(ApiResponse<object>.SuccessResponse(lstAttendance, String.Format("{0} Attendance records fetched successfully", lstAttendance.Count), 200));
|
return Ok(ApiResponse<object>.SuccessResponse(lstAttendance, System.String.Format("{0} Attendance records fetched successfully", lstAttendance.Count), 200));
|
||||||
|
|
||||||
}
|
}
|
||||||
[HttpGet("log/employee/{employeeid}")]
|
[HttpGet("log/employee/{employeeid}")]
|
||||||
@ -276,8 +276,8 @@ namespace MarcoBMS.Services.Controllers
|
|||||||
if (recordAttendanceDot.MarkTime == null) return BadRequest(ApiResponse<object>.ErrorResponse("Invalid Mark Time", "Invalid Mark Time",400));
|
if (recordAttendanceDot.MarkTime == null) return BadRequest(ApiResponse<object>.ErrorResponse("Invalid Mark Time", "Invalid Mark Time",400));
|
||||||
|
|
||||||
DateTime finalDateTime = GetDateFromTimeStamp(recordAttendanceDot, recordAttendanceDot.MarkTime);
|
DateTime finalDateTime = GetDateFromTimeStamp(recordAttendanceDot, recordAttendanceDot.MarkTime);
|
||||||
|
if (recordAttendanceDot.Comment == null) return BadRequest(ApiResponse<object>.ErrorResponse("Invalid Comment", "Invalid Comment", 400));
|
||||||
|
|
||||||
//if(recordAttendanceDot.Comment != null)
|
|
||||||
if (attendance != null)
|
if (attendance != null)
|
||||||
{
|
{
|
||||||
attendance.Comment = recordAttendanceDot.Comment;
|
attendance.Comment = recordAttendanceDot.Comment;
|
||||||
|
@ -43,30 +43,29 @@ namespace MarcoBMS.Services.Controllers
|
|||||||
{
|
{
|
||||||
var user = await _context.ApplicationUsers.FirstOrDefaultAsync(u => u.Email == loginDto.Username || u.PhoneNumber == loginDto.Username);
|
var user = await _context.ApplicationUsers.FirstOrDefaultAsync(u => u.Email == loginDto.Username || u.PhoneNumber == loginDto.Username);
|
||||||
|
|
||||||
if (user == null || !await _userManager.CheckPasswordAsync(user, loginDto.Password))
|
if (user != null && await _userManager.CheckPasswordAsync(user, loginDto.Password))
|
||||||
{
|
{
|
||||||
return Unauthorized(ApiResponse<object>.ErrorResponse("Invalid username or password.", "Invalid username or password.", 401));
|
if (!user.IsActive)
|
||||||
//return Unauthorized("Invalid username or password.");
|
{
|
||||||
|
return BadRequest(ApiResponse<object>.ErrorResponse("User is In Active", "User is In Active", 400));
|
||||||
|
}
|
||||||
|
if (!user.EmailConfirmed)
|
||||||
|
{
|
||||||
|
return BadRequest(ApiResponse<object>.ErrorResponse("Your email is not verified, Please verify your email", "Your email is not verified, Please verify your email", 400));
|
||||||
|
}
|
||||||
|
Employee emp = await _employeeHelper.GetEmployeeByApplicationUserID(user.Id);
|
||||||
|
//var refreshToken = GenerateRefreshToken();
|
||||||
|
if (user.UserName == null) return NotFound(ApiResponse<object>.ErrorResponse("UserName Not found", "UserName Not found", 404)); ;
|
||||||
|
|
||||||
|
var token = _refreshTokenService.GenerateJwtToken(user.UserName, emp.TenantId.ToString(), _jwtSettings);
|
||||||
|
|
||||||
|
var refreshToken = await _refreshTokenService.CreateRefreshToken(user.Id, emp.TenantId.ToString(), _jwtSettings);
|
||||||
|
|
||||||
|
return Ok(ApiResponse<object>.SuccessResponse(new { token = token, refreshToken = refreshToken }, "User logged in successfully.", 200));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!user.IsActive)
|
return Unauthorized(ApiResponse<object>.ErrorResponse("Invalid username or password.", "Invalid username or password.", 401));
|
||||||
{
|
|
||||||
return BadRequest(ApiResponse<object>.ErrorResponse("User is In Active", "User is In Active", 400));
|
|
||||||
//return BadRequest("User is In Active");
|
|
||||||
}
|
|
||||||
if (!user.EmailConfirmed)
|
|
||||||
{
|
|
||||||
return BadRequest(ApiResponse<object>.ErrorResponse("Your email is not verified, Please verify your email", "Your email is not verified, Please verify your email", 400));
|
|
||||||
//return BadRequest("Your email is not verified, Please verify your email");
|
|
||||||
}
|
|
||||||
Employee emp = await _employeeHelper.GetEmployeeByApplicationUserID(user.Id);
|
|
||||||
//var refreshToken = GenerateRefreshToken();
|
|
||||||
|
|
||||||
var token = _refreshTokenService.GenerateJwtToken(user.UserName, emp.TenantId.ToString(), _jwtSettings);
|
|
||||||
|
|
||||||
var refreshToken = await _refreshTokenService.CreateRefreshToken(user.Id, emp.TenantId.ToString(), _jwtSettings);
|
|
||||||
|
|
||||||
return Ok(ApiResponse<object>.SuccessResponse(new { token = token, refreshToken = refreshToken }, "User logged in successfully.", 200));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost("logout")]
|
[HttpPost("logout")]
|
||||||
@ -98,7 +97,7 @@ namespace MarcoBMS.Services.Controllers
|
|||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
// _logger.LogError(ex, "Error during logout");
|
// _logger.LogError(ex, "Error during logout");
|
||||||
return BadRequest(ApiResponse<object>.ErrorResponse("Internal server error", "Internal server error", 500));
|
return BadRequest(ApiResponse<object>.ErrorResponse("Internal server error", ex.Message, 500));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -120,6 +119,8 @@ namespace MarcoBMS.Services.Controllers
|
|||||||
return BadRequest(ApiResponse<object>.ErrorResponse("Invalid request.", "Invalid request.", 400));
|
return BadRequest(ApiResponse<object>.ErrorResponse("Invalid request.", "Invalid request.", 400));
|
||||||
|
|
||||||
Employee emp = await _employeeHelper.GetEmployeeByApplicationUserID(user.Id);
|
Employee emp = await _employeeHelper.GetEmployeeByApplicationUserID(user.Id);
|
||||||
|
|
||||||
|
if (user.UserName == null) return NotFound(ApiResponse<object>.ErrorResponse("UserName Not found", "UserName Not found", 404));
|
||||||
|
|
||||||
var newJwtToken = _refreshTokenService.GenerateJwtToken(user.UserName, emp.TenantId.ToString(), _jwtSettings);
|
var newJwtToken = _refreshTokenService.GenerateJwtToken(user.UserName, emp.TenantId.ToString(), _jwtSettings);
|
||||||
var newRefreshToken = await _refreshTokenService.CreateRefreshToken(user.Id, emp.TenantId.ToString(), _jwtSettings);
|
var newRefreshToken = await _refreshTokenService.CreateRefreshToken(user.Id, emp.TenantId.ToString(), _jwtSettings);
|
||||||
@ -137,6 +138,9 @@ namespace MarcoBMS.Services.Controllers
|
|||||||
/* SEND USER REGISTRATION MAIL*/
|
/* SEND USER REGISTRATION MAIL*/
|
||||||
var token = await _userManager.GeneratePasswordResetTokenAsync(user);
|
var token = await _userManager.GeneratePasswordResetTokenAsync(user);
|
||||||
var resetLink = $"{_configuration["AppSettings:WebFrontendUrl"]}/reset-password?token={WebUtility.UrlEncode(token)}";
|
var resetLink = $"{_configuration["AppSettings:WebFrontendUrl"]}/reset-password?token={WebUtility.UrlEncode(token)}";
|
||||||
|
|
||||||
|
if (user.Email == null) return NotFound(ApiResponse<object>.ErrorResponse("Email Not found", "Email Not found", 404));
|
||||||
|
|
||||||
await _emailSender.SendResetPasswordEmail(user.Email, "", resetLink);
|
await _emailSender.SendResetPasswordEmail(user.Email, "", resetLink);
|
||||||
|
|
||||||
|
|
||||||
@ -199,7 +203,7 @@ namespace MarcoBMS.Services.Controllers
|
|||||||
var user = await _userManager.FindByEmailAsync(emailDot.ToEmail);
|
var user = await _userManager.FindByEmailAsync(emailDot.ToEmail);
|
||||||
if (user == null)
|
if (user == null)
|
||||||
{
|
{
|
||||||
return BadRequest(ApiResponse<object>.ErrorResponse("User not found.", "User not found.", 400));
|
return NotFound(ApiResponse<object>.ErrorResponse("User not found.", "User not found.", 404));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* New User*/
|
/* New User*/
|
||||||
@ -217,6 +221,9 @@ namespace MarcoBMS.Services.Controllers
|
|||||||
var isTokenValid = await _userManager.VerifyUserTokenAsync(user, TokenOptions.DefaultProvider, "ResetPassword", token);
|
var isTokenValid = await _userManager.VerifyUserTokenAsync(user, TokenOptions.DefaultProvider, "ResetPassword", token);
|
||||||
|
|
||||||
var resetLink = $"{_configuration["AppSettings:WebFrontendUrl"]}/reset-password?token={WebUtility.UrlEncode(token)}";
|
var resetLink = $"{_configuration["AppSettings:WebFrontendUrl"]}/reset-password?token={WebUtility.UrlEncode(token)}";
|
||||||
|
|
||||||
|
if (user.Email == null) return NotFound(ApiResponse<object>.ErrorResponse("Email Not found", "Email Not found", 404));
|
||||||
|
|
||||||
await _emailSender.SendResetPasswordEmail(user.Email, "", resetLink);
|
await _emailSender.SendResetPasswordEmail(user.Email, "", resetLink);
|
||||||
|
|
||||||
return Ok(ApiResponse<object>.SuccessResponse(new {}, "Password reset link sent.", 200));
|
return Ok(ApiResponse<object>.SuccessResponse(new {}, "Password reset link sent.", 200));
|
||||||
|
@ -57,7 +57,7 @@ namespace MarcoBMS.Services.Controllers
|
|||||||
}
|
}
|
||||||
int tenantId = GetTenantId();
|
int tenantId = GetTenantId();
|
||||||
|
|
||||||
var empRoles = _context.EmployeeRoleMappings.Where(c => c.EmployeeId == employeeId).Include(c => c.Role).Include(c => c.Employee).ToList();
|
var empRoles = await _context.EmployeeRoleMappings.Where(c => c.EmployeeId == employeeId).Include(c => c.Role).Include(c => c.Employee).ToListAsync();
|
||||||
if (empRoles.Any())
|
if (empRoles.Any())
|
||||||
{
|
{
|
||||||
List<EmployeeRolesVM> roles = new List<EmployeeRolesVM>();
|
List<EmployeeRolesVM> roles = new List<EmployeeRolesVM>();
|
||||||
@ -220,7 +220,7 @@ namespace MarcoBMS.Services.Controllers
|
|||||||
// Create Employee record if missing
|
// Create Employee record if missing
|
||||||
//Employee newEmployee = GetNewEmployeeModel(model, TenantId, existingUser.Id);
|
//Employee newEmployee = GetNewEmployeeModel(model, TenantId, existingUser.Id);
|
||||||
//_context.Employees.Add(newEmployee);
|
//_context.Employees.Add(newEmployee);
|
||||||
return BadRequest(ApiResponse<object>.ErrorResponse("You cannot use this email", "You cannot use this email", 400));
|
return BadRequest(ApiResponse<object>.ErrorResponse("Email already exist", "Email already exist", 400));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -276,8 +276,8 @@ namespace MarcoBMS.Services.Controllers
|
|||||||
}
|
}
|
||||||
return Ok(ApiResponse<object>.SuccessResponse("Success.",responsemessage, 200));
|
return Ok(ApiResponse<object>.SuccessResponse("Success.",responsemessage, 200));
|
||||||
}
|
}
|
||||||
|
#nullable disable
|
||||||
private static Employee GetNewEmployeeModel(CreateUserDto model, int TenantId, string? ApplicationUserId)
|
private static Employee GetNewEmployeeModel(CreateUserDto model, int TenantId, string ApplicationUserId)
|
||||||
{
|
{
|
||||||
var newEmployee = new Employee
|
var newEmployee = new Employee
|
||||||
{
|
{
|
||||||
@ -304,7 +304,7 @@ namespace MarcoBMS.Services.Controllers
|
|||||||
return newEmployee;
|
return newEmployee;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Employee GetUpdateEmployeeModel(CreateUserDto model, Employee existingEmployee, IdentityUser? existingIdentityUser = null)
|
private static Employee GetUpdateEmployeeModel(CreateUserDto model, Employee existingEmployee, IdentityUser existingIdentityUser = null)
|
||||||
{
|
{
|
||||||
if (existingEmployee.ApplicationUserId == null && existingIdentityUser != null)
|
if (existingEmployee.ApplicationUserId == null && existingIdentityUser != null)
|
||||||
{
|
{
|
||||||
|
@ -20,6 +20,7 @@ namespace MarcoBMS.Services.Controllers
|
|||||||
[HttpPost("fileupload")]
|
[HttpPost("fileupload")]
|
||||||
public async Task<IActionResult> FileUploadDemo([FromForm] DemoEmployeeModel model)
|
public async Task<IActionResult> FileUploadDemo([FromForm] DemoEmployeeModel model)
|
||||||
{
|
{
|
||||||
|
if(model.ImageFile == null) {return BadRequest(ApiResponse<object>.ErrorResponse("Error.", "Error.", 400));}
|
||||||
string imageName = await Saveimage(model.ImageFile);
|
string imageName = await Saveimage(model.ImageFile);
|
||||||
return Ok(ApiResponse<object>.SuccessResponse("Success.", "Success.", 200));
|
return Ok(ApiResponse<object>.SuccessResponse("Success.", "Success.", 200));
|
||||||
}
|
}
|
||||||
@ -71,7 +72,7 @@ namespace MarcoBMS.Services.Controllers
|
|||||||
public string? EmployeeName { get; set; }
|
public string? EmployeeName { get; set; }
|
||||||
public string? Occupation { get; set; }
|
public string? Occupation { get; set; }
|
||||||
public string? ImageName { get; set; }
|
public string? ImageName { get; set; }
|
||||||
public string ImageSrc { get; set; }
|
public string? ImageSrc { get; set; }
|
||||||
|
|
||||||
public IFormFile? ImageFile { get; set; } // List to handle multiple files
|
public IFormFile? ImageFile { get; set; } // List to handle multiple files
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
using Marco.Pms.DataAccess.Data;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using Marco.Pms.DataAccess.Data;
|
||||||
using Marco.Pms.Model.Dtos.Project;
|
using Marco.Pms.Model.Dtos.Project;
|
||||||
using Marco.Pms.Model.Employees;
|
using Marco.Pms.Model.Employees;
|
||||||
using Marco.Pms.Model.Entitlements;
|
using Marco.Pms.Model.Entitlements;
|
||||||
@ -9,8 +11,8 @@ using Marco.Pms.Model.ViewModels;
|
|||||||
using Marco.Pms.Model.ViewModels.Employee;
|
using Marco.Pms.Model.ViewModels.Employee;
|
||||||
using MarcoBMS.Services.Helpers;
|
using MarcoBMS.Services.Helpers;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Identity;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
namespace MarcoBMS.Services.Controllers
|
namespace MarcoBMS.Services.Controllers
|
||||||
@ -22,18 +24,18 @@ namespace MarcoBMS.Services.Controllers
|
|||||||
{
|
{
|
||||||
//private readonly IUnitOfWork _unitOfWork;
|
//private readonly IUnitOfWork _unitOfWork;
|
||||||
private readonly ApplicationDbContext _context;
|
private readonly ApplicationDbContext _context;
|
||||||
private ApplicationUser _applicationUser;
|
//private ApplicationUser _applicationUser;
|
||||||
// private readonly IProjectRepository _projectrepo;
|
// private readonly IProjectRepository _projectrepo;
|
||||||
private readonly UserManager<IdentityUser> _userManager;
|
//private readonly UserManager<IdentityUser> _userManager;
|
||||||
private readonly UserHelper _userHelper;
|
private readonly UserHelper _userHelper;
|
||||||
|
|
||||||
|
|
||||||
public ProjectController(UserManager<IdentityUser> userManager, ApplicationDbContext context, UserHelper userHelper)
|
public ProjectController(ApplicationDbContext context, UserHelper userHelper)
|
||||||
{
|
{
|
||||||
//_unitOfWork = unitOfWork;
|
//_unitOfWork = unitOfWork;
|
||||||
_context = context;
|
_context = context;
|
||||||
//_projectrepo = projectrepo;
|
//_projectrepo = projectrepo;
|
||||||
_userManager = userManager;
|
//_userManager = userManager;
|
||||||
_userHelper = userHelper;
|
_userHelper = userHelper;
|
||||||
}
|
}
|
||||||
[HttpGet("list")]
|
[HttpGet("list")]
|
||||||
@ -99,7 +101,7 @@ namespace MarcoBMS.Services.Controllers
|
|||||||
}
|
}
|
||||||
|
|
||||||
var project = await _context.Projects.Where(c => c.TenantId == _userHelper.GetTenantId() && c.Id == id).SingleOrDefaultAsync();
|
var project = await _context.Projects.Where(c => c.TenantId == _userHelper.GetTenantId() && c.Id == id).SingleOrDefaultAsync();
|
||||||
|
if (project == null) return NotFound(ApiResponse<object>.ErrorResponse("Project not found", "Project not found", 404));
|
||||||
return Ok(ApiResponse<object>.SuccessResponse(project, "Success.", 200));
|
return Ok(ApiResponse<object>.SuccessResponse(project, "Success.", 200));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -129,47 +131,63 @@ namespace MarcoBMS.Services.Controllers
|
|||||||
{
|
{
|
||||||
//var project = projects.Where(c => c.Id == id).SingleOrDefault();
|
//var project = projects.Where(c => c.Id == id).SingleOrDefault();
|
||||||
ProjectDetailsVM vm = await GetProjectViewModel(id, project);
|
ProjectDetailsVM vm = await GetProjectViewModel(id, project);
|
||||||
|
|
||||||
ProjectVM projectVM = new ProjectVM();
|
ProjectVM projectVM = new ProjectVM();
|
||||||
projectVM.Id = vm.project.Id;
|
if (vm.project != null) {
|
||||||
projectVM.Name = vm.project.Name;
|
projectVM.Id = vm.project.Id;
|
||||||
projectVM.ProjectAddress = vm.project.ProjectAddress;
|
projectVM.Name = vm.project.Name;
|
||||||
projectVM.ContactPerson = vm.project.ContactPerson;
|
projectVM.ProjectAddress = vm.project.ProjectAddress;
|
||||||
projectVM.StartDate = vm.project.StartDate;
|
projectVM.ContactPerson = vm.project.ContactPerson;
|
||||||
projectVM.EndDate = vm.project.EndDate;
|
projectVM.StartDate = vm.project.StartDate;
|
||||||
projectVM.ProjectStatusId = vm.project.ProjectStatusId;
|
projectVM.EndDate = vm.project.EndDate;
|
||||||
|
projectVM.ProjectStatusId = vm.project.ProjectStatusId;
|
||||||
|
}
|
||||||
projectVM.Buildings = new List<BuildingVM>();
|
projectVM.Buildings = new List<BuildingVM>();
|
||||||
foreach (Building build in vm.buildings)
|
if (vm.buildings != null) {
|
||||||
{
|
foreach (Building build in vm.buildings)
|
||||||
BuildingVM buildVM = new BuildingVM() { Id = build.Id, Description = build.Description, Name = build.Name };
|
|
||||||
buildVM.Floors = new List<FloorsVM>();
|
|
||||||
foreach (Floor floorDto in vm.floors.Where(c => c.BuildingId == build.Id).ToList())
|
|
||||||
{
|
{
|
||||||
FloorsVM floorVM = new FloorsVM() { FloorName = floorDto.FloorName, Id = floorDto.Id };
|
BuildingVM buildVM = new BuildingVM() { Id = build.Id, Description = build.Description, Name = build.Name };
|
||||||
floorVM.WorkAreas = new List<WorkAreaVM>();
|
buildVM.Floors = new List<FloorsVM>();
|
||||||
|
if (vm.floors != null)
|
||||||
foreach (WorkArea workAreaDto in vm.workAreas.Where(c => c.FloorId == floorVM.Id).ToList())
|
|
||||||
{
|
{
|
||||||
WorkAreaVM workAreaVM = new WorkAreaVM() { Id = workAreaDto.Id, AreaName = workAreaDto.AreaName, WorkItems = new List<WorkItemVM>() };
|
foreach (Floor floorDto in vm.floors.Where(c => c.BuildingId == build.Id).ToList())
|
||||||
|
|
||||||
foreach (WorkItem workItemDto in vm.workItems.Where(c => c.WorkAreaId == workAreaDto.Id).ToList())
|
|
||||||
{
|
{
|
||||||
WorkItemVM workItemVM = new WorkItemVM() { WorkItemId = workItemDto.Id, WorkItem = workItemDto };
|
FloorsVM floorVM = new FloorsVM() { FloorName = floorDto.FloorName, Id = floorDto.Id };
|
||||||
workItemVM.WorkItem.WorkArea = null;
|
floorVM.WorkAreas = new List<WorkAreaVM>();
|
||||||
workItemVM.WorkItem.ActivityMaster.Tenant = null;
|
|
||||||
workItemVM.WorkItem.Tenant = null;
|
if (vm.workAreas != null)
|
||||||
|
{
|
||||||
|
foreach (WorkArea workAreaDto in vm.workAreas.Where(c => c.FloorId == floorVM.Id).ToList())
|
||||||
|
{
|
||||||
|
WorkAreaVM workAreaVM = new WorkAreaVM() { Id = workAreaDto.Id, AreaName = workAreaDto.AreaName, WorkItems = new List<WorkItemVM>() };
|
||||||
|
|
||||||
|
if(vm.workItems != null)
|
||||||
|
{
|
||||||
|
foreach (WorkItem workItemDto in vm.workItems.Where(c => c.WorkAreaId == workAreaDto.Id).ToList())
|
||||||
|
{
|
||||||
|
WorkItemVM workItemVM = new WorkItemVM() { WorkItemId = workItemDto.Id, WorkItem = workItemDto };
|
||||||
|
//workItemVM.WorkItem.WorkArea = null
|
||||||
|
workItemVM.WorkItem.WorkArea = new WorkArea();
|
||||||
|
//workItemVM.WorkItem.ActivityMaster.Tenant = null;
|
||||||
|
workItemVM.WorkItem.ActivityMaster.Tenant = new Tenant();
|
||||||
|
//workItemVM.WorkItem.Tenant = null;
|
||||||
|
workItemVM.WorkItem.Tenant = new Tenant();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
workAreaVM.WorkItems.Add(workItemVM);
|
workAreaVM.WorkItems.Add(workItemVM);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
floorVM.WorkAreas.Add(workAreaVM);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
buildVM.Floors.Add(floorVM);
|
||||||
}
|
}
|
||||||
|
|
||||||
floorVM.WorkAreas.Add(workAreaVM);
|
|
||||||
}
|
}
|
||||||
|
projectVM.Buildings.Add(buildVM);
|
||||||
buildVM.Floors.Add(floorVM);
|
|
||||||
}
|
}
|
||||||
projectVM.Buildings.Add(buildVM);
|
|
||||||
}
|
}
|
||||||
return Ok(ApiResponse<object>.SuccessResponse(projectVM, "Success.", 200));
|
return Ok(ApiResponse<object>.SuccessResponse(projectVM, "Success.", 200));
|
||||||
}
|
}
|
||||||
@ -314,7 +332,7 @@ namespace MarcoBMS.Services.Controllers
|
|||||||
|
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[Route("employees/get/{projectid?}/{includeInactive?}")]
|
[Route("employees/get/{projectid?}/{includeInactive?}")]
|
||||||
public async Task<IActionResult> GetEmployeeByProjectID(int? projectid, bool? includeInactive = false)
|
public async Task<IActionResult> GetEmployeeByProjectID(int? projectid, bool includeInactive = false)
|
||||||
{
|
{
|
||||||
if (!ModelState.IsValid)
|
if (!ModelState.IsValid)
|
||||||
{
|
{
|
||||||
@ -403,13 +421,14 @@ namespace MarcoBMS.Services.Controllers
|
|||||||
if (projectAllocationDot != null)
|
if (projectAllocationDot != null)
|
||||||
{
|
{
|
||||||
int TenentID = GetTenantId();
|
int TenentID = GetTenantId();
|
||||||
|
List<object>? result = new List<object>();
|
||||||
|
|
||||||
foreach (var item in projectAllocationDot)
|
foreach (var item in projectAllocationDot)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
ProjectAllocation projectAllocation = item.ToProjectAllocationFromProjectAllocationDto(TenentID);
|
ProjectAllocation projectAllocation = item.ToProjectAllocationFromProjectAllocationDto(TenentID);
|
||||||
ProjectAllocation projectAllocationFromDb = await _context.ProjectAllocations.Where(c => c.EmployeeId == projectAllocation.EmployeeId
|
ProjectAllocation? projectAllocationFromDb = await _context.ProjectAllocations.Where(c => c.EmployeeId == projectAllocation.EmployeeId
|
||||||
&& c.ProjectId == projectAllocation.ProjectId
|
&& c.ProjectId == projectAllocation.ProjectId
|
||||||
&& c.ReAllocationDate == null
|
&& c.ReAllocationDate == null
|
||||||
&& c.TenantId == TenentID).SingleOrDefaultAsync();
|
&& c.TenantId == TenentID).SingleOrDefaultAsync();
|
||||||
@ -433,7 +452,18 @@ namespace MarcoBMS.Services.Controllers
|
|||||||
_context.Entry(projectAllocationFromDb).Property(e => e.IsActive).IsModified = true;
|
_context.Entry(projectAllocationFromDb).Property(e => e.IsActive).IsModified = true;
|
||||||
}
|
}
|
||||||
await _context.SaveChangesAsync();
|
await _context.SaveChangesAsync();
|
||||||
|
var result1 = new
|
||||||
|
{
|
||||||
|
Id = projectAllocationFromDb.Id,
|
||||||
|
EmployeeId = projectAllocation.EmployeeId,
|
||||||
|
JobRoleId = projectAllocation.JobRoleId,
|
||||||
|
IsActive = projectAllocation.IsActive,
|
||||||
|
ProjectId = projectAllocation.ProjectId,
|
||||||
|
AllocationDate = projectAllocation.AllocationDate,
|
||||||
|
ReAllocationDate = projectAllocation.ReAllocationDate,
|
||||||
|
TenantId = projectAllocation.TenantId
|
||||||
|
};
|
||||||
|
result.Add(result1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -448,7 +478,8 @@ namespace MarcoBMS.Services.Controllers
|
|||||||
return Ok(ApiResponse<object>.ErrorResponse(ex.Message,ex, 400));
|
return Ok(ApiResponse<object>.ErrorResponse(ex.Message,ex, 400));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Ok(ApiResponse<object>.SuccessResponse(null, "Data saved successfully.", 200));
|
|
||||||
|
return Ok(ApiResponse<object>.SuccessResponse(result, "Data saved successfully", 200));
|
||||||
|
|
||||||
}
|
}
|
||||||
return BadRequest(ApiResponse<object>.ErrorResponse("Invalid details.", "Work Item Details are not valid." , 400));
|
return BadRequest(ApiResponse<object>.ErrorResponse("Invalid details.", "Work Item Details are not valid." , 400));
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
using Azure;
|
using System.Data;
|
||||||
using Marco.Pms.DataAccess.Data;
|
using Marco.Pms.DataAccess.Data;
|
||||||
using Marco.Pms.Model.Dtos.Roles;
|
using Marco.Pms.Model.Dtos.Roles;
|
||||||
using Marco.Pms.Model.Entitlements;
|
using Marco.Pms.Model.Entitlements;
|
||||||
@ -10,9 +10,7 @@ using Microsoft.AspNetCore.Authorization;
|
|||||||
using Microsoft.AspNetCore.Identity;
|
using Microsoft.AspNetCore.Identity;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using System.Data;
|
#nullable disable
|
||||||
using static System.Runtime.InteropServices.JavaScript.JSType;
|
|
||||||
|
|
||||||
namespace MarcoBMS.Services.Controllers
|
namespace MarcoBMS.Services.Controllers
|
||||||
{
|
{
|
||||||
[Route("api/[controller]")]
|
[Route("api/[controller]")]
|
||||||
|
@ -67,14 +67,18 @@ namespace MarcoBMS.Services.Controllers
|
|||||||
var response = taskAllocation.ToAssignTaskVMFromTaskAllocation();
|
var response = taskAllocation.ToAssignTaskVMFromTaskAllocation();
|
||||||
|
|
||||||
var teamMembers = new List<TaskMembers> { };
|
var teamMembers = new List<TaskMembers> { };
|
||||||
foreach (var teamMember in assignTask.TaskTeam) {
|
if (assignTask.TaskTeam != null)
|
||||||
var result = new TaskMembers
|
{
|
||||||
|
foreach (var teamMember in assignTask.TaskTeam)
|
||||||
{
|
{
|
||||||
TaskAllocationId = taskAllocation.Id,
|
var result = new TaskMembers
|
||||||
EmployeeId = teamMember,
|
{
|
||||||
TenantId = tenantId,
|
TaskAllocationId = taskAllocation.Id,
|
||||||
};
|
EmployeeId = teamMember,
|
||||||
teamMembers.Add(result);
|
TenantId = tenantId,
|
||||||
|
};
|
||||||
|
teamMembers.Add(result);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
_context.TaskMembers.AddRange(teamMembers);
|
_context.TaskMembers.AddRange(teamMembers);
|
||||||
await _context.SaveChangesAsync();
|
await _context.SaveChangesAsync();
|
||||||
@ -109,13 +113,17 @@ namespace MarcoBMS.Services.Controllers
|
|||||||
if (taskAllocation == null) {
|
if (taskAllocation == null) {
|
||||||
return BadRequest(ApiResponse<object>.ErrorResponse("No such task has been allocated.", "No such task has been allocated.", 400));
|
return BadRequest(ApiResponse<object>.ErrorResponse("No such task has been allocated.", "No such task has been allocated.", 400));
|
||||||
}
|
}
|
||||||
if(taskAllocation.CompletedTask != 0)
|
if(taskAllocation.WorkItem != null)
|
||||||
{
|
{
|
||||||
taskAllocation.WorkItem.CompletedWork -= taskAllocation.CompletedTask;
|
if (taskAllocation.CompletedTask != 0)
|
||||||
|
{
|
||||||
|
taskAllocation.WorkItem.CompletedWork -= taskAllocation.CompletedTask;
|
||||||
|
}
|
||||||
|
taskAllocation.ReportedDate = reportTask.ReportedDate;
|
||||||
|
taskAllocation.CompletedTask = reportTask.CompletedTask;
|
||||||
|
taskAllocation.WorkItem.CompletedWork += reportTask.CompletedTask;
|
||||||
}
|
}
|
||||||
taskAllocation.ReportedDate = reportTask.ReportedDate;
|
|
||||||
taskAllocation.CompletedTask = reportTask.CompletedTask;
|
|
||||||
taskAllocation.WorkItem.CompletedWork += reportTask.CompletedTask;
|
|
||||||
|
|
||||||
var comment = reportTask.ToCommentFromReportTaskDto(tenantId,Employee.Id);
|
var comment = reportTask.ToCommentFromReportTaskDto(tenantId,Employee.Id);
|
||||||
|
|
||||||
|
@ -3,18 +3,19 @@ using Marco.Pms.DataAccess.Data;
|
|||||||
using Marco.Pms.Model.Employees;
|
using Marco.Pms.Model.Employees;
|
||||||
using Marco.Pms.Model.Mapper;
|
using Marco.Pms.Model.Mapper;
|
||||||
using Marco.Pms.Model.ViewModels.Employee;
|
using Marco.Pms.Model.ViewModels.Employee;
|
||||||
|
using MarcoBMS.Services.Service;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Runtime.Intrinsics.Arm;
|
|
||||||
|
|
||||||
namespace MarcoBMS.Services.Helpers
|
namespace MarcoBMS.Services.Helpers
|
||||||
{
|
{
|
||||||
public class EmployeeHelper
|
public class EmployeeHelper
|
||||||
{
|
{
|
||||||
private readonly ApplicationDbContext _context;
|
private readonly ApplicationDbContext _context;
|
||||||
public EmployeeHelper(ApplicationDbContext context)
|
private readonly ILoggingService _logger;
|
||||||
|
public EmployeeHelper(ApplicationDbContext context, ILoggingService logger)
|
||||||
{
|
{
|
||||||
_context = context;
|
_context = context;
|
||||||
|
_logger = logger;
|
||||||
}
|
}
|
||||||
public async Task<Employee> GetEmployeeByID(int EmployeeID)
|
public async Task<Employee> GetEmployeeByID(int EmployeeID)
|
||||||
{
|
{
|
||||||
@ -28,11 +29,12 @@ namespace MarcoBMS.Services.Helpers
|
|||||||
{
|
{
|
||||||
var result = await _context.Employees.Where(c => c.ApplicationUserId == ApplicationUserID).ToListAsync();
|
var result = await _context.Employees.Where(c => c.ApplicationUserId == ApplicationUserID).ToListAsync();
|
||||||
|
|
||||||
return await _context.Employees.Where(c => c.ApplicationUserId == ApplicationUserID).SingleOrDefaultAsync();
|
return await _context.Employees.Where(c => c.ApplicationUserId == ApplicationUserID).SingleOrDefaultAsync() ?? new Employee { };
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
return null;
|
_logger.LogError("{Error}", ex.Message);
|
||||||
|
return new Employee();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -64,6 +66,7 @@ namespace MarcoBMS.Services.Helpers
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
_logger.LogError("{Error}", ex.Message);
|
||||||
return new List<EmployeeVM>();
|
return new List<EmployeeVM>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -94,6 +97,7 @@ namespace MarcoBMS.Services.Helpers
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
_logger.LogError("{Error}", ex.Message);
|
||||||
return new List<EmployeeVM>();
|
return new List<EmployeeVM>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
using Marco.Pms.DataAccess.Data;
|
using System.Security.Claims;
|
||||||
using Marco.Pms.Model.Dtos.Employees;
|
using Marco.Pms.DataAccess.Data;
|
||||||
using Marco.Pms.Model.Employees;
|
using Marco.Pms.Model.Employees;
|
||||||
using Marco.Pms.Model.Entitlements;
|
|
||||||
using Microsoft.AspNetCore.Identity;
|
using Microsoft.AspNetCore.Identity;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using System.Security.Claims;
|
|
||||||
|
|
||||||
namespace MarcoBMS.Services.Helpers
|
namespace MarcoBMS.Services.Helpers
|
||||||
{
|
{
|
||||||
@ -39,8 +37,9 @@ namespace MarcoBMS.Services.Helpers
|
|||||||
public async Task<Employee> GetCurrentEmployeeAsync()
|
public async Task<Employee> GetCurrentEmployeeAsync()
|
||||||
{
|
{
|
||||||
var user = await GetCurrentUserAsync();
|
var user = await GetCurrentUserAsync();
|
||||||
|
if (user == null) return new Employee { };
|
||||||
var Employee = await _context.Employees.FirstOrDefaultAsync(e => e.ApplicationUserId == user.Id);
|
var Employee = await _context.Employees.FirstOrDefaultAsync(e => e.ApplicationUserId == user.Id);
|
||||||
return Employee;
|
return Employee ?? new Employee { };
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<object?> GetCurrentUserProfileAsync()
|
public async Task<object?> GetCurrentUserProfileAsync()
|
||||||
@ -58,16 +57,7 @@ namespace MarcoBMS.Services.Helpers
|
|||||||
|
|
||||||
public async Task<IdentityUser?> GetRegisteredUser(string email)
|
public async Task<IdentityUser?> GetRegisteredUser(string email)
|
||||||
{
|
{
|
||||||
//IdentityUser? user = await _userManager.Users
|
|
||||||
// .FirstOrDefaultAsync(u => u.Email == model.Email || u.PhoneNumber == model.PhoneNumber);
|
|
||||||
|
|
||||||
|
|
||||||
IdentityUser? user = await _userManager.FindByEmailAsync(email);
|
IdentityUser? user = await _userManager.FindByEmailAsync(email);
|
||||||
//if (user == null)
|
|
||||||
//{
|
|
||||||
// user = await _userManager.Find(model.Email);
|
|
||||||
|
|
||||||
//}
|
|
||||||
return user;
|
return user;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
public async Task Invoke(HttpContext context)
|
public async Task Invoke(HttpContext context)
|
||||||
{
|
{
|
||||||
if (context.User.Identity.IsAuthenticated)
|
if (context.User.Identity != null && context.User.Identity.IsAuthenticated)
|
||||||
{
|
{
|
||||||
var tenantId = context.User.FindFirst("tenantId")?.Value;
|
var tenantId = context.User.FindFirst("tenantId")?.Value;
|
||||||
if (tenantId == null)
|
if (tenantId == null)
|
||||||
|
@ -27,45 +27,33 @@ builder.Host.UseSerilog((context, config) =>
|
|||||||
#region CORS Settings
|
#region CORS Settings
|
||||||
|
|
||||||
// Add services
|
// Add services
|
||||||
builder.Services.AddCors(options =>
|
|
||||||
{
|
|
||||||
options.AddPolicy("DevCorsPolicy", policy =>
|
|
||||||
{
|
|
||||||
policy.AllowAnyOrigin()
|
|
||||||
.AllowAnyMethod()
|
|
||||||
.AllowAnyHeader();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
//var corsSettings = builder.Configuration.GetSection("Cors");
|
|
||||||
//var allowedOrigins = corsSettings.GetValue<string>("AllowedOrigins")?.Split(',');
|
|
||||||
//var allowedMethods = corsSettings.GetValue<string>("AllowedMethods")?.Split(',');
|
|
||||||
//var allowedHeaders = corsSettings.GetValue<string>("AllowedHeaders")?.Split(',');
|
|
||||||
|
|
||||||
//builder.Services.AddCors(options =>
|
//builder.Services.AddCors(options =>
|
||||||
//{
|
//{
|
||||||
// options.AddPolicy("Policy", policy =>
|
// options.AddPolicy("DevCorsPolicy", policy =>
|
||||||
// {
|
// {
|
||||||
// if (allowedOrigins != null)
|
// policy.AllowAnyOrigin()
|
||||||
// {
|
// .AllowAnyMethod()
|
||||||
// policy.WithOrigins(allowedOrigins)
|
// .AllowAnyHeader();
|
||||||
// .WithMethods(allowedMethods)
|
|
||||||
// .WithHeaders(allowedHeaders);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// options.AddPolicy("AllowAll", policy =>
|
|
||||||
// {
|
|
||||||
// if (allowedOrigins != null)
|
|
||||||
// {
|
|
||||||
// policy.AllowAnyOrigin()
|
|
||||||
// .AllowAnyMethod()
|
|
||||||
// .AllowAnyHeader();
|
|
||||||
|
|
||||||
// }
|
|
||||||
// });
|
// });
|
||||||
//});
|
//});
|
||||||
|
|
||||||
#endregion
|
var corsSettings = builder.Configuration.GetSection("Cors");
|
||||||
|
var allowedOrigins = corsSettings.GetValue<string>("AllowedOrigins")?.Split(',');
|
||||||
|
var allowedMethods = corsSettings.GetValue<string>("AllowedMethods")?.Split(',');
|
||||||
|
var allowedHeaders = corsSettings.GetValue<string>("AllowedHeaders")?.Split(',');
|
||||||
|
|
||||||
|
builder.Services.AddCors(options =>
|
||||||
|
{
|
||||||
|
options.AddPolicy("Policy", policy =>
|
||||||
|
{
|
||||||
|
if (allowedOrigins != null && allowedMethods != null && allowedHeaders != null)
|
||||||
|
{
|
||||||
|
policy.WithOrigins(allowedOrigins)
|
||||||
|
.WithMethods(allowedMethods)
|
||||||
|
.WithHeaders(allowedHeaders);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
// Add services to the container.
|
// Add services to the container.
|
||||||
builder.Services.AddControllers();
|
builder.Services.AddControllers();
|
||||||
@ -107,7 +95,7 @@ builder.Services.AddTransient<IEmailSender, EmailSender>();
|
|||||||
builder.Services.AddIdentity<IdentityUser, IdentityRole>().AddEntityFrameworkStores<ApplicationDbContext>().AddDefaultTokenProviders();
|
builder.Services.AddIdentity<IdentityUser, IdentityRole>().AddEntityFrameworkStores<ApplicationDbContext>().AddDefaultTokenProviders();
|
||||||
|
|
||||||
|
|
||||||
string connString = builder.Configuration.GetConnectionString("DefaultConnectionString");
|
string? connString = builder.Configuration.GetConnectionString("DefaultConnectionString");
|
||||||
|
|
||||||
builder.Services.AddDbContext<ApplicationDbContext>(options =>
|
builder.Services.AddDbContext<ApplicationDbContext>(options =>
|
||||||
{
|
{
|
||||||
@ -136,24 +124,27 @@ builder.Services.AddSingleton<ILoggingService, LoggingService>();
|
|||||||
builder.Services.AddHttpContextAccessor();
|
builder.Services.AddHttpContextAccessor();
|
||||||
|
|
||||||
var jwtSettings = builder.Configuration.GetSection("Jwt").Get<JwtSettings>();
|
var jwtSettings = builder.Configuration.GetSection("Jwt").Get<JwtSettings>();
|
||||||
builder.Services.AddAuthentication(options =>
|
if(jwtSettings != null && jwtSettings.Key != null)
|
||||||
{
|
{
|
||||||
options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme;
|
builder.Services.AddAuthentication(options =>
|
||||||
options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme;
|
|
||||||
})
|
|
||||||
.AddJwtBearer(options =>
|
|
||||||
{
|
|
||||||
options.TokenValidationParameters = new TokenValidationParameters
|
|
||||||
{
|
{
|
||||||
ValidateIssuer = true,
|
options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme;
|
||||||
ValidateAudience = true,
|
options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme;
|
||||||
ValidateLifetime = true,
|
})
|
||||||
ValidateIssuerSigningKey = true,
|
.AddJwtBearer(options =>
|
||||||
ValidIssuer = jwtSettings.Issuer,
|
{
|
||||||
ValidAudience = jwtSettings.Audience,
|
options.TokenValidationParameters = new TokenValidationParameters
|
||||||
IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(jwtSettings.Key))
|
{
|
||||||
};
|
ValidateIssuer = true,
|
||||||
});
|
ValidateAudience = true,
|
||||||
|
ValidateLifetime = true,
|
||||||
|
ValidateIssuerSigningKey = true,
|
||||||
|
ValidIssuer = jwtSettings.Issuer,
|
||||||
|
ValidAudience = jwtSettings.Audience,
|
||||||
|
IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(jwtSettings.Key))
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
builder.Services.AddSingleton(jwtSettings);
|
builder.Services.AddSingleton(jwtSettings);
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ namespace MarcoBMS.Services.Service
|
|||||||
{
|
{
|
||||||
void LogInfo(string? message, params object[]? args);
|
void LogInfo(string? message, params object[]? args);
|
||||||
void LogWarning(string? message, params object[]? args);
|
void LogWarning(string? message, params object[]? args);
|
||||||
void LogError(Exception? ex, string? message, params object[]? args);
|
void LogError(string? message, params object[]? args);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,23 +11,42 @@ namespace MarcoBMS.Services.Service
|
|||||||
_logger = logger;
|
_logger = logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LogError(Exception? ex, string? message, params object[]? args)
|
public void LogError(string? message, params object[]? args)
|
||||||
{
|
{
|
||||||
using (LogContext.PushProperty("Error", ex))
|
|
||||||
using (LogContext.PushProperty("LogLevel", "Error"))
|
using (LogContext.PushProperty("LogLevel", "Error"))
|
||||||
_logger.LogError(message, args);
|
if (args != null)
|
||||||
}
|
{
|
||||||
|
_logger.LogError(message, args);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
_logger.LogError(message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void LogInfo(string? message, params object[]? args)
|
public void LogInfo(string? message, params object[]? args)
|
||||||
{
|
{
|
||||||
using (LogContext.PushProperty("LogLevel", "Information"))
|
using (LogContext.PushProperty("LogLevel", "Information"))
|
||||||
_logger.LogInformation(message, args);
|
if (args != null)
|
||||||
|
{
|
||||||
|
_logger.LogInformation(message, args);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_logger.LogInformation(message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LogWarning(string? message, params object[]? args)
|
public void LogWarning(string? message, params object[]? args)
|
||||||
{
|
{
|
||||||
using (LogContext.PushProperty("LogLevel", "Warning"))
|
using (LogContext.PushProperty("LogLevel", "Warning"))
|
||||||
_logger.LogWarning(message,args);
|
if (args != null)
|
||||||
|
{
|
||||||
|
_logger.LogWarning(message, args);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_logger.LogWarning(message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,30 +1,27 @@
|
|||||||
using Marco.Pms.DataAccess.Data;
|
using System.IdentityModel.Tokens.Jwt;
|
||||||
|
using System.Security.Claims;
|
||||||
|
using System.Text;
|
||||||
|
using Marco.Pms.DataAccess.Data;
|
||||||
using Marco.Pms.Model.Authentication;
|
using Marco.Pms.Model.Authentication;
|
||||||
using Marco.Pms.Model.Entitlements;
|
|
||||||
using Microsoft.AspNetCore.Identity;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.Extensions.Caching.Memory;
|
using Microsoft.Extensions.Caching.Memory;
|
||||||
using Microsoft.IdentityModel.Tokens;
|
using Microsoft.IdentityModel.Tokens;
|
||||||
using Newtonsoft.Json.Linq;
|
|
||||||
using SharpCompress.Common;
|
|
||||||
using System.IdentityModel.Tokens.Jwt;
|
|
||||||
using System.Security.Claims;
|
|
||||||
using System.Security.Cryptography;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
namespace MarcoBMS.Services.Service
|
namespace MarcoBMS.Services.Service
|
||||||
{
|
{
|
||||||
public class RefreshTokenService
|
public class RefreshTokenService
|
||||||
{
|
{
|
||||||
private readonly ApplicationDbContext _context;
|
private readonly ApplicationDbContext _context;
|
||||||
private readonly IMemoryCache _cache; // For optional JWT blacklisting
|
private readonly IMemoryCache _cache; // For optional JWT blacklisting
|
||||||
|
private readonly ILoggingService _logger;
|
||||||
|
|
||||||
|
|
||||||
public RefreshTokenService(ApplicationDbContext context, IMemoryCache cache)
|
public RefreshTokenService(ApplicationDbContext context, IMemoryCache cache, ILoggingService logger)
|
||||||
{
|
{
|
||||||
_context = context;
|
_context = context;
|
||||||
_cache = cache;
|
_cache = cache;
|
||||||
|
_logger = logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
public string GenerateJwtToken(string username, string tenantId, JwtSettings _jwtSettings)
|
public string GenerateJwtToken(string username, string tenantId, JwtSettings _jwtSettings)
|
||||||
@ -94,13 +91,14 @@ namespace MarcoBMS.Services.Service
|
|||||||
return strToken;
|
return strToken;
|
||||||
}catch(Exception ex)
|
}catch(Exception ex)
|
||||||
{
|
{
|
||||||
|
_logger.LogError("{Error}", ex.Message);
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<RefreshToken> GetRefreshToken(string token)
|
public async Task<RefreshToken> GetRefreshToken(string token)
|
||||||
{
|
{
|
||||||
return await _context.RefreshTokens.FirstOrDefaultAsync(rt => rt.Token == token && !rt.IsRevoked && !rt.IsUsed);
|
return await _context.RefreshTokens.FirstOrDefaultAsync(rt => rt.Token == token && !rt.IsRevoked && !rt.IsUsed) ?? new RefreshToken();
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task MarkRefreshTokenAsUsed(RefreshToken refreshToken)
|
public async Task MarkRefreshTokenAsUsed(RefreshToken refreshToken)
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
"Override": {
|
"Override": {
|
||||||
"Microsoft": "Warning",
|
"Microsoft": "Warning",
|
||||||
"Microsoft.EntityFrameworkCore.Database.Command": "Warning",
|
"Microsoft.EntityFrameworkCore.Database.Command": "Warning",
|
||||||
"Microsoft.AspNetCore.Mvc.Infrastructure": "Warning",
|
"Microsoft.AspNetCore.Mvc.Infrastructure": "Warning"
|
||||||
//"Serilog.AspNetCore.RequestLoggingMiddleware": "Warning"
|
//"Serilog.AspNetCore.RequestLoggingMiddleware": "Warning"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -64,7 +64,7 @@
|
|||||||
|
|
||||||
"ConnectionStrings": {
|
"ConnectionStrings": {
|
||||||
// "DefaultConnectionString": "Server=103.50.160.45;User ID=marcowvh_admin;Password=Marcoemp@123;Database=marcowvh_empattendanceci",
|
// "DefaultConnectionString": "Server=103.50.160.45;User ID=marcowvh_admin;Password=Marcoemp@123;Database=marcowvh_empattendanceci",
|
||||||
"DefaultConnectionString": "Server=localhost;port=3306;User ID=root;Password=root;Database=MarcoBMS2",
|
"DefaultConnectionString": "Server=localhost;port=3306;User ID=root;Password=root;Database=MarcoBMS2"
|
||||||
//"DefaultConnectionString": "Server=147.93.98.152;User ID=devuser;Password=AppUser@123$;Database=MarcoBMS1"
|
//"DefaultConnectionString": "Server=147.93.98.152;User ID=devuser;Password=AppUser@123$;Database=MarcoBMS1"
|
||||||
},
|
},
|
||||||
"AppSettings": {
|
"AppSettings": {
|
||||||
|
@ -1,12 +1,4 @@
|
|||||||
using Microsoft.AspNetCore.Http;
|
namespace Marco.Pms.Utility
|
||||||
using Newtonsoft.Json;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Marco.Pms.Utility
|
|
||||||
{
|
{
|
||||||
public class SessionUtil
|
public class SessionUtil
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user