Compare commits

...

24 Commits

Author SHA1 Message Date
832555d2b2 Merge pull request 'Ashutosh_ActivityMaster_managenment' (#17) from Ashutosh_ActivityMaster_managenment into Feature_Task_management
Reviewed-on: #17
2025-04-14 09:23:47 +00:00
829a421ab0 Fixed Confilts 2025-04-14 13:37:27 +05:30
f57e40219e Merge branch 'Ashutosh_ActivityMaster_managenment' of https://git.marcoaiot.com/admin/marco.pms.api into Ashutosh_ActivityMaster_managenment 2025-04-14 12:57:06 +05:30
498ea6e4e7 Added the Check list in Activity Master APIs 2025-04-14 12:56:49 +05:30
3ec3618b7e Fixed code error 2025-04-14 12:55:47 +05:30
c6f3216150 Added CheckList to Update and Create API 2025-04-14 12:55:09 +05:30
ed449fdf47 Created new Api for creating and editing activities 2025-04-14 12:55:05 +05:30
17994bff08 Added CheckList to Update and Create API 2025-04-14 12:52:58 +05:30
16a4234f75 Created new Api for creating and editing activities 2025-04-14 12:52:54 +05:30
d1be217740 Fixed code error 2025-04-14 12:52:01 +05:30
f391806a57 Added CheckList to Update and Create API 2025-04-14 12:51:52 +05:30
c3079258d9 Created new Api for creating and editing activities 2025-04-14 12:51:08 +05:30
a51c11389d Added the Check list in Activity Master APIs 2025-04-14 12:28:25 +05:30
e4f8e507d5 Merge branch 'Ashutosh_ActivityMaster_managenment' of https://git.marcoaiot.com/admin/marco.pms.api into Ashutosh_ActivityMaster_managenment 2025-04-11 17:26:25 +05:30
23322fdeb2 Fixed code error 2025-04-11 17:22:38 +05:30
0fe811d78c Added CheckList to Update and Create API 2025-04-11 17:21:04 +05:30
689d5c28bb Created new Api for creating and editing activities 2025-04-11 17:21:04 +05:30
b8e2c265be Fixed code error 2025-04-11 17:19:32 +05:30
3fabadc380 Added the date filter while fetching data from database 2025-04-11 16:40:57 +05:30
b624e9ec62 Merge branch 'Ashutosh_ActivityMaster_managenment' of https://git.marcoaiot.com/admin/marco.pms.api into Ashutosh_ActivityMaster_managenment 2025-04-11 16:17:22 +05:30
3702dae1ac Added CheckList to Update and Create API 2025-04-11 16:16:53 +05:30
e53d45ed77 Created new Api for creating and editing activities 2025-04-11 16:16:53 +05:30
90b5152bb2 Added CheckList to Update and Create API 2025-04-10 19:56:30 +05:30
81d487f9f2 Created new Api for creating and editing activities 2025-04-10 19:16:21 +05:30
39 changed files with 3366 additions and 145 deletions

View File

@ -72,6 +72,7 @@ namespace Marco.Pms.DataAccess.Data
public DbSet<RolePermissionMappings> RolePermissionMappings { get; set; }
public DbSet<Industry>Industries { get; set; }
public DbSet<ActivityCheckList>ActivityCheckLists { get; set; }
protected override void OnModelCreating(ModelBuilder modelBuilder)
{

View File

@ -79,7 +79,7 @@ namespace Marco.Pms.DataAccess.Initializer
ApplicationUserId = user.Id,
BirthDate = DateTime.MinValue,
PanNumber = "",
PeramnentAddress = "",
PermanentAddress = "",
PhoneNumber = "",
TenantId = user.TenantId
};

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,984 @@
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Added_Check_List_Table : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "PeramnentAddress",
table: "Employees");
migrationBuilder.AlterColumn<string>(
name: "Name",
table: "WorkShifts",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "Name",
table: "Tenants",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "DomainName",
table: "Tenants",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "Description",
table: "Tenants",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "ContactNumber",
table: "Tenants",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "ContactName",
table: "Tenants",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "Status",
table: "StatusMasters",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "UserId",
table: "RefreshTokens",
type: "varchar(255)",
nullable: true,
oldClrType: typeof(string),
oldType: "varchar(255)")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "Token",
table: "RefreshTokens",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "ProjectAddress",
table: "Projects",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "ContactPerson",
table: "Projects",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "Description",
table: "Modules",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "Name",
table: "JobRoles",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "Name",
table: "Industries",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "Name",
table: "Features",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "Description",
table: "Features",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "Name",
table: "FeaturePermissions",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "Description",
table: "FeaturePermissions",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "PhoneNumber",
table: "Employees",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "LastName",
table: "Employees",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "Gender",
table: "Employees",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "FirstName",
table: "Employees",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "EmergencyPhoneNumber",
table: "Employees",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "EmergencyContactPerson",
table: "Employees",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "CurrentAddress",
table: "Employees",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "PermanentAddress",
table: "Employees",
type: "longtext",
nullable: true)
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "Role",
table: "ApplicationRoles",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "Description",
table: "ApplicationRoles",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "UnitOfMeasurement",
table: "ActivityMasters",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "ActivityName",
table: "ActivityMasters",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<bool>(
name: "IsActive",
table: "ActivityMasters",
type: "tinyint(1)",
nullable: false,
defaultValue: false);
migrationBuilder.CreateTable(
name: "ActivityCheckLists",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
ActivityMasterId = table.Column<int>(type: "int", nullable: false),
Check = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
IsChecked = table.Column<bool>(type: "tinyint(1)", nullable: false),
IsMandatory = table.Column<bool>(type: "tinyint(1)", nullable: false),
TenantId = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ActivityCheckLists", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "ActivityMasters",
keyColumn: "Id",
keyValue: 1,
column: "IsActive",
value: true);
migrationBuilder.UpdateData(
table: "ActivityMasters",
keyColumn: "Id",
keyValue: 2,
column: "IsActive",
value: true);
migrationBuilder.UpdateData(
table: "ActivityMasters",
keyColumn: "Id",
keyValue: 3,
column: "IsActive",
value: true);
migrationBuilder.UpdateData(
table: "ActivityMasters",
keyColumn: "Id",
keyValue: 4,
column: "IsActive",
value: true);
migrationBuilder.UpdateData(
table: "ActivityMasters",
keyColumn: "Id",
keyValue: 5,
column: "IsActive",
value: true);
migrationBuilder.UpdateData(
table: "ActivityMasters",
keyColumn: "Id",
keyValue: 6,
column: "IsActive",
value: true);
migrationBuilder.UpdateData(
table: "ActivityMasters",
keyColumn: "Id",
keyValue: 7,
column: "IsActive",
value: true);
migrationBuilder.UpdateData(
table: "ActivityMasters",
keyColumn: "Id",
keyValue: 8,
column: "IsActive",
value: true);
migrationBuilder.UpdateData(
table: "ActivityMasters",
keyColumn: "Id",
keyValue: 9,
column: "IsActive",
value: true);
migrationBuilder.UpdateData(
table: "ActivityMasters",
keyColumn: "Id",
keyValue: 10,
column: "IsActive",
value: true);
migrationBuilder.UpdateData(
table: "ActivityMasters",
keyColumn: "Id",
keyValue: 11,
column: "IsActive",
value: true);
migrationBuilder.UpdateData(
table: "ActivityMasters",
keyColumn: "Id",
keyValue: 12,
column: "IsActive",
value: true);
migrationBuilder.UpdateData(
table: "ActivityMasters",
keyColumn: "Id",
keyValue: 13,
column: "IsActive",
value: true);
migrationBuilder.UpdateData(
table: "ActivityMasters",
keyColumn: "Id",
keyValue: 14,
column: "IsActive",
value: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "ActivityCheckLists");
migrationBuilder.DropColumn(
name: "PermanentAddress",
table: "Employees");
migrationBuilder.DropColumn(
name: "IsActive",
table: "ActivityMasters");
migrationBuilder.UpdateData(
table: "WorkShifts",
keyColumn: "Name",
keyValue: null,
column: "Name",
value: "");
migrationBuilder.AlterColumn<string>(
name: "Name",
table: "WorkShifts",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "Tenants",
keyColumn: "Name",
keyValue: null,
column: "Name",
value: "");
migrationBuilder.AlterColumn<string>(
name: "Name",
table: "Tenants",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "Tenants",
keyColumn: "DomainName",
keyValue: null,
column: "DomainName",
value: "");
migrationBuilder.AlterColumn<string>(
name: "DomainName",
table: "Tenants",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "Tenants",
keyColumn: "Description",
keyValue: null,
column: "Description",
value: "");
migrationBuilder.AlterColumn<string>(
name: "Description",
table: "Tenants",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "Tenants",
keyColumn: "ContactNumber",
keyValue: null,
column: "ContactNumber",
value: "");
migrationBuilder.AlterColumn<string>(
name: "ContactNumber",
table: "Tenants",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "Tenants",
keyColumn: "ContactName",
keyValue: null,
column: "ContactName",
value: "");
migrationBuilder.AlterColumn<string>(
name: "ContactName",
table: "Tenants",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "StatusMasters",
keyColumn: "Status",
keyValue: null,
column: "Status",
value: "");
migrationBuilder.AlterColumn<string>(
name: "Status",
table: "StatusMasters",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "RefreshTokens",
keyColumn: "UserId",
keyValue: null,
column: "UserId",
value: "");
migrationBuilder.AlterColumn<string>(
name: "UserId",
table: "RefreshTokens",
type: "varchar(255)",
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(255)",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "RefreshTokens",
keyColumn: "Token",
keyValue: null,
column: "Token",
value: "");
migrationBuilder.AlterColumn<string>(
name: "Token",
table: "RefreshTokens",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "Projects",
keyColumn: "ProjectAddress",
keyValue: null,
column: "ProjectAddress",
value: "");
migrationBuilder.AlterColumn<string>(
name: "ProjectAddress",
table: "Projects",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "Projects",
keyColumn: "ContactPerson",
keyValue: null,
column: "ContactPerson",
value: "");
migrationBuilder.AlterColumn<string>(
name: "ContactPerson",
table: "Projects",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Description",
keyValue: null,
column: "Description",
value: "");
migrationBuilder.AlterColumn<string>(
name: "Description",
table: "Modules",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "JobRoles",
keyColumn: "Name",
keyValue: null,
column: "Name",
value: "");
migrationBuilder.AlterColumn<string>(
name: "Name",
table: "JobRoles",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "Industries",
keyColumn: "Name",
keyValue: null,
column: "Name",
value: "");
migrationBuilder.AlterColumn<string>(
name: "Name",
table: "Industries",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "Features",
keyColumn: "Name",
keyValue: null,
column: "Name",
value: "");
migrationBuilder.AlterColumn<string>(
name: "Name",
table: "Features",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "Features",
keyColumn: "Description",
keyValue: null,
column: "Description",
value: "");
migrationBuilder.AlterColumn<string>(
name: "Description",
table: "Features",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "FeaturePermissions",
keyColumn: "Name",
keyValue: null,
column: "Name",
value: "");
migrationBuilder.AlterColumn<string>(
name: "Name",
table: "FeaturePermissions",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "FeaturePermissions",
keyColumn: "Description",
keyValue: null,
column: "Description",
value: "");
migrationBuilder.AlterColumn<string>(
name: "Description",
table: "FeaturePermissions",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "Employees",
keyColumn: "PhoneNumber",
keyValue: null,
column: "PhoneNumber",
value: "");
migrationBuilder.AlterColumn<string>(
name: "PhoneNumber",
table: "Employees",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "Employees",
keyColumn: "LastName",
keyValue: null,
column: "LastName",
value: "");
migrationBuilder.AlterColumn<string>(
name: "LastName",
table: "Employees",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "Employees",
keyColumn: "Gender",
keyValue: null,
column: "Gender",
value: "");
migrationBuilder.AlterColumn<string>(
name: "Gender",
table: "Employees",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "Employees",
keyColumn: "FirstName",
keyValue: null,
column: "FirstName",
value: "");
migrationBuilder.AlterColumn<string>(
name: "FirstName",
table: "Employees",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "Employees",
keyColumn: "EmergencyPhoneNumber",
keyValue: null,
column: "EmergencyPhoneNumber",
value: "");
migrationBuilder.AlterColumn<string>(
name: "EmergencyPhoneNumber",
table: "Employees",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "Employees",
keyColumn: "EmergencyContactPerson",
keyValue: null,
column: "EmergencyContactPerson",
value: "");
migrationBuilder.AlterColumn<string>(
name: "EmergencyContactPerson",
table: "Employees",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "Employees",
keyColumn: "CurrentAddress",
keyValue: null,
column: "CurrentAddress",
value: "");
migrationBuilder.AlterColumn<string>(
name: "CurrentAddress",
table: "Employees",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "PeramnentAddress",
table: "Employees",
type: "longtext",
nullable: false)
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "ApplicationRoles",
keyColumn: "Role",
keyValue: null,
column: "Role",
value: "");
migrationBuilder.AlterColumn<string>(
name: "Role",
table: "ApplicationRoles",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "ApplicationRoles",
keyColumn: "Description",
keyValue: null,
column: "Description",
value: "");
migrationBuilder.AlterColumn<string>(
name: "Description",
table: "ApplicationRoles",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "ActivityMasters",
keyColumn: "UnitOfMeasurement",
keyValue: null,
column: "UnitOfMeasurement",
value: "");
migrationBuilder.AlterColumn<string>(
name: "UnitOfMeasurement",
table: "ActivityMasters",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "ActivityMasters",
keyColumn: "ActivityName",
keyValue: null,
column: "ActivityName",
value: "");
migrationBuilder.AlterColumn<string>(
name: "ActivityName",
table: "ActivityMasters",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
}
}
}

View File

@ -258,11 +258,9 @@ namespace Marco.Pms.DataAccess.Migrations
.HasColumnType("datetime(6)");
b.Property<string>("Token")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("varchar(255)");
b.HasKey("Id");
@ -290,26 +288,21 @@ namespace Marco.Pms.DataAccess.Migrations
.HasColumnType("datetime(6)");
b.Property<string>("CurrentAddress")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("Email")
.HasColumnType("longtext");
b.Property<string>("EmergencyContactPerson")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("EmergencyPhoneNumber")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("FirstName")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("Gender")
.IsRequired()
.HasColumnType("longtext");
b.Property<bool>("IsActive")
@ -322,7 +315,6 @@ namespace Marco.Pms.DataAccess.Migrations
.HasColumnType("datetime(6)");
b.Property<string>("LastName")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("MiddleName")
@ -331,12 +323,10 @@ namespace Marco.Pms.DataAccess.Migrations
b.Property<string>("PanNumber")
.HasColumnType("longtext");
b.Property<string>("PeramnentAddress")
.IsRequired()
b.Property<string>("PermanentAddress")
.HasColumnType("longtext");
b.Property<string>("PhoneNumber")
.IsRequired()
.HasColumnType("longtext");
b.Property<byte[]>("Photo")
@ -371,7 +361,6 @@ namespace Marco.Pms.DataAccess.Migrations
.HasColumnType("time(6)");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
b.Property<TimeOnly>("StartTime")
@ -387,6 +376,34 @@ namespace Marco.Pms.DataAccess.Migrations
b.ToTable("WorkShifts");
});
modelBuilder.Entity("Marco.Pms.Model.Entitlements.ActivityCheckList", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<int>("ActivityMasterId")
.HasColumnType("int");
b.Property<string>("Check")
.HasColumnType("longtext");
b.Property<bool>("IsChecked")
.HasColumnType("tinyint(1)");
b.Property<bool>("IsMandatory")
.HasColumnType("tinyint(1)");
b.Property<int>("TenantId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("ActivityCheckLists");
});
modelBuilder.Entity("Marco.Pms.Model.Entitlements.ActivityMaster", b =>
{
b.Property<int>("Id")
@ -396,14 +413,15 @@ namespace Marco.Pms.DataAccess.Migrations
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("ActivityName")
.IsRequired()
.HasColumnType("longtext");
b.Property<bool>("IsActive")
.HasColumnType("tinyint(1)");
b.Property<int>("TenantId")
.HasColumnType("int");
b.Property<string>("UnitOfMeasurement")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("Id");
@ -417,6 +435,7 @@ namespace Marco.Pms.DataAccess.Migrations
{
Id = 1,
ActivityName = "Core Cutting",
IsActive = true,
TenantId = 1,
UnitOfMeasurement = "Number"
},
@ -424,6 +443,7 @@ namespace Marco.Pms.DataAccess.Migrations
{
Id = 2,
ActivityName = "Fabrication",
IsActive = true,
TenantId = 1,
UnitOfMeasurement = "Meter"
},
@ -431,6 +451,7 @@ namespace Marco.Pms.DataAccess.Migrations
{
Id = 3,
ActivityName = "Lifting",
IsActive = true,
TenantId = 1,
UnitOfMeasurement = "Meter"
},
@ -438,6 +459,7 @@ namespace Marco.Pms.DataAccess.Migrations
{
Id = 4,
ActivityName = "Hanging",
IsActive = true,
TenantId = 1,
UnitOfMeasurement = "Meter"
},
@ -445,6 +467,7 @@ namespace Marco.Pms.DataAccess.Migrations
{
Id = 5,
ActivityName = "Tapping",
IsActive = true,
TenantId = 1,
UnitOfMeasurement = "Meter"
},
@ -452,6 +475,7 @@ namespace Marco.Pms.DataAccess.Migrations
{
Id = 6,
ActivityName = "Welding",
IsActive = true,
TenantId = 1,
UnitOfMeasurement = "Meter"
},
@ -459,6 +483,7 @@ namespace Marco.Pms.DataAccess.Migrations
{
Id = 7,
ActivityName = "Testing",
IsActive = true,
TenantId = 1,
UnitOfMeasurement = "Area"
},
@ -466,6 +491,7 @@ namespace Marco.Pms.DataAccess.Migrations
{
Id = 8,
ActivityName = "Painting",
IsActive = true,
TenantId = 1,
UnitOfMeasurement = "Meter"
},
@ -473,6 +499,7 @@ namespace Marco.Pms.DataAccess.Migrations
{
Id = 9,
ActivityName = "Marking Area",
IsActive = true,
TenantId = 1,
UnitOfMeasurement = "Meter"
},
@ -480,6 +507,7 @@ namespace Marco.Pms.DataAccess.Migrations
{
Id = 10,
ActivityName = "Drilling",
IsActive = true,
TenantId = 1,
UnitOfMeasurement = "Number"
},
@ -487,6 +515,7 @@ namespace Marco.Pms.DataAccess.Migrations
{
Id = 11,
ActivityName = "MS Support Fabrication",
IsActive = true,
TenantId = 1,
UnitOfMeasurement = "Number"
},
@ -494,6 +523,7 @@ namespace Marco.Pms.DataAccess.Migrations
{
Id = 12,
ActivityName = "MS Support Hanging",
IsActive = true,
TenantId = 1,
UnitOfMeasurement = "Number"
},
@ -501,6 +531,7 @@ namespace Marco.Pms.DataAccess.Migrations
{
Id = 13,
ActivityName = "Hydrant Volve",
IsActive = true,
TenantId = 1,
UnitOfMeasurement = "Number"
},
@ -508,6 +539,7 @@ namespace Marco.Pms.DataAccess.Migrations
{
Id = 14,
ActivityName = "Sprinkler Installation",
IsActive = true,
TenantId = 1,
UnitOfMeasurement = "Number"
});
@ -520,11 +552,9 @@ namespace Marco.Pms.DataAccess.Migrations
.HasColumnType("char(36)");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("Role")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("TenantId")
@ -610,7 +640,6 @@ namespace Marco.Pms.DataAccess.Migrations
.HasColumnType("char(36)");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("longtext");
b.Property<bool>("IsActive")
@ -620,7 +649,6 @@ namespace Marco.Pms.DataAccess.Migrations
.HasColumnType("int");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("Id");
@ -703,7 +731,6 @@ namespace Marco.Pms.DataAccess.Migrations
.HasColumnType("char(36)");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("longtext");
b.Property<Guid>("FeatureId")
@ -713,7 +740,6 @@ namespace Marco.Pms.DataAccess.Migrations
.HasColumnType("tinyint(1)");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("Id");
@ -881,7 +907,6 @@ namespace Marco.Pms.DataAccess.Migrations
.HasColumnType("longtext");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("TenantId")
@ -903,7 +928,6 @@ namespace Marco.Pms.DataAccess.Migrations
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Description")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("Key")
@ -966,7 +990,6 @@ namespace Marco.Pms.DataAccess.Migrations
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Status")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("TenantId")
@ -1014,19 +1037,15 @@ namespace Marco.Pms.DataAccess.Migrations
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("ContactName")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("ContactNumber")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("DomainName")
.IsRequired()
.HasColumnType("longtext");
b.Property<int?>("IndustryId")
@ -1036,7 +1055,6 @@ namespace Marco.Pms.DataAccess.Migrations
.HasColumnType("tinyint(1)");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
b.Property<DateTime>("OnBoardingDate")
@ -1075,7 +1093,6 @@ namespace Marco.Pms.DataAccess.Migrations
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("Id");
@ -1194,7 +1211,6 @@ namespace Marco.Pms.DataAccess.Migrations
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("ContactPerson")
.IsRequired()
.HasColumnType("longtext");
b.Property<DateTime?>("EndDate")
@ -1205,7 +1221,6 @@ namespace Marco.Pms.DataAccess.Migrations
.HasColumnType("longtext");
b.Property<string>("ProjectAddress")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("ProjectStatusId")
@ -1718,8 +1733,7 @@ namespace Marco.Pms.DataAccess.Migrations
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", "User")
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
.OnDelete(DeleteBehavior.Cascade);
b.Navigation("User");
});

View File

@ -12,17 +12,16 @@ namespace Marco.Pms.Model.Activities
public long TaskAllocationId { get; set; }
[ValidateNever]
[ForeignKey(nameof(TaskAllocationId))]
public TaskAllocation TaskAllocation { get; set; }
public TaskAllocation? TaskAllocation { get; set; }
public int EmployeeId { get; set; }
[ForeignKey("EmployeeId")]
[ValidateNever]
public Employee Employee { get; set; }
public Employee? Employee { get; set; }
public int TenantId { get; set; }
[ValidateNever]
[ForeignKey(nameof(TenantId))]
public Tenant Tenant { get; set; }
public Tenant? Tenant { get; set; }
}
}

View File

@ -46,6 +46,6 @@ namespace Marco.Pms.Model.AttendanceModule
public int TenantId { get; set; }
[ValidateNever]
[ForeignKey(nameof(TenantId))]
public Tenant Tenant { get; set; }
public Tenant? Tenant { get; set; }
}
}

View File

@ -5,8 +5,8 @@ namespace Marco.Pms.Model.Authentication
public class RefreshToken
{
public int Id { get; set; }
public string Token { get; set; }
public string UserId { get; set; }
public string? Token { get; set; }
public string? UserId { get; set; }
public DateTime ExpiryDate { get; set; }
public bool IsRevoked { get; set; }
public bool IsUsed { get; set; }
@ -15,6 +15,6 @@ namespace Marco.Pms.Model.Authentication
// Relationship with the User
public IdentityUser User { get; set; }
public IdentityUser? User { get; set; }
}
}

View File

@ -4,5 +4,6 @@
{
public string? ActivityName { get; set; }
public string? UnitOfMeasurement { get; set; }
public List<CreateCheckListDto>? CheckList { get; set; }
}
}

View File

@ -0,0 +1,9 @@
namespace Marco.Pms.Model.Dtos.Activities
{
public class CreateCheckListDto
{
public int Id { get; set; }
public string? Check { get; set; }
public bool IsMandatory { get; set; }
}
}

View File

@ -8,21 +8,21 @@ namespace Marco.Pms.Model.Employees
public class Employee
{
public int Id { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string? FirstName { get; set; }
public string? LastName { get; set; }
public string? MiddleName { get; set; }
public string? Email { get; set; }
public string Gender { get; set; }
public string? Gender { get; set; }
public DateTime? BirthDate { get; set; }
public DateTime? JoiningDate { get; set; }
public string PeramnentAddress { get; set; }
public string CurrentAddress { get; set; }
public string PhoneNumber { get; set; }
public string? PermanentAddress { get; set; }
public string? CurrentAddress { get; set; }
public string? PhoneNumber { get; set; }
public string EmergencyPhoneNumber { get; set; }
public string EmergencyContactPerson { get; set; }
public string? EmergencyPhoneNumber { get; set; }
public string? EmergencyContactPerson { get; set; }
public string? AadharNumber { get; set; }
@ -42,8 +42,7 @@ namespace Marco.Pms.Model.Employees
[ValidateNever]
[ForeignKey(nameof(TenantId))]
public Tenant Tenant { get; set; }
public Tenant? Tenant { get; set; }
public Guid RoleId { get; set; }
//[ForeignKey(nameof(RoleId))]
//public EmployeeRole EmployeeRole { get; set; }

View File

@ -1,5 +1,5 @@
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
namespace Marco.Pms.Model.Employees
{

View File

@ -9,7 +9,7 @@ namespace Marco.Pms.Model.Employees
{
public int Id { get; set; }
[DisplayName("Shift Name")]
public string Name { get; set; }
public string? Name { get; set; }
public TimeOnly StartTime { get; set; }
public TimeOnly EndTime { get; set; }
@ -18,7 +18,7 @@ namespace Marco.Pms.Model.Employees
[ValidateNever]
[ForeignKey(nameof(TenantId))]
public Tenant Tenant { get; set; }
public Tenant? Tenant { get; set; }
}
}

View File

@ -0,0 +1,12 @@
namespace Marco.Pms.Model.Entitlements
{
public class ActivityCheckList
{
public int Id { get; set; }
public int ActivityMasterId { get; set; }
public string? Check { get; set; }
public bool IsChecked { get; set; } = false;
public bool IsMandatory { get; set; }
public int TenantId { get; set; }
}
}

View File

@ -7,15 +7,16 @@ namespace Marco.Pms.Model.Entitlements
public class ActivityMaster
{
public int Id { get; set; }
public string ActivityName { get; set; }
public string? ActivityName { get; set; }
public string UnitOfMeasurement { get; set; }
public string? UnitOfMeasurement { get; set; }
[DisplayName("TenantId")]
public int TenantId { get; set; }
[ValidateNever]
[ForeignKey(nameof(TenantId))]
public Tenant Tenant { get; set; }
public Tenant? Tenant { get; set; }
public bool IsActive { get; set; } = true;
}
}

View File

@ -1,14 +1,10 @@
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations.Schema;
namespace Marco.Pms.Model.Entitlements
namespace Marco.Pms.Model.Entitlements
{
public class ApplicationRole
{
public Guid Id { get; set; }
public string Role { get; set; }
public string Description { get; set; }
public string? Role { get; set; }
public string? Description { get; set; }
public int TenantId { get; set; }

View File

@ -7,18 +7,18 @@ namespace Marco.Pms.Model.Entitlements
public class Tenant
{
public int Id { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public string DomainName { get; set; }
public string ContactName { get; set; }
public string ContactNumber { get; set; }
public string? Name { get; set; }
public string? Description { get; set; }
public string? DomainName { get; set; }
public string? ContactName { get; set; }
public string? ContactNumber { get; set; }
public DateTime OnBoardingDate { get; set; }
public string? OragnizationSize { get; set; }
public int? IndustryId { get;set; }
[ForeignKey("IndustryId")]
[ValidateNever]
public Industry Industry{ get; set; }
public Industry? Industry{ get; set; }
public bool IsActive { get; set; } = true;
}

View File

@ -10,19 +10,19 @@ namespace Marco.Pms.Model.Entitlements
public int EmployeeId { get; set; }
[ValidateNever]
[ForeignKey(nameof(EmployeeId))]
public Employee Employee { get; set; } // Navigation property to Employee
public Employee? Employee { get; set; } // Navigation property to Employee
public Guid RoleId { get; set; }
[ValidateNever]
[ForeignKey(nameof(RoleId))]
public ApplicationRole Role { get; set; }
public ApplicationRole? Role { get; set; }
public bool IsEnabled { get; set; }
public int TenantId { get; set; }
[ValidateNever]
[ForeignKey(nameof(TenantId))]
public Tenant Tenant { get; set; }
public Tenant? Tenant { get; set; }
}
}

View File

@ -9,12 +9,12 @@ namespace Marco.Pms.Model.Entitlements
public int ModuleId { get; set; }
[ValidateNever]
[ForeignKey(nameof(ModuleId))]
public Module Module { get; set; }
public string Name { get; set; } // Feature name
public string Description { get; set; } // Feature description
public Module? Module { get; set; }
public string? Name { get; set; } // Feature name
public string? Description { get; set; } // Feature description
public bool IsActive { get; set; }
public ICollection<FeaturePermission> FeaturePermissions { get; set; } // Features assigned to this role
public ICollection<FeaturePermission>? FeaturePermissions { get; set; }// Features assigned to this role
}
}

View File

@ -1,12 +1,5 @@
using Marco.Pms.Model.Projects;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Marco.Pms.Model.Entitlements
{
@ -17,10 +10,10 @@ namespace Marco.Pms.Model.Entitlements
public Guid FeatureId { get; set; } // Foreign key to Feature
[ForeignKey("FeatureId")]
[ValidateNever]
public Feature Feature { get; set; }
public Feature? Feature { get; set; }
public string Name { get; set; } // Feature name
public string Description { get; set; } // Feature description
public string? Name { get; set; } // Feature name
public string? Description { get; set; } // Feature description
public bool IsEnabled { get; set; } // Whether the feature is enabled for this role

View File

@ -1,17 +1,17 @@
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
namespace Marco.Pms.Model.Entitlements
{
public class JobRole
{
public int Id { get; set; }
public string Name { get; set; }
public string? Name { get; set; }
public string? Description { get; set; }
public int TenantId { get; set; }
[ValidateNever]
[ForeignKey(nameof(TenantId))]
public Tenant Tenant { get; set; }
public Tenant? Tenant { get; set; }
}
}

View File

@ -13,9 +13,9 @@ namespace Marco.Pms.Model.Entitlements
public int Id { get; set; }
[Required]
public string Name { get; set; }
public string? Name { get; set; }
public string Description { get; set; }
public string? Description { get; set; }

View File

@ -12,13 +12,13 @@ namespace Marco.Pms.Model.Entitlements
public class StatusMaster
{
public int Id { get; set; }
public string Status { get; set; }
public string? Status { get; set; }
[DisplayName("TenantId")]
public int TenantId { get; set; }
[ValidateNever]
[ForeignKey(nameof(TenantId))]
public Tenant Tenant { get; set; }
public Tenant? Tenant { get; set; }
}
}

View File

@ -3,6 +3,6 @@
public class Industry
{
public int Id { get; set; }
public string Name { get; set; }
public string? Name { get; set; }
}
}

View File

@ -122,5 +122,37 @@ namespace Marco.Pms.Model.Mapper
Employee = comment.Employee.ToEmployeeVMFromEmployee()
};
}
public static ActivityVM ToActivityVMFromActivityMaster(this ActivityMaster activity,List<CheckListVM> checkList)
{
return new ActivityVM
{
Id = activity.Id,
ActivityName = activity.ActivityName,
UnitOfMeasurement = activity.UnitOfMeasurement,
CheckLists = checkList,
};
}
public static CheckListVM ToCheckListVMFromActivityCheckList(this ActivityCheckList checkList,int activityId)
{
return new CheckListVM
{
Id = checkList.Id,
Check = checkList.Check,
ActivityMasterId = activityId,
IsChecked = checkList.IsChecked,
IsMandatory = checkList.IsMandatory,
};
}
public static ActivityCheckList ToActivityCheckListFromCreateCheckListDto(this CreateCheckListDto checkListDto,int tenantId)
{
return new ActivityCheckList
{
Id = checkListDto.Id,
Check = checkListDto.Check,
IsMandatory = checkListDto.IsMandatory,
TenantId = tenantId
};
}
}
}

View File

@ -24,7 +24,7 @@ namespace Marco.Pms.Model.Mapper
JobRole = (model.JobRole != null ? model.JobRole.Name : null),
JobRoleId = model.JobRoleId,
PanNumber = model.PanNumber,
PermanentAddress = model.PeramnentAddress,
PermanentAddress = model.PermanentAddress,
PhoneNumber = model.PhoneNumber,
Photo = model.Photo,
IsActive = model.IsActive,

View File

@ -12,7 +12,7 @@ namespace Marco.Pms.Model.Projects
public int Id { get; set; }
[Required]
[DisplayName("Building Name")]
public string Name { get; set; }
public string? Name { get; set; }
public string? Description { get; set; }
public int ProjectId { get; set; }
@ -23,6 +23,6 @@ namespace Marco.Pms.Model.Projects
[ValidateNever]
[ForeignKey(nameof(TenantId))]
public Tenant Tenant { get; set; }
public Tenant? Tenant { get; set; }
}
}

View File

@ -12,14 +12,14 @@ namespace Marco.Pms.Model.Projects
[Required]
[DisplayName("Floor Name")]
public string FloorName { get; set; }
public string? FloorName { get; set; }
public int BuildingId { get; set; }
[ForeignKey("BuildingId")]
[ValidateNever]
public Building Building { get; set; }
public Building? Building { get; set; }
[DisplayName("TenantId")]
@ -27,6 +27,6 @@ namespace Marco.Pms.Model.Projects
[ValidateNever]
[ForeignKey(nameof(TenantId))]
public Tenant Tenant { get; set; }
public Tenant? Tenant { get; set; }
}
}

View File

@ -12,14 +12,14 @@ namespace Marco.Pms.Model.Projects
public int Id { get; set; }
[Required]
[DisplayName("Project Name")]
public string Name { get; set; }
public string? Name { get; set; }
[DisplayName("Project Address")]
public string ProjectAddress { get; set; }
public string? ProjectAddress { get; set; }
[DisplayName("Contact Person")]
public string ContactPerson { get; set; }
public string? ContactPerson { get; set; }
public DateTime? StartDate { get; set; }
public DateTime? EndDate { get; set; }
@ -29,13 +29,13 @@ namespace Marco.Pms.Model.Projects
[ValidateNever]
[ForeignKey(nameof(ProjectStatusId))]
public StatusMaster ProjectStatus { get; set; }
public StatusMaster? ProjectStatus { get; set; }
[DisplayName("TenantId")]
public int TenantId { get; set; }
[ValidateNever]
[ForeignKey(nameof(TenantId))]
public Tenant Tenant { get; set; }
public Tenant? Tenant { get; set; }
}
}

View File

@ -12,7 +12,7 @@ namespace Marco.Pms.Model.Projects
public int EmployeeId { get; set; }
[ForeignKey("EmployeeId")]
[ValidateNever]
public Employee Employee { get; set; }
public Employee? Employee { get; set; }
public int? JobRoleId { get; set; }
//[ForeignKey("EmployeeRoleId")]
@ -24,7 +24,7 @@ namespace Marco.Pms.Model.Projects
public int ProjectId { get; set; }
[ForeignKey("ProjectId")]
[ValidateNever]
public Project Project { get; set; }
public Project? Project { get; set; }
public DateTime AllocationDate { get; set; }
@ -35,6 +35,6 @@ namespace Marco.Pms.Model.Projects
public int TenantId { get; set; }
[ValidateNever]
[ForeignKey(nameof(TenantId))]
public Tenant Tenant { get; set; }
public Tenant? Tenant { get; set; }
}
}

View File

@ -13,13 +13,13 @@ namespace Marco.Pms.Model.Projects
[Required]
[DisplayName("Area Name")]
public string AreaName { get; set; }
public string? AreaName { get; set; }
public int FloorId { get; set; }
[ForeignKey("FloorId")]
[ValidateNever]
public Floor Floor { get; set; }
public Floor? Floor { get; set; }
//[ValidateNever]
//public List<WorkItem> WorkItems { get; set; }
@ -29,6 +29,7 @@ namespace Marco.Pms.Model.Projects
[ValidateNever]
[ForeignKey(nameof(TenantId))]
public Tenant Tenant { get; set; }
public Tenant? Tenant { get; set; }
}
}

View File

@ -1,7 +1,7 @@
using Marco.Pms.Model.Entitlements;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
using System.ComponentModel;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations.Schema;
using Marco.Pms.Model.Entitlements;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
namespace Marco.Pms.Model.Projects
{
@ -13,12 +13,12 @@ namespace Marco.Pms.Model.Projects
public int WorkAreaId { get; set; }
[ForeignKey("WorkAreaId")]
[ValidateNever]
public WorkArea WorkArea { get; set; }
public WorkArea? WorkArea { get; set; }
[ForeignKey("ActivityId")]
[ValidateNever]
public ActivityMaster ActivityMaster { get; set; }
public ActivityMaster? ActivityMaster { get; set; }
public double PlannedWork { get; set; }
public double CompletedWork { get; set; }
@ -29,6 +29,6 @@ namespace Marco.Pms.Model.Projects
[ValidateNever]
[ForeignKey(nameof(TenantId))]
public Tenant Tenant { get; set; }
public Tenant? Tenant { get; set; }
}
}

View File

@ -0,0 +1,11 @@
namespace Marco.Pms.Model.ViewModels.Activities
{
public class ActivityVM
{
public int Id { get; set; }
public string? ActivityName { get; set; }
public string? UnitOfMeasurement { get; set; }
public List<CheckListVM>? CheckLists { get; set; }
}
}

View File

@ -0,0 +1,11 @@
namespace Marco.Pms.Model.ViewModels.Activities
{
public class CheckListVM
{
public int Id { get; set; }
public int ActivityMasterId { get; set; }
public string? Check { get; set; }
public bool IsChecked { get; set; }
public bool IsMandatory { get; set; }
}
}

View File

@ -294,7 +294,7 @@ namespace MarcoBMS.Services.Controllers
Gender = model.Gender,
MiddleName = model.MiddleName,
PanNumber = model.PanNumber,
PeramnentAddress = model.PermanentAddress,
PermanentAddress = model.PermanentAddress,
PhoneNumber = model.PhoneNumber,
Photo = null, // GetFileDetails(model.Photo).Result.FileData,
JobRoleId = Convert.ToInt32(model.JobRoleId),
@ -321,7 +321,7 @@ namespace MarcoBMS.Services.Controllers
existingEmployee.Gender = model.Gender;
existingEmployee.MiddleName = model.MiddleName;
existingEmployee.PanNumber = model.PanNumber;
existingEmployee.PeramnentAddress = model.PermanentAddress;
existingEmployee.PermanentAddress = model.PermanentAddress;
existingEmployee.PhoneNumber = model.PhoneNumber;
existingEmployee.Photo = null; // GetFileDetails(model.Photo).Result.FileData,
existingEmployee.JobRoleId = Convert.ToInt32(model.JobRoleId);

View File

@ -1,10 +1,14 @@
using Marco.Pms.DataAccess.Data;
using System.Diagnostics;
using Marco.Pms.DataAccess.Data;
using Marco.Pms.Model.Dtos.Activities;
using Marco.Pms.Model.Entitlements;
using Marco.Pms.Model.Mapper;
using Marco.Pms.Model.Utilities;
using Marco.Pms.Model.ViewModels.Activities;
using MarcoBMS.Services.Helpers;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
namespace Marco.Pms.Services.Controllers
{
@ -20,6 +24,31 @@ namespace Marco.Pms.Services.Controllers
_context = context;
_userHelper = userHelper;
}
[HttpGet]
[Route("activities")]
public async Task<IActionResult> GetActivitiesMaster()
{
var tenantId = _userHelper.GetTenantId();
var activities = await _context.ActivityMasters.Where(c => c.TenantId == tenantId && c.IsActive == true).ToListAsync();
List<ActivityVM> activitiesVM = new List<ActivityVM>();
foreach (var activity in activities) {
var checkList = await _context.ActivityCheckLists.Where(c => c.TenantId == tenantId && c.ActivityMasterId == activity.Id).ToListAsync();
List<CheckListVM> checkListVM = new List<CheckListVM>();
if(checkList != null)
{
foreach (ActivityCheckList check in checkList)
{
var checkVM = check.ToCheckListVMFromActivityCheckList(activity.Id);
checkListVM.Add(checkVM);
}
}
ActivityVM activityVM = activity.ToActivityVMFromActivityMaster(checkListVM);
activitiesVM.Add(activityVM);
}
return Ok(ApiResponse<object>.SuccessResponse(activitiesVM, "Success.", 200));
}
[HttpPost("activity")]
public async Task<IActionResult> CreateActivity([FromBody] CreateActivityMasterDto createActivity)
{
@ -32,7 +61,76 @@ namespace Marco.Pms.Services.Controllers
var activityMaster = createActivity.ToActivityMasterFromCreateActivityMasterDto(tenantId);
_context.ActivityMasters.Add(activityMaster);
await _context.SaveChangesAsync();
return Ok(ApiResponse<object>.SuccessResponse(activityMaster, "Activity created successfully", 200));
if (createActivity.CheckList != null) {
List<ActivityCheckList> activityCheckList = new List<ActivityCheckList>();
foreach (var check in createActivity.CheckList)
{
ActivityCheckList checkList = check.ToActivityCheckListFromCreateCheckListDto(tenantId);
activityCheckList.Add(checkList);
}
_context.ActivityCheckLists.AddRange(activityCheckList);
await _context.SaveChangesAsync();
List<CheckListVM> checkListVM = new List<CheckListVM>();
foreach (ActivityCheckList check in activityCheckList)
{
var checkVM = check.ToCheckListVMFromActivityCheckList(activityMaster.Id);
checkListVM.Add(checkVM);
}
ActivityVM activityVM = activityMaster.ToActivityVMFromActivityMaster(checkListVM);
return Ok(ApiResponse<object>.SuccessResponse(activityVM, "Activity created successfully", 200));
}
return BadRequest(ApiResponse<object>.ErrorResponse("Check List is Empty", "Check List is Empty", 400));
}
[HttpPost("edit/{id}")]
public async Task<IActionResult> UpdateActivity(int id, [FromBody] CreateActivityMasterDto createActivity)
{
var tenantId = _userHelper.GetTenantId();
var employee = await _userHelper.GetCurrentEmployeeAsync();
ActivityMaster? activity = await _context.ActivityMasters.FirstOrDefaultAsync(x => x.Id == id && x.IsActive == true && x.TenantId == tenantId);
if (activity != null && createActivity.UnitOfMeasurement != null && createActivity.ActivityName != null) {
activity.ActivityName = createActivity.ActivityName;
activity.UnitOfMeasurement = createActivity.UnitOfMeasurement;
if (createActivity.CheckList != null)
{
List<ActivityCheckList> activityCheckList = new List<ActivityCheckList>();
foreach (var check in createActivity.CheckList)
{
ActivityCheckList checkList = check.ToActivityCheckListFromCreateCheckListDto(tenantId);
activityCheckList.Add(checkList);
}
_context.ActivityCheckLists.UpdateRange(activityCheckList);
await _context.SaveChangesAsync();
List<CheckListVM> checkListVM = new List<CheckListVM>();
foreach (ActivityCheckList check in activityCheckList)
{
var checkVM = check.ToCheckListVMFromActivityCheckList(activity.Id);
checkListVM.Add(checkVM);
}
ActivityVM activityVM = activity.ToActivityVMFromActivityMaster(checkListVM);
return Ok(ApiResponse<object>.SuccessResponse(activityVM, "Activity created successfully", 200));
}
}
return NotFound(ApiResponse<object>.ErrorResponse("Activity no found", "Activity no found", 404));
}
#nullable disable
[HttpDelete("delete/{id}")]
public async Task<IActionResult> DeleteActivity(int Id)
{
int tenantId = _userHelper.GetTenantId();
var activity = await _context.ActivityMasters.FirstOrDefaultAsync(a => a.Id == Id && a.TenantId == tenantId);
if(activity != null)
{
activity.IsActive = false;
}
await _context.SaveChangesAsync();
return Ok(ApiResponse<object>.SuccessResponse(null, "Activity Deleted Successfully", 200));
}
}
}

View File

@ -35,17 +35,6 @@ namespace MarcoBMS.Services.Controllers
return _userHelper.GetTenantId();
}
[HttpGet]
[Route("activities")]
public async Task<IActionResult> GetActivitiesMaster()
{
var tenantId = GetTenantId();
var activities = await _context.ActivityMasters.Where(c => c.TenantId == tenantId).ToListAsync();
return Ok(ApiResponse<object>.SuccessResponse(activities, "Success.", 200));
}
[HttpPost("assign")]
public async Task<IActionResult> AssignTask([FromBody] AssignTaskDto assignTask)
{

View File

@ -23,9 +23,6 @@ builder.Host.UseSerilog((context, config) =>
})
;
#region CORS Settings
// Add services
//builder.Services.AddCors(options =>
//{