From 58ab8661fb5d3208a256c33d388118de352fafdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sedat=20=C3=96ZT=C3=9CRK?= <76204082+iamsedatozturk@users.noreply.github.com> Date: Thu, 27 Nov 2025 11:49:09 +0300 Subject: [PATCH] =?UTF-8?q?Project=20Task=20g=C3=BCncellemesi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Seeds/LanguagesData.json | 32 +- .../Seeds/ListFormSeeder_Project.cs | 602 +++++++++++++++++- .../Seeds/MenusData.json | 70 +- .../Seeds/PermissionsData.json | 373 +++++++---- .../Enums/TableNameEnum.cs | 5 +- .../TableNameResolver.cs | 3 + .../Erp.Platform.Domain/Data/SeedConsts.cs | 7 +- .../Tenant/Project/ProjectCategory.cs | 18 + .../Entities/Tenant/Project/ProjectPhase.cs | 40 ++ .../Entities/Tenant/Project/ProjectRisk.cs | 18 + .../EntityFrameworkCore/PlatformDbContext.cs | 51 ++ ....cs => 20251127083732_Initial.Designer.cs} | 296 ++++++++- ...2_Initial.cs => 20251127083732_Initial.cs} | 369 ++++++++--- .../PlatformDbContextModelSnapshot.cs | 294 ++++++++- .../Tenants/Seeds/TenantData.json | 182 +++++- .../Tenants/TenantDataSeeder.cs | 70 +- .../Tenants/TenantSeederDto.cs | 42 ++ ui/src/views/intranet/Dashboard.tsx | 2 +- 18 files changed, 2208 insertions(+), 266 deletions(-) create mode 100644 api/src/Erp.Platform.Domain/Entities/Tenant/Project/ProjectCategory.cs create mode 100644 api/src/Erp.Platform.Domain/Entities/Tenant/Project/ProjectPhase.cs create mode 100644 api/src/Erp.Platform.Domain/Entities/Tenant/Project/ProjectRisk.cs rename api/src/Erp.Platform.EntityFrameworkCore/Migrations/{20251127061452_Initial.Designer.cs => 20251127083732_Initial.Designer.cs} (98%) rename api/src/Erp.Platform.EntityFrameworkCore/Migrations/{20251127061452_Initial.cs => 20251127083732_Initial.cs} (98%) diff --git a/api/src/Erp.Platform.DbMigrator/Seeds/LanguagesData.json b/api/src/Erp.Platform.DbMigrator/Seeds/LanguagesData.json index 8a033d04..d2cd6569 100644 --- a/api/src/Erp.Platform.DbMigrator/Seeds/LanguagesData.json +++ b/api/src/Erp.Platform.DbMigrator/Seeds/LanguagesData.json @@ -9579,16 +9579,28 @@ }, { "resourceName": "Platform", - "key": "App.Project.ProjectType", + "key": "App.Project.Type", "tr": "Proje Türleri", "en": "Project Types" }, { "resourceName": "Platform", - "key": "App.Project.ProjectStatus", + "key": "App.Project.Status", "tr": "Proje Durumları", "en": "Project Statuses" }, + { + "resourceName": "Platform", + "key": "App.Project.Category", + "tr": "Proje Kategorileri", + "en": "Project Categories" + }, + { + "resourceName": "Platform", + "key": "App.Project.Risk", + "tr": "Proje Riskleri", + "en": "Project Risks" + }, { "resourceName": "Platform", "key": "App.Project.Projects", @@ -9597,19 +9609,19 @@ }, { "resourceName": "Platform", - "key": "App.Project.Tasks", - "tr": "Görevler", - "en": "Tasks" - }, - { - "resourceName": "Platform", - "key": "App.Project.Phases", + "key": "App.Project.Phase", "tr": "Aşamalar", "en": "Phases" }, { "resourceName": "Platform", - "key": "App.Project.Activities", + "key": "App.Project.Task", + "tr": "Görevler", + "en": "Tasks" + }, + { + "resourceName": "Platform", + "key": "App.Project.Activity", "tr": "Aktiviteler", "en": "Activities" }, diff --git a/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Project.cs b/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Project.cs index 3b5e0d2c..092eee37 100644 --- a/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Project.cs +++ b/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Project.cs @@ -46,7 +46,7 @@ public class ListFormSeeder_Project : IDataSeedContributor, ITransientDependency var listFormName = String.Empty; #region Project Type - listFormName = AppCodes.Project.ProjectType; + listFormName = AppCodes.Project.Type; if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName)) { var listForm = await _listFormRepository.InsertAsync( @@ -169,7 +169,7 @@ public class ListFormSeeder_Project : IDataSeedContributor, ITransientDependency #endregion #region Project Status - listFormName = AppCodes.Project.ProjectStatus; + listFormName = AppCodes.Project.Status; if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName)) { var listForm = await _listFormRepository.InsertAsync( @@ -688,6 +688,604 @@ public class ListFormSeeder_Project : IDataSeedContributor, ITransientDependency #endregion } #endregion + + #region Project Risk + listFormName = AppCodes.Project.Risk; + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName)) + { + var listForm = await _listFormRepository.InsertAsync( + new ListForm() + { + ListFormType = ListFormTypeEnum.List, + IsSubForm = false, + ShowNote = true, + LayoutJson = DefaultLayoutJson, + CultureName = LanguageCodes.En, + ListFormCode = listFormName, + Name = listFormName, + Title = listFormName, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = true, + IsBranch = false, + IsOrganizationUnit = false, + Description = listFormName, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.ProjectRisk)), + KeyFieldName = "Id", + KeyFieldDbSourceType = DbType.Guid, + DefaultFilter = DefaultFilterJson, + SortMode = GridOptions.SortModeSingle, + FilterRowJson = DefaultFilterRowJson, + HeaderFilterJson = DefaultHeaderFilterJson, + SearchPanelJson = DefaultSearchPanelJson, + GroupPanelJson = DefaultGroupPanelJson, + SelectionJson = DefaultSelectionSingleJson, + ColumnOptionJson = DefaultColumnOptionJson, + PermissionJson = DefaultPermissionJson(listFormName), + DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.ProjectRisk)), + DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson, + PagerOptionJson = DefaultPagerOptionJson, + EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 300, true, true, true, true, false), + InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson, + EditingFormJson = JsonSerializer.Serialize(new List() + { + new() { + Order=1, ColCount=1, ColSpan=1, ItemType="group", Items =[ + new EditingFormItemDto { Order = 1, DataField="Name", ColSpan = 1, IsRequired =true, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 2, DataField="Description", ColSpan = 1, EditorType2 = EditorTypes.dxTextArea }, + new EditingFormItemDto { Order = 3, DataField="IsActive", ColSpan = 1, EditorType2 = EditorTypes.dxCheckBox }, + ]} + }), + FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + new() { FieldName = "IsActive", FieldDbType = DbType.Boolean, Value = "true", CustomValueType = FieldCustomValueTypeEnum.Value } + }), + } + ); + + #region Project Type Fields + await _listFormFieldRepository.InsertManyAsync([ + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + Width = 100, + ListOrderNo = 1, + Visible = false, + IsActive = true, + IsDeleted = false, + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Name", + Width = 300, + ListOrderNo = 2, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + SortIndex = 1, + SortDirection = GridColumnOptions.SortOrderAsc, + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Description", + Width = 500, + ListOrderNo = 3, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Boolean, + FieldName = "IsActive", + Width = 100, + ListOrderNo = 4, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + ]); + #endregion + } + #endregion + + #region Project Category + listFormName = AppCodes.Project.Category; + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName)) + { + var listForm = await _listFormRepository.InsertAsync( + new ListForm() + { + ListFormType = ListFormTypeEnum.List, + IsSubForm = false, + ShowNote = true, + LayoutJson = DefaultLayoutJson, + CultureName = LanguageCodes.En, + ListFormCode = listFormName, + Name = listFormName, + Title = listFormName, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = true, + IsBranch = false, + IsOrganizationUnit = false, + Description = listFormName, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.ProjectCategory)), + KeyFieldName = "Id", + KeyFieldDbSourceType = DbType.Guid, + DefaultFilter = DefaultFilterJson, + SortMode = GridOptions.SortModeSingle, + FilterRowJson = DefaultFilterRowJson, + HeaderFilterJson = DefaultHeaderFilterJson, + SearchPanelJson = DefaultSearchPanelJson, + GroupPanelJson = DefaultGroupPanelJson, + SelectionJson = DefaultSelectionSingleJson, + ColumnOptionJson = DefaultColumnOptionJson, + PermissionJson = DefaultPermissionJson(listFormName), + DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.ProjectCategory)), + DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson, + PagerOptionJson = DefaultPagerOptionJson, + EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 300, true, true, true, true, false), + InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson, + EditingFormJson = JsonSerializer.Serialize(new List() + { + new() { + Order=1, ColCount=1, ColSpan=1, ItemType="group", Items =[ + new EditingFormItemDto { Order = 1, DataField="Name", ColSpan = 1, IsRequired =true, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 2, DataField="Description", ColSpan = 1, EditorType2 = EditorTypes.dxTextArea }, + new EditingFormItemDto { Order = 3, DataField="IsActive", ColSpan = 1, EditorType2 = EditorTypes.dxCheckBox }, + ]} + }), + FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + new() { FieldName = "IsActive", FieldDbType = DbType.Boolean, Value = "true", CustomValueType = FieldCustomValueTypeEnum.Value } + }), + } + ); + + #region Project Category Fields + await _listFormFieldRepository.InsertManyAsync([ + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + Width = 100, + ListOrderNo = 1, + Visible = false, + IsActive = true, + IsDeleted = false, + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Name", + Width = 300, + ListOrderNo = 2, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + SortIndex = 1, + SortDirection = GridColumnOptions.SortOrderAsc, + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Description", + Width = 500, + ListOrderNo = 3, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Boolean, + FieldName = "IsActive", + Width = 100, + ListOrderNo = 4, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + ]); + #endregion + } + #endregion + + #region Project Phase + listFormName = AppCodes.Project.Phase; + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName)) + { + var listForm = await _listFormRepository.InsertAsync( + new ListForm() + { + ListFormType = ListFormTypeEnum.List, + IsSubForm = false, + ShowNote = true, + LayoutJson = DefaultLayoutJson, + CultureName = LanguageCodes.En, + ListFormCode = listFormName, + Name = listFormName, + Title = listFormName, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = true, + IsBranch = false, + IsOrganizationUnit = false, + Description = listFormName, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.ProjectPhase)), + KeyFieldName = "Id", + KeyFieldDbSourceType = DbType.Guid, + DefaultFilter = DefaultFilterJson, + SortMode = GridOptions.SortModeSingle, + FilterRowJson = DefaultFilterRowJson, + HeaderFilterJson = DefaultHeaderFilterJson, + SearchPanelJson = DefaultSearchPanelJson, + GroupPanelJson = DefaultGroupPanelJson, + SelectionJson = DefaultSelectionSingleJson, + ColumnOptionJson = DefaultColumnOptionJson, + PermissionJson = DefaultPermissionJson(listFormName), + DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.ProjectPhase)), + DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson, + PagerOptionJson = DefaultPagerOptionJson, + EditingOptionJson = DefaultEditingOptionJson(listFormName, 800, 500, true, true, true, true, false), + InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson, + EditingFormJson = JsonSerializer.Serialize(new List() + { + new() { + Order=1, ColCount=2, ColSpan=1, ItemType="group", Items =[ + new EditingFormItemDto { Order = 1, DataField="ProjectId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 2, DataField="ProjectCategoryId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 3, DataField="Code", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 4, DataField="Name", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 5, DataField="Description", ColSpan = 2, EditorType2 = EditorTypes.dxTextArea }, + new EditingFormItemDto { Order = 6, DataField="StatusId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 7, DataField="Sequence", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxNumberBox }, + new EditingFormItemDto { Order = 8, DataField="StartDate", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxDateBox }, + new EditingFormItemDto { Order = 9, DataField="EndDate", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxDateBox }, + new EditingFormItemDto { Order = 10, DataField="Budget", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxNumberBox, EditorOptions = EditorOptionValues.NumberStandartFormat }, + new EditingFormItemDto { Order = 11, DataField="ActualStartDate", ColSpan = 1, EditorType2 = EditorTypes.dxDateBox }, + new EditingFormItemDto { Order = 12, DataField="ActualEndDate", ColSpan = 1, EditorType2 = EditorTypes.dxDateBox }, + new EditingFormItemDto { Order = 13, DataField="ActualCost", ColSpan = 1, EditorType2 = EditorTypes.dxNumberBox, EditorOptions = EditorOptionValues.NumberStandartFormat }, + new EditingFormItemDto { Order = 14, DataField="Progress", ColSpan = 1, EditorType2 = EditorTypes.dxSlider }, + new EditingFormItemDto { Order = 15, DataField="Risks", ColSpan = 1, EditorType2 = EditorTypes.dxTagBox }, + new EditingFormItemDto { Order = 16, DataField="IsActive", ColSpan = 1, EditorType2 = EditorTypes.dxCheckBox }, + ]} + }), + FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + new() { FieldName = "Budget", FieldDbType = DbType.Decimal, Value = "0", CustomValueType = FieldCustomValueTypeEnum.Value }, + new() { FieldName = "Sequence", FieldDbType = DbType.Int32, Value = "1", CustomValueType = FieldCustomValueTypeEnum.Value }, + new() { FieldName = "ActualCost", FieldDbType = DbType.Decimal, Value = "0", CustomValueType = FieldCustomValueTypeEnum.Value }, + new() { FieldName = "StartDate", FieldDbType = DbType.Date, Value = "@DATE", CustomValueType = FieldCustomValueTypeEnum.CustomKey }, + new() { FieldName = "Progress", FieldDbType = DbType.Int32, Value = "0", CustomValueType = FieldCustomValueTypeEnum.Value }, + new() { FieldName = "IsActive", FieldDbType = DbType.Boolean, Value = "true", CustomValueType = FieldCustomValueTypeEnum.Value } + }), + } + ); + + #region Project Phase Fields + await _listFormFieldRepository.InsertManyAsync([ + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + Width = 100, + ListOrderNo = 1, + Visible = false, + IsActive = true, + IsDeleted = false, + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "ProjectId", + Width = 200, + ListOrderNo = 2, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.Projects), "Id", "Name"), + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "ProjectCategoryId", + Width = 100, + ListOrderNo = 3, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.ProjectCategory), "Id", "Name"), + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Code", + Width = 100, + ListOrderNo = 4, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Name", + Width = 200, + ListOrderNo = 5, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + SortIndex = 1, + SortDirection = GridColumnOptions.SortOrderAsc, + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Description", + Width = 300, + ListOrderNo = 6, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "StatusId", + Width = 100, + ListOrderNo = 7, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.ProjectStatus), "Id", "Name"), + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Int32, + FieldName = "Sequence", + Width = 100, + ListOrderNo = 8, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Date, + FieldName = "StartDate", + Width = 100, + ListOrderNo = 9, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Date, + FieldName = "EndDate", + Width = 100, + ListOrderNo = 10, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Decimal, + FieldName = "Budget", + Format = "fixedPoint", + Alignment = "right", + Width = 100, + ListOrderNo = 11, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Date, + FieldName = "ActualStartDate", + Width = 100, + ListOrderNo = 12, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Date, + FieldName = "ActualEndDate", + Width = 100, + ListOrderNo = 13, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Decimal, + FieldName = "ActualCost", + Format = "fixedPoint", + Alignment = "right", + Width = 100, + ListOrderNo = 14, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Int32, + FieldName = "Progress", + Width = 100, + ListOrderNo = 15, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Risks", + Width = 300, + ListOrderNo = 16, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.ProjectRisk), "Id", "Name"), + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Boolean, + FieldName = "IsActive", + Width = 100, + ListOrderNo = 17, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + ]); + #endregion + } + #endregion } } diff --git a/api/src/Erp.Platform.DbMigrator/Seeds/MenusData.json b/api/src/Erp.Platform.DbMigrator/Seeds/MenusData.json index 00144530..091fa58a 100644 --- a/api/src/Erp.Platform.DbMigrator/Seeds/MenusData.json +++ b/api/src/Erp.Platform.DbMigrator/Seeds/MenusData.json @@ -2576,29 +2576,49 @@ }, { "ParentCode": "App.Project", - "Code": "App.Project.ProjectType", - "DisplayName": "App.Project.ProjectType", + "Code": "App.Project.Type", + "DisplayName": "App.Project.Type", "Order": 1, - "Url": "/admin/list/App.Project.ProjectType", + "Url": "/admin/list/App.Project.Type", "Icon": "FcWorkflow", - "RequiredPermissionName": "App.Project.ProjectType", + "RequiredPermissionName": "App.Project.Type", "IsDisabled": false }, { "ParentCode": "App.Project", - "Code": "App.Project.ProjectStatus", - "DisplayName": "App.Project.ProjectStatus", + "Code": "App.Project.Status", + "DisplayName": "App.Project.Status", "Order": 2, - "Url": "/admin/list/App.Project.ProjectStatus", + "Url": "/admin/list/App.Project.Status", "Icon": "FcTimeline", - "RequiredPermissionName": "App.Project.ProjectStatus", + "RequiredPermissionName": "App.Project.Status", + "IsDisabled": false + }, + { + "ParentCode": "App.Project", + "Code": "App.Project.Category", + "DisplayName": "App.Project.Category", + "Order": 3, + "Url": "/admin/list/App.Project.Category", + "Icon": "FcTimeline", + "RequiredPermissionName": "App.Project.Category", + "IsDisabled": false + }, + { + "ParentCode": "App.Project", + "Code": "App.Project.Risk", + "DisplayName": "App.Project.Risk", + "Order": 4, + "Url": "/admin/list/App.Project.Risk", + "Icon": "FcHighPriority", + "RequiredPermissionName": "App.Project.Risk", "IsDisabled": false }, { "ParentCode": "App.Project", "Code": "App.Project.Projects", "DisplayName": "App.Project.Projects", - "Order": 3, + "Order": 5, "Url": "/admin/list/App.Project.Projects", "Icon": "FcTodoList", "RequiredPermissionName": "App.Project.Projects", @@ -2606,39 +2626,39 @@ }, { "ParentCode": "App.Project", - "Code": "App.Project.Phases", - "DisplayName": "App.Project.Phases", - "Order": 4, - "Url": "/admin/projects/phases", + "Code": "App.Project.Phase", + "DisplayName": "App.Project.Phase", + "Order": 6, + "Url": "/admin/list/App.Project.Phase", "Icon": "FcParallelTasks", - "RequiredPermissionName": "App.Project.Phases", + "RequiredPermissionName": "App.Project.Phase", "IsDisabled": false }, { "ParentCode": "App.Project", - "Code": "App.Project.Tasks", - "DisplayName": "App.Project.Tasks", - "Order": 5, + "Code": "App.Project.Task", + "DisplayName": "App.Project.Task", + "Order": 7, "Url": "/admin/projects/tasks", "Icon": "FcBullish", - "RequiredPermissionName": "App.Project.Tasks", + "RequiredPermissionName": "App.Project.Task", "IsDisabled": false }, { "ParentCode": "App.Project", - "Code": "App.Project.Activities", - "DisplayName": "App.Project.Activities", - "Order": 6, + "Code": "App.Project.Activity", + "DisplayName": "App.Project.Activity", + "Order": 8, "Url": "/admin/projects/activities", "Icon": "FcPlanner", - "RequiredPermissionName": "App.Project.Activities", + "RequiredPermissionName": "App.Project.Activity", "IsDisabled": false }, { "ParentCode": "App.Project", "Code": "App.Project.Workload", "DisplayName": "App.Project.Workload", - "Order": 7, + "Order": 9, "Url": "/admin/projects/workload", "Icon": "FcFlowChart", "RequiredPermissionName": "App.Project.Workload", @@ -2648,7 +2668,7 @@ "ParentCode": "App.Project", "Code": "App.Project.CostTracking", "DisplayName": "App.Project.CostTracking", - "Order": 8, + "Order": 10, "Url": "/admin/projects/cost-tracking", "Icon": "FcMoneyTransfer", "RequiredPermissionName": "App.Project.CostTracking", @@ -2658,7 +2678,7 @@ "ParentCode": "App.Project", "Code": "App.Project.DailyUpdates", "DisplayName": "App.Project.DailyUpdates", - "Order": 9, + "Order": 11, "Url": "/admin/projects/daily-updates", "Icon": "FcConferenceCall", "RequiredPermissionName": "App.Project.DailyUpdates", diff --git a/api/src/Erp.Platform.DbMigrator/Seeds/PermissionsData.json b/api/src/Erp.Platform.DbMigrator/Seeds/PermissionsData.json index bdd70231..b6f7dca4 100644 --- a/api/src/Erp.Platform.DbMigrator/Seeds/PermissionsData.json +++ b/api/src/Erp.Platform.DbMigrator/Seeds/PermissionsData.json @@ -8016,17 +8016,17 @@ }, { "GroupName": "App.Project", - "Name": "App.Project.ProjectType", + "Name": "App.Project.Type", "ParentName": null, - "DisplayName": "App.Project.ProjectType", + "DisplayName": "App.Project.Type", "IsEnabled": true, "MultiTenancySide": 3, "MenuGroup": "Erp" }, { "GroupName": "App.Project", - "Name": "App.Project.ProjectType.Create", - "ParentName": "App.Project.ProjectType", + "Name": "App.Project.Type.Create", + "ParentName": "App.Project.Type", "DisplayName": "Create", "IsEnabled": true, "MultiTenancySide": 3, @@ -8034,8 +8034,8 @@ }, { "GroupName": "App.Project", - "Name": "App.Project.ProjectType.Update", - "ParentName": "App.Project.ProjectType", + "Name": "App.Project.Type.Update", + "ParentName": "App.Project.Type", "DisplayName": "Update", "IsEnabled": true, "MultiTenancySide": 3, @@ -8043,8 +8043,8 @@ }, { "GroupName": "App.Project", - "Name": "App.Project.ProjectType.Delete", - "ParentName": "App.Project.ProjectType", + "Name": "App.Project.Type.Delete", + "ParentName": "App.Project.Type", "DisplayName": "Delete", "IsEnabled": true, "MultiTenancySide": 3, @@ -8052,8 +8052,8 @@ }, { "GroupName": "App.Project", - "Name": "App.Project.ProjectType.Export", - "ParentName": "App.Project.ProjectType", + "Name": "App.Project.Type.Export", + "ParentName": "App.Project.Type", "DisplayName": "Export", "IsEnabled": true, "MultiTenancySide": 3, @@ -8061,8 +8061,8 @@ }, { "GroupName": "App.Project", - "Name": "App.Project.ProjectType.Import", - "ParentName": "App.Project.ProjectType", + "Name": "App.Project.Type.Import", + "ParentName": "App.Project.Type", "DisplayName": "Import", "IsEnabled": true, "MultiTenancySide": 3, @@ -8070,8 +8070,8 @@ }, { "GroupName": "App.Project", - "Name": "App.Project.ProjectType.Note", - "ParentName": "App.Project.ProjectType", + "Name": "App.Project.Type.Note", + "ParentName": "App.Project.Type", "DisplayName": "Note", "IsEnabled": true, "MultiTenancySide": 3, @@ -8079,17 +8079,17 @@ }, { "GroupName": "App.Project", - "Name": "App.Project.ProjectStatus", + "Name": "App.Project.Status", "ParentName": null, - "DisplayName": "App.Project.ProjectStatus", + "DisplayName": "App.Project.Status", "IsEnabled": true, "MultiTenancySide": 3, "MenuGroup": "Erp" }, { "GroupName": "App.Project", - "Name": "App.Project.ProjectStatus.Create", - "ParentName": "App.Project.ProjectStatus", + "Name": "App.Project.Status.Create", + "ParentName": "App.Project.Status", "DisplayName": "Create", "IsEnabled": true, "MultiTenancySide": 3, @@ -8097,8 +8097,8 @@ }, { "GroupName": "App.Project", - "Name": "App.Project.ProjectStatus.Update", - "ParentName": "App.Project.ProjectStatus", + "Name": "App.Project.Status.Update", + "ParentName": "App.Project.Status", "DisplayName": "Update", "IsEnabled": true, "MultiTenancySide": 3, @@ -8106,8 +8106,8 @@ }, { "GroupName": "App.Project", - "Name": "App.Project.ProjectStatus.Delete", - "ParentName": "App.Project.ProjectStatus", + "Name": "App.Project.Status.Delete", + "ParentName": "App.Project.Status", "DisplayName": "Delete", "IsEnabled": true, "MultiTenancySide": 3, @@ -8115,8 +8115,8 @@ }, { "GroupName": "App.Project", - "Name": "App.Project.ProjectStatus.Export", - "ParentName": "App.Project.ProjectStatus", + "Name": "App.Project.Status.Export", + "ParentName": "App.Project.Status", "DisplayName": "Export", "IsEnabled": true, "MultiTenancySide": 3, @@ -8124,8 +8124,8 @@ }, { "GroupName": "App.Project", - "Name": "App.Project.ProjectStatus.Import", - "ParentName": "App.Project.ProjectStatus", + "Name": "App.Project.Status.Import", + "ParentName": "App.Project.Status", "DisplayName": "Import", "IsEnabled": true, "MultiTenancySide": 3, @@ -8133,13 +8133,142 @@ }, { "GroupName": "App.Project", - "Name": "App.Project.ProjectStatus.Note", - "ParentName": "App.Project.ProjectStatus", + "Name": "App.Project.Status.Note", + "ParentName": "App.Project.Status", "DisplayName": "Note", "IsEnabled": true, "MultiTenancySide": 3, "MenuGroup": "Erp" }, + + { + "GroupName": "App.Project", + "Name": "App.Project.Category", + "ParentName": null, + "DisplayName": "App.Project.Category", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Project", + "Name": "App.Project.Category.Create", + "ParentName": "App.Project.Category", + "DisplayName": "Create", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Project", + "Name": "App.Project.Category.Update", + "ParentName": "App.Project.Category", + "DisplayName": "Update", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Project", + "Name": "App.Project.Category.Delete", + "ParentName": "App.Project.Category", + "DisplayName": "Delete", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Project", + "Name": "App.Project.Category.Export", + "ParentName": "App.Project.Category", + "DisplayName": "Export", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Project", + "Name": "App.Project.Category.Import", + "ParentName": "App.Project.Category", + "DisplayName": "Import", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Project", + "Name": "App.Project.Category.Note", + "ParentName": "App.Project.Category", + "DisplayName": "Note", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + + { + "GroupName": "App.Project", + "Name": "App.Project.Risk", + "ParentName": null, + "DisplayName": "App.Project.Risk", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Project", + "Name": "App.Project.Risk.Create", + "ParentName": "App.Project.Risk", + "DisplayName": "Create", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Project", + "Name": "App.Project.Risk.Update", + "ParentName": "App.Project.Risk", + "DisplayName": "Update", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Project", + "Name": "App.Project.Risk.Delete", + "ParentName": "App.Project.Risk", + "DisplayName": "Delete", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Project", + "Name": "App.Project.Risk.Export", + "ParentName": "App.Project.Risk", + "DisplayName": "Export", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Project", + "Name": "App.Project.Risk.Import", + "ParentName": "App.Project.Risk", + "DisplayName": "Import", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Project", + "Name": "App.Project.Risk.Note", + "ParentName": "App.Project.Risk", + "DisplayName": "Note", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { "GroupName": "App.Project", "Name": "App.Project.Projects", @@ -8205,17 +8334,17 @@ }, { "GroupName": "App.Project", - "Name": "App.Project.Tasks", + "Name": "App.Project.Phase", "ParentName": null, - "DisplayName": "App.Project.Tasks", + "DisplayName": "App.Project.Phase", "IsEnabled": true, "MultiTenancySide": 3, "MenuGroup": "Erp" }, { "GroupName": "App.Project", - "Name": "App.Project.Tasks.Create", - "ParentName": "App.Project.Tasks", + "Name": "App.Project.Phase.Create", + "ParentName": "App.Project.Phase", "DisplayName": "Create", "IsEnabled": true, "MultiTenancySide": 3, @@ -8223,8 +8352,8 @@ }, { "GroupName": "App.Project", - "Name": "App.Project.Tasks.Update", - "ParentName": "App.Project.Tasks", + "Name": "App.Project.Phase.Update", + "ParentName": "App.Project.Phase", "DisplayName": "Update", "IsEnabled": true, "MultiTenancySide": 3, @@ -8232,8 +8361,8 @@ }, { "GroupName": "App.Project", - "Name": "App.Project.Tasks.Delete", - "ParentName": "App.Project.Tasks", + "Name": "App.Project.Phase.Delete", + "ParentName": "App.Project.Phase", "DisplayName": "Delete", "IsEnabled": true, "MultiTenancySide": 3, @@ -8241,8 +8370,8 @@ }, { "GroupName": "App.Project", - "Name": "App.Project.Tasks.Export", - "ParentName": "App.Project.Tasks", + "Name": "App.Project.Phase.Export", + "ParentName": "App.Project.Phase", "DisplayName": "Export", "IsEnabled": true, "MultiTenancySide": 3, @@ -8250,8 +8379,8 @@ }, { "GroupName": "App.Project", - "Name": "App.Project.Tasks.Import", - "ParentName": "App.Project.Tasks", + "Name": "App.Project.Phase.Import", + "ParentName": "App.Project.Phase", "DisplayName": "Import", "IsEnabled": true, "MultiTenancySide": 3, @@ -8259,8 +8388,8 @@ }, { "GroupName": "App.Project", - "Name": "App.Project.Tasks.Note", - "ParentName": "App.Project.Tasks", + "Name": "App.Project.Phase.Note", + "ParentName": "App.Project.Phase", "DisplayName": "Note", "IsEnabled": true, "MultiTenancySide": 3, @@ -8268,8 +8397,71 @@ }, { "GroupName": "App.Project", - "Name": "App.Project.Tasks.Widget", - "ParentName": "App.Project.Tasks", + "Name": "App.Project.Task", + "ParentName": null, + "DisplayName": "App.Project.Task", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Project", + "Name": "App.Project.Task.Create", + "ParentName": "App.Project.Task", + "DisplayName": "Create", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Project", + "Name": "App.Project.Task.Update", + "ParentName": "App.Project.Task", + "DisplayName": "Update", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Project", + "Name": "App.Project.Task.Delete", + "ParentName": "App.Project.Task", + "DisplayName": "Delete", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Project", + "Name": "App.Project.Task.Export", + "ParentName": "App.Project.Task", + "DisplayName": "Export", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Project", + "Name": "App.Project.Task.Import", + "ParentName": "App.Project.Task", + "DisplayName": "Import", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Project", + "Name": "App.Project.Task.Note", + "ParentName": "App.Project.Task", + "DisplayName": "Note", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Project", + "Name": "App.Project.Task.Widget", + "ParentName": "App.Project.Task", "DisplayName": "Widget", "IsEnabled": true, "MultiTenancySide": 3, @@ -8277,17 +8469,17 @@ }, { "GroupName": "App.Project", - "Name": "App.Project.Phases", + "Name": "App.Project.Activity", "ParentName": null, - "DisplayName": "App.Project.Phases", + "DisplayName": "App.Project.Activity", "IsEnabled": true, "MultiTenancySide": 3, "MenuGroup": "Erp" }, { "GroupName": "App.Project", - "Name": "App.Project.Phases.Create", - "ParentName": "App.Project.Phases", + "Name": "App.Project.Activity.Create", + "ParentName": "App.Project.Activity", "DisplayName": "Create", "IsEnabled": true, "MultiTenancySide": 3, @@ -8295,8 +8487,8 @@ }, { "GroupName": "App.Project", - "Name": "App.Project.Phases.Update", - "ParentName": "App.Project.Phases", + "Name": "App.Project.Activity.Update", + "ParentName": "App.Project.Activity", "DisplayName": "Update", "IsEnabled": true, "MultiTenancySide": 3, @@ -8304,8 +8496,8 @@ }, { "GroupName": "App.Project", - "Name": "App.Project.Phases.Delete", - "ParentName": "App.Project.Phases", + "Name": "App.Project.Activity.Delete", + "ParentName": "App.Project.Activity", "DisplayName": "Delete", "IsEnabled": true, "MultiTenancySide": 3, @@ -8313,8 +8505,8 @@ }, { "GroupName": "App.Project", - "Name": "App.Project.Phases.Export", - "ParentName": "App.Project.Phases", + "Name": "App.Project.Activity.Export", + "ParentName": "App.Project.Activity", "DisplayName": "Export", "IsEnabled": true, "MultiTenancySide": 3, @@ -8322,8 +8514,8 @@ }, { "GroupName": "App.Project", - "Name": "App.Project.Phases.Import", - "ParentName": "App.Project.Phases", + "Name": "App.Project.Activity.Import", + "ParentName": "App.Project.Activity", "DisplayName": "Import", "IsEnabled": true, "MultiTenancySide": 3, @@ -8331,71 +8523,8 @@ }, { "GroupName": "App.Project", - "Name": "App.Project.Phases.Note", - "ParentName": "App.Project.Phases", - "DisplayName": "Note", - "IsEnabled": true, - "MultiTenancySide": 3, - "MenuGroup": "Erp" - }, - { - "GroupName": "App.Project", - "Name": "App.Project.Activities", - "ParentName": null, - "DisplayName": "App.Project.Activities", - "IsEnabled": true, - "MultiTenancySide": 3, - "MenuGroup": "Erp" - }, - { - "GroupName": "App.Project", - "Name": "App.Project.Activities.Create", - "ParentName": "App.Project.Activities", - "DisplayName": "Create", - "IsEnabled": true, - "MultiTenancySide": 3, - "MenuGroup": "Erp" - }, - { - "GroupName": "App.Project", - "Name": "App.Project.Activities.Update", - "ParentName": "App.Project.Activities", - "DisplayName": "Update", - "IsEnabled": true, - "MultiTenancySide": 3, - "MenuGroup": "Erp" - }, - { - "GroupName": "App.Project", - "Name": "App.Project.Activities.Delete", - "ParentName": "App.Project.Activities", - "DisplayName": "Delete", - "IsEnabled": true, - "MultiTenancySide": 3, - "MenuGroup": "Erp" - }, - { - "GroupName": "App.Project", - "Name": "App.Project.Activities.Export", - "ParentName": "App.Project.Activities", - "DisplayName": "Export", - "IsEnabled": true, - "MultiTenancySide": 3, - "MenuGroup": "Erp" - }, - { - "GroupName": "App.Project", - "Name": "App.Project.Activities.Import", - "ParentName": "App.Project.Activities", - "DisplayName": "Import", - "IsEnabled": true, - "MultiTenancySide": 3, - "MenuGroup": "Erp" - }, - { - "GroupName": "App.Project", - "Name": "App.Project.Activities.Note", - "ParentName": "App.Project.Activities", + "Name": "App.Project.Activity.Note", + "ParentName": "App.Project.Activity", "DisplayName": "Note", "IsEnabled": true, "MultiTenancySide": 3, @@ -12551,4 +12680,4 @@ "MenuGroup": "Erp" } ] -} \ No newline at end of file +} diff --git a/api/src/Erp.Platform.Domain.Shared/Enums/TableNameEnum.cs b/api/src/Erp.Platform.Domain.Shared/Enums/TableNameEnum.cs index a8c23ad9..bdca8e2d 100644 --- a/api/src/Erp.Platform.Domain.Shared/Enums/TableNameEnum.cs +++ b/api/src/Erp.Platform.Domain.Shared/Enums/TableNameEnum.cs @@ -190,5 +190,8 @@ public enum TableNameEnum BomComponent, Projects, ProjectType, - ProjectStatus + ProjectStatus, + ProjectRisk, + ProjectPhase, + ProjectCategory } diff --git a/api/src/Erp.Platform.Domain.Shared/TableNameResolver.cs b/api/src/Erp.Platform.Domain.Shared/TableNameResolver.cs index 13ffb7ac..bc8ee6ff 100644 --- a/api/src/Erp.Platform.Domain.Shared/TableNameResolver.cs +++ b/api/src/Erp.Platform.Domain.Shared/TableNameResolver.cs @@ -229,6 +229,9 @@ public static class TableNameResolver // 🔹 R&D { nameof(TableNameEnum.ProjectType), (TablePrefix.TenantByName, MenuPrefix.Project) }, { nameof(TableNameEnum.ProjectStatus), (TablePrefix.TenantByName, MenuPrefix.Project) }, + { nameof(TableNameEnum.ProjectRisk), (TablePrefix.TenantByName, MenuPrefix.Project) }, + { nameof(TableNameEnum.ProjectCategory), (TablePrefix.TenantByName, MenuPrefix.Project) }, + { nameof(TableNameEnum.ProjectPhase), (TablePrefix.TenantByName, MenuPrefix.Project) }, { nameof(TableNameEnum.Projects), (TablePrefix.TenantByName, MenuPrefix.Project) }, }; diff --git a/api/src/Erp.Platform.Domain/Data/SeedConsts.cs b/api/src/Erp.Platform.Domain/Data/SeedConsts.cs index 8ac56fda..cb49b0d9 100644 --- a/api/src/Erp.Platform.Domain/Data/SeedConsts.cs +++ b/api/src/Erp.Platform.Domain/Data/SeedConsts.cs @@ -562,9 +562,12 @@ public static class SeedConsts public static class Project { public const string Default = Prefix.App + ".Project"; - public const string ProjectType = Default + ".ProjectType"; - public const string ProjectStatus = Default + ".ProjectStatus"; + public const string Type = Default + ".Type"; + public const string Status = Default + ".Status"; public const string Projects = Default + ".Projects"; + public const string Risk = Default + ".Risk"; + public const string Category = Default + ".Category"; + public const string Phase = Default + ".Phase"; } public static class Mrp diff --git a/api/src/Erp.Platform.Domain/Entities/Tenant/Project/ProjectCategory.cs b/api/src/Erp.Platform.Domain/Entities/Tenant/Project/ProjectCategory.cs new file mode 100644 index 00000000..3948537d --- /dev/null +++ b/api/src/Erp.Platform.Domain/Entities/Tenant/Project/ProjectCategory.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using Volo.Abp.Domain.Entities.Auditing; +using Volo.Abp.MultiTenancy; + +namespace Erp.Platform.Entities; + +public class ProjectCategory : FullAuditedEntity, IMultiTenant +{ + public Guid? TenantId { get; set; } + + public string Name { get; set; } + public string Description { get; set; } + public bool IsActive { get; set; } + + public ICollection ProjectPhases { get; set; } +} + diff --git a/api/src/Erp.Platform.Domain/Entities/Tenant/Project/ProjectPhase.cs b/api/src/Erp.Platform.Domain/Entities/Tenant/Project/ProjectPhase.cs new file mode 100644 index 00000000..66bc87d2 --- /dev/null +++ b/api/src/Erp.Platform.Domain/Entities/Tenant/Project/ProjectPhase.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using Volo.Abp.Domain.Entities.Auditing; +using Volo.Abp.MultiTenancy; + +namespace Erp.Platform.Entities; + +public class ProjectPhase : FullAuditedEntity, IMultiTenant +{ + public Guid? TenantId { get; set; } + + public Guid? ProjectId { get; set; } + public Project? Project { get; set; } + + public Guid? ProjectCategoryId { get; set; } + public ProjectCategory? ProjectCategory { get; set; } + + public string Code { get; set; } + public string Name { get; set; } + public string Description { get; set; } + + public int Sequence { get; set; } + public DateTime StartDate { get; set; } + public DateTime EndDate { get; set; } + + public DateTime? ActualStartDate { get; set; } + public DateTime? ActualEndDate { get; set; } + + public decimal Budget { get; set; } + public decimal ActualCost { get; set; } + public int Progress { get; set; } + public string Risks { get; set; } + + public Guid? StatusId { get; set; } + public ProjectStatus? Status { get; set; } + + public bool IsActive { get; set; } + + public ICollection Projects { get; set; } +} diff --git a/api/src/Erp.Platform.Domain/Entities/Tenant/Project/ProjectRisk.cs b/api/src/Erp.Platform.Domain/Entities/Tenant/Project/ProjectRisk.cs new file mode 100644 index 00000000..243a7992 --- /dev/null +++ b/api/src/Erp.Platform.Domain/Entities/Tenant/Project/ProjectRisk.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using Volo.Abp.Domain.Entities.Auditing; +using Volo.Abp.MultiTenancy; + +namespace Erp.Platform.Entities; + +public class ProjectRisk : FullAuditedEntity, IMultiTenant +{ + public Guid? TenantId { get; set; } + + public string Name { get; set; } + public string Description { get; set; } + public bool IsActive { get; set; } + + public ICollection ProjectPhases { get; set; } +} + diff --git a/api/src/Erp.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs b/api/src/Erp.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs index 68622ef1..b193991f 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs @@ -271,6 +271,9 @@ public class PlatformDbContext : public DbSet ProjectTypes { get; set; } public DbSet ProjectStatuses { get; set; } public DbSet Projects { get; set; } + public DbSet ProjectRisks { get; set; } + public DbSet ProjectCategories { get; set; } + public DbSet ProjectPhases { get; set; } #endregion public PlatformDbContext(DbContextOptions options) @@ -3141,6 +3144,11 @@ public class PlatformDbContext : b.Property(x => x.BaseQuantity).HasPrecision(18, 2).HasDefaultValue(1); b.Property(x => x.IsActive).HasDefaultValue(true); + b.HasOne(x => x.BomType) + .WithMany(x => x.Boms) + .HasForeignKey(x => x.BomTypeId) + .OnDelete(DeleteBehavior.Restrict); + b.HasOne(x => x.Material) .WithMany(x => x.Boms) .HasForeignKey(x => x.MaterialId) @@ -3256,5 +3264,48 @@ public class PlatformDbContext : .HasForeignKey(x => x.StatusId) .OnDelete(DeleteBehavior.Restrict); }); + + builder.Entity(b => + { + b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.ProjectRisk)), Prefix.DbSchema); + b.ConfigureByConvention(); + + b.Property(x => x.Name).IsRequired().HasMaxLength(50); + b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.IsActive).HasDefaultValue(true); + }); + + builder.Entity(b => + { + b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.ProjectCategory)), Prefix.DbSchema); + b.ConfigureByConvention(); + + b.Property(x => x.Name).IsRequired().HasMaxLength(50); + b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.IsActive).HasDefaultValue(true); + }); + + builder.Entity(b => + { + b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.ProjectPhase)), Prefix.DbSchema); + b.ConfigureByConvention(); + + b.Property(x => x.ProjectId).IsRequired(); + b.Property(x => x.ProjectCategoryId).IsRequired(); + b.Property(x => x.Code).IsRequired().HasMaxLength(100); + b.Property(x => x.Name).IsRequired().HasMaxLength(200); + b.Property(x => x.Description).HasMaxLength(500); + + b.Property(x => x.Sequence).IsRequired().HasDefaultValue(1); + b.Property(x => x.StartDate).IsRequired(); + b.Property(x => x.EndDate).IsRequired(); + b.Property(x => x.Budget).HasPrecision(18, 2).HasDefaultValue(0); + b.Property(x => x.ActualCost).HasPrecision(18, 2).HasDefaultValue(0); + b.Property(x => x.Progress).HasDefaultValue(0); + b.Property(x => x.Risks).HasMaxLength(500); + b.Property(x => x.StatusId).IsRequired(); + + b.Property(x => x.IsActive).HasDefaultValue(true); + }); } } \ No newline at end of file diff --git a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251127061452_Initial.Designer.cs b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251127083732_Initial.Designer.cs similarity index 98% rename from api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251127061452_Initial.Designer.cs rename to api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251127083732_Initial.Designer.cs index 4398fb08..0452f0fb 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251127061452_Initial.Designer.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251127083732_Initial.Designer.cs @@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore; namespace Erp.Platform.Migrations { [DbContext(typeof(PlatformDbContext))] - [Migration("20251127061452_Initial")] + [Migration("20251127083732_Initial")] partial class Initial { /// @@ -9845,6 +9845,9 @@ namespace Erp.Platform.Migrations .HasColumnType("int") .HasDefaultValue(0); + b.Property("ProjectPhaseId") + .HasColumnType("uniqueidentifier"); + b.Property("ProjectTypeId") .HasColumnType("uniqueidentifier"); @@ -9864,6 +9867,8 @@ namespace Erp.Platform.Migrations b.HasIndex("ManagerId"); + b.HasIndex("ProjectPhaseId"); + b.HasIndex("ProjectTypeId"); b.HasIndex("StatusId"); @@ -9871,6 +9876,243 @@ namespace Erp.Platform.Migrations b.ToTable("Prj_T_Projects", (string)null); }); + modelBuilder.Entity("Erp.Platform.Entities.ProjectCategory", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("IsActive") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(true); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("Prj_T_ProjectCategory", (string)null); + }); + + modelBuilder.Entity("Erp.Platform.Entities.ProjectPhase", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ActualCost") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); + + b.Property("ActualEndDate") + .HasColumnType("datetime2"); + + b.Property("ActualStartDate") + .HasColumnType("datetime2"); + + b.Property("Budget") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); + + b.Property("Code") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("EndDate") + .HasColumnType("datetime2"); + + b.Property("IsActive") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(true); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Progress") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("ProjectCategoryId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProjectId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProjectRiskId") + .HasColumnType("uniqueidentifier"); + + b.Property("Risks") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("Sequence") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(1); + + b.Property("StartDate") + .HasColumnType("datetime2"); + + b.Property("StatusId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("ProjectCategoryId"); + + b.HasIndex("ProjectId"); + + b.HasIndex("ProjectRiskId"); + + b.HasIndex("StatusId"); + + b.ToTable("Prj_T_ProjectPhase", (string)null); + }); + + modelBuilder.Entity("Erp.Platform.Entities.ProjectRisk", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("IsActive") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(true); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("Prj_T_ProjectRisk", (string)null); + }); + modelBuilder.Entity("Erp.Platform.Entities.ProjectStatus", b => { b.Property("Id") @@ -16234,7 +16476,7 @@ namespace Erp.Platform.Migrations b.HasOne("Erp.Platform.Entities.BomType", "BomType") .WithMany("Boms") .HasForeignKey("BomTypeId") - .OnDelete(DeleteBehavior.Cascade) + .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("Erp.Platform.Entities.Material", "Material") @@ -17118,6 +17360,10 @@ namespace Erp.Platform.Migrations .WithMany() .HasForeignKey("ManagerId"); + b.HasOne("Erp.Platform.Entities.ProjectPhase", null) + .WithMany("Projects") + .HasForeignKey("ProjectPhaseId"); + b.HasOne("Erp.Platform.Entities.ProjectType", "ProjectType") .WithMany("Projects") .HasForeignKey("ProjectTypeId") @@ -17139,6 +17385,37 @@ namespace Erp.Platform.Migrations b.Navigation("Status"); }); + modelBuilder.Entity("Erp.Platform.Entities.ProjectPhase", b => + { + b.HasOne("Erp.Platform.Entities.ProjectCategory", "ProjectCategory") + .WithMany("ProjectPhases") + .HasForeignKey("ProjectCategoryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Erp.Platform.Entities.Project", "Project") + .WithMany() + .HasForeignKey("ProjectId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Erp.Platform.Entities.ProjectRisk", null) + .WithMany("ProjectPhases") + .HasForeignKey("ProjectRiskId"); + + b.HasOne("Erp.Platform.Entities.ProjectStatus", "Status") + .WithMany() + .HasForeignKey("StatusId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Project"); + + b.Navigation("ProjectCategory"); + + b.Navigation("Status"); + }); + modelBuilder.Entity("Erp.Platform.Entities.PutawayCondition", b => { b.HasOne("Erp.Platform.Entities.Putaway", "Rule") @@ -18016,6 +18293,21 @@ namespace Erp.Platform.Migrations b.Navigation("Items"); }); + modelBuilder.Entity("Erp.Platform.Entities.ProjectCategory", b => + { + b.Navigation("ProjectPhases"); + }); + + modelBuilder.Entity("Erp.Platform.Entities.ProjectPhase", b => + { + b.Navigation("Projects"); + }); + + modelBuilder.Entity("Erp.Platform.Entities.ProjectRisk", b => + { + b.Navigation("ProjectPhases"); + }); + modelBuilder.Entity("Erp.Platform.Entities.ProjectStatus", b => { b.Navigation("Projects"); diff --git a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251127061452_Initial.cs b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251127083732_Initial.cs similarity index 98% rename from api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251127061452_Initial.cs rename to api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251127083732_Initial.cs index 32c1f422..41cb501c 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251127061452_Initial.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251127083732_Initial.cs @@ -1823,6 +1823,50 @@ namespace Erp.Platform.Migrations table.PrimaryKey("PK_Plat_H_SettingDefinition", x => x.Id); }); + migrationBuilder.CreateTable( + name: "Prj_T_ProjectCategory", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + Name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + Description = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), + IsActive = table.Column(type: "bit", nullable: false, defaultValue: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Prj_T_ProjectCategory", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Prj_T_ProjectRisk", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + Name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + Description = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), + IsActive = table.Column(type: "bit", nullable: false, defaultValue: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Prj_T_ProjectRisk", x => x.Id); + }); + migrationBuilder.CreateTable( name: "Prj_T_ProjectStatus", columns: table => new @@ -4524,7 +4568,7 @@ namespace Erp.Platform.Migrations column: x => x.BomTypeId, principalTable: "Mrp_T_BomType", principalColumn: "Id", - onDelete: ReferentialAction.Cascade); + onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_Mrp_T_Bom_Scp_T_Material_MaterialId", column: x => x.MaterialId, @@ -5948,64 +5992,6 @@ namespace Erp.Platform.Migrations onDelete: ReferentialAction.Restrict); }); - migrationBuilder.CreateTable( - name: "Prj_T_Projects", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - TenantId = table.Column(type: "uniqueidentifier", nullable: true), - Code = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), - Name = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), - Description = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), - ProjectTypeId = table.Column(type: "uniqueidentifier", nullable: false), - StatusId = table.Column(type: "uniqueidentifier", nullable: false), - Priority = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), - ManagerId = table.Column(type: "uniqueidentifier", nullable: true), - StartDate = table.Column(type: "datetime2", nullable: false), - EndDate = table.Column(type: "datetime2", nullable: false), - ActualStartDate = table.Column(type: "datetime2", nullable: true), - ActualEndDate = table.Column(type: "datetime2", nullable: true), - CustomerId = table.Column(type: "uniqueidentifier", nullable: true), - Budget = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m), - ActualCost = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m), - Currency = table.Column(type: "nvarchar(10)", maxLength: 10, nullable: true), - Progress = table.Column(type: "int", nullable: false, defaultValue: 0), - IsActive = table.Column(type: "bit", nullable: false, defaultValue: true), - CreationTime = table.Column(type: "datetime2", nullable: false), - CreatorId = table.Column(type: "uniqueidentifier", nullable: true), - LastModificationTime = table.Column(type: "datetime2", nullable: true), - LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), - IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), - DeleterId = table.Column(type: "uniqueidentifier", nullable: true), - DeletionTime = table.Column(type: "datetime2", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Prj_T_Projects", x => x.Id); - table.ForeignKey( - name: "FK_Prj_T_Projects_Adm_T_Partner_CustomerId", - column: x => x.CustomerId, - principalTable: "Adm_T_Partner", - principalColumn: "Id"); - table.ForeignKey( - name: "FK_Prj_T_Projects_Hr_T_Employee_ManagerId", - column: x => x.ManagerId, - principalTable: "Hr_T_Employee", - principalColumn: "Id"); - table.ForeignKey( - name: "FK_Prj_T_Projects_Prj_T_ProjectStatus_StatusId", - column: x => x.StatusId, - principalTable: "Prj_T_ProjectStatus", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Prj_T_Projects_Prj_T_ProjectType_ProjectTypeId", - column: x => x.ProjectTypeId, - principalTable: "Prj_T_ProjectType", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - migrationBuilder.CreateTable( name: "Scp_T_Request", columns: table => new @@ -6755,6 +6741,123 @@ namespace Erp.Platform.Migrations onDelete: ReferentialAction.Restrict); }); + migrationBuilder.CreateTable( + name: "Prj_T_ProjectPhase", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + ProjectId = table.Column(type: "uniqueidentifier", nullable: false), + ProjectCategoryId = table.Column(type: "uniqueidentifier", nullable: false), + Code = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), + Name = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), + Description = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), + Sequence = table.Column(type: "int", nullable: false, defaultValue: 1), + StartDate = table.Column(type: "datetime2", nullable: false), + EndDate = table.Column(type: "datetime2", nullable: false), + ActualStartDate = table.Column(type: "datetime2", nullable: true), + ActualEndDate = table.Column(type: "datetime2", nullable: true), + Budget = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m), + ActualCost = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m), + Progress = table.Column(type: "int", nullable: false, defaultValue: 0), + Risks = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), + StatusId = table.Column(type: "uniqueidentifier", nullable: false), + IsActive = table.Column(type: "bit", nullable: false, defaultValue: true), + ProjectRiskId = table.Column(type: "uniqueidentifier", nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Prj_T_ProjectPhase", x => x.Id); + table.ForeignKey( + name: "FK_Prj_T_ProjectPhase_Prj_T_ProjectCategory_ProjectCategoryId", + column: x => x.ProjectCategoryId, + principalTable: "Prj_T_ProjectCategory", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_Prj_T_ProjectPhase_Prj_T_ProjectRisk_ProjectRiskId", + column: x => x.ProjectRiskId, + principalTable: "Prj_T_ProjectRisk", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_Prj_T_ProjectPhase_Prj_T_ProjectStatus_StatusId", + column: x => x.StatusId, + principalTable: "Prj_T_ProjectStatus", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "Prj_T_Projects", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + Code = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), + Name = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), + Description = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), + ProjectTypeId = table.Column(type: "uniqueidentifier", nullable: false), + StatusId = table.Column(type: "uniqueidentifier", nullable: false), + Priority = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + ManagerId = table.Column(type: "uniqueidentifier", nullable: true), + StartDate = table.Column(type: "datetime2", nullable: false), + EndDate = table.Column(type: "datetime2", nullable: false), + ActualStartDate = table.Column(type: "datetime2", nullable: true), + ActualEndDate = table.Column(type: "datetime2", nullable: true), + CustomerId = table.Column(type: "uniqueidentifier", nullable: true), + Budget = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m), + ActualCost = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m), + Currency = table.Column(type: "nvarchar(10)", maxLength: 10, nullable: true), + Progress = table.Column(type: "int", nullable: false, defaultValue: 0), + IsActive = table.Column(type: "bit", nullable: false, defaultValue: true), + ProjectPhaseId = table.Column(type: "uniqueidentifier", nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Prj_T_Projects", x => x.Id); + table.ForeignKey( + name: "FK_Prj_T_Projects_Adm_T_Partner_CustomerId", + column: x => x.CustomerId, + principalTable: "Adm_T_Partner", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_Prj_T_Projects_Hr_T_Employee_ManagerId", + column: x => x.ManagerId, + principalTable: "Hr_T_Employee", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_Prj_T_Projects_Prj_T_ProjectPhase_ProjectPhaseId", + column: x => x.ProjectPhaseId, + principalTable: "Prj_T_ProjectPhase", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_Prj_T_Projects_Prj_T_ProjectStatus_StatusId", + column: x => x.StatusId, + principalTable: "Prj_T_ProjectStatus", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Prj_T_Projects_Prj_T_ProjectType_ProjectTypeId", + column: x => x.ProjectTypeId, + principalTable: "Prj_T_ProjectType", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + migrationBuilder.CreateIndex( name: "IX_AbpAuditLogActions_AuditLogId", table: "AbpAuditLogActions", @@ -7664,6 +7767,26 @@ namespace Erp.Platform.Migrations table: "Plat_H_Notification", column: "NotificationRuleId"); + migrationBuilder.CreateIndex( + name: "IX_Prj_T_ProjectPhase_ProjectCategoryId", + table: "Prj_T_ProjectPhase", + column: "ProjectCategoryId"); + + migrationBuilder.CreateIndex( + name: "IX_Prj_T_ProjectPhase_ProjectId", + table: "Prj_T_ProjectPhase", + column: "ProjectId"); + + migrationBuilder.CreateIndex( + name: "IX_Prj_T_ProjectPhase_ProjectRiskId", + table: "Prj_T_ProjectPhase", + column: "ProjectRiskId"); + + migrationBuilder.CreateIndex( + name: "IX_Prj_T_ProjectPhase_StatusId", + table: "Prj_T_ProjectPhase", + column: "StatusId"); + migrationBuilder.CreateIndex( name: "IX_Prj_T_Projects_CustomerId", table: "Prj_T_Projects", @@ -7674,6 +7797,11 @@ namespace Erp.Platform.Migrations table: "Prj_T_Projects", column: "ManagerId"); + migrationBuilder.CreateIndex( + name: "IX_Prj_T_Projects_ProjectPhaseId", + table: "Prj_T_Projects", + column: "ProjectPhaseId"); + migrationBuilder.CreateIndex( name: "IX_Prj_T_Projects_ProjectTypeId", table: "Prj_T_Projects", @@ -8008,6 +8136,14 @@ namespace Erp.Platform.Migrations principalTable: "Hr_T_Employee", principalColumn: "Id", onDelete: ReferentialAction.Restrict); + + migrationBuilder.AddForeignKey( + name: "FK_Prj_T_ProjectPhase_Prj_T_Projects_ProjectId", + table: "Prj_T_ProjectPhase", + column: "ProjectId", + principalTable: "Prj_T_Projects", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); } /// @@ -8017,6 +8153,10 @@ namespace Erp.Platform.Migrations name: "FK_Hr_T_Employee_Acc_T_Bank_BankId", table: "Hr_T_Employee"); + migrationBuilder.DropForeignKey( + name: "FK_Prj_T_Projects_Adm_T_Partner_CustomerId", + table: "Prj_T_Projects"); + migrationBuilder.DropForeignKey( name: "FK_Hr_T_CostCenter_Hr_T_Employee_ResponsibleEmployeeId", table: "Hr_T_CostCenter"); @@ -8025,10 +8165,34 @@ namespace Erp.Platform.Migrations name: "FK_Hr_T_Department_Hr_T_Employee_ManagerId", table: "Hr_T_Department"); + migrationBuilder.DropForeignKey( + name: "FK_Prj_T_Projects_Hr_T_Employee_ManagerId", + table: "Prj_T_Projects"); + migrationBuilder.DropForeignKey( name: "FK_Hr_T_CostCenter_Hr_T_Department_DepartmentId", table: "Hr_T_CostCenter"); + migrationBuilder.DropForeignKey( + name: "FK_Prj_T_ProjectPhase_Prj_T_ProjectCategory_ProjectCategoryId", + table: "Prj_T_ProjectPhase"); + + migrationBuilder.DropForeignKey( + name: "FK_Prj_T_ProjectPhase_Prj_T_ProjectRisk_ProjectRiskId", + table: "Prj_T_ProjectPhase"); + + migrationBuilder.DropForeignKey( + name: "FK_Prj_T_ProjectPhase_Prj_T_ProjectStatus_StatusId", + table: "Prj_T_ProjectPhase"); + + migrationBuilder.DropForeignKey( + name: "FK_Prj_T_Projects_Prj_T_ProjectStatus_StatusId", + table: "Prj_T_Projects"); + + migrationBuilder.DropForeignKey( + name: "FK_Prj_T_ProjectPhase_Prj_T_Projects_ProjectId", + table: "Prj_T_ProjectPhase"); + migrationBuilder.DropTable( name: "AbpAuditLogActions"); @@ -8332,9 +8496,6 @@ namespace Erp.Platform.Migrations migrationBuilder.DropTable( name: "Plat_H_SettingDefinition"); - migrationBuilder.DropTable( - name: "Prj_T_Projects"); - migrationBuilder.DropTable( name: "Prt_T_Interesting"); @@ -8524,15 +8685,6 @@ namespace Erp.Platform.Migrations migrationBuilder.DropTable( name: "Plat_H_NotificationRule"); - migrationBuilder.DropTable( - name: "Adm_T_Partner"); - - migrationBuilder.DropTable( - name: "Prj_T_ProjectStatus"); - - migrationBuilder.DropTable( - name: "Prj_T_ProjectType"); - migrationBuilder.DropTable( name: "Sas_H_City"); @@ -8614,27 +8766,6 @@ namespace Erp.Platform.Migrations migrationBuilder.DropTable( name: "Plat_H_BackgroundWorker_MailQueueTableFormat"); - migrationBuilder.DropTable( - name: "Crm_T_CustomerSegment"); - - migrationBuilder.DropTable( - name: "Crm_T_CustomerType"); - - migrationBuilder.DropTable( - name: "Sas_T_Sector"); - - migrationBuilder.DropTable( - name: "Scp_T_Material"); - - migrationBuilder.DropTable( - name: "Scp_T_PaymentTerm"); - - migrationBuilder.DropTable( - name: "Scp_T_SupplyCardType"); - - migrationBuilder.DropTable( - name: "Scp_T_SupplyType"); - migrationBuilder.DropTable( name: "Sas_H_Country"); @@ -8668,12 +8799,6 @@ namespace Erp.Platform.Migrations migrationBuilder.DropTable( name: "Mrp_T_OperationCategory"); - migrationBuilder.DropTable( - name: "Scp_T_MaterialGroup"); - - migrationBuilder.DropTable( - name: "Scp_T_MaterialType"); - migrationBuilder.DropTable( name: "Sas_H_CountryGroup"); @@ -8689,6 +8814,36 @@ namespace Erp.Platform.Migrations migrationBuilder.DropTable( name: "Acc_T_Bank"); + migrationBuilder.DropTable( + name: "Adm_T_Partner"); + + migrationBuilder.DropTable( + name: "Crm_T_CustomerSegment"); + + migrationBuilder.DropTable( + name: "Crm_T_CustomerType"); + + migrationBuilder.DropTable( + name: "Sas_T_Sector"); + + migrationBuilder.DropTable( + name: "Scp_T_Material"); + + migrationBuilder.DropTable( + name: "Scp_T_PaymentTerm"); + + migrationBuilder.DropTable( + name: "Scp_T_SupplyCardType"); + + migrationBuilder.DropTable( + name: "Scp_T_SupplyType"); + + migrationBuilder.DropTable( + name: "Scp_T_MaterialGroup"); + + migrationBuilder.DropTable( + name: "Scp_T_MaterialType"); + migrationBuilder.DropTable( name: "Hr_T_Employee"); @@ -8706,6 +8861,24 @@ namespace Erp.Platform.Migrations migrationBuilder.DropTable( name: "Hr_T_CostCenter"); + + migrationBuilder.DropTable( + name: "Prj_T_ProjectCategory"); + + migrationBuilder.DropTable( + name: "Prj_T_ProjectRisk"); + + migrationBuilder.DropTable( + name: "Prj_T_ProjectStatus"); + + migrationBuilder.DropTable( + name: "Prj_T_Projects"); + + migrationBuilder.DropTable( + name: "Prj_T_ProjectPhase"); + + migrationBuilder.DropTable( + name: "Prj_T_ProjectType"); } } } diff --git a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs index 1ef74c42..53ed9014 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs @@ -9842,6 +9842,9 @@ namespace Erp.Platform.Migrations .HasColumnType("int") .HasDefaultValue(0); + b.Property("ProjectPhaseId") + .HasColumnType("uniqueidentifier"); + b.Property("ProjectTypeId") .HasColumnType("uniqueidentifier"); @@ -9861,6 +9864,8 @@ namespace Erp.Platform.Migrations b.HasIndex("ManagerId"); + b.HasIndex("ProjectPhaseId"); + b.HasIndex("ProjectTypeId"); b.HasIndex("StatusId"); @@ -9868,6 +9873,243 @@ namespace Erp.Platform.Migrations b.ToTable("Prj_T_Projects", (string)null); }); + modelBuilder.Entity("Erp.Platform.Entities.ProjectCategory", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("IsActive") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(true); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("Prj_T_ProjectCategory", (string)null); + }); + + modelBuilder.Entity("Erp.Platform.Entities.ProjectPhase", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ActualCost") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); + + b.Property("ActualEndDate") + .HasColumnType("datetime2"); + + b.Property("ActualStartDate") + .HasColumnType("datetime2"); + + b.Property("Budget") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); + + b.Property("Code") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("EndDate") + .HasColumnType("datetime2"); + + b.Property("IsActive") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(true); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Progress") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("ProjectCategoryId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProjectId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProjectRiskId") + .HasColumnType("uniqueidentifier"); + + b.Property("Risks") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("Sequence") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(1); + + b.Property("StartDate") + .HasColumnType("datetime2"); + + b.Property("StatusId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("ProjectCategoryId"); + + b.HasIndex("ProjectId"); + + b.HasIndex("ProjectRiskId"); + + b.HasIndex("StatusId"); + + b.ToTable("Prj_T_ProjectPhase", (string)null); + }); + + modelBuilder.Entity("Erp.Platform.Entities.ProjectRisk", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("IsActive") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(true); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("Prj_T_ProjectRisk", (string)null); + }); + modelBuilder.Entity("Erp.Platform.Entities.ProjectStatus", b => { b.Property("Id") @@ -16231,7 +16473,7 @@ namespace Erp.Platform.Migrations b.HasOne("Erp.Platform.Entities.BomType", "BomType") .WithMany("Boms") .HasForeignKey("BomTypeId") - .OnDelete(DeleteBehavior.Cascade) + .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("Erp.Platform.Entities.Material", "Material") @@ -17115,6 +17357,10 @@ namespace Erp.Platform.Migrations .WithMany() .HasForeignKey("ManagerId"); + b.HasOne("Erp.Platform.Entities.ProjectPhase", null) + .WithMany("Projects") + .HasForeignKey("ProjectPhaseId"); + b.HasOne("Erp.Platform.Entities.ProjectType", "ProjectType") .WithMany("Projects") .HasForeignKey("ProjectTypeId") @@ -17136,6 +17382,37 @@ namespace Erp.Platform.Migrations b.Navigation("Status"); }); + modelBuilder.Entity("Erp.Platform.Entities.ProjectPhase", b => + { + b.HasOne("Erp.Platform.Entities.ProjectCategory", "ProjectCategory") + .WithMany("ProjectPhases") + .HasForeignKey("ProjectCategoryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Erp.Platform.Entities.Project", "Project") + .WithMany() + .HasForeignKey("ProjectId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Erp.Platform.Entities.ProjectRisk", null) + .WithMany("ProjectPhases") + .HasForeignKey("ProjectRiskId"); + + b.HasOne("Erp.Platform.Entities.ProjectStatus", "Status") + .WithMany() + .HasForeignKey("StatusId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Project"); + + b.Navigation("ProjectCategory"); + + b.Navigation("Status"); + }); + modelBuilder.Entity("Erp.Platform.Entities.PutawayCondition", b => { b.HasOne("Erp.Platform.Entities.Putaway", "Rule") @@ -18013,6 +18290,21 @@ namespace Erp.Platform.Migrations b.Navigation("Items"); }); + modelBuilder.Entity("Erp.Platform.Entities.ProjectCategory", b => + { + b.Navigation("ProjectPhases"); + }); + + modelBuilder.Entity("Erp.Platform.Entities.ProjectPhase", b => + { + b.Navigation("Projects"); + }); + + modelBuilder.Entity("Erp.Platform.Entities.ProjectRisk", b => + { + b.Navigation("ProjectPhases"); + }); + modelBuilder.Entity("Erp.Platform.Entities.ProjectStatus", b => { b.Navigation("Projects"); diff --git a/api/src/Erp.Platform.EntityFrameworkCore/Tenants/Seeds/TenantData.json b/api/src/Erp.Platform.EntityFrameworkCore/Tenants/Seeds/TenantData.json index db59fb7b..df20f8e8 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Tenants/Seeds/TenantData.json +++ b/api/src/Erp.Platform.EntityFrameworkCore/Tenants/Seeds/TenantData.json @@ -4785,10 +4785,13 @@ ], "OrganizationUnits": [ { - "displayName": "Satış Ekibi" + "displayName": "Satış Ekipleri" }, { "displayName": "Bakım Ekipleri" + }, + { + "displayName": "Proje Ekipleri" } ], "RequestTypes": [ @@ -5938,5 +5941,182 @@ "progress": 10, "isActive": true } + ], + "ProjectCategories": [ + { + "name": "Planlama", + "description": "Şirket içi projeler için kullanılan tür", + "isActive": true + }, + { + "name": "Yürütme", + "description": "Müşteri projeleri için kullanılan tür", + "isActive": true + }, + { + "name": "İzleme", + "description": "Araştırma ve geliştirme projeleri için kullanılan tür", + "isActive": true + }, + { + "name": "Kapanış", + "description": "Bakım ve iyileştirme projeleri için kullanılan tür", + "isActive": true + }, + { + "name": "Diğer", + "description": "Yeni ürün ve süreç geliştirme projeleri için kullanılan tür", + "isActive": true + } + ], + "ProjectRisks": [ + { + "name": "Platformlar arası tutarlılık sorunları", + "description": "Platformlar arası tutarlılık sorunları", + "isActive": true + }, + { + "name": "Sistem kesintileri", + "description": "Sistem kesintileri", + "isActive": true + }, + { + "name": "Kullanıcı adaptasyon sorunları", + "description": "Kullanıcı adaptasyon sorunları", + "isActive": true + }, + { + "name": "Kritik hataların geç tespit edilmesi", + "description": "Kritik hataların geç tespit edilmesi", + "isActive": true + }, + { + "name": "Tarayıcı uyumluluk sorunları", + "description": "Tarayıcı uyumluluk sorunları", + "isActive": true + }, + { + "name": "Performans optimizasyonu", + "description": "Performans optimizasyonu", + "isActive": true + }, + { + "name": "Performans sorunları", + "description": "Performans sorunları", + "isActive": true + }, + { + "name": "Üçüncü parti entegrasyon gecikmeleri", + "description": "Üçüncü parti entegrasyon gecikmeleri", + "isActive": true + }, + { + "name": "Gereksinim değişiklikleri", + "description": "Gereksinim değişiklikleri", + "isActive": true + } + ], + "ProjectPhases": [ + { + "projectCode": "PRJ-2024-001", + "categoryName": "Planlama", + "statusName": "Planlama", + "code": "PH-001", + "name": "Analiz ve Tasarım", + "description": "Sistem analizi ve tasarım dokümantasyonu hazırlanması", + "startDate": "2024-01-15T00:00:00.000Z", + "endDate": "2024-02-28T00:00:00.000Z", + "actualStartDate": "2024-01-15T00:00:00.000Z", + "actualEndDate": "2024-02-25T00:00:00.000Z", + "budget": 150000, + "actualCost": 145000, + "progress": 100, + "risks": "Gereksinim değişiklikleri", + "sequence": 0, + "isActive": false + }, + { + "projectCode": "PRJ-2024-001", + "categoryName": "Yürütme", + "statusName": "Aktif", + "code": "PH-002", + "name": "Geliştirme - Faz 1", + "description": "Backend altyapısı ve temel modüllerin geliştirilmesi", + "startDate": "2024-03-01T00:00:00.000Z", + "endDate": "2024-05-15T00:00:00.000Z", + "actualStartDate": "2024-03-01T00:00:00.000Z", + "actualEndDate": "2024-05-10T00:00:00.000Z", + "budget": 400000, + "actualCost": 280000, + "progress": 70, + "risks": "Performans sorunları|Üçüncü parti entegrasyon gecikmeleri", + "sequence": 0, + "isActive": false + }, + { + "projectCode": "PRJ-2024-001", + "categoryName": "Yürütme", + "statusName": "Beklemede", + "code": "PH-003", + "name": "Geliştirme - Faz 2", + "description": "Frontend geliştirme ve kullanıcı arayüzleri", + "startDate": "2024-04-15T00:00:00.000Z", + "endDate": "2024-07-30T00:00:00.000Z", + "budget": 350000, + "actualCost": 0, + "progress": 0, + "risks": "Tarayıcı uyumluluk sorunları|Performans optimizasyonu", + "sequence": 0, + "isActive": false + }, + { + "projectCode": "PRJ-2024-002", + "categoryName": "İzleme", + "statusName": "Aktif", + "code": "PH-004", + "name": "Test ve Kalite Güvence", + "description": "Kapsamlı test süreçleri ve kalite kontrolleri", + "startDate": "2024-07-01T00:00:00.000Z", + "endDate": "2024-09-15T00:00:00.000Z", + "budget": 120000, + "actualCost": 0, + "progress": 0, + "risks": "Kritik hataların geç tespit edilmesi", + "sequence": 0, + "isActive": false + }, + { + "projectCode": "PRJ-2024-002", + "categoryName": "Kapanış", + "statusName": "Planlama", + "code": "PH-005", + "name": "Deployment ve Go-Live", + "description": "Üretime alma ve kullanıcı eğitimleri", + "startDate": "2024-09-15T00:00:00.000Z", + "endDate": "2024-10-31T00:00:00.000Z", + "budget": 80000, + "actualCost": 0, + "progress": 0, + "risks": "Sistem kesintileri|Kullanıcı adaptasyon sorunları", + "sequence": 0, + "isActive": false + }, + { + "projectCode": "PRJ-2024-002", + "categoryName": "Diğer", + "statusName": "Planlama", + "code": "PH-006", + "name": "Mobil UI Tasarımı", + "description": "Mobil uygulama kullanıcı arayüzü tasarımı", + "startDate": "2024-03-01T00:00:00.000Z", + "endDate": "2024-04-15T00:00:00.000Z", + "actualStartDate": "2024-03-05T00:00:00.000Z", + "budget": 75000, + "actualCost": 25000, + "progress": 35, + "risks": "Platformlar arası tutarlılık sorunları", + "sequence": 0, + "isActive": false + } ] } diff --git a/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantDataSeeder.cs b/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantDataSeeder.cs index b446c3cd..38fe176b 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantDataSeeder.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantDataSeeder.cs @@ -131,6 +131,9 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency private readonly IRepository _projectTypeRepository; private readonly IRepository _projectStatusRepository; private readonly IRepository _projectRepository; + private readonly IRepository _projectCategoryRepository; + private readonly IRepository _projectRiskRepository; + private readonly IRepository _projectPhaseRepository; public TenantDataSeeder( IClock clock, @@ -244,7 +247,10 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency IRepository bomOperationRepository, IRepository projectTypeRepository, IRepository projectStatusRepository, - IRepository projectRepository + IRepository projectRepository, + IRepository projectRiskRepository, + IRepository projectCategoryRepository, + IRepository projectPhaseRepository ) { _clock = clock; @@ -360,6 +366,9 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency _projectTypeRepository = projectTypeRepository; _projectStatusRepository = projectStatusRepository; _projectRepository = projectRepository; + _projectCategoryRepository = projectCategoryRepository; + _projectRiskRepository = projectRiskRepository; + _projectPhaseRepository = projectPhaseRepository; } private static IConfigurationRoot BuildConfiguration() @@ -2516,6 +2525,65 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency IsActive = item.IsActive }, autoSave: true); } + + foreach (var item in items.ProjectRisks) + { + var exists = await _projectRiskRepository.AnyAsync(x => x.Name == item.Name); + if (exists) + continue; + + await _projectRiskRepository.InsertAsync(new ProjectRisk + { + Name = item.Name, + Description = item.Description, + IsActive = item.IsActive + }, autoSave: true); + } + + foreach (var item in items.ProjectCategories) + { + var exists = await _projectCategoryRepository.AnyAsync(x => x.Name == item.Name); + if (exists) + continue; + + await _projectCategoryRepository.InsertAsync(new ProjectCategory + { + Name = item.Name, + Description = item.Description, + IsActive = item.IsActive + }, autoSave: true); + } + + foreach (var item in items.ProjectPhases) + { + var exists = await _projectPhaseRepository.AnyAsync(x => x.Code == item.Code); + if (exists) + continue; + + var project = await _projectRepository.FirstOrDefaultAsync(x => x.Code == item.ProjectCode); + var projectCategory = await _projectCategoryRepository.FirstOrDefaultAsync(x => x.Name == item.CategoryName); + var projectStatus = await _projectStatusRepository.FirstOrDefaultAsync(x => x.Name == item.StatusName); + + await _projectPhaseRepository.InsertAsync(new ProjectPhase + { + ProjectId = project?.Id, + ProjectCategoryId = projectCategory?.Id, + Code = item.Code, + Name = item.Name, + Description = item.Description, + StatusId = projectStatus?.Id, + Sequence = item.Sequence, + StartDate = item.StartDate, + EndDate = item.EndDate, + Budget = item.Budget, + ActualStartDate = item.ActualStartDate, + ActualEndDate = item.ActualEndDate, + ActualCost = item.ActualCost, + Progress = item.Progress, + Risks = item.Risks, + IsActive = item.IsActive + }, autoSave: true); + } } } diff --git a/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantSeederDto.cs b/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantSeederDto.cs index a177f392..a71d5202 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantSeederDto.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantSeederDto.cs @@ -131,6 +131,48 @@ public class TenantSeederDto public List ProjectTypes { get; set; } public List ProjectStatuses { get; set; } public List Projects { get; set; } + public List ProjectRisks { get; set; } + public List ProjectCategories { get; set; } + public List ProjectPhases { get; set; } +} + +public class ProjectPhaseSeedDto +{ + public string ProjectCode { get; set; } + public string CategoryName { get; set; } + public string StatusName { get; set; } + + public string Code { get; set; } + public string Name { get; set; } + public string Description { get; set; } + + public int Sequence { get; set; } + public DateTime StartDate { get; set; } + public DateTime EndDate { get; set; } + + public DateTime? ActualStartDate { get; set; } + public DateTime? ActualEndDate { get; set; } + + public decimal Budget { get; set; } + public decimal ActualCost { get; set; } + public int Progress { get; set; } + public string Risks { get; set; } + + public bool IsActive { get; set; } +} + +public class ProjectCategorySeedDto +{ + public string Name { get; set; } + public string Description { get; set; } + public bool IsActive { get; set; } +} + +public class ProjectRiskSeedDto +{ + public string Name { get; set; } + public string Description { get; set; } + public bool IsActive { get; set; } } public class ProjectSeedDto diff --git a/ui/src/views/intranet/Dashboard.tsx b/ui/src/views/intranet/Dashboard.tsx index efa8ce80..b36caf56 100644 --- a/ui/src/views/intranet/Dashboard.tsx +++ b/ui/src/views/intranet/Dashboard.tsx @@ -127,7 +127,7 @@ const IntranetDashboard: React.FC = () => { permission: 'App.Intranet.Announcement.Widget', column: 'right', }, - { id: 'priority-tasks', permission: 'App.Project.Tasks.Widget', column: 'right' }, + { id: 'priority-tasks', permission: 'App.Project.Task.Widget', column: 'right' }, { id: 'meal-weekly-menu', permission: 'App.Intranet.Meal.Widget', column: 'right' }, { id: 'shuttle-route', permission: 'App.Intranet.ShuttleRoute.Widget', column: 'right' }, { id: 'leave-management', permission: 'App.Hr.Leave.Widget', column: 'right' },