Compare commits

..

130 Commits

Author SHA1 Message Date
a3ffe1d3d6 Corrected the spelling mistake JobTicketId in job attendance 2025-11-25 12:55:50 +05:30
55c2ca73de Merge pull request 'Project_Branch_Management' (#155) from Project_Branch_Management into main
Reviewed-on: #155
2025-11-25 06:49:18 +00:00
bcba454b6e Added a function to check if have service project permission 2025-11-25 12:17:23 +05:30
e73413c849 Added the date in project report API in market controller 2025-11-24 12:01:56 +05:30
457e3b411e Updated the dynamic sorting in collection controller 2025-11-24 11:04:53 +05:30
8f5a49deed Added dynamic sortting, grouping, cloumn searching in collection controller 2025-11-22 00:31:47 +05:30
f1f5fc263f Update firebase helper function for record attendance 2025-11-21 13:07:55 +05:30
64aab7d712 Removed Project ForignKey From ProjectContactMapping Table 2025-11-21 12:04:35 +05:30
c7a73e78fb Removed Project ForignKey From PaymentRequest Table 2025-11-21 11:33:57 +05:30
1b94592026 Removed the project forign key and able to create payment request for both infra and service project 2025-11-20 17:59:59 +05:30
9c95b12a8f Removed the project forign key and able to create expense for both infra and service project 2025-11-20 16:47:25 +05:30
df0e9f7b46 Added the update at in job details update log histeroy vm 2025-11-20 15:39:53 +05:30
24e45037da Added an API to get list of branch types 2025-11-20 14:35:02 +05:30
a31266ee4a Update the Id check in branch update API 2025-11-20 12:25:58 +05:30
bd2f9d953f Added IsArchive field in ob ticket table 2025-11-20 11:58:45 +05:30
d5a7ad0716 Added An APi to get Projects Completion Status 2025-11-19 18:30:16 +05:30
4108915b92 Added the project branch in job ticket table 2025-11-19 18:11:54 +05:30
dad135571d Added the project branch CRUD oprations 2025-11-19 15:36:45 +05:30
5a402925b1 Added the Project branch related tables 2025-11-19 15:10:40 +05:30
0277303c54 Added the search string in get infra project list API 2025-11-19 12:07:48 +05:30
eed97d31c6 Searching project through short name as well 2025-11-19 10:52:16 +05:30
a7a9fb4012 Updated the API to get employee list with current advance payment balance 2025-11-19 10:31:21 +05:30
03ee834505 Corrected the logic for next status in expense 2025-11-18 18:01:17 +05:30
0349229bac added the logic only employee who created expense or payment requset able to submit it for review 2025-11-18 17:45:31 +05:30
f4e6fab3d6 Added API to get list of combined projects and add current in get status list API 2025-11-18 16:57:55 +05:30
6dfbf655ef Added on hold count in service project list VM 2025-11-18 16:19:07 +05:30
230267bdb9 Added on hold job count in service project list API 2025-11-18 14:47:24 +05:30
f171b0add6 Added the Addition project related information in service project list API 2025-11-18 13:06:45 +05:30
5522551e67 Optimizied all collection related APIs 2025-11-18 12:06:24 +05:30
b74ae2d75c Checking the job id while getting employee mapping in updae job API 2025-11-18 11:10:19 +05:30
0cdabf61ad Added UpdatedAt in job update log VM 2025-11-18 11:03:38 +05:30
76e77eb50f Added the billedTo in collection module and removed the project forign key and update so able to accept both infra project and service project 2025-11-18 10:43:34 +05:30
b247ed36ed Changed the name of of expense category in master menu 2025-11-18 10:37:36 +05:30
88de8b218b Changed the time out interval for signalR 2025-11-17 18:13:29 +05:30
bb328ad980 Removed the primary employee creation form create organization API and added interval time for signalR 2025-11-17 17:59:30 +05:30
92a234ff7e Added attendanceId job details VM 2025-11-17 17:43:51 +05:30
64cb2e0671 Added the action and next action in get job details API for current employee 2025-11-17 16:28:11 +05:30
863f0ce8e2 Added the UID in job ticket table and view model 2025-11-17 14:34:21 +05:30
bd14424062 Added an API to get logs of certain attendance 2025-11-17 13:06:24 +05:30
897537a60c Added the API to get latest tagging entitry for current employee 2025-11-17 12:03:06 +05:30
08a336be37 Added the manage job tagging APi and get List of job tagging per job 2025-11-17 11:38:25 +05:30
4cec5860ec Added GSTNumber in UpdateOrganizaton DTO 2025-11-15 15:57:22 +05:30
5b57c93a21 Added GST number and converted all Double SPRID to long 2025-11-15 15:54:51 +05:30
e30aec1791 Converted the SPRID to integer 2025-11-15 14:50:02 +05:30
2c8486f0de Added an API to update comments 2025-11-15 12:43:36 +05:30
2806dceab2 Added Google map url in service project table 2025-11-14 17:49:49 +05:30
c61ef92f6e Added an API to get list service project allocation 2025-11-14 17:25:32 +05:30
e7a21e9e2f Added an API to get list of team roles 2025-11-14 17:10:05 +05:30
62031046a1 Added an API to allocate employee to service project 2025-11-14 16:51:01 +05:30
fbb8a2261b Added an API to update the job ticket 2025-11-14 15:17:29 +05:30
ed16c0f102 Added an API to change the status of the job ticket 2025-11-14 11:16:57 +05:30
2f04339b4d Added the Attachments in job comments APIs and removed list of comments from job tickets details API 2025-11-14 10:04:51 +05:30
611d7753bb Added an API to get job status list 2025-11-13 17:23:54 +05:30
b789b84be1 Merge branch 'Upgrade_Expense_Main' of https://git.marcoaiot.com/admin/marco.pms.api into Service_Project_Management 2025-11-13 15:04:59 +05:30
883a65d124 Added an API to get list of job tags 2025-11-13 15:04:21 +05:30
a9f1a99e6f Added an API to get list of comments using job ID (if possible) 2025-11-13 14:49:56 +05:30
6679c5877d Added the an API to add comment to the job ticket 2025-11-13 13:03:31 +05:30
4401bc0fa2 Added the an API to get job details including update logs and comments 2025-11-13 12:40:15 +05:30
3d192770e9 Set updateAt nullable in payment request details VM 2025-11-13 12:01:17 +05:30
4a0144c23b Added the API to get list of jobs 2025-11-13 11:12:04 +05:30
6e945cf6c1 Merge pull request 'Organization_Hierarchy' (#153) from Organization_Hierarchy into Service_Project_Management
Reviewed-on: #153
2025-11-13 04:29:48 +00:00
5a97cd472c Added the Create Job ticket API 2025-11-13 09:58:42 +05:30
9af4c2279a Added the service project menu for mobile 2025-11-12 17:45:14 +05:30
8ce6f1c32f Added the mobile link parameter in side menu 2025-11-12 17:17:24 +05:30
a3703ae2ca Changed the response of service project list API 2025-11-12 11:43:30 +05:30
a32515fc84 Added the service project details API and pagination in list of infra projects 2025-11-12 11:35:47 +05:30
bfe9c03147 Added the missing colan 2025-11-12 10:34:13 +05:30
d18bdb1363 Added contact details of the project in service project list view model 2025-11-12 09:44:02 +05:30
31cfe2b581 Added the API to delete service project 2025-11-11 19:10:41 +05:30
394b8496f9 Added pagination in get service project list API 2025-11-11 18:47:40 +05:30
2b6c886186 Added the pagination in get service project list 2025-11-11 18:21:29 +05:30
8be9b05695 Checking the client and status when creating service projects 2025-11-11 17:53:39 +05:30
b9c8fb539f Merge pull request 'Ashutosh_UserTask#1727' (#152) from Ashutosh_UserTask#1727 into Organization_Hierarchy
Reviewed-on: #152
2025-11-11 11:24:36 +00:00
128417858e Optimized the manage organization hierarchy API 2025-11-11 16:53:51 +05:30
4825f24694 added end created, update and getListService Projects 2025-11-11 16:33:29 +05:30
e63b320d99 Checking the last Advance payment certain employee 2025-11-11 15:53:02 +05:30
b023883233 Added the APi to manage organization hierarchies 2025-11-11 14:31:41 +05:30
0b2ed71dab Merge pull request 'Added the API to get list organization hierarchy for certain employee' (#151) from Ashutosh_UserTask#1719 into Organization_Hierarchy
Reviewed-on: #151
2025-11-11 07:37:03 +00:00
7c80e49809 Added the API to get list organization hierarchy for certain employee 2025-11-11 13:06:33 +05:30
7928c6ca36 Added the OrganizationService and IOrganizationService 2025-11-11 11:06:09 +05:30
d1c427f7b9 Added the sevice project and ServiceProjectServiceMapping table with migration 2025-11-11 09:44:03 +05:30
e657f91d4b Chnaged the comment in update logs while creating the payment request 2025-11-10 15:30:34 +05:30
58a4a23ac7 added the due date for PaymentRequestConversion API 2025-11-10 15:15:46 +05:30
985dc616c7 Adding the update logs when creating payment request from recurring template 2025-11-10 14:57:31 +05:30
14be381f5f Returning the list recurring templates while creating payment request from recurring template 2025-11-10 14:32:00 +05:30
ac711c7254 Added EndDate and NextStrikeDate in recurring payment models and view models 2025-11-10 11:20:26 +05:30
85ca0a4cb1 Searching the expense using ExpenseUID 2025-11-08 16:16:05 +05:30
7ba97314b9 Added the Expense Category in expense details VM 2025-11-08 16:05:18 +05:30
08e81c1185 Added email in basic employee VM 2025-11-08 15:12:46 +05:30
27399322b8 Added TDSPercentage in view model in expense and payment request 2025-11-08 14:49:33 +05:30
381723d785 Made StatusId Nullable In StatusUpdateLog Table 2025-11-08 12:26:57 +05:30
f22f6c4ad9 After processing the payment request for Advance payment setting the status to be done 2025-11-08 11:57:55 +05:30
643501ee9e Updated the action API for payment requests to create the expense after expense is processed 2025-11-08 10:29:16 +05:30
a6d5dfa1fc Change the parameter from ExpenseTypeId to ExpenseCategoryId in expene updae DTO and excluding the Done status from expense 2025-11-08 09:35:12 +05:30
0c6e9fc57b Changed the response parameter for API of get expense filter 2025-11-07 18:05:03 +05:30
7a80345c64 Added the API to get list of employee with advance payments 2025-11-07 18:02:58 +05:30
8b44fb6f39 Added the API to get list of advance payment transaction 2025-11-07 18:01:31 +05:30
c71343d550 Added the API to create payment request from recurring payment 2025-11-07 17:58:15 +05:30
5910517d01 Added the API to update recurring payment 2025-11-07 17:53:39 +05:30
1615dde267 Added the API to create the recurring payment 2025-11-07 17:51:01 +05:30
e6b66479d5 Added the API to get details of recurring payment 2025-11-07 17:48:58 +05:30
46806b34bb Added the API to get list of recurring payments 2025-11-07 17:47:09 +05:30
e21a9b8eda Added the API to delete payment request 2025-11-07 17:43:54 +05:30
6f2903c0c7 Added the API to update payment request 2025-11-07 17:42:04 +05:30
73b85bee84 Added the API to create expense from payment request 2025-11-07 17:40:20 +05:30
96411c43b0 Added the API to change the status of payment request 2025-11-07 17:38:38 +05:30
b54b83c63d Added the API to create the payment request 2025-11-07 17:36:11 +05:30
eccd4f6d76 Added the API to get list of avaliable filter according to payment request table 2025-11-07 17:34:17 +05:30
244da76b75 Added the API to get list of supplier names from payment request table 2025-11-07 17:32:01 +05:30
c5adc6322d Added the API to get details of payment request 2025-11-07 17:25:16 +05:30
90b7cabaf5 Added the API to get list of payment requests 2025-11-07 17:23:05 +05:30
f385a1b555 Added Finance related model and migrations 2025-11-07 17:16:05 +05:30
a589f2af4b Merge pull request 'Payment_Gatway_Management' (#150) from Payment_Gatway_Management into main
Reviewed-on: #150
2025-11-06 12:12:37 +00:00
08e893dcc8 Change the check permssion check for tenant details API 2025-10-31 11:26:57 +05:30
83e8e8c7de Added the renew Subscription API 2025-10-29 17:25:20 +05:30
3b0c958342 Added the self subscription API 2025-10-29 16:28:55 +05:30
4916a95eb4 Corrected adding the subscription after payment 2025-10-29 14:44:54 +05:30
86b37549eb Featching the industry while create tenant enquire 2025-10-28 15:39:34 +05:30
5253ed9a39 Corrected the migration errors in subscription plan table 2025-10-28 10:57:42 +05:30
4e171e8ca3 revert 1a360447cd54ae92c981323e5895602f8e24f17f
revert Added the Payment details in tenant subscription table
2025-10-28 05:23:22 +00:00
bd839b12f9 revert 7273f49b3ffd96f11fc8220e5d3e4ef663179541
revert Make the payment details nullable
2025-10-28 05:23:06 +00:00
08b2cfe844 revert eed4e4cf314730579cbb0cd117acf581759a5295
revert changed the response for self Registration
2025-10-28 05:22:56 +00:00
eed4e4cf31 changed the response for self Registration 2025-10-28 10:47:04 +05:30
7273f49b3f Make the payment details nullable 2025-10-28 10:41:52 +05:30
1a360447cd Added the Payment details in tenant subscription table 2025-10-27 18:29:26 +05:30
78575337ec Saving the tenant if payment is successfully 2025-10-27 17:56:51 +05:30
ac4da0c930 Saving the tenant enquire in before payment 2025-10-27 16:12:19 +05:30
d29b061799 saving the payment details in database 2025-10-27 09:49:23 +05:30
04f1917332 Added the payment details in verify payment API 2025-10-25 15:57:16 +05:30
1d54af7c00 Added create order and verify payment API for razor pay 2025-10-24 17:01:22 +05:30
277 changed files with 202923 additions and 30532 deletions

File diff suppressed because it is too large Load Diff

View File

@ -4,7 +4,6 @@
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,46 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Added_PaymentDetails_Table : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "PaymentDetails",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
PaymentId = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
OrderId = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Status = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Method = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
EncryptedDetails = table.Column<byte[]>(type: "longblob", nullable: true),
Nonce = table.Column<byte[]>(type: "longblob", nullable: true),
Tag = table.Column<byte[]>(type: "longblob", nullable: true),
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_PaymentDetails", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "PaymentDetails");
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,62 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Added_TenantEnquire_Table : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "TenantEnquires",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
FirstName = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
LastName = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
OrganizationName = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Email = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
ContactNumber = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
BillingAddress = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
OrganizationSize = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
IndustryId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Reference = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_TenantEnquires", x => x.Id);
table.ForeignKey(
name: "FK_TenantEnquires_Industries_IndustryId",
column: x => x.IndustryId,
principalTable: "Industries",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_TenantEnquires_IndustryId",
table: "TenantEnquires",
column: "IndustryId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "TenantEnquires");
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,50 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Added_PaymentDetails_In_TenantSubscription_Table : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<Guid>(
name: "PaymentDetailId",
table: "TenantSubscriptions",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.CreateIndex(
name: "IX_TenantSubscriptions_PaymentDetailId",
table: "TenantSubscriptions",
column: "PaymentDetailId");
migrationBuilder.AddForeignKey(
name: "FK_TenantSubscriptions_PaymentDetails_PaymentDetailId",
table: "TenantSubscriptions",
column: "PaymentDetailId",
principalTable: "PaymentDetails",
principalColumn: "Id");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_TenantSubscriptions_PaymentDetails_PaymentDetailId",
table: "TenantSubscriptions");
migrationBuilder.DropIndex(
name: "IX_TenantSubscriptions_PaymentDetailId",
table: "TenantSubscriptions");
migrationBuilder.DropColumn(
name: "PaymentDetailId",
table: "TenantSubscriptions");
}
}
}

View File

@ -1,304 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Added_Data_In_Units_And_CompanyTypeMaster_Table : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "CompanyTypeMasters",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Name = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Description = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_CompanyTypeMasters", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.InsertData(
table: "CompanyTypeMasters",
columns: new[] { "Id", "Description", "Name" },
values: new object[,]
{
{ new Guid("04f543cb-6797-41bf-bfd8-e3c399c9c071"), "Company whose shares are traded publicly", "Public Limited" },
{ new Guid("8703932e-ca8d-4ab9-876b-7c313133356d"), "Owned and run by one individual", "Sole Proprietorship" },
{ new Guid("ea0d374a-e149-4296-9f45-eb36b39047d6"), "Privately held company with limited liability", "Private Limited" },
{ new Guid("f9426132-8bc9-440d-bd4f-a9f2bc7f395a"), "Business owned by two or more partners", "Partnership" }
});
migrationBuilder.InsertData(
table: "UnitTypes",
columns: new[] { "Id", "Description", "Name" },
values: new object[,]
{
{ new Guid("21dc7d85-1018-479f-8e4a-3b52294903ea"), "Measures the extent of an object or distance between two points in space.", "Length" },
{ new Guid("2ecfd89f-8c90-4664-a72e-911b7ad29646"), "Measures the flow of electric charge.", "Electric Current" },
{ new Guid("52733b8a-04bc-4eb7-bade-9f7869283473"), "Measures the three - dimensional space occupied by a substance or object.", "Volume" },
{ new Guid("7ef849c0-0979-4a6c-87ad-9aefb8675679"), "Measures the duration or interval between events.", "Time" },
{ new Guid("806e3b0a-306e-427e-8206-610c1c618cd8"), "Measures how fast an object moves, i.e., distance traveled per unit time.", "Speed" },
{ new Guid("a0dd396c-943a-49cd-87e9-24e1fc9cf1b3"), "Measures the heat or thermal energy level of a system.", "Thermodynamic Temperature" },
{ new Guid("abc1b8cc-fcaf-4e45-8b72-e47036166fbc"), "Measures the perceived brightness of light emitted from a source.", "Luminous Intensity" },
{ new Guid("b1c4b844-1b85-4601-a575-4992c47533ac"), "Counts the number of elementary entities(atoms, molecules, etc.) in a sample.", "Amount of Substance" },
{ new Guid("d1300314-3db6-48c6-b5d2-5542d30d18ea"), "Measures the size of a surface.", "Area" },
{ new Guid("d47a54aa-de46-4aec-9bd6-276b046d35ac"), "Represents the amount of matter in an object.", "Mass" }
});
migrationBuilder.InsertData(
table: "TechnicalUnits",
columns: new[] { "Id", "Description", "Name", "UnitTypeId" },
values: new object[,]
{
{ new Guid("088630c5-6866-49ea-afab-cb6c0d3d0ebb"), "Non-SI unit; equal to 0.3048 meters", "Foot", new Guid("21dc7d85-1018-479f-8e4a-3b52294903ea") },
{ new Guid("0dd0fa51-36bf-4083-a7b1-901f7a3fe234"), "SI base unit of temperature", "Kelvin", new Guid("a0dd396c-943a-49cd-87e9-24e1fc9cf1b3") },
{ new Guid("131b4588-aba2-479c-a1e5-0ad461f16329"), "1000 meters; commonly used for large distances", "Kilometer", new Guid("21dc7d85-1018-479f-8e4a-3b52294903ea") },
{ new Guid("151c7344-7b70-4bea-a04f-39b6f5b43ce0"), "SI derived unit for speed/velocity", "Meter per second", new Guid("806e3b0a-306e-427e-8206-610c1c618cd8") },
{ new Guid("15f4422e-b861-45f6-84e4-c1932b7df119"), "SI derived unit of area", "Square meter", new Guid("d1300314-3db6-48c6-b5d2-5542d30d18ea") },
{ new Guid("18e72164-8ead-45a0-9291-a5179e059c0c"), "Scale for measuring temperature; 0°C = 273.15 K", "Degree Celsius", new Guid("a0dd396c-943a-49cd-87e9-24e1fc9cf1b3") },
{ new Guid("26f6a207-5c8a-43a5-91f3-33eb1f46227f"), "0.000001 kilogram", "Milligram", new Guid("d47a54aa-de46-4aec-9bd6-276b046d35ac") },
{ new Guid("2e7d1cad-4c26-408c-9b70-dd0dc0dcc145"), "Non-SI unit; equal to 0.0254 meters", "Inch", new Guid("21dc7d85-1018-479f-8e4a-3b52294903ea") },
{ new Guid("356a2536-5b0b-4128-baaa-306245068d3c"), "1000 kilograms", "Metric ton", new Guid("d47a54aa-de46-4aec-9bd6-276b046d35ac") },
{ new Guid("36c29f6f-70dc-4ca6-bd1e-64b578de0a0f"), "0.001 cubic meter; commonly used for liquids", "Liter", new Guid("52733b8a-04bc-4eb7-bade-9f7869283473") },
{ new Guid("45dd0601-dc09-4922-9153-ec76431ef0c5"), "0.001 ampere", "Milliampere", new Guid("2ecfd89f-8c90-4664-a72e-911b7ad29646") },
{ new Guid("4752422b-4b9b-4fca-9d78-3a372c0a8e7c"), "0.001 second", "Millisecond", new Guid("7ef849c0-0979-4a6c-87ad-9aefb8675679") },
{ new Guid("4769e008-5e0c-4b60-b434-b23060966d54"), "Non-SI unit; equal to 1609.34 meters", "Mile", new Guid("21dc7d85-1018-479f-8e4a-3b52294903ea") },
{ new Guid("53f3a4ca-f44b-481c-92ab-a9cd49649243"), "SI base unit of electric current", "Ampere", new Guid("2ecfd89f-8c90-4664-a72e-911b7ad29646") },
{ new Guid("6df17071-6506-46dc-bd81-326391941dfa"), "0.001 kilogram", "Gram", new Guid("d47a54aa-de46-4aec-9bd6-276b046d35ac") },
{ new Guid("723496bc-500b-4938-8f25-48472446c6e9"), "SI base unit of amount of substance", "Mole", new Guid("b1c4b844-1b85-4601-a575-4992c47533ac") },
{ new Guid("78b9db6d-5bca-4d87-9d98-7a70fcc400f7"), "Common unit of speed; 1 km/h = 0.27778 m/s", "Kilometer per hour", new Guid("806e3b0a-306e-427e-8206-610c1c618cd8") },
{ new Guid("7bc508a0-c5d1-497e-859c-6a617613d9a6"), "10,000 square meters; used for land area", "Hectare", new Guid("d1300314-3db6-48c6-b5d2-5542d30d18ea") },
{ new Guid("8392eab5-7b8c-4785-873b-81072566b876"), "SI base unit of mass", "Kilogram", new Guid("d47a54aa-de46-4aec-9bd6-276b046d35ac") },
{ new Guid("8ca66275-772e-43c3-bb7b-6b68af4b1839"), "SI base unit of time", "Second", new Guid("7ef849c0-0979-4a6c-87ad-9aefb8675679") },
{ new Guid("8ce98c62-83f3-4a45-afb0-32d4e3edfb9c"), "0.001 meter; for very small lengths", "Millimeter", new Guid("21dc7d85-1018-479f-8e4a-3b52294903ea") },
{ new Guid("93a97a4d-603d-4c00-a516-f3170656f0b2"), "60 seconds", "Minute", new Guid("7ef849c0-0979-4a6c-87ad-9aefb8675679") },
{ new Guid("94eea97c-8853-414c-b7a9-4b05b483353d"), "3600 seconds", "Hour", new Guid("7ef849c0-0979-4a6c-87ad-9aefb8675679") },
{ new Guid("98c8f101-310b-450e-b502-4cf61d9cde1a"), "SI derived unit of volume", "Cubic meter", new Guid("52733b8a-04bc-4eb7-bade-9f7869283473") },
{ new Guid("9e830840-c1f1-4dfc-aaef-74a1f464c798"), "SI base unit of luminous intensity", "Candela", new Guid("abc1b8cc-fcaf-4e45-8b72-e47036166fbc") },
{ new Guid("9f758559-e5a0-40b9-a21f-f9bd5ddd1e9b"), "0.01 meter; used for small lengths", "Centimeter", new Guid("21dc7d85-1018-479f-8e4a-3b52294903ea") },
{ new Guid("b1aab8fe-2d78-4e65-974a-bc09a22446ee"), "0.000001 cubic meter or 0.001 liter", "Milliliter", new Guid("52733b8a-04bc-4eb7-bade-9f7869283473") },
{ new Guid("e0009850-0d6a-4ed0-bf9b-daf1354869f7"), "Non-SI unit; equal to 0.453592 kilograms", "Pound", new Guid("d47a54aa-de46-4aec-9bd6-276b046d35ac") },
{ new Guid("f968eb00-c9b3-483b-ba4b-3ed8ee89de17"), "1,000,000 square meters", "Square kilometer", new Guid("d1300314-3db6-48c6-b5d2-5542d30d18ea") },
{ new Guid("fae4dd36-e9eb-49a4-bcaa-9e723fd43069"), "SI base unit of length", "Meter", new Guid("21dc7d85-1018-479f-8e4a-3b52294903ea") }
});
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "CompanyTypeMasters");
migrationBuilder.DeleteData(
table: "TechnicalUnits",
keyColumn: "Id",
keyValue: new Guid("088630c5-6866-49ea-afab-cb6c0d3d0ebb"));
migrationBuilder.DeleteData(
table: "TechnicalUnits",
keyColumn: "Id",
keyValue: new Guid("0dd0fa51-36bf-4083-a7b1-901f7a3fe234"));
migrationBuilder.DeleteData(
table: "TechnicalUnits",
keyColumn: "Id",
keyValue: new Guid("131b4588-aba2-479c-a1e5-0ad461f16329"));
migrationBuilder.DeleteData(
table: "TechnicalUnits",
keyColumn: "Id",
keyValue: new Guid("151c7344-7b70-4bea-a04f-39b6f5b43ce0"));
migrationBuilder.DeleteData(
table: "TechnicalUnits",
keyColumn: "Id",
keyValue: new Guid("15f4422e-b861-45f6-84e4-c1932b7df119"));
migrationBuilder.DeleteData(
table: "TechnicalUnits",
keyColumn: "Id",
keyValue: new Guid("18e72164-8ead-45a0-9291-a5179e059c0c"));
migrationBuilder.DeleteData(
table: "TechnicalUnits",
keyColumn: "Id",
keyValue: new Guid("26f6a207-5c8a-43a5-91f3-33eb1f46227f"));
migrationBuilder.DeleteData(
table: "TechnicalUnits",
keyColumn: "Id",
keyValue: new Guid("2e7d1cad-4c26-408c-9b70-dd0dc0dcc145"));
migrationBuilder.DeleteData(
table: "TechnicalUnits",
keyColumn: "Id",
keyValue: new Guid("356a2536-5b0b-4128-baaa-306245068d3c"));
migrationBuilder.DeleteData(
table: "TechnicalUnits",
keyColumn: "Id",
keyValue: new Guid("36c29f6f-70dc-4ca6-bd1e-64b578de0a0f"));
migrationBuilder.DeleteData(
table: "TechnicalUnits",
keyColumn: "Id",
keyValue: new Guid("45dd0601-dc09-4922-9153-ec76431ef0c5"));
migrationBuilder.DeleteData(
table: "TechnicalUnits",
keyColumn: "Id",
keyValue: new Guid("4752422b-4b9b-4fca-9d78-3a372c0a8e7c"));
migrationBuilder.DeleteData(
table: "TechnicalUnits",
keyColumn: "Id",
keyValue: new Guid("4769e008-5e0c-4b60-b434-b23060966d54"));
migrationBuilder.DeleteData(
table: "TechnicalUnits",
keyColumn: "Id",
keyValue: new Guid("53f3a4ca-f44b-481c-92ab-a9cd49649243"));
migrationBuilder.DeleteData(
table: "TechnicalUnits",
keyColumn: "Id",
keyValue: new Guid("6df17071-6506-46dc-bd81-326391941dfa"));
migrationBuilder.DeleteData(
table: "TechnicalUnits",
keyColumn: "Id",
keyValue: new Guid("723496bc-500b-4938-8f25-48472446c6e9"));
migrationBuilder.DeleteData(
table: "TechnicalUnits",
keyColumn: "Id",
keyValue: new Guid("78b9db6d-5bca-4d87-9d98-7a70fcc400f7"));
migrationBuilder.DeleteData(
table: "TechnicalUnits",
keyColumn: "Id",
keyValue: new Guid("7bc508a0-c5d1-497e-859c-6a617613d9a6"));
migrationBuilder.DeleteData(
table: "TechnicalUnits",
keyColumn: "Id",
keyValue: new Guid("8392eab5-7b8c-4785-873b-81072566b876"));
migrationBuilder.DeleteData(
table: "TechnicalUnits",
keyColumn: "Id",
keyValue: new Guid("8ca66275-772e-43c3-bb7b-6b68af4b1839"));
migrationBuilder.DeleteData(
table: "TechnicalUnits",
keyColumn: "Id",
keyValue: new Guid("8ce98c62-83f3-4a45-afb0-32d4e3edfb9c"));
migrationBuilder.DeleteData(
table: "TechnicalUnits",
keyColumn: "Id",
keyValue: new Guid("93a97a4d-603d-4c00-a516-f3170656f0b2"));
migrationBuilder.DeleteData(
table: "TechnicalUnits",
keyColumn: "Id",
keyValue: new Guid("94eea97c-8853-414c-b7a9-4b05b483353d"));
migrationBuilder.DeleteData(
table: "TechnicalUnits",
keyColumn: "Id",
keyValue: new Guid("98c8f101-310b-450e-b502-4cf61d9cde1a"));
migrationBuilder.DeleteData(
table: "TechnicalUnits",
keyColumn: "Id",
keyValue: new Guid("9e830840-c1f1-4dfc-aaef-74a1f464c798"));
migrationBuilder.DeleteData(
table: "TechnicalUnits",
keyColumn: "Id",
keyValue: new Guid("9f758559-e5a0-40b9-a21f-f9bd5ddd1e9b"));
migrationBuilder.DeleteData(
table: "TechnicalUnits",
keyColumn: "Id",
keyValue: new Guid("b1aab8fe-2d78-4e65-974a-bc09a22446ee"));
migrationBuilder.DeleteData(
table: "TechnicalUnits",
keyColumn: "Id",
keyValue: new Guid("e0009850-0d6a-4ed0-bf9b-daf1354869f7"));
migrationBuilder.DeleteData(
table: "TechnicalUnits",
keyColumn: "Id",
keyValue: new Guid("f968eb00-c9b3-483b-ba4b-3ed8ee89de17"));
migrationBuilder.DeleteData(
table: "TechnicalUnits",
keyColumn: "Id",
keyValue: new Guid("fae4dd36-e9eb-49a4-bcaa-9e723fd43069"));
migrationBuilder.DeleteData(
table: "UnitTypes",
keyColumn: "Id",
keyValue: new Guid("21dc7d85-1018-479f-8e4a-3b52294903ea"));
migrationBuilder.DeleteData(
table: "UnitTypes",
keyColumn: "Id",
keyValue: new Guid("2ecfd89f-8c90-4664-a72e-911b7ad29646"));
migrationBuilder.DeleteData(
table: "UnitTypes",
keyColumn: "Id",
keyValue: new Guid("52733b8a-04bc-4eb7-bade-9f7869283473"));
migrationBuilder.DeleteData(
table: "UnitTypes",
keyColumn: "Id",
keyValue: new Guid("7ef849c0-0979-4a6c-87ad-9aefb8675679"));
migrationBuilder.DeleteData(
table: "UnitTypes",
keyColumn: "Id",
keyValue: new Guid("806e3b0a-306e-427e-8206-610c1c618cd8"));
migrationBuilder.DeleteData(
table: "UnitTypes",
keyColumn: "Id",
keyValue: new Guid("a0dd396c-943a-49cd-87e9-24e1fc9cf1b3"));
migrationBuilder.DeleteData(
table: "UnitTypes",
keyColumn: "Id",
keyValue: new Guid("abc1b8cc-fcaf-4e45-8b72-e47036166fbc"));
migrationBuilder.DeleteData(
table: "UnitTypes",
keyColumn: "Id",
keyValue: new Guid("b1c4b844-1b85-4601-a575-4992c47533ac"));
migrationBuilder.DeleteData(
table: "UnitTypes",
keyColumn: "Id",
keyValue: new Guid("d1300314-3db6-48c6-b5d2-5542d30d18ea"));
migrationBuilder.DeleteData(
table: "UnitTypes",
keyColumn: "Id",
keyValue: new Guid("d47a54aa-de46-4aec-9bd6-276b046d35ac"));
}
}
}

View File

@ -1,280 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Made_Status_Mapping_Nullable : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_PurchaseStatusMappings_PurchaseOrderStatus_NextPurchaseStatu~",
table: "PurchaseStatusMappings");
migrationBuilder.DropForeignKey(
name: "FK_PurchaseStatusMappings_PurchaseOrderStatus_PreviousPurchaseS~",
table: "PurchaseStatusMappings");
migrationBuilder.DropForeignKey(
name: "FK_RequisitionStatusMappings_RequisitionStatus_PreviousRequisit~",
table: "RequisitionStatusMappings");
migrationBuilder.AddColumn<Guid>(
name: "CompanyTypeId",
table: "Suppliers",
type: "char(36)",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
collation: "ascii_general_ci");
migrationBuilder.AlterColumn<Guid>(
name: "PreviousRequisitionStatusId",
table: "RequisitionStatusMappings",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci",
oldClrType: typeof(Guid),
oldType: "char(36)")
.OldAnnotation("Relational:Collation", "ascii_general_ci");
migrationBuilder.AlterColumn<Guid>(
name: "PreviousPurchaseStatusId",
table: "PurchaseStatusMappings",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci",
oldClrType: typeof(Guid),
oldType: "char(36)")
.OldAnnotation("Relational:Collation", "ascii_general_ci");
migrationBuilder.AlterColumn<Guid>(
name: "NextPurchaseStatusId",
table: "PurchaseStatusMappings",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci",
oldClrType: typeof(Guid),
oldType: "char(36)")
.OldAnnotation("Relational:Collation", "ascii_general_ci");
migrationBuilder.InsertData(
table: "ProductCategoryMasters",
columns: new[] { "Id", "Description", "IsActive", "Name", "ShortName" },
values: new object[,]
{
{ new Guid("2e097d8b-63a2-4b96-8c55-61c2826f1001"), "Materials, components, and systems used in civil and structural engineering, including concrete, steel, reinforcement, and construction accessories.", true, "Civil/Structural", "CIV" },
{ new Guid("57b4ccf4-9e34-422d-b2c9-0a16d9c91009"), "Hand tools, power tools, measuring instruments, and workshop equipment for industrial and maintenance use.", true, "Tools & Equipment", "TOO" },
{ new Guid("6089cc9c-70dd-4d3a-8b68-0c7c79371004"), "Mechanical components and systems such as pumps, motors, gearboxes, bearings, compressors, and power transmission equipment.", true, "Mechanical & Power Transmission", "MEC" },
{ new Guid("a4ad945b-9213-4f4f-b823-b8c277871005"), "Pipes, fittings, valves, sanitary fixtures, and drainage systems used for water supply and waste management.", true, "Plumbing & Sanitary", "PLU" },
{ new Guid("ac930654-b973-4d5c-b13b-06e6815c1008"), "Industrial machinery, plant equipment, forklifts, cranes, and material handling systems.", true, "Plant, Machinery & Material Handling", "PLA" },
{ new Guid("adbd1c50-e845-4b52-9406-2f1e1c881007"), "Firefighting systems, alarms, extinguishers, safety gear, and related safety infrastructure.", true, "Fire & Safety", "FIR" },
{ new Guid("b5c4f7b3-bf24-4f19-9b5c-2deb12131002"), "Cables, lighting, wiring devices, control panels, transformers, and electrical distribution systems for building and industrial use.", true, "Electrical", "ELE" },
{ new Guid("bbdc04bb-d930-428c-aabc-72e198ea100c"), "Industrial packaging materials, adhesive tapes, cleaning agents, lubricants, and operational consumables.", true, "Packaging, Consumables, Chemicals & Lubricants", "PAC" },
{ new Guid("cd59914f-4e6b-47eb-8d2a-eecb85bc100e"), "Vehicles, fleet equipment, spare parts, lubricants, and accessories for automotive applications.", true, "Automotive & Fleet", "AUT" },
{ new Guid("d77d7b2c-83a3-44e9-8dea-62ee85bb1006"), "Heating, ventilation, and air conditioning equipment including chillers, ducts, diffusers, and air handling units.", true, "HVAC", "HVA" },
{ new Guid("d9677af1-6f91-44da-b12e-0f7ab00c100d"), "Cement, tiles, paints, glass, flooring, and other architectural finishing materials.", true, "Building Materials & Finishes", "BLD" },
{ new Guid("db8c7b16-b6c4-463e-9a59-6558a837100a"), "General office supplies including stationery, furniture, printers, and consumables for daily operations.", true, "Office Supplies & Stationery", "OFF" },
{ new Guid("e0e7d2cf-0438-4acd-aa1e-09304d5b1003"), "Electronic and communication products including data cabling, networking equipment, surveillance systems, and audio-visual devices.", true, "Electronics/ICT", "ICT" },
{ new Guid("fb081cf7-fef2-4d91-a052-4922d20d100b"), "Computers, servers, storage devices, network accessories, and related IT infrastructure.", true, "IT, Computing & Networking", "ITC" }
});
migrationBuilder.CreateIndex(
name: "IX_Suppliers_CompanyTypeId",
table: "Suppliers",
column: "CompanyTypeId");
migrationBuilder.AddForeignKey(
name: "FK_PurchaseStatusMappings_PurchaseOrderStatus_NextPurchaseStatu~",
table: "PurchaseStatusMappings",
column: "NextPurchaseStatusId",
principalTable: "PurchaseOrderStatus",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_PurchaseStatusMappings_PurchaseOrderStatus_PreviousPurchaseS~",
table: "PurchaseStatusMappings",
column: "PreviousPurchaseStatusId",
principalTable: "PurchaseOrderStatus",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_RequisitionStatusMappings_RequisitionStatus_PreviousRequisit~",
table: "RequisitionStatusMappings",
column: "PreviousRequisitionStatusId",
principalTable: "RequisitionStatus",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_Suppliers_CompanyTypeMasters_CompanyTypeId",
table: "Suppliers",
column: "CompanyTypeId",
principalTable: "CompanyTypeMasters",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_PurchaseStatusMappings_PurchaseOrderStatus_NextPurchaseStatu~",
table: "PurchaseStatusMappings");
migrationBuilder.DropForeignKey(
name: "FK_PurchaseStatusMappings_PurchaseOrderStatus_PreviousPurchaseS~",
table: "PurchaseStatusMappings");
migrationBuilder.DropForeignKey(
name: "FK_RequisitionStatusMappings_RequisitionStatus_PreviousRequisit~",
table: "RequisitionStatusMappings");
migrationBuilder.DropForeignKey(
name: "FK_Suppliers_CompanyTypeMasters_CompanyTypeId",
table: "Suppliers");
migrationBuilder.DropIndex(
name: "IX_Suppliers_CompanyTypeId",
table: "Suppliers");
migrationBuilder.DeleteData(
table: "ProductCategoryMasters",
keyColumn: "Id",
keyValue: new Guid("2e097d8b-63a2-4b96-8c55-61c2826f1001"));
migrationBuilder.DeleteData(
table: "ProductCategoryMasters",
keyColumn: "Id",
keyValue: new Guid("57b4ccf4-9e34-422d-b2c9-0a16d9c91009"));
migrationBuilder.DeleteData(
table: "ProductCategoryMasters",
keyColumn: "Id",
keyValue: new Guid("6089cc9c-70dd-4d3a-8b68-0c7c79371004"));
migrationBuilder.DeleteData(
table: "ProductCategoryMasters",
keyColumn: "Id",
keyValue: new Guid("a4ad945b-9213-4f4f-b823-b8c277871005"));
migrationBuilder.DeleteData(
table: "ProductCategoryMasters",
keyColumn: "Id",
keyValue: new Guid("ac930654-b973-4d5c-b13b-06e6815c1008"));
migrationBuilder.DeleteData(
table: "ProductCategoryMasters",
keyColumn: "Id",
keyValue: new Guid("adbd1c50-e845-4b52-9406-2f1e1c881007"));
migrationBuilder.DeleteData(
table: "ProductCategoryMasters",
keyColumn: "Id",
keyValue: new Guid("b5c4f7b3-bf24-4f19-9b5c-2deb12131002"));
migrationBuilder.DeleteData(
table: "ProductCategoryMasters",
keyColumn: "Id",
keyValue: new Guid("bbdc04bb-d930-428c-aabc-72e198ea100c"));
migrationBuilder.DeleteData(
table: "ProductCategoryMasters",
keyColumn: "Id",
keyValue: new Guid("cd59914f-4e6b-47eb-8d2a-eecb85bc100e"));
migrationBuilder.DeleteData(
table: "ProductCategoryMasters",
keyColumn: "Id",
keyValue: new Guid("d77d7b2c-83a3-44e9-8dea-62ee85bb1006"));
migrationBuilder.DeleteData(
table: "ProductCategoryMasters",
keyColumn: "Id",
keyValue: new Guid("d9677af1-6f91-44da-b12e-0f7ab00c100d"));
migrationBuilder.DeleteData(
table: "ProductCategoryMasters",
keyColumn: "Id",
keyValue: new Guid("db8c7b16-b6c4-463e-9a59-6558a837100a"));
migrationBuilder.DeleteData(
table: "ProductCategoryMasters",
keyColumn: "Id",
keyValue: new Guid("e0e7d2cf-0438-4acd-aa1e-09304d5b1003"));
migrationBuilder.DeleteData(
table: "ProductCategoryMasters",
keyColumn: "Id",
keyValue: new Guid("fb081cf7-fef2-4d91-a052-4922d20d100b"));
migrationBuilder.DropColumn(
name: "CompanyTypeId",
table: "Suppliers");
migrationBuilder.AlterColumn<Guid>(
name: "PreviousRequisitionStatusId",
table: "RequisitionStatusMappings",
type: "char(36)",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
collation: "ascii_general_ci",
oldClrType: typeof(Guid),
oldType: "char(36)",
oldNullable: true)
.OldAnnotation("Relational:Collation", "ascii_general_ci");
migrationBuilder.AlterColumn<Guid>(
name: "PreviousPurchaseStatusId",
table: "PurchaseStatusMappings",
type: "char(36)",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
collation: "ascii_general_ci",
oldClrType: typeof(Guid),
oldType: "char(36)",
oldNullable: true)
.OldAnnotation("Relational:Collation", "ascii_general_ci");
migrationBuilder.AlterColumn<Guid>(
name: "NextPurchaseStatusId",
table: "PurchaseStatusMappings",
type: "char(36)",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
collation: "ascii_general_ci",
oldClrType: typeof(Guid),
oldType: "char(36)",
oldNullable: true)
.OldAnnotation("Relational:Collation", "ascii_general_ci");
migrationBuilder.AddForeignKey(
name: "FK_PurchaseStatusMappings_PurchaseOrderStatus_NextPurchaseStatu~",
table: "PurchaseStatusMappings",
column: "NextPurchaseStatusId",
principalTable: "PurchaseOrderStatus",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_PurchaseStatusMappings_PurchaseOrderStatus_PreviousPurchaseS~",
table: "PurchaseStatusMappings",
column: "PreviousPurchaseStatusId",
principalTable: "PurchaseOrderStatus",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_RequisitionStatusMappings_RequisitionStatus_PreviousRequisit~",
table: "RequisitionStatusMappings",
column: "PreviousRequisitionStatusId",
principalTable: "RequisitionStatus",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
}
}

View File

@ -1,64 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Made_Requisition_Status_Mapping_Nullable : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_RequisitionStatusMappings_RequisitionStatus_NextRequisitionS~",
table: "RequisitionStatusMappings");
migrationBuilder.AlterColumn<Guid>(
name: "NextRequisitionStatusId",
table: "RequisitionStatusMappings",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci",
oldClrType: typeof(Guid),
oldType: "char(36)")
.OldAnnotation("Relational:Collation", "ascii_general_ci");
migrationBuilder.AddForeignKey(
name: "FK_RequisitionStatusMappings_RequisitionStatus_NextRequisitionS~",
table: "RequisitionStatusMappings",
column: "NextRequisitionStatusId",
principalTable: "RequisitionStatus",
principalColumn: "Id");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_RequisitionStatusMappings_RequisitionStatus_NextRequisitionS~",
table: "RequisitionStatusMappings");
migrationBuilder.AlterColumn<Guid>(
name: "NextRequisitionStatusId",
table: "RequisitionStatusMappings",
type: "char(36)",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
collation: "ascii_general_ci",
oldClrType: typeof(Guid),
oldType: "char(36)",
oldNullable: true)
.OldAnnotation("Relational:Collation", "ascii_general_ci");
migrationBuilder.AddForeignKey(
name: "FK_RequisitionStatusMappings_RequisitionStatus_NextRequisitionS~",
table: "RequisitionStatusMappings",
column: "NextRequisitionStatusId",
principalTable: "RequisitionStatus",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,950 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Added_Finance_Related_Tables : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Expenses_ExpensesTypeMaster_ExpensesTypeId",
table: "Expenses");
migrationBuilder.DropForeignKey(
name: "FK_PaymentModeMatser_Tenants_TenantId",
table: "PaymentModeMatser");
migrationBuilder.DropIndex(
name: "IX_PaymentModeMatser_TenantId",
table: "PaymentModeMatser");
migrationBuilder.DropIndex(
name: "IX_Expenses_ExpensesTypeId",
table: "Expenses");
migrationBuilder.DeleteData(
table: "ExpensesTypeMaster",
keyColumn: "Id",
keyValue: new Guid("1e2d697a-76b4-4be8-bc66-87144561a1a0"));
migrationBuilder.DeleteData(
table: "ExpensesTypeMaster",
keyColumn: "Id",
keyValue: new Guid("2de53163-0dbd-404b-8e60-1b02e6b4886a"));
migrationBuilder.DeleteData(
table: "ExpensesTypeMaster",
keyColumn: "Id",
keyValue: new Guid("4842fa61-64eb-4241-aebd-8282065af9f9"));
migrationBuilder.DeleteData(
table: "ExpensesTypeMaster",
keyColumn: "Id",
keyValue: new Guid("52484820-1b54-4865-8f0f-baa2b1d339b9"));
migrationBuilder.DeleteData(
table: "ExpensesTypeMaster",
keyColumn: "Id",
keyValue: new Guid("5e0c6227-d49d-41ff-9f1f-781f0aee2469"));
migrationBuilder.DeleteData(
table: "ExpensesTypeMaster",
keyColumn: "Id",
keyValue: new Guid("77013784-9324-4d8b-bd36-d6f928e68942"));
migrationBuilder.DeleteData(
table: "ExpensesTypeMaster",
keyColumn: "Id",
keyValue: new Guid("dd120bc4-ab0a-45ba-8450-5cd45ff221ca"));
migrationBuilder.DeleteData(
table: "ExpensesTypeMaster",
keyColumn: "Id",
keyValue: new Guid("fc59eb90-98ea-481c-b421-54bfa9e42d8f"));
migrationBuilder.DropColumn(
name: "TenantId",
table: "PaymentModeMatser");
migrationBuilder.AlterColumn<string>(
name: "ExpenseUId",
table: "Expenses",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<double>(
name: "BaseAmount",
table: "Expenses",
type: "double",
nullable: true);
migrationBuilder.AddColumn<Guid>(
name: "CurrencyId",
table: "Expenses",
type: "char(36)",
nullable: false,
defaultValue: new Guid("78e96e4a-7ce0-4164-ae3a-c833ad45ec2c"),
collation: "ascii_general_ci");
migrationBuilder.AddColumn<Guid>(
name: "ExpenseCategoryId",
table: "Expenses",
type: "char(36)",
nullable: false,
defaultValue: new Guid("5e0c6227-d49d-41ff-9f1f-781f0aee2469"),
collation: "ascii_general_ci");
migrationBuilder.AddColumn<Guid>(
name: "PaymentRequestId",
table: "Expenses",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.AddColumn<double>(
name: "TDSPercentage",
table: "Expenses",
type: "double",
nullable: true);
migrationBuilder.AddColumn<double>(
name: "TaxAmount",
table: "Expenses",
type: "double",
nullable: true);
migrationBuilder.AddColumn<int>(
name: "UIDPostfix",
table: "Expenses",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<string>(
name: "UIDPrefix",
table: "Expenses",
type: "longtext",
nullable: false)
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "AdvancePaymentTransactions",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
FinanceUIdPrefix = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
FinanceUIdPostfix = table.Column<int>(type: "int", nullable: false),
Title = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
ProjectId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
EmployeeId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Amount = table.Column<double>(type: "double", nullable: false),
CurrentBalance = table.Column<double>(type: "double", nullable: false),
PaidAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
CreatedById = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
IsActive = table.Column<bool>(type: "tinyint(1)", nullable: false),
TenantId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_AdvancePaymentTransactions", x => x.Id);
table.ForeignKey(
name: "FK_AdvancePaymentTransactions_Employees_CreatedById",
column: x => x.CreatedById,
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_AdvancePaymentTransactions_Employees_EmployeeId",
column: x => x.EmployeeId,
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_AdvancePaymentTransactions_Projects_ProjectId",
column: x => x.ProjectId,
principalTable: "Projects",
principalColumn: "Id");
table.ForeignKey(
name: "FK_AdvancePaymentTransactions_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "ExpenseCategoryMasters",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Name = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
NoOfPersonsRequired = table.Column<bool>(type: "tinyint(1)", nullable: false),
Description = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
IsActive = table.Column<bool>(type: "tinyint(1)", nullable: false),
IsAttachmentRequried = table.Column<bool>(type: "tinyint(1)", nullable: false),
TenantId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_ExpenseCategoryMasters", x => x.Id);
table.ForeignKey(
name: "FK_ExpenseCategoryMasters_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "RecurringPaymentStatus",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Name = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_RecurringPaymentStatus", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "StatusUpdateLogs",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
StatusId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
NextStatusId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
EntityId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Comment = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
UpdatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
UpdatedById = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
TenantId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_StatusUpdateLogs", x => x.Id);
table.ForeignKey(
name: "FK_StatusUpdateLogs_Employees_UpdatedById",
column: x => x.UpdatedById,
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_StatusUpdateLogs_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "RecurringPayments",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Title = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Description = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
UIDPrefix = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
UIDPostfix = table.Column<int>(type: "int", nullable: false),
Payee = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
NotifyTo = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
CurrencyId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Amount = table.Column<double>(type: "double", nullable: false),
StrikeDate = table.Column<DateTime>(type: "datetime(6)", nullable: false),
LatestPRGeneratedAt = table.Column<DateTime>(type: "datetime(6)", nullable: true),
ProjectId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
PaymentBufferDays = table.Column<int>(type: "int", nullable: false),
NumberOfIteration = table.Column<int>(type: "int", nullable: false),
ExpenseCategoryId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
StatusId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Frequency = table.Column<int>(type: "int", nullable: false),
IsVariable = table.Column<bool>(type: "tinyint(1)", nullable: false),
IsActive = table.Column<bool>(type: "tinyint(1)", nullable: false),
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
CreatedById = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
UpdatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: true),
UpdatedById = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
TenantId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_RecurringPayments", x => x.Id);
table.ForeignKey(
name: "FK_RecurringPayments_CurrencyMaster_CurrencyId",
column: x => x.CurrencyId,
principalTable: "CurrencyMaster",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_RecurringPayments_Employees_CreatedById",
column: x => x.CreatedById,
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_RecurringPayments_Employees_UpdatedById",
column: x => x.UpdatedById,
principalTable: "Employees",
principalColumn: "Id");
table.ForeignKey(
name: "FK_RecurringPayments_ExpenseCategoryMasters_ExpenseCategoryId",
column: x => x.ExpenseCategoryId,
principalTable: "ExpenseCategoryMasters",
principalColumn: "Id");
table.ForeignKey(
name: "FK_RecurringPayments_Projects_ProjectId",
column: x => x.ProjectId,
principalTable: "Projects",
principalColumn: "Id");
table.ForeignKey(
name: "FK_RecurringPayments_RecurringPaymentStatus_StatusId",
column: x => x.StatusId,
principalTable: "RecurringPaymentStatus",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_RecurringPayments_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "PaymentRequests",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Title = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Description = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
UIDPrefix = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
UIDPostfix = table.Column<int>(type: "int", nullable: false),
Payee = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
IsAdvancePayment = table.Column<bool>(type: "tinyint(1)", nullable: false),
CurrencyId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Amount = table.Column<double>(type: "double", nullable: false),
BaseAmount = table.Column<double>(type: "double", nullable: true),
TaxAmount = table.Column<double>(type: "double", nullable: true),
TDSPercentage = table.Column<double>(type: "double", nullable: true),
DueDate = table.Column<DateTime>(type: "datetime(6)", nullable: false),
ProjectId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
RecurringPaymentId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
ExpenseCategoryId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
ExpenseStatusId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
PaidTransactionId = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
PaidAt = table.Column<DateTime>(type: "datetime(6)", nullable: true),
PaidById = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
IsExpenseCreated = table.Column<bool>(type: "tinyint(1)", nullable: false),
IsActive = table.Column<bool>(type: "tinyint(1)", nullable: false),
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
CreatedById = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
UpdatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: true),
UpdatedById = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
TenantId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_PaymentRequests", x => x.Id);
table.ForeignKey(
name: "FK_PaymentRequests_CurrencyMaster_CurrencyId",
column: x => x.CurrencyId,
principalTable: "CurrencyMaster",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_PaymentRequests_Employees_CreatedById",
column: x => x.CreatedById,
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_PaymentRequests_Employees_PaidById",
column: x => x.PaidById,
principalTable: "Employees",
principalColumn: "Id");
table.ForeignKey(
name: "FK_PaymentRequests_Employees_UpdatedById",
column: x => x.UpdatedById,
principalTable: "Employees",
principalColumn: "Id");
table.ForeignKey(
name: "FK_PaymentRequests_ExpenseCategoryMasters_ExpenseCategoryId",
column: x => x.ExpenseCategoryId,
principalTable: "ExpenseCategoryMasters",
principalColumn: "Id");
table.ForeignKey(
name: "FK_PaymentRequests_ExpensesStatusMaster_ExpenseStatusId",
column: x => x.ExpenseStatusId,
principalTable: "ExpensesStatusMaster",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_PaymentRequests_Projects_ProjectId",
column: x => x.ProjectId,
principalTable: "Projects",
principalColumn: "Id");
table.ForeignKey(
name: "FK_PaymentRequests_RecurringPayments_RecurringPaymentId",
column: x => x.RecurringPaymentId,
principalTable: "RecurringPayments",
principalColumn: "Id");
table.ForeignKey(
name: "FK_PaymentRequests_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "PaymentRequestAttachments",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
PaymentRequestId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
DocumentId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
TenantId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_PaymentRequestAttachments", x => x.Id);
table.ForeignKey(
name: "FK_PaymentRequestAttachments_Documents_DocumentId",
column: x => x.DocumentId,
principalTable: "Documents",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_PaymentRequestAttachments_PaymentRequests_PaymentRequestId",
column: x => x.PaymentRequestId,
principalTable: "PaymentRequests",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_PaymentRequestAttachments_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.InsertData(
table: "ExpenseCategoryMasters",
columns: new[] { "Id", "Description", "IsActive", "IsAttachmentRequried", "Name", "NoOfPersonsRequired", "TenantId" },
values: new object[,]
{
{ new Guid("1e2d697a-76b4-4be8-bc66-87144561a1a0"), "Scheduled payments for external services or goods.", true, true, "Vendor/Supplier Payments", false, new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("2de53163-0dbd-404b-8e60-1b02e6b4886a"), "Vehicle fuel, logistics services and delivery of goods or personnel.", true, false, "Transport", false, new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("4842fa61-64eb-4241-aebd-8282065af9f9"), "Government fees, insurance, inspections and safety-related expenditures.", true, true, "Compliance & Safety", false, new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("52484820-1b54-4865-8f0f-baa2b1d339b9"), "Site setup costs including equipment deployment and temporary infrastructure.", true, true, "Mobilization", false, new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("5e0c6227-d49d-41ff-9f1f-781f0aee2469"), "Materials, equipment and supplies purchased for site operations.", true, true, "Procurement", false, new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("77013784-9324-4d8b-bd36-d6f928e68942"), "Machinery servicing, electricity, water, and temporary office needs.", true, true, "Maintenance & Utilities", false, new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("dd120bc4-ab0a-45ba-8450-5cd45ff221ca"), "Delivery of personnel.", true, false, "Travelling", true, new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("fc59eb90-98ea-481c-b421-54bfa9e42d8f"), " Worker amenities like snacks, meals, safety gear, accommodation, medical support etc.", true, true, "Employee Welfare", true, new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }
});
migrationBuilder.UpdateData(
table: "ExpensesStatusMaster",
keyColumn: "Id",
keyValue: new Guid("6537018f-f4e9-4cb3-a210-6c3b2da999d7"),
column: "DisplayName",
value: "Submit for Review");
migrationBuilder.InsertData(
table: "ExpensesStatusMaster",
columns: new[] { "Id", "Color", "Description", "DisplayName", "IsActive", "IsSystem", "Name" },
values: new object[] { new Guid("b8586f67-dc19-49c3-b4af-224149efe1d3"), "#0E9F6E", "Create new Expense.", "Create Expense", true, true, "Done" });
migrationBuilder.InsertData(
table: "Features",
columns: new[] { "Id", "Description", "IsActive", "ModuleId", "Name" },
values: new object[] { new Guid("86e80017-0698-4efe-93d0-806de67266e0"), "Recurring Template Management is the automated creation and scheduling of repetitive tasks, processes, or transactions using predefined templates at set intervals to ensure consistent and efficient workflow execution without manual recreation each time.", true, new Guid("bf59fd88-b57a-4d67-bf01-3780f385896b"), "Recurring Template Management" });
migrationBuilder.InsertData(
table: "Modules",
columns: new[] { "Id", "Description", "Key", "Name" },
values: new object[] { new Guid("0a79687a-86d7-430d-a2d7-8b8603cc76a1"), "Finance Module", "504ec132-e6a9-422f-8f85-050602cfce05", "Finance" });
migrationBuilder.InsertData(
table: "PaymentModeMatser",
columns: new[] { "Id", "Description", "IsActive", "Name" },
values: new object[,]
{
{ new Guid("95697409-baf6-4f78-86ab-42d93d9569a8"), "A debit card is a payment card that deducts funds directly from the cardholder's bank account when a purchase is made.", true, "Debit Card" },
{ new Guid("a820f240-5e9a-4ae9-9091-8a7aa7720cea"), "A credit card is a payment card that allows you to borrow funds from a financial institution to pay for goods and services", true, "Credit card" },
{ new Guid("f67beee6-6763-4108-922c-03bd86b9178d"), "When a bill is paid using the amount received in advance from a company.", true, "Advance Payment" }
});
migrationBuilder.InsertData(
table: "RecurringPaymentStatus",
columns: new[] { "Id", "Name" },
values: new object[,]
{
{ new Guid("306856fb-5655-42eb-bf8b-808bb5e84725"), "Completed" },
{ new Guid("3ec864d2-8bf5-42fb-ba70-5090301dd816"), "De-Activated" },
{ new Guid("8bfc9346-e092-4a80-acbf-515ae1ef6868"), "Paused" },
{ new Guid("da462422-13b2-45cc-a175-910a225f6fc8"), "Active" }
});
migrationBuilder.InsertData(
table: "ExpensesStatusMapping",
columns: new[] { "Id", "NextStatusId", "StatusId" },
values: new object[] { new Guid("a1cc95ed-b276-4a3e-9f00-0a249b522d64"), new Guid("b8586f67-dc19-49c3-b4af-224149efe1d3"), new Guid("61578360-3a49-4c34-8604-7b35a3787b95") });
migrationBuilder.InsertData(
table: "FeaturePermissions",
columns: new[] { "Id", "Description", "FeatureId", "IsEnabled", "Name" },
values: new object[,]
{
{ new Guid("6382ea8b-aff2-4cd2-a48f-a652b35825d8"), "Manage Recurring Template payment permission allows authorized users to set up, modify, and execute automated recurring payments using predefined templates, ensuring secure and controlled handling of repetitive financial transactions.", new Guid("86e80017-0698-4efe-93d0-806de67266e0"), true, "Manage Recurring" },
{ new Guid("7ddf2fba-c44d-4fe3-b4ec-690ff70be2e3"), "The \"View All Recurring Template payment permission\" generally allows users to see and access all recurring payment templates in the system, enabling them to review, manage, and process recurring transactions efficiently.", new Guid("86e80017-0698-4efe-93d0-806de67266e0"), true, "View All Recurring" },
{ new Guid("e5d21efe-573d-4a16-a0f8-414d3e442e78"), "View Self Recurring Template payment permission allows a user to view and access their own recurring payment templates without editing rights.", new Guid("86e80017-0698-4efe-93d0-806de67266e0"), true, "View Self Recurring" }
});
migrationBuilder.InsertData(
table: "StatusPermissionMapping",
columns: new[] { "Id", "PermissionId", "StatusId" },
values: new object[] { new Guid("de04b6c7-a5cd-4a61-88b0-b43b0008202e"), new Guid("ea5a1529-4ee8-4828-80ea-0e23c9d4dd11"), new Guid("b8586f67-dc19-49c3-b4af-224149efe1d3") });
migrationBuilder.CreateIndex(
name: "IX_Expenses_CurrencyId",
table: "Expenses",
column: "CurrencyId");
migrationBuilder.CreateIndex(
name: "IX_Expenses_ExpenseCategoryId",
table: "Expenses",
column: "ExpenseCategoryId");
migrationBuilder.CreateIndex(
name: "IX_Expenses_PaymentRequestId",
table: "Expenses",
column: "PaymentRequestId");
migrationBuilder.CreateIndex(
name: "IX_AdvancePaymentTransactions_CreatedById",
table: "AdvancePaymentTransactions",
column: "CreatedById");
migrationBuilder.CreateIndex(
name: "IX_AdvancePaymentTransactions_EmployeeId",
table: "AdvancePaymentTransactions",
column: "EmployeeId");
migrationBuilder.CreateIndex(
name: "IX_AdvancePaymentTransactions_ProjectId",
table: "AdvancePaymentTransactions",
column: "ProjectId");
migrationBuilder.CreateIndex(
name: "IX_AdvancePaymentTransactions_TenantId",
table: "AdvancePaymentTransactions",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_ExpenseCategoryMasters_TenantId",
table: "ExpenseCategoryMasters",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_PaymentRequestAttachments_DocumentId",
table: "PaymentRequestAttachments",
column: "DocumentId");
migrationBuilder.CreateIndex(
name: "IX_PaymentRequestAttachments_PaymentRequestId",
table: "PaymentRequestAttachments",
column: "PaymentRequestId");
migrationBuilder.CreateIndex(
name: "IX_PaymentRequestAttachments_TenantId",
table: "PaymentRequestAttachments",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_PaymentRequests_CreatedById",
table: "PaymentRequests",
column: "CreatedById");
migrationBuilder.CreateIndex(
name: "IX_PaymentRequests_CurrencyId",
table: "PaymentRequests",
column: "CurrencyId");
migrationBuilder.CreateIndex(
name: "IX_PaymentRequests_ExpenseCategoryId",
table: "PaymentRequests",
column: "ExpenseCategoryId");
migrationBuilder.CreateIndex(
name: "IX_PaymentRequests_ExpenseStatusId",
table: "PaymentRequests",
column: "ExpenseStatusId");
migrationBuilder.CreateIndex(
name: "IX_PaymentRequests_PaidById",
table: "PaymentRequests",
column: "PaidById");
migrationBuilder.CreateIndex(
name: "IX_PaymentRequests_ProjectId",
table: "PaymentRequests",
column: "ProjectId");
migrationBuilder.CreateIndex(
name: "IX_PaymentRequests_RecurringPaymentId",
table: "PaymentRequests",
column: "RecurringPaymentId");
migrationBuilder.CreateIndex(
name: "IX_PaymentRequests_TenantId",
table: "PaymentRequests",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_PaymentRequests_UpdatedById",
table: "PaymentRequests",
column: "UpdatedById");
migrationBuilder.CreateIndex(
name: "IX_RecurringPayments_CreatedById",
table: "RecurringPayments",
column: "CreatedById");
migrationBuilder.CreateIndex(
name: "IX_RecurringPayments_CurrencyId",
table: "RecurringPayments",
column: "CurrencyId");
migrationBuilder.CreateIndex(
name: "IX_RecurringPayments_ExpenseCategoryId",
table: "RecurringPayments",
column: "ExpenseCategoryId");
migrationBuilder.CreateIndex(
name: "IX_RecurringPayments_ProjectId",
table: "RecurringPayments",
column: "ProjectId");
migrationBuilder.CreateIndex(
name: "IX_RecurringPayments_StatusId",
table: "RecurringPayments",
column: "StatusId");
migrationBuilder.CreateIndex(
name: "IX_RecurringPayments_TenantId",
table: "RecurringPayments",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_RecurringPayments_UpdatedById",
table: "RecurringPayments",
column: "UpdatedById");
migrationBuilder.CreateIndex(
name: "IX_StatusUpdateLogs_TenantId",
table: "StatusUpdateLogs",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_StatusUpdateLogs_UpdatedById",
table: "StatusUpdateLogs",
column: "UpdatedById");
migrationBuilder.AddForeignKey(
name: "FK_Expenses_CurrencyMaster_CurrencyId",
table: "Expenses",
column: "CurrencyId",
principalTable: "CurrencyMaster",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_Expenses_ExpenseCategoryMasters_ExpenseCategoryId",
table: "Expenses",
column: "ExpenseCategoryId",
principalTable: "ExpenseCategoryMasters",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_Expenses_PaymentRequests_PaymentRequestId",
table: "Expenses",
column: "PaymentRequestId",
principalTable: "PaymentRequests",
principalColumn: "Id");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Expenses_CurrencyMaster_CurrencyId",
table: "Expenses");
migrationBuilder.DropForeignKey(
name: "FK_Expenses_ExpenseCategoryMasters_ExpenseCategoryId",
table: "Expenses");
migrationBuilder.DropForeignKey(
name: "FK_Expenses_PaymentRequests_PaymentRequestId",
table: "Expenses");
migrationBuilder.DropTable(
name: "AdvancePaymentTransactions");
migrationBuilder.DropTable(
name: "PaymentRequestAttachments");
migrationBuilder.DropTable(
name: "StatusUpdateLogs");
migrationBuilder.DropTable(
name: "PaymentRequests");
migrationBuilder.DropTable(
name: "RecurringPayments");
migrationBuilder.DropTable(
name: "ExpenseCategoryMasters");
migrationBuilder.DropTable(
name: "RecurringPaymentStatus");
migrationBuilder.DropIndex(
name: "IX_Expenses_CurrencyId",
table: "Expenses");
migrationBuilder.DropIndex(
name: "IX_Expenses_ExpenseCategoryId",
table: "Expenses");
migrationBuilder.DropIndex(
name: "IX_Expenses_PaymentRequestId",
table: "Expenses");
migrationBuilder.DeleteData(
table: "ExpensesStatusMapping",
keyColumn: "Id",
keyValue: new Guid("a1cc95ed-b276-4a3e-9f00-0a249b522d64"));
migrationBuilder.DeleteData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("6382ea8b-aff2-4cd2-a48f-a652b35825d8"));
migrationBuilder.DeleteData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("7ddf2fba-c44d-4fe3-b4ec-690ff70be2e3"));
migrationBuilder.DeleteData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("e5d21efe-573d-4a16-a0f8-414d3e442e78"));
migrationBuilder.DeleteData(
table: "Modules",
keyColumn: "Id",
keyValue: new Guid("0a79687a-86d7-430d-a2d7-8b8603cc76a1"));
migrationBuilder.DeleteData(
table: "PaymentModeMatser",
keyColumn: "Id",
keyValue: new Guid("95697409-baf6-4f78-86ab-42d93d9569a8"));
migrationBuilder.DeleteData(
table: "PaymentModeMatser",
keyColumn: "Id",
keyValue: new Guid("a820f240-5e9a-4ae9-9091-8a7aa7720cea"));
migrationBuilder.DeleteData(
table: "PaymentModeMatser",
keyColumn: "Id",
keyValue: new Guid("f67beee6-6763-4108-922c-03bd86b9178d"));
migrationBuilder.DeleteData(
table: "StatusPermissionMapping",
keyColumn: "Id",
keyValue: new Guid("de04b6c7-a5cd-4a61-88b0-b43b0008202e"));
migrationBuilder.DeleteData(
table: "ExpensesStatusMaster",
keyColumn: "Id",
keyValue: new Guid("b8586f67-dc19-49c3-b4af-224149efe1d3"));
migrationBuilder.DeleteData(
table: "Features",
keyColumn: "Id",
keyValue: new Guid("86e80017-0698-4efe-93d0-806de67266e0"));
migrationBuilder.DropColumn(
name: "BaseAmount",
table: "Expenses");
migrationBuilder.DropColumn(
name: "CurrencyId",
table: "Expenses");
migrationBuilder.DropColumn(
name: "ExpenseCategoryId",
table: "Expenses");
migrationBuilder.DropColumn(
name: "PaymentRequestId",
table: "Expenses");
migrationBuilder.DropColumn(
name: "TDSPercentage",
table: "Expenses");
migrationBuilder.DropColumn(
name: "TaxAmount",
table: "Expenses");
migrationBuilder.DropColumn(
name: "UIDPostfix",
table: "Expenses");
migrationBuilder.DropColumn(
name: "UIDPrefix",
table: "Expenses");
migrationBuilder.AddColumn<Guid>(
name: "TenantId",
table: "PaymentModeMatser",
type: "char(36)",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
collation: "ascii_general_ci");
migrationBuilder.UpdateData(
table: "Expenses",
keyColumn: "ExpenseUId",
keyValue: null,
column: "ExpenseUId",
value: "");
migrationBuilder.AlterColumn<string>(
name: "ExpenseUId",
table: "Expenses",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "ExpensesStatusMaster",
keyColumn: "Id",
keyValue: new Guid("6537018f-f4e9-4cb3-a210-6c3b2da999d7"),
column: "DisplayName",
value: "Submit");
migrationBuilder.InsertData(
table: "ExpensesTypeMaster",
columns: new[] { "Id", "Description", "IsActive", "IsAttachmentRequried", "Name", "NoOfPersonsRequired", "TenantId" },
values: new object[,]
{
{ new Guid("1e2d697a-76b4-4be8-bc66-87144561a1a0"), "Scheduled payments for external services or goods.", true, true, "Vendor/Supplier Payments", false, new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("2de53163-0dbd-404b-8e60-1b02e6b4886a"), "Vehicle fuel, logistics services and delivery of goods or personnel.", true, false, "Transport", false, new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("4842fa61-64eb-4241-aebd-8282065af9f9"), "Government fees, insurance, inspections and safety-related expenditures.", true, true, "Compliance & Safety", false, new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("52484820-1b54-4865-8f0f-baa2b1d339b9"), "Site setup costs including equipment deployment and temporary infrastructure.", true, true, "Mobilization", false, new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("5e0c6227-d49d-41ff-9f1f-781f0aee2469"), "Materials, equipment and supplies purchased for site operations.", true, true, "Procurement", false, new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("77013784-9324-4d8b-bd36-d6f928e68942"), "Machinery servicing, electricity, water, and temporary office needs.", true, true, "Maintenance & Utilities", false, new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("dd120bc4-ab0a-45ba-8450-5cd45ff221ca"), "Delivery of personnel.", true, false, "Travelling", true, new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("fc59eb90-98ea-481c-b421-54bfa9e42d8f"), " Worker amenities like snacks, meals, safety gear, accommodation, medical support etc.", true, true, "Employee Welfare", true, new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }
});
migrationBuilder.UpdateData(
table: "PaymentModeMatser",
keyColumn: "Id",
keyValue: new Guid("24e6b0df-7929-47d2-88a3-4cf14c1f28f9"),
column: "TenantId",
value: new Guid("b3466e83-7e11-464c-b93a-daf047838b26"));
migrationBuilder.UpdateData(
table: "PaymentModeMatser",
keyColumn: "Id",
keyValue: new Guid("2e919e94-694c-41d9-9489-0a2b4208a027"),
column: "TenantId",
value: new Guid("b3466e83-7e11-464c-b93a-daf047838b26"));
migrationBuilder.UpdateData(
table: "PaymentModeMatser",
keyColumn: "Id",
keyValue: new Guid("48d9b462-5d87-4dec-8dec-2bc943943172"),
column: "TenantId",
value: new Guid("b3466e83-7e11-464c-b93a-daf047838b26"));
migrationBuilder.UpdateData(
table: "PaymentModeMatser",
keyColumn: "Id",
keyValue: new Guid("ed667353-8eea-4fd1-8750-719405932480"),
column: "TenantId",
value: new Guid("b3466e83-7e11-464c-b93a-daf047838b26"));
migrationBuilder.CreateIndex(
name: "IX_PaymentModeMatser_TenantId",
table: "PaymentModeMatser",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_Expenses_ExpensesTypeId",
table: "Expenses",
column: "ExpensesTypeId");
migrationBuilder.AddForeignKey(
name: "FK_Expenses_ExpensesTypeMaster_ExpensesTypeId",
table: "Expenses",
column: "ExpensesTypeId",
principalTable: "ExpensesTypeMaster",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_PaymentModeMatser_Tenants_TenantId",
table: "PaymentModeMatser",
column: "TenantId",
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,41 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Made_StatusId_Nullable_In_StatusUpdateLog_Table : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<Guid>(
name: "StatusId",
table: "StatusUpdateLogs",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci",
oldClrType: typeof(Guid),
oldType: "char(36)")
.OldAnnotation("Relational:Collation", "ascii_general_ci");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<Guid>(
name: "StatusId",
table: "StatusUpdateLogs",
type: "char(36)",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
collation: "ascii_general_ci",
oldClrType: typeof(Guid),
oldType: "char(36)",
oldNullable: true)
.OldAnnotation("Relational:Collation", "ascii_general_ci");
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,50 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Added_NextStrikeDate_And_EndDate_In_RecurringPayment_Table : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "NumberOfIteration",
table: "RecurringPayments");
migrationBuilder.AddColumn<DateTime>(
name: "EndDate",
table: "RecurringPayments",
type: "datetime(6)",
nullable: false,
defaultValue: new DateTime(2025, 11, 10, 10, 17, 0, 0, DateTimeKind.Unspecified));
migrationBuilder.AddColumn<DateTime>(
name: "NextStrikeDate",
table: "RecurringPayments",
type: "datetime(6)",
nullable: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "EndDate",
table: "RecurringPayments");
migrationBuilder.DropColumn(
name: "NextStrikeDate",
table: "RecurringPayments");
migrationBuilder.AddColumn<int>(
name: "NumberOfIteration",
table: "RecurringPayments",
type: "int",
nullable: false,
defaultValue: 0);
}
}
}

View File

@ -0,0 +1,160 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Added_ServiceProject_And_ServiceProjectServiceMapping_Table : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "ServiceProjects",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Name = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
ShortName = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
ClientId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Address = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
AssignedDate = table.Column<DateTime>(type: "datetime(6)", nullable: false),
StatusId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
ContactName = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
ContactPhone = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
ContactEmail = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
IsActive = table.Column<bool>(type: "tinyint(1)", nullable: false),
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
CreatedById = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
UpdatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: true),
UpdatedById = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
TenantId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_ServiceProjects", x => x.Id);
table.ForeignKey(
name: "FK_ServiceProjects_Employees_CreatedById",
column: x => x.CreatedById,
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_ServiceProjects_Employees_UpdatedById",
column: x => x.UpdatedById,
principalTable: "Employees",
principalColumn: "Id");
table.ForeignKey(
name: "FK_ServiceProjects_Organizations_ClientId",
column: x => x.ClientId,
principalTable: "Organizations",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_ServiceProjects_StatusMasters_StatusId",
column: x => x.StatusId,
principalTable: "StatusMasters",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_ServiceProjects_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "ServiceProjectServiceMapping",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
ProjectId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
ServiceId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
TenantId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_ServiceProjectServiceMapping", x => x.Id);
table.ForeignKey(
name: "FK_ServiceProjectServiceMapping_ServiceMasters_ServiceId",
column: x => x.ServiceId,
principalTable: "ServiceMasters",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_ServiceProjectServiceMapping_ServiceProjects_ProjectId",
column: x => x.ProjectId,
principalTable: "ServiceProjects",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_ServiceProjectServiceMapping_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_ServiceProjects_ClientId",
table: "ServiceProjects",
column: "ClientId");
migrationBuilder.CreateIndex(
name: "IX_ServiceProjects_CreatedById",
table: "ServiceProjects",
column: "CreatedById");
migrationBuilder.CreateIndex(
name: "IX_ServiceProjects_StatusId",
table: "ServiceProjects",
column: "StatusId");
migrationBuilder.CreateIndex(
name: "IX_ServiceProjects_TenantId",
table: "ServiceProjects",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_ServiceProjects_UpdatedById",
table: "ServiceProjects",
column: "UpdatedById");
migrationBuilder.CreateIndex(
name: "IX_ServiceProjectServiceMapping_ProjectId",
table: "ServiceProjectServiceMapping",
column: "ProjectId");
migrationBuilder.CreateIndex(
name: "IX_ServiceProjectServiceMapping_ServiceId",
table: "ServiceProjectServiceMapping",
column: "ServiceId");
migrationBuilder.CreateIndex(
name: "IX_ServiceProjectServiceMapping_TenantId",
table: "ServiceProjectServiceMapping",
column: "TenantId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "ServiceProjectServiceMapping");
migrationBuilder.DropTable(
name: "ServiceProjects");
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,137 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Added_OrganiazationHierarchy_Related_Table : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "OrganizationHierarchies",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
EmployeeId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
ReportToId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
IsPrimary = table.Column<bool>(type: "tinyint(1)", nullable: false),
IsActive = table.Column<bool>(type: "tinyint(1)", nullable: false),
AssignedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
AssignedById = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
TenantId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_OrganizationHierarchies", x => x.Id);
table.ForeignKey(
name: "FK_OrganizationHierarchies_Employees_AssignedById",
column: x => x.AssignedById,
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_OrganizationHierarchies_Employees_EmployeeId",
column: x => x.EmployeeId,
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_OrganizationHierarchies_Employees_ReportToId",
column: x => x.ReportToId,
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_OrganizationHierarchies_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "OrgHierarchyLogs",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
OrganizationHierarchyId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
ReAssignedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
ReAssignedById = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
TenantId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_OrgHierarchyLogs", x => x.Id);
table.ForeignKey(
name: "FK_OrgHierarchyLogs_Employees_ReAssignedById",
column: x => x.ReAssignedById,
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_OrgHierarchyLogs_OrganizationHierarchies_OrganizationHierarc~",
column: x => x.OrganizationHierarchyId,
principalTable: "OrganizationHierarchies",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_OrgHierarchyLogs_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_OrganizationHierarchies_AssignedById",
table: "OrganizationHierarchies",
column: "AssignedById");
migrationBuilder.CreateIndex(
name: "IX_OrganizationHierarchies_EmployeeId",
table: "OrganizationHierarchies",
column: "EmployeeId");
migrationBuilder.CreateIndex(
name: "IX_OrganizationHierarchies_ReportToId",
table: "OrganizationHierarchies",
column: "ReportToId");
migrationBuilder.CreateIndex(
name: "IX_OrganizationHierarchies_TenantId",
table: "OrganizationHierarchies",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_OrgHierarchyLogs_OrganizationHierarchyId",
table: "OrgHierarchyLogs",
column: "OrganizationHierarchyId");
migrationBuilder.CreateIndex(
name: "IX_OrgHierarchyLogs_ReAssignedById",
table: "OrgHierarchyLogs",
column: "ReAssignedById");
migrationBuilder.CreateIndex(
name: "IX_OrgHierarchyLogs_TenantId",
table: "OrgHierarchyLogs",
column: "TenantId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "OrgHierarchyLogs");
migrationBuilder.DropTable(
name: "OrganizationHierarchies");
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,538 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Added_JobTicket_Related_Tables : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "JobStatus",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Name = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
DisplayName = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_JobStatus", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "JobTags",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Name = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
TenantId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_JobTags", x => x.Id);
table.ForeignKey(
name: "FK_JobTags_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "ServiceProjectTags",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Name = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
TenantId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_ServiceProjectTags", x => x.Id);
table.ForeignKey(
name: "FK_ServiceProjectTags_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "TeamRoleMasters",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Name = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Description = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_TeamRoleMasters", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "JobTickets",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Title = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Description = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
ProjectId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
AssigneeId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
StatusId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
StartDate = table.Column<DateTime>(type: "datetime(6)", nullable: false),
DueDate = table.Column<DateTime>(type: "datetime(6)", nullable: false),
IsActive = table.Column<bool>(type: "tinyint(1)", nullable: false),
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
CreatedById = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
UpdatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: true),
UpdatedById = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
TenantId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_JobTickets", x => x.Id);
table.ForeignKey(
name: "FK_JobTickets_Employees_AssigneeId",
column: x => x.AssigneeId,
principalTable: "Employees",
principalColumn: "Id");
table.ForeignKey(
name: "FK_JobTickets_Employees_CreatedById",
column: x => x.CreatedById,
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_JobTickets_Employees_UpdatedById",
column: x => x.UpdatedById,
principalTable: "Employees",
principalColumn: "Id");
table.ForeignKey(
name: "FK_JobTickets_JobStatus_StatusId",
column: x => x.StatusId,
principalTable: "JobStatus",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_JobTickets_ServiceProjects_ProjectId",
column: x => x.ProjectId,
principalTable: "ServiceProjects",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_JobTickets_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "ServiceProjectTagMappings",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
ServiceProjectTagId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
ServiceProjectId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_ServiceProjectTagMappings", x => x.Id);
table.ForeignKey(
name: "FK_ServiceProjectTagMappings_ServiceProjectTags_ServiceProjectT~",
column: x => x.ServiceProjectTagId,
principalTable: "ServiceProjectTags",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_ServiceProjectTagMappings_ServiceProjects_ServiceProjectId",
column: x => x.ServiceProjectId,
principalTable: "ServiceProjects",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "JobStatusMappings",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
TeamRoleId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
StatusId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
NextStatusId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
TenantId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_JobStatusMappings", x => x.Id);
table.ForeignKey(
name: "FK_JobStatusMappings_JobStatus_NextStatusId",
column: x => x.NextStatusId,
principalTable: "JobStatus",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_JobStatusMappings_JobStatus_StatusId",
column: x => x.StatusId,
principalTable: "JobStatus",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_JobStatusMappings_TeamRoleMasters_TeamRoleId",
column: x => x.TeamRoleId,
principalTable: "TeamRoleMasters",
principalColumn: "Id");
table.ForeignKey(
name: "FK_JobStatusMappings_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "JobEmployeeMappings",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
AssigneeId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
JobTicketId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
TenantId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_JobEmployeeMappings", x => x.Id);
table.ForeignKey(
name: "FK_JobEmployeeMappings_Employees_AssigneeId",
column: x => x.AssigneeId,
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_JobEmployeeMappings_JobTickets_JobTicketId",
column: x => x.JobTicketId,
principalTable: "JobTickets",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_JobEmployeeMappings_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "JobTagMappings",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
JobTagId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
JobTicketId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
TenantId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_JobTagMappings", x => x.Id);
table.ForeignKey(
name: "FK_JobTagMappings_JobTags_JobTagId",
column: x => x.JobTagId,
principalTable: "JobTags",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_JobTagMappings_JobTickets_JobTicketId",
column: x => x.JobTicketId,
principalTable: "JobTickets",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_JobTagMappings_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "JobUpdateLogs",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
JobTicketId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
StatusId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
NextStatusId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
Comment = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Description = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
UpdatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
UpdatedById = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
TenantId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_JobUpdateLogs", x => x.Id);
table.ForeignKey(
name: "FK_JobUpdateLogs_Employees_UpdatedById",
column: x => x.UpdatedById,
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_JobUpdateLogs_JobStatus_NextStatusId",
column: x => x.NextStatusId,
principalTable: "JobStatus",
principalColumn: "Id");
table.ForeignKey(
name: "FK_JobUpdateLogs_JobStatus_StatusId",
column: x => x.StatusId,
principalTable: "JobStatus",
principalColumn: "Id");
table.ForeignKey(
name: "FK_JobUpdateLogs_JobTickets_JobTicketId",
column: x => x.JobTicketId,
principalTable: "JobTickets",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_JobUpdateLogs_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.InsertData(
table: "JobStatus",
columns: new[] { "Id", "DisplayName", "Name" },
values: new object[,]
{
{ new Guid("32d76a02-8f44-4aa0-9b66-c3716c45a918"), "New", "New" },
{ new Guid("3ddeefb5-ae3c-4e10-a922-35e0a452bb69"), "Closed", "Closed" },
{ new Guid("5a6873a5-fed7-4745-a52f-8f61bf3bd72d"), "In Progress", "In Progress" },
{ new Guid("75a0c8b8-9c6a-41af-80bf-b35bab722eb2"), "On Hold", "On Hold" },
{ new Guid("aab71020-2fb8-44d9-9430-c9a7e9bf33b0"), "Resolved", "Resolved" },
{ new Guid("cfa1886d-055f-4ded-84c6-42a2a8a14a66"), "Assigned", "Assigned" },
{ new Guid("ed10ab57-dbaa-4ca5-8ecd-56745dcbdbd7"), "Done", "Done" }
});
migrationBuilder.InsertData(
table: "TeamRoleMasters",
columns: new[] { "Id", "Description", "Name" },
values: new object[,]
{
{ new Guid("03bf5853-5e0b-4eb8-9f37-33bd999a05b3"), "A Manager oversees and coordinates a team or department to achieve organizational goals through planning, decision-making, and leadership.", "Manager" },
{ new Guid("145d7222-408b-4733-8a17-f417e070b8b8"), "A Service Engineer installs, maintains, repairs, and troubleshoots equipment to ensure optimal operation and customer satisfaction.", "Service Engineer" },
{ new Guid("8cfbf16f-7d3b-4c29-af5b-18935f20aa7b"), "A Support role involves assisting users or customers by resolving technical or service-related issues, answering inquiries, and ensuring a positive experience with products or services.", "Support" }
});
migrationBuilder.InsertData(
table: "JobStatusMappings",
columns: new[] { "Id", "NextStatusId", "StatusId", "TeamRoleId", "TenantId" },
values: new object[,]
{
{ new Guid("024e1810-6a57-4a0d-8d2e-be88da79fcd4"), new Guid("cfa1886d-055f-4ded-84c6-42a2a8a14a66"), new Guid("32d76a02-8f44-4aa0-9b66-c3716c45a918"), null, new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("16c83c23-09be-40fd-9d05-f44795d8dee8"), new Guid("3ddeefb5-ae3c-4e10-a922-35e0a452bb69"), new Guid("cfa1886d-055f-4ded-84c6-42a2a8a14a66"), null, new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("2787c903-1b39-4e7d-a0f2-3bb2309bb341"), new Guid("cfa1886d-055f-4ded-84c6-42a2a8a14a66"), new Guid("75a0c8b8-9c6a-41af-80bf-b35bab722eb2"), null, new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("42f24930-387e-4f51-9c2d-3e29ffaaf02a"), new Guid("75a0c8b8-9c6a-41af-80bf-b35bab722eb2"), new Guid("cfa1886d-055f-4ded-84c6-42a2a8a14a66"), null, new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("5602d32c-290e-48a3-83dd-91af6d12ed46"), new Guid("5a6873a5-fed7-4745-a52f-8f61bf3bd72d"), new Guid("aab71020-2fb8-44d9-9430-c9a7e9bf33b0"), null, new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("7165ecee-10e3-4fc0-85d2-6d93d5b11776"), new Guid("3ddeefb5-ae3c-4e10-a922-35e0a452bb69"), new Guid("5a6873a5-fed7-4745-a52f-8f61bf3bd72d"), null, new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("76bc5551-8f80-469d-ba23-95d7e746c9a9"), new Guid("3ddeefb5-ae3c-4e10-a922-35e0a452bb69"), new Guid("ed10ab57-dbaa-4ca5-8ecd-56745dcbdbd7"), null, new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("87891499-e45d-406b-bf22-722db1beedc9"), new Guid("75a0c8b8-9c6a-41af-80bf-b35bab722eb2"), new Guid("5a6873a5-fed7-4745-a52f-8f61bf3bd72d"), null, new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("8c4ecdae-7435-4475-8389-15bc453561a1"), new Guid("aab71020-2fb8-44d9-9430-c9a7e9bf33b0"), new Guid("5a6873a5-fed7-4745-a52f-8f61bf3bd72d"), null, new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("9c2918be-b3c1-46fb-a03b-14dd613e1021"), new Guid("3ddeefb5-ae3c-4e10-a922-35e0a452bb69"), new Guid("aab71020-2fb8-44d9-9430-c9a7e9bf33b0"), null, new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("a44b0a66-ee33-47e7-a01f-6b8d9b621543"), new Guid("cfa1886d-055f-4ded-84c6-42a2a8a14a66"), new Guid("5a6873a5-fed7-4745-a52f-8f61bf3bd72d"), null, new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("ab974bdb-2d8f-4ddc-9b71-bd6d198bae75"), new Guid("75a0c8b8-9c6a-41af-80bf-b35bab722eb2"), new Guid("aab71020-2fb8-44d9-9430-c9a7e9bf33b0"), null, new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("ca8b4358-3122-4aaa-bcf8-0b66e4ab313a"), new Guid("cfa1886d-055f-4ded-84c6-42a2a8a14a66"), new Guid("aab71020-2fb8-44d9-9430-c9a7e9bf33b0"), null, new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("cb0db140-87fa-4a6f-812d-2834bd0f53a9"), new Guid("5a6873a5-fed7-4745-a52f-8f61bf3bd72d"), new Guid("cfa1886d-055f-4ded-84c6-42a2a8a14a66"), null, new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("dc986ec4-858e-4c98-b330-4a5c98c91f07"), new Guid("ed10ab57-dbaa-4ca5-8ecd-56745dcbdbd7"), new Guid("aab71020-2fb8-44d9-9430-c9a7e9bf33b0"), null, new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }
});
migrationBuilder.CreateIndex(
name: "IX_JobEmployeeMappings_AssigneeId",
table: "JobEmployeeMappings",
column: "AssigneeId");
migrationBuilder.CreateIndex(
name: "IX_JobEmployeeMappings_JobTicketId",
table: "JobEmployeeMappings",
column: "JobTicketId");
migrationBuilder.CreateIndex(
name: "IX_JobEmployeeMappings_TenantId",
table: "JobEmployeeMappings",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_JobStatusMappings_NextStatusId",
table: "JobStatusMappings",
column: "NextStatusId");
migrationBuilder.CreateIndex(
name: "IX_JobStatusMappings_StatusId",
table: "JobStatusMappings",
column: "StatusId");
migrationBuilder.CreateIndex(
name: "IX_JobStatusMappings_TeamRoleId",
table: "JobStatusMappings",
column: "TeamRoleId");
migrationBuilder.CreateIndex(
name: "IX_JobStatusMappings_TenantId",
table: "JobStatusMappings",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_JobTagMappings_JobTagId",
table: "JobTagMappings",
column: "JobTagId");
migrationBuilder.CreateIndex(
name: "IX_JobTagMappings_JobTicketId",
table: "JobTagMappings",
column: "JobTicketId");
migrationBuilder.CreateIndex(
name: "IX_JobTagMappings_TenantId",
table: "JobTagMappings",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_JobTags_TenantId",
table: "JobTags",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_JobTickets_AssigneeId",
table: "JobTickets",
column: "AssigneeId");
migrationBuilder.CreateIndex(
name: "IX_JobTickets_CreatedById",
table: "JobTickets",
column: "CreatedById");
migrationBuilder.CreateIndex(
name: "IX_JobTickets_ProjectId",
table: "JobTickets",
column: "ProjectId");
migrationBuilder.CreateIndex(
name: "IX_JobTickets_StatusId",
table: "JobTickets",
column: "StatusId");
migrationBuilder.CreateIndex(
name: "IX_JobTickets_TenantId",
table: "JobTickets",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_JobTickets_UpdatedById",
table: "JobTickets",
column: "UpdatedById");
migrationBuilder.CreateIndex(
name: "IX_JobUpdateLogs_JobTicketId",
table: "JobUpdateLogs",
column: "JobTicketId");
migrationBuilder.CreateIndex(
name: "IX_JobUpdateLogs_NextStatusId",
table: "JobUpdateLogs",
column: "NextStatusId");
migrationBuilder.CreateIndex(
name: "IX_JobUpdateLogs_StatusId",
table: "JobUpdateLogs",
column: "StatusId");
migrationBuilder.CreateIndex(
name: "IX_JobUpdateLogs_TenantId",
table: "JobUpdateLogs",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_JobUpdateLogs_UpdatedById",
table: "JobUpdateLogs",
column: "UpdatedById");
migrationBuilder.CreateIndex(
name: "IX_ServiceProjectTagMappings_ServiceProjectId",
table: "ServiceProjectTagMappings",
column: "ServiceProjectId");
migrationBuilder.CreateIndex(
name: "IX_ServiceProjectTagMappings_ServiceProjectTagId",
table: "ServiceProjectTagMappings",
column: "ServiceProjectTagId");
migrationBuilder.CreateIndex(
name: "IX_ServiceProjectTags_TenantId",
table: "ServiceProjectTags",
column: "TenantId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "JobEmployeeMappings");
migrationBuilder.DropTable(
name: "JobStatusMappings");
migrationBuilder.DropTable(
name: "JobTagMappings");
migrationBuilder.DropTable(
name: "JobUpdateLogs");
migrationBuilder.DropTable(
name: "ServiceProjectTagMappings");
migrationBuilder.DropTable(
name: "TeamRoleMasters");
migrationBuilder.DropTable(
name: "JobTags");
migrationBuilder.DropTable(
name: "JobTickets");
migrationBuilder.DropTable(
name: "ServiceProjectTags");
migrationBuilder.DropTable(
name: "JobStatus");
}
}
}

View File

@ -0,0 +1,50 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Removed_Assignee_From_JobTicket_Table : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_JobTickets_Employees_AssigneeId",
table: "JobTickets");
migrationBuilder.DropIndex(
name: "IX_JobTickets_AssigneeId",
table: "JobTickets");
migrationBuilder.DropColumn(
name: "AssigneeId",
table: "JobTickets");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<Guid>(
name: "AssigneeId",
table: "JobTickets",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.CreateIndex(
name: "IX_JobTickets_AssigneeId",
table: "JobTickets",
column: "AssigneeId");
migrationBuilder.AddForeignKey(
name: "FK_JobTickets_Employees_AssigneeId",
table: "JobTickets",
column: "AssigneeId",
principalTable: "Employees",
principalColumn: "Id");
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,151 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Removed_JobUpdateLog_Table_And_Added_JobComments_Table : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "JobUpdateLogs");
migrationBuilder.CreateTable(
name: "JobComments",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
JobTicketId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Comment = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
CreatedById = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
TenantId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_JobComments", x => x.Id);
table.ForeignKey(
name: "FK_JobComments_Employees_CreatedById",
column: x => x.CreatedById,
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_JobComments_JobTickets_JobTicketId",
column: x => x.JobTicketId,
principalTable: "JobTickets",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_JobComments_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_JobComments_CreatedById",
table: "JobComments",
column: "CreatedById");
migrationBuilder.CreateIndex(
name: "IX_JobComments_JobTicketId",
table: "JobComments",
column: "JobTicketId");
migrationBuilder.CreateIndex(
name: "IX_JobComments_TenantId",
table: "JobComments",
column: "TenantId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "JobComments");
migrationBuilder.CreateTable(
name: "JobUpdateLogs",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
JobTicketId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
NextStatusId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
StatusId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
TenantId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
UpdatedById = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Comment = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Description = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
UpdatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_JobUpdateLogs", x => x.Id);
table.ForeignKey(
name: "FK_JobUpdateLogs_Employees_UpdatedById",
column: x => x.UpdatedById,
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_JobUpdateLogs_JobStatus_NextStatusId",
column: x => x.NextStatusId,
principalTable: "JobStatus",
principalColumn: "Id");
table.ForeignKey(
name: "FK_JobUpdateLogs_JobStatus_StatusId",
column: x => x.StatusId,
principalTable: "JobStatus",
principalColumn: "Id");
table.ForeignKey(
name: "FK_JobUpdateLogs_JobTickets_JobTicketId",
column: x => x.JobTicketId,
principalTable: "JobTickets",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_JobUpdateLogs_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_JobUpdateLogs_JobTicketId",
table: "JobUpdateLogs",
column: "JobTicketId");
migrationBuilder.CreateIndex(
name: "IX_JobUpdateLogs_NextStatusId",
table: "JobUpdateLogs",
column: "NextStatusId");
migrationBuilder.CreateIndex(
name: "IX_JobUpdateLogs_StatusId",
table: "JobUpdateLogs",
column: "StatusId");
migrationBuilder.CreateIndex(
name: "IX_JobUpdateLogs_TenantId",
table: "JobUpdateLogs",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_JobUpdateLogs_UpdatedById",
table: "JobUpdateLogs",
column: "UpdatedById");
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,222 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Added_JobAttcahments_Table : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "IsActive",
table: "JobComments",
type: "tinyint(1)",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<DateTime>(
name: "UpdatedAt",
table: "JobComments",
type: "datetime(6)",
nullable: true);
migrationBuilder.AddColumn<Guid>(
name: "UpdatedById",
table: "JobComments",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.CreateTable(
name: "JobAttachments",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
DocumentId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
StatusId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
JobCommentId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
TenantId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_JobAttachments", x => x.Id);
table.ForeignKey(
name: "FK_JobAttachments_Documents_DocumentId",
column: x => x.DocumentId,
principalTable: "Documents",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_JobAttachments_JobComments_JobCommentId",
column: x => x.JobCommentId,
principalTable: "JobComments",
principalColumn: "Id");
table.ForeignKey(
name: "FK_JobAttachments_JobStatus_StatusId",
column: x => x.StatusId,
principalTable: "JobStatus",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_JobAttachments_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "ServiceProjectAllocations",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
ProjectId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
EmployeeId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
TeamRoleId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
IsActive = table.Column<bool>(type: "tinyint(1)", nullable: false),
AssignedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
AssignedById = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
ReAssignedAt = table.Column<DateTime>(type: "datetime(6)", nullable: true),
ReAssignedById = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
TenantId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_ServiceProjectAllocations", x => x.Id);
table.ForeignKey(
name: "FK_ServiceProjectAllocations_Employees_AssignedById",
column: x => x.AssignedById,
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_ServiceProjectAllocations_Employees_EmployeeId",
column: x => x.EmployeeId,
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_ServiceProjectAllocations_Employees_ReAssignedById",
column: x => x.ReAssignedById,
principalTable: "Employees",
principalColumn: "Id");
table.ForeignKey(
name: "FK_ServiceProjectAllocations_ServiceProjects_ProjectId",
column: x => x.ProjectId,
principalTable: "ServiceProjects",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_ServiceProjectAllocations_TeamRoleMasters_TeamRoleId",
column: x => x.TeamRoleId,
principalTable: "TeamRoleMasters",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_ServiceProjectAllocations_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_JobComments_UpdatedById",
table: "JobComments",
column: "UpdatedById");
migrationBuilder.CreateIndex(
name: "IX_JobAttachments_DocumentId",
table: "JobAttachments",
column: "DocumentId");
migrationBuilder.CreateIndex(
name: "IX_JobAttachments_JobCommentId",
table: "JobAttachments",
column: "JobCommentId");
migrationBuilder.CreateIndex(
name: "IX_JobAttachments_StatusId",
table: "JobAttachments",
column: "StatusId");
migrationBuilder.CreateIndex(
name: "IX_JobAttachments_TenantId",
table: "JobAttachments",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_ServiceProjectAllocations_AssignedById",
table: "ServiceProjectAllocations",
column: "AssignedById");
migrationBuilder.CreateIndex(
name: "IX_ServiceProjectAllocations_EmployeeId",
table: "ServiceProjectAllocations",
column: "EmployeeId");
migrationBuilder.CreateIndex(
name: "IX_ServiceProjectAllocations_ProjectId",
table: "ServiceProjectAllocations",
column: "ProjectId");
migrationBuilder.CreateIndex(
name: "IX_ServiceProjectAllocations_ReAssignedById",
table: "ServiceProjectAllocations",
column: "ReAssignedById");
migrationBuilder.CreateIndex(
name: "IX_ServiceProjectAllocations_TeamRoleId",
table: "ServiceProjectAllocations",
column: "TeamRoleId");
migrationBuilder.CreateIndex(
name: "IX_ServiceProjectAllocations_TenantId",
table: "ServiceProjectAllocations",
column: "TenantId");
migrationBuilder.AddForeignKey(
name: "FK_JobComments_Employees_UpdatedById",
table: "JobComments",
column: "UpdatedById",
principalTable: "Employees",
principalColumn: "Id");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_JobComments_Employees_UpdatedById",
table: "JobComments");
migrationBuilder.DropTable(
name: "JobAttachments");
migrationBuilder.DropTable(
name: "ServiceProjectAllocations");
migrationBuilder.DropIndex(
name: "IX_JobComments_UpdatedById",
table: "JobComments");
migrationBuilder.DropColumn(
name: "IsActive",
table: "JobComments");
migrationBuilder.DropColumn(
name: "UpdatedAt",
table: "JobComments");
migrationBuilder.DropColumn(
name: "UpdatedById",
table: "JobComments");
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,85 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Added_Level_In_JobStatus_Table : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "Level",
table: "JobStatus",
type: "int",
nullable: false,
defaultValue: 1);
migrationBuilder.UpdateData(
table: "JobStatus",
keyColumn: "Id",
keyValue: new Guid("32d76a02-8f44-4aa0-9b66-c3716c45a918"),
column: "Level",
value: 1);
migrationBuilder.UpdateData(
table: "JobStatus",
keyColumn: "Id",
keyValue: new Guid("3ddeefb5-ae3c-4e10-a922-35e0a452bb69"),
column: "Level",
value: 6);
migrationBuilder.UpdateData(
table: "JobStatus",
keyColumn: "Id",
keyValue: new Guid("5a6873a5-fed7-4745-a52f-8f61bf3bd72d"),
column: "Level",
value: 3);
migrationBuilder.UpdateData(
table: "JobStatus",
keyColumn: "Id",
keyValue: new Guid("75a0c8b8-9c6a-41af-80bf-b35bab722eb2"),
column: "Level",
value: 7);
migrationBuilder.UpdateData(
table: "JobStatus",
keyColumn: "Id",
keyValue: new Guid("aab71020-2fb8-44d9-9430-c9a7e9bf33b0"),
columns: new[] { "DisplayName", "Level", "Name" },
values: new object[] { "Review", 4, "Review" });
migrationBuilder.UpdateData(
table: "JobStatus",
keyColumn: "Id",
keyValue: new Guid("cfa1886d-055f-4ded-84c6-42a2a8a14a66"),
column: "Level",
value: 2);
migrationBuilder.UpdateData(
table: "JobStatus",
keyColumn: "Id",
keyValue: new Guid("ed10ab57-dbaa-4ca5-8ecd-56745dcbdbd7"),
column: "Level",
value: 5);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Level",
table: "JobStatus");
migrationBuilder.UpdateData(
table: "JobStatus",
keyColumn: "Id",
keyValue: new Guid("aab71020-2fb8-44d9-9430-c9a7e9bf33b0"),
columns: new[] { "DisplayName", "Name" },
values: new object[] { "Resolved", "Resolved" });
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,29 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Added_GoogleMapUrl_In_ServiceProject_Table : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "GoogleMapUrl",
table: "ServiceProjects",
type: "longtext",
nullable: true)
.Annotation("MySql:CharSet", "utf8mb4");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "GoogleMapUrl",
table: "ServiceProjects");
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,76 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Added_GSTNumber_In_Organization_Table : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<long>(
name: "SPRID",
table: "TenantOrgMappings",
type: "bigint",
nullable: false,
oldClrType: typeof(double),
oldType: "double");
migrationBuilder.AlterColumn<long>(
name: "SPRID",
table: "Organizations",
type: "bigint",
nullable: false,
oldClrType: typeof(double),
oldType: "double");
migrationBuilder.AddColumn<string>(
name: "GSTNumber",
table: "Organizations",
type: "longtext",
nullable: true)
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "Organizations",
keyColumn: "Id",
keyValue: new Guid("4e3a6d31-c640-40f7-8d67-6c109fcdb9ea"),
columns: new[] { "GSTNumber", "SPRID" },
values: new object[] { null, 5400L });
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "GSTNumber",
table: "Organizations");
migrationBuilder.AlterColumn<double>(
name: "SPRID",
table: "TenantOrgMappings",
type: "double",
nullable: false,
oldClrType: typeof(long),
oldType: "bigint");
migrationBuilder.AlterColumn<double>(
name: "SPRID",
table: "Organizations",
type: "double",
nullable: false,
oldClrType: typeof(long),
oldType: "bigint");
migrationBuilder.UpdateData(
table: "Organizations",
keyColumn: "Id",
keyValue: new Guid("4e3a6d31-c640-40f7-8d67-6c109fcdb9ea"),
column: "SPRID",
value: 5400.0);
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,158 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Added_JobAttendance_Related_Table : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "JobAttendance",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
JobTcketId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Action = table.Column<int>(type: "int", nullable: false),
EmployeeId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
TaggedInTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
TaggedOutTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
TaggedInAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
TaggedOutAt = table.Column<DateTime>(type: "datetime(6)", nullable: true),
TenantId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_JobAttendance", x => x.Id);
table.ForeignKey(
name: "FK_JobAttendance_Employees_EmployeeId",
column: x => x.EmployeeId,
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_JobAttendance_JobTickets_JobTcketId",
column: x => x.JobTcketId,
principalTable: "JobTickets",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_JobAttendance_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "JobAttendanceLogs",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
JobAttendanceId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
JobTcketId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
DocumentId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
Latitude = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Longitude = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Action = table.Column<int>(type: "int", nullable: false),
Comment = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
EmployeeId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
MarkedTIme = table.Column<DateTime>(type: "datetime(6)", nullable: false),
MarkedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
TenantId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_JobAttendanceLogs", x => x.Id);
table.ForeignKey(
name: "FK_JobAttendanceLogs_Documents_DocumentId",
column: x => x.DocumentId,
principalTable: "Documents",
principalColumn: "Id");
table.ForeignKey(
name: "FK_JobAttendanceLogs_Employees_EmployeeId",
column: x => x.EmployeeId,
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_JobAttendanceLogs_JobAttendance_JobAttendanceId",
column: x => x.JobAttendanceId,
principalTable: "JobAttendance",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_JobAttendanceLogs_JobTickets_JobTcketId",
column: x => x.JobTcketId,
principalTable: "JobTickets",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_JobAttendanceLogs_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_JobAttendance_EmployeeId",
table: "JobAttendance",
column: "EmployeeId");
migrationBuilder.CreateIndex(
name: "IX_JobAttendance_JobTcketId",
table: "JobAttendance",
column: "JobTcketId");
migrationBuilder.CreateIndex(
name: "IX_JobAttendance_TenantId",
table: "JobAttendance",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_JobAttendanceLogs_DocumentId",
table: "JobAttendanceLogs",
column: "DocumentId");
migrationBuilder.CreateIndex(
name: "IX_JobAttendanceLogs_EmployeeId",
table: "JobAttendanceLogs",
column: "EmployeeId");
migrationBuilder.CreateIndex(
name: "IX_JobAttendanceLogs_JobAttendanceId",
table: "JobAttendanceLogs",
column: "JobAttendanceId");
migrationBuilder.CreateIndex(
name: "IX_JobAttendanceLogs_JobTcketId",
table: "JobAttendanceLogs",
column: "JobTcketId");
migrationBuilder.CreateIndex(
name: "IX_JobAttendanceLogs_TenantId",
table: "JobAttendanceLogs",
column: "TenantId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "JobAttendanceLogs");
migrationBuilder.DropTable(
name: "JobAttendance");
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,40 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Added_UID_In_JobTicket_Table : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "UIDPostfix",
table: "JobTickets",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<string>(
name: "UIDPrefix",
table: "JobTickets",
type: "longtext",
nullable: false)
.Annotation("MySql:CharSet", "utf8mb4");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "UIDPostfix",
table: "JobTickets");
migrationBuilder.DropColumn(
name: "UIDPrefix",
table: "JobTickets");
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,71 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Added_BilledTo_In_Invoice_Table : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Invoices_Projects_ProjectId",
table: "Invoices");
migrationBuilder.DropIndex(
name: "IX_Invoices_ProjectId",
table: "Invoices");
migrationBuilder.AddColumn<Guid>(
name: "BilledToId",
table: "Invoices",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.CreateIndex(
name: "IX_Invoices_BilledToId",
table: "Invoices",
column: "BilledToId");
migrationBuilder.AddForeignKey(
name: "FK_Invoices_Organizations_BilledToId",
table: "Invoices",
column: "BilledToId",
principalTable: "Organizations",
principalColumn: "Id");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Invoices_Organizations_BilledToId",
table: "Invoices");
migrationBuilder.DropIndex(
name: "IX_Invoices_BilledToId",
table: "Invoices");
migrationBuilder.DropColumn(
name: "BilledToId",
table: "Invoices");
migrationBuilder.CreateIndex(
name: "IX_Invoices_ProjectId",
table: "Invoices",
column: "ProjectId");
migrationBuilder.AddForeignKey(
name: "FK_Invoices_Projects_ProjectId",
table: "Invoices",
column: "ProjectId",
principalTable: "Projects",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
}
}

View File

@ -0,0 +1,122 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Added_ProjectBranches_Table : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
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.CreateTable(
name: "ProjectBranches",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
BranchName = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
ProjectId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
ContactInformation = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Address = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
BranchType = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
GoogleMapUrl = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
IsActive = table.Column<bool>(type: "tinyint(1)", nullable: false),
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
CreatedById = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
UpdatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: true),
UpdatedById = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
TenantId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_ProjectBranches", x => x.Id);
table.ForeignKey(
name: "FK_ProjectBranches_Employees_CreatedById",
column: x => x.CreatedById,
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_ProjectBranches_Employees_UpdatedById",
column: x => x.UpdatedById,
principalTable: "Employees",
principalColumn: "Id");
table.ForeignKey(
name: "FK_ProjectBranches_ServiceProjects_ProjectId",
column: x => x.ProjectId,
principalTable: "ServiceProjects",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_ProjectBranches_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_ProjectBranches_CreatedById",
table: "ProjectBranches",
column: "CreatedById");
migrationBuilder.CreateIndex(
name: "IX_ProjectBranches_ProjectId",
table: "ProjectBranches",
column: "ProjectId");
migrationBuilder.CreateIndex(
name: "IX_ProjectBranches_TenantId",
table: "ProjectBranches",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_ProjectBranches_UpdatedById",
table: "ProjectBranches",
column: "UpdatedById");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "ProjectBranches");
migrationBuilder.AlterColumn<string>(
name: "ContactPerson",
table: "Projects",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
}
}
}

View File

@ -0,0 +1,78 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Added_ProjectBranch_As_ForignKey_In_JobTickets_Table : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<Guid>(
name: "ProjectBranchId",
table: "JobTickets",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.UpdateData(
table: "JobStatus",
keyColumn: "Id",
keyValue: new Guid("aab71020-2fb8-44d9-9430-c9a7e9bf33b0"),
columns: new[] { "DisplayName", "Name" },
values: new object[] { "Work Done", "Work Done" });
migrationBuilder.UpdateData(
table: "JobStatus",
keyColumn: "Id",
keyValue: new Guid("ed10ab57-dbaa-4ca5-8ecd-56745dcbdbd7"),
columns: new[] { "DisplayName", "Name" },
values: new object[] { "Review Done", "Review Done" });
migrationBuilder.CreateIndex(
name: "IX_JobTickets_ProjectBranchId",
table: "JobTickets",
column: "ProjectBranchId");
migrationBuilder.AddForeignKey(
name: "FK_JobTickets_ProjectBranches_ProjectBranchId",
table: "JobTickets",
column: "ProjectBranchId",
principalTable: "ProjectBranches",
principalColumn: "Id");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_JobTickets_ProjectBranches_ProjectBranchId",
table: "JobTickets");
migrationBuilder.DropIndex(
name: "IX_JobTickets_ProjectBranchId",
table: "JobTickets");
migrationBuilder.DropColumn(
name: "ProjectBranchId",
table: "JobTickets");
migrationBuilder.UpdateData(
table: "JobStatus",
keyColumn: "Id",
keyValue: new Guid("aab71020-2fb8-44d9-9430-c9a7e9bf33b0"),
columns: new[] { "DisplayName", "Name" },
values: new object[] { "Review", "Review" });
migrationBuilder.UpdateData(
table: "JobStatus",
keyColumn: "Id",
keyValue: new Guid("ed10ab57-dbaa-4ca5-8ecd-56745dcbdbd7"),
columns: new[] { "DisplayName", "Name" },
values: new object[] { "Done", "Done" });
}
}
}

View File

@ -0,0 +1,29 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Added_IsArchive_In_JobTicket_Table : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "IsArchive",
table: "JobTickets",
type: "tinyint(1)",
nullable: false,
defaultValue: false);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "IsArchive",
table: "JobTickets");
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,39 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Removed_Project_ForignKey_From_Expenses_Table : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Expenses_Projects_ProjectId",
table: "Expenses");
migrationBuilder.DropIndex(
name: "IX_Expenses_ProjectId",
table: "Expenses");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateIndex(
name: "IX_Expenses_ProjectId",
table: "Expenses",
column: "ProjectId");
migrationBuilder.AddForeignKey(
name: "FK_Expenses_Projects_ProjectId",
table: "Expenses",
column: "ProjectId",
principalTable: "Projects",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,38 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Removed_Project_ForignKey_From_PaymentRequest_Table : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_PaymentRequests_Projects_ProjectId",
table: "PaymentRequests");
migrationBuilder.DropIndex(
name: "IX_PaymentRequests_ProjectId",
table: "PaymentRequests");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateIndex(
name: "IX_PaymentRequests_ProjectId",
table: "PaymentRequests",
column: "ProjectId");
migrationBuilder.AddForeignKey(
name: "FK_PaymentRequests_Projects_ProjectId",
table: "PaymentRequests",
column: "ProjectId",
principalTable: "Projects",
principalColumn: "Id");
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,38 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Removed_Project_ForignKey_From_RecurringPayment_Table : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_RecurringPayments_Projects_ProjectId",
table: "RecurringPayments");
migrationBuilder.DropIndex(
name: "IX_RecurringPayments_ProjectId",
table: "RecurringPayments");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateIndex(
name: "IX_RecurringPayments_ProjectId",
table: "RecurringPayments",
column: "ProjectId");
migrationBuilder.AddForeignKey(
name: "FK_RecurringPayments_Projects_ProjectId",
table: "RecurringPayments",
column: "ProjectId",
principalTable: "Projects",
principalColumn: "Id");
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,39 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Removed_Project_ForignKey_From_ProjectContactMapping_Table : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_ContactProjectMappings_Projects_ProjectId",
table: "ContactProjectMappings");
migrationBuilder.DropIndex(
name: "IX_ContactProjectMappings_ProjectId",
table: "ContactProjectMappings");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateIndex(
name: "IX_ContactProjectMappings_ProjectId",
table: "ContactProjectMappings",
column: "ProjectId");
migrationBuilder.AddForeignKey(
name: "FK_ContactProjectMappings_Projects_ProjectId",
table: "ContactProjectMappings",
column: "ProjectId",
principalTable: "Projects",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,106 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Corrected_JobTicketId_Spelling_In_JobAttendance : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_JobAttendance_JobTickets_JobTcketId",
table: "JobAttendance");
migrationBuilder.DropForeignKey(
name: "FK_JobAttendanceLogs_JobTickets_JobTcketId",
table: "JobAttendanceLogs");
migrationBuilder.RenameColumn(
name: "JobTcketId",
table: "JobAttendanceLogs",
newName: "JobTicketId");
migrationBuilder.RenameIndex(
name: "IX_JobAttendanceLogs_JobTcketId",
table: "JobAttendanceLogs",
newName: "IX_JobAttendanceLogs_JobTicketId");
migrationBuilder.RenameColumn(
name: "JobTcketId",
table: "JobAttendance",
newName: "JobTicketId");
migrationBuilder.RenameIndex(
name: "IX_JobAttendance_JobTcketId",
table: "JobAttendance",
newName: "IX_JobAttendance_JobTicketId");
migrationBuilder.AddForeignKey(
name: "FK_JobAttendance_JobTickets_JobTicketId",
table: "JobAttendance",
column: "JobTicketId",
principalTable: "JobTickets",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_JobAttendanceLogs_JobTickets_JobTicketId",
table: "JobAttendanceLogs",
column: "JobTicketId",
principalTable: "JobTickets",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_JobAttendance_JobTickets_JobTicketId",
table: "JobAttendance");
migrationBuilder.DropForeignKey(
name: "FK_JobAttendanceLogs_JobTickets_JobTicketId",
table: "JobAttendanceLogs");
migrationBuilder.RenameColumn(
name: "JobTicketId",
table: "JobAttendanceLogs",
newName: "JobTcketId");
migrationBuilder.RenameIndex(
name: "IX_JobAttendanceLogs_JobTicketId",
table: "JobAttendanceLogs",
newName: "IX_JobAttendanceLogs_JobTcketId");
migrationBuilder.RenameColumn(
name: "JobTicketId",
table: "JobAttendance",
newName: "JobTcketId");
migrationBuilder.RenameIndex(
name: "IX_JobAttendance_JobTicketId",
table: "JobAttendance",
newName: "IX_JobAttendance_JobTcketId");
migrationBuilder.AddForeignKey(
name: "FK_JobAttendance_JobTickets_JobTcketId",
table: "JobAttendance",
column: "JobTcketId",
principalTable: "JobTickets",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_JobAttendanceLogs_JobTickets_JobTcketId",
table: "JobAttendanceLogs",
column: "JobTcketId",
principalTable: "JobTickets",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
}
}

View File

@ -4,11 +4,11 @@
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MongoDB.Driver" Version="3.0.0" />
<PackageReference Include="Razorpay" Version="3.3.2" />
</ItemGroup>
<ItemGroup>

View File

@ -13,7 +13,8 @@ namespace Marco.Pms.Model.AppMenu
public string? Icon { get; set; }
public bool Available { get; set; } = true;
public string? Link { get; set; }
public string Link { get; set; } = string.Empty;
public string MobileLink { get; set; } = string.Empty;
// Changed from string → List<string>
public List<string> PermissionIds { get; set; } = new List<string>();

View File

@ -13,6 +13,7 @@ namespace Marco.Pms.Model.AppMenu
public bool Available { get; set; } = true;
public string Link { get; set; } = string.Empty;
public string MobileLink { get; set; } = string.Empty;
// Changed from string → List<string>
public List<string> PermissionIds { get; set; } = new List<string>();

View File

@ -1,5 +1,5 @@
using Marco.Pms.Model.Employees;
using Marco.Pms.Model.Projects;
using Marco.Pms.Model.OrganizationModel;
using Marco.Pms.Model.Utilities;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
using System.ComponentModel.DataAnnotations.Schema;
@ -11,13 +11,14 @@ namespace Marco.Pms.Model.Collection
public Guid Id { get; set; }
public string Title { get; set; } = default!;
public string Description { get; set; } = default!;
public Guid? BilledToId { get; set; }
[ValidateNever]
[ForeignKey("BilledToId")]
public Organization? BilledTo { get; set; }
public string InvoiceNumber { get; set; } = default!;
public string? EInvoiceNumber { get; set; }
public Guid ProjectId { get; set; }
[ValidateNever]
[ForeignKey("ProjectId")]
public Project? Project { get; set; }
public DateTime InvoiceDate { get; set; }
public DateTime ClientSubmitedDate { get; set; }
public DateTime ExceptedPaymentDate { get; set; }

View File

@ -1,7 +1,6 @@
using System.ComponentModel.DataAnnotations.Schema;
using Marco.Pms.Model.Projects;
using Marco.Pms.Model.Utilities;
using Marco.Pms.Model.Utilities;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
using System.ComponentModel.DataAnnotations.Schema;
namespace Marco.Pms.Model.Directory
{
@ -9,9 +8,6 @@ namespace Marco.Pms.Model.Directory
{
public Guid Id { get; set; }
public Guid ProjectId { get; set; }
[ValidateNever]
[ForeignKey("ProjectId")]
public Project? Project { get; set; }
public Guid ContactId { get; set; }
[ValidateNever]
[ForeignKey("ContactId")]

View File

@ -7,6 +7,7 @@
public bool Available { get; set; } = true;
public required string Link { get; set; }
public string? MobileLink { get; set; }
// Changed from string → List<string>
public List<string> PermissionIds { get; set; } = new List<string>();

View File

@ -6,7 +6,7 @@
public bool Available { get; set; } = true;
public required string Link { get; set; } = string.Empty;
public string? MobileLink { get; set; }
// Changed from string → List<string>
public List<string> PermissionIds { get; set; } = new List<string>();
}

View File

@ -9,6 +9,7 @@
public bool Available { get; set; } = true;
public required string Link { get; set; }
public string? MobileLink { get; set; }
// Changed from string → List<string>
public List<string> PermissionIds { get; set; } = new List<string>();

View File

@ -8,6 +8,7 @@
public bool Available { get; set; } = true;
public string Link { get; set; } = string.Empty;
public string? MobileLink { get; set; }
// Changed from string → List<string>
public List<string> PermissionIds { get; set; } = new List<string>();

View File

@ -10,6 +10,7 @@ namespace Marco.Pms.Model.Dtos.Collection
public required string InvoiceNumber { get; set; }
public string? EInvoiceNumber { get; set; }
public required Guid ProjectId { get; set; }
public required Guid BilledToId { get; set; }
public required DateTime InvoiceDate { get; set; }
public required DateTime ClientSubmitedDate { get; set; }
public required DateTime ExceptedPaymentDate { get; set; }

View File

@ -0,0 +1,8 @@
namespace Marco.Pms.Model.Dtos.Employees
{
public class BasicEmployeeDto
{
public Guid EmployeeId { get; set; }
public bool IsActive { get; set; }
}
}

View File

@ -5,7 +5,7 @@ namespace Marco.Pms.Model.Dtos.Expenses
public class CreateExpensesDto
{
public required Guid ProjectId { get; set; }
public required Guid ExpensesTypeId { get; set; }
public required Guid ExpenseCategoryId { get; set; }
public required Guid PaymentModeId { get; set; }
public required Guid PaidById { get; set; }
public DateTime TransactionDate { get; set; } = DateTime.Now;
@ -15,6 +15,7 @@ namespace Marco.Pms.Model.Dtos.Expenses
public string? GSTNumber { get; set; }
public required string SupplerName { get; set; }
public required double Amount { get; set; }
public Guid? CurrencyId { get; set; }
public int? NoOfPersons { get; set; } = 0;
public bool PreApproved { get; set; } = false;
public required List<FileUploadModel> BillAttachments { get; set; }

View File

@ -0,0 +1,22 @@
using Marco.Pms.Model.TenantModels;
namespace Marco.Pms.Model.Dtos.Expenses
{
public class CreateRecurringTemplateDto
{
public required string Title { get; set; }
public required string Description { get; set; }
public required string Payee { get; set; }
public required string NotifyTo { get; set; }
public required Guid CurrencyId { get; set; }
public required double Amount { get; set; }
public required DateTime StrikeDate { get; set; }
public Guid? ProjectId { get; set; }
public required int PaymentBufferDays { get; set; }
public required DateTime EndDate { get; set; }
public required Guid ExpenseCategoryId { get; set; }
public required Guid StatusId { get; set; }
public required PLAN_FREQUENCY Frequency { get; set; }
public required bool IsVariable { get; set; }
}
}

View File

@ -0,0 +1,13 @@
using Marco.Pms.Model.Utilities;
namespace Marco.Pms.Model.Dtos.Expenses
{
public class ExpenseConversionDto
{
public required Guid PaymentRequestId { get; set; }
public required Guid PaymentModeId { get; set; }
public string? Location { get; set; }
public string? GSTNumber { get; set; }
public List<FileUploadModel>? BillAttachments { get; set; }
}
}

View File

@ -5,6 +5,9 @@
public Guid ExpenseId { get; set; }
public Guid StatusId { get; set; }
public string? Comment { get; set; }
public double? TDSPercentage { get; set; }
public double? BaseAmount { get; set; }
public double? TaxAmount { get; set; }
public string? ReimburseTransactionId { get; set; }
public DateTime? ReimburseDate { get; set; }
public Guid? ReimburseById { get; set; }

View File

@ -0,0 +1,11 @@
namespace Marco.Pms.Model.Dtos.Expenses.Masters
{
public class ExpenseCategoryMasterDto
{
public Guid? Id { get; set; }
public required string Name { get; set; }
public required bool NoOfPersonsRequired { get; set; }
public required bool IsAttachmentRequried { get; set; }
public string? Description { get; set; }
}
}

View File

@ -0,0 +1,7 @@
namespace Marco.Pms.Model.Dtos.Expenses
{
public class PaymentRequestConversionDto
{
public required List<Guid> RecurringTemplateIds { get; set; }
}
}

View File

@ -0,0 +1,19 @@
using Marco.Pms.Model.Utilities;
namespace Marco.Pms.Model.Dtos.Expenses
{
public class PaymentRequestDto
{
public Guid? Id { get; set; }
public required string Title { get; set; }
public required string Description { get; set; }
public required string Payee { get; set; }
public required Guid CurrencyId { get; set; }
public required double Amount { get; set; }
public required DateTime DueDate { get; set; }
public Guid? ProjectId { get; set; }
public required Guid ExpenseCategoryId { get; set; }
public bool IsAdvancePayment { get; set; }
public List<FileUploadModel>? BillAttachments { get; set; }
}
}

View File

@ -0,0 +1,21 @@
using Marco.Pms.Model.Utilities;
namespace Marco.Pms.Model.Dtos.Expenses
{
public class PaymentRequestRecordDto
{
public Guid PaymentRequestId { get; set; }
public Guid StatusId { get; set; }
public string? Comment { get; set; }
public string? PaidTransactionId { get; set; }
public double? TDSPercentage { get; set; }
public double? BaseAmount { get; set; }
public double? TaxAmount { get; set; }
public DateTime? PaidAt { get; set; }
public Guid? PaidById { get; set; }
public Guid? PaymentModeId { get; set; }
public string? Location { get; set; }
public string? GSTNumber { get; set; }
public List<FileUploadModel>? BillAttachments { get; set; }
}
}

View File

@ -6,7 +6,7 @@ namespace Marco.Pms.Model.Dtos.Expenses
{
public required Guid Id { get; set; }
public required Guid ProjectId { get; set; }
public required Guid ExpensesTypeId { get; set; }
public required Guid ExpenseCategoryId { get; set; }
public required Guid PaymentModeId { get; set; }
public required Guid PaidById { get; set; }
public DateTime TransactionDate { get; set; } = DateTime.Now;

View File

@ -0,0 +1,22 @@
using Marco.Pms.Model.TenantModels;
namespace Marco.Pms.Model.Dtos.Expenses
{
public class UpdateRecurringTemplateDto
{
public Guid Id { get; set; }
public required string Title { get; set; }
public required string Description { get; set; }
public required string Payee { get; set; }
public required string NotifyTo { get; set; }
public required Guid CurrencyId { get; set; }
public required double Amount { get; set; }
public Guid? ProjectId { get; set; }
public required int PaymentBufferDays { get; set; }
public required DateTime EndDate { get; set; }
public required Guid ExpenseCategoryId { get; set; }
public required Guid StatusId { get; set; }
public required PLAN_FREQUENCY Frequency { get; set; }
public required bool IsVariable { get; set; }
}
}

View File

@ -1,14 +0,0 @@
namespace Marco.Pms.Model.Dtos.Inventory
{
public class ItemDto
{
public Guid Id { get; set; }
public string Name { get; set; } = default!;
public string Description { get; set; } = default!;
public Guid ItemGroupId { get; set; }
public Guid TechnicalUnitId { get; set; }
public int Threshold { get; set; }
public List<SupplierManufacturerDto>? Suppliers { get; set; }
public List<ItemTaxTypeDto>? TaxRates { get; set; }
}
}

View File

@ -1,8 +0,0 @@
namespace Marco.Pms.Model.Dtos.Inventory
{
public class ItemTaxTypeDto
{
public Guid ServicesTaxTypeId { get; set; }
public int Rate { get; set; }
}
}

View File

@ -1,9 +0,0 @@
namespace Marco.Pms.Model.Dtos.Inventory
{
public class ProductCategoryDto
{
public Guid? Id { get; set; }
public required string Name { get; set; }
public required string Description { get; set; }
}
}

View File

@ -1,9 +0,0 @@
namespace Marco.Pms.Model.Dtos.Inventory
{
public class PurchaseOrderStatusDto
{
public Guid? Id { get; set; }
public required string Name { get; set; }
public required string Description { get; set; }
}
}

View File

@ -1,9 +0,0 @@
namespace Marco.Pms.Model.Dtos.Inventory
{
public class PurchaseStatusMappingDto
{
public Guid PurchaseStatusId { get; set; }
public Guid NextPurchaseStatusId { get; set; }
public bool IsActive { get; set; }
}
}

View File

@ -1,9 +0,0 @@
namespace Marco.Pms.Model.Dtos.Inventory
{
public class RequisitionStatusDto
{
public Guid? Id { get; set; }
public required string Name { get; set; }
public required string Description { get; set; }
}
}

View File

@ -1,9 +0,0 @@
namespace Marco.Pms.Model.Dtos.Inventory
{
public class RequisitionStatusMappingDto
{
public Guid RequisitionStatusId { get; set; }
public Guid NextRequisitionStatusId { get; set; }
public bool IsActive { get; set; }
}
}

View File

@ -1,12 +0,0 @@
namespace Marco.Pms.Model.Dtos.Inventory
{
public class SupplierManufacturerDto
{
public Guid ManufacturerId { get; set; }
public Guid SupplierId { get; set; }
public double BasePrice { get; set; }
public int PurchaseLeadTime { get; set; }
public Guid CurrencyId { get; set; }
public bool IsActive { get; set; }
}
}

View File

@ -0,0 +1,9 @@
namespace Marco.Pms.Model.Dtos.Master
{
public class TagDto
{
public Guid? Id { get; set; }
public required string Name { get; set; }
public bool IsActive { get; set; }
}
}

View File

@ -7,6 +7,7 @@
public required string ContactPerson { get; set; }
public required string Address { get; set; }
public required string ContactNumber { get; set; }
public string? GSTNumber { get; set; }
public string? logoImage { get; set; }
public List<Guid>? ServiceIds { get; set; }
}

View File

@ -0,0 +1,9 @@
namespace Marco.Pms.Model.Dtos.Organization
{
public class OrganizationHierarchyDto
{
public Guid ReportToId { get; set; }
public bool IsPrimary { get; set; }
public bool IsActive { get; set; }
}
}

View File

@ -7,6 +7,7 @@
public required string ContactPerson { get; set; }
public required string Address { get; set; }
public required string ContactNumber { get; set; }
public string? GSTNumber { get; set; }
public List<Guid>? ServiceIds { get; set; }
}
}

View File

@ -0,0 +1,7 @@
namespace Marco.Pms.Model.Dtos.PaymentGetway
{
public class CreateOrderDto
{
public double Amount { get; set; }
}
}

View File

@ -0,0 +1,11 @@
namespace Marco.Pms.Model.Dtos.PaymentGetway
{
public class PaymentVerificationRequest
{
public required Guid TenantEnquireId { get; set; }
public required Guid PlanId { get; set; }
public required string OrderId { get; set; }
public required string PaymentId { get; set; }
public required string Signature { get; set; }
}
}

View File

@ -0,0 +1,9 @@
namespace Marco.Pms.Model.Dtos.ServiceProject
{
public class ChangeJobStatusDto
{
public required Guid JobTicketId { get; set; }
public required Guid StatusId { get; set; }
public required string Comment { get; set; }
}
}

View File

@ -0,0 +1,17 @@
using Marco.Pms.Model.Dtos.Employees;
using Marco.Pms.Model.Dtos.Master;
namespace Marco.Pms.Model.Dtos.ServiceProject
{
public class CreateJobTicketDto
{
public required string Title { get; set; }
public required string Description { get; set; }
public required Guid ProjectId { get; set; }
public Guid? ProjectBranchId { get; set; }
public List<BasicEmployeeDto>? Assignees { get; set; }
public required DateTime StartDate { get; set; }
public required DateTime DueDate { get; set; }
public List<TagDto>? Tags { get; set; }
}
}

View File

@ -0,0 +1,16 @@
using Marco.Pms.Model.ServiceProject;
using Marco.Pms.Model.Utilities;
namespace Marco.Pms.Model.Dtos.ServiceProject
{
public class JobAttendanceDto
{
public required Guid JobTicketId { get; set; }
public required TAGGING_MARK_TYPE Action { get; set; }
public string? Latitude { get; set; }
public string? Longitude { get; set; }
public string? Comment { get; set; }
public DateTime? MarkedAt { get; set; }
public FileUploadModel? Attachment { get; set; }
}
}

View File

@ -0,0 +1,12 @@
using Marco.Pms.Model.Utilities;
namespace Marco.Pms.Model.Dtos.ServiceProject
{
public class JobCommentDto
{
public Guid? Id { get; set; }
public required Guid JobTicketId { get; set; }
public required string Comment { get; set; }
public List<FileUploadModel>? Attachments { get; set; }
}
}

View File

@ -0,0 +1,13 @@
namespace Marco.Pms.Model.Dtos.ServiceProject
{
public class ProjectBranchDto
{
public Guid? Id { get; set; }
public required string BranchName { get; set; }
public required Guid ProjectId { get; set; }
public required string ContactInformation { get; set; }
public required string Address { get; set; }
public required string BranchType { get; set; } // HQ, ATMs, Bank Branches, Overcounter desk
public string? GoogleMapUrl { get; set; }
}
}

Some files were not shown because too many files have changed in this diff Show More