From 6875d1f48fba931620b9e981306c95cc2e86b69f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sedat=20=C3=96zt=C3=BCrk?= Date: Sun, 16 Nov 2025 23:35:09 +0300 Subject: [PATCH] Purchase Request --- .../Seeds/LanguagesData.json | 20 +- .../Seeds/ListFormSeeder_SupplyChain.cs | 643 +++++++++++++++- .../Seeds/MenusData.json | 714 +++++++++--------- .../Seeds/PermissionsData.json | 131 +++- .../Enums/TableNameEnum.cs | 3 + .../PlatformConsts.cs | 4 + .../TableNameResolver.cs | 3 + .../Erp.Platform.Domain/Data/SeedConsts.cs | 3 + .../Entities/Tenant/Administration/Uom.cs | 1 - .../Entities/Tenant/SupplyChain/Approval.cs | 10 +- .../Entities/Tenant/SupplyChain/Request.cs | 32 + .../Tenant/SupplyChain/RequestItem.cs | 24 + .../Tenant/SupplyChain/RequestType.cs | 18 + .../Queries/DefaultValueManager.cs | 12 +- .../EntityFrameworkCore/PlatformDbContext.cs | 47 +- ....cs => 20251116194718_Initial.Designer.cs} | 292 ++++++- ...0_Initial.cs => 20251116194718_Initial.cs} | 152 ++++ .../PlatformDbContextModelSnapshot.cs | 290 ++++++- .../Tenants/Seeds/TenantData.json | 55 +- .../Tenants/TenantDataSeeder.cs | 41 +- .../Tenants/TenantSeederDto.cs | 18 + .../assets/styles/components/_menu-item.css | 2 +- ui/src/views/list/Grid.tsx | 19 +- 23 files changed, 2133 insertions(+), 401 deletions(-) create mode 100644 api/src/Erp.Platform.Domain/Entities/Tenant/SupplyChain/Request.cs create mode 100644 api/src/Erp.Platform.Domain/Entities/Tenant/SupplyChain/RequestItem.cs create mode 100644 api/src/Erp.Platform.Domain/Entities/Tenant/SupplyChain/RequestType.cs rename api/src/Erp.Platform.EntityFrameworkCore/Migrations/{20251114204400_Initial.Designer.cs => 20251116194718_Initial.Designer.cs} (98%) rename api/src/Erp.Platform.EntityFrameworkCore/Migrations/{20251114204400_Initial.cs => 20251116194718_Initial.cs} (98%) diff --git a/api/src/Erp.Platform.DbMigrator/Seeds/LanguagesData.json b/api/src/Erp.Platform.DbMigrator/Seeds/LanguagesData.json index 5ff4cd54..1d80d0ef 100644 --- a/api/src/Erp.Platform.DbMigrator/Seeds/LanguagesData.json +++ b/api/src/Erp.Platform.DbMigrator/Seeds/LanguagesData.json @@ -154,8 +154,8 @@ { "resourceName": "Platform", "key": "App.SupplyChain", - "en": "Supply Chain", - "tr": "Tedarik Zinciri" + "en": "Supply", + "tr": "Tedarik" }, { "resourceName": "Platform", @@ -172,8 +172,8 @@ { "resourceName": "Platform", "key": "App.Projects", - "en": "Projects", - "tr": "Arge" + "en": "R&D", + "tr": "Ar-ge" }, { "resourceName": "Platform", @@ -9229,12 +9229,24 @@ "tr": "Tedarikçiler", "en": "Suppliers" }, + { + "resourceName": "Platform", + "key": "App.SupplyChain.RequestType", + "tr": "Talep Türleri", + "en": "Request Types" + }, { "resourceName": "Platform", "key": "App.SupplyChain.Request", "tr": "Satın Alma Talepleri", "en": "Purchase Requests" }, + { + "resourceName": "Platform", + "key": "App.SupplyChain.RequestItem", + "tr": "Satın Alma Talep Ürünleri", + "en": "Purchase Request Items" + }, { "resourceName": "Platform", "key": "App.SupplyChain.PartnerBank", diff --git a/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_SupplyChain.cs b/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_SupplyChain.cs index 6ba5f190..6d5205f1 100644 --- a/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_SupplyChain.cs +++ b/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_SupplyChain.cs @@ -72,7 +72,7 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -211,7 +211,7 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -387,7 +387,7 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -701,7 +701,7 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -824,7 +824,7 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -947,7 +947,7 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -1069,7 +1069,7 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -1761,7 +1761,7 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -2086,7 +2086,7 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -2240,7 +2240,7 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -2464,7 +2464,7 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -2652,7 +2652,7 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, - SearchPanelJson= DefaultSearchPanelJson, + SearchPanelJson = DefaultSearchPanelJson, GroupPanelJson = DefaultGroupPanelJson, SelectionJson = DefaultSelectionSingleJson, ColumnOptionJson = DefaultColumnOptionJson, @@ -2798,5 +2798,624 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend #endregion } #endregion + + #region Request Type + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.RequestType)) + { + var listForm = await _listFormRepository.InsertAsync( + new ListForm() + { + ListFormType = ListFormTypeEnum.List, + IsSubForm = true, + ShowNote = true, + LayoutJson = DefaultLayoutJson, + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.RequestType, + Name = AppCodes.SupplyChain.RequestType, + Title = AppCodes.SupplyChain.RequestType, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = true, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.SupplyChain.RequestType, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.RequestType)), + KeyFieldName = "Id", + KeyFieldDbSourceType = DbType.Guid, + DefaultFilter = DefaultFilterJson, + SortMode = GridOptions.SortModeSingle, + FilterRowJson = DefaultFilterRowJson, + HeaderFilterJson = DefaultHeaderFilterJson, + SearchPanelJson = DefaultSearchPanelJson, + GroupPanelJson = DefaultGroupPanelJson, + SelectionJson = DefaultSelectionSingleJson, + ColumnOptionJson = DefaultColumnOptionJson, + PermissionJson = DefaultPermissionJson(AppCodes.SupplyChain.RequestType), + DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.RequestType)), + DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson, + PagerOptionJson = DefaultPagerOptionJson, + EditingOptionJson = DefaultEditingOptionJson(AppCodes.SupplyChain.RequestType, 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 Request 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, + SortIndex = 0, + 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, + 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, + ValidationRuleJson = DefaultValidationRuleRequiredJson, + 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, + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + ]); + #endregion + } + #endregion + + #region Purchase Request + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Request)) + { + var listForm = await _listFormRepository.InsertAsync(new ListForm() + { + ListFormType = ListFormTypeEnum.List, + IsSubForm = false, + ShowNote = true, + LayoutJson = DefaultLayoutJson, + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.Request, + Name = AppCodes.SupplyChain.Request, + Title = AppCodes.SupplyChain.Request, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = true, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.SupplyChain.Request, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.Request)), + KeyFieldName = "Id", + KeyFieldDbSourceType = DbType.Guid, + DefaultFilter = DefaultFilterJson, + SortMode = GridOptions.SortModeSingle, + FilterRowJson = DefaultFilterRowJson, + HeaderFilterJson = DefaultHeaderFilterJson, + SearchPanelJson = DefaultSearchPanelJson, + GroupPanelJson = DefaultGroupPanelJson, + SelectionJson = DefaultSelectionSingleJson, + ColumnOptionJson = DefaultColumnOptionJson, + PermissionJson = DefaultPermissionJson(AppCodes.SupplyChain.Request), + DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.Request)), + DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson, + PagerOptionJson = DefaultPagerOptionJson, + EditingOptionJson = DefaultEditingOptionJson(AppCodes.SupplyChain.Request, 800, 300, true, true, true, true, false), + EditingFormJson = JsonSerializer.Serialize(new List() + { + new() + { + Order = 1, ColCount = 2, ColSpan = 2, ItemType = "group", Items = + [ + new EditingFormItemDto { Order = 1, DataField = "RequestNumber", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox, EditorOptions = EditorOptionValues.Disabled }, + new EditingFormItemDto { Order = 2, DataField = "RequestTypeId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 3, DataField = "DepartmentId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 4, DataField = "EmployeeId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 5, DataField = "RequestDate", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxDateBox }, + new EditingFormItemDto { Order = 6, DataField = "RequiredDate", ColSpan = 1, EditorType2 = EditorTypes.dxDateBox }, + new EditingFormItemDto { Order = 7, DataField = "Priority", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 8, DataField = "Status", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 9, DataField = "Description", ColSpan = 2, EditorType2 = EditorTypes.dxTextArea }, + ] + } + }), + InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson, + FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] + { + new() { FieldName = "RequestNumber", FieldDbType = DbType.String, Value = "@AUTONUMBER", CustomValueType = FieldCustomValueTypeEnum.CustomKey }, + new() { FieldName = "RequestDate", FieldDbType = DbType.Date, Value = "@DATE", CustomValueType = FieldCustomValueTypeEnum.CustomKey }, + new() { FieldName = "Priority", FieldDbType = DbType.String, Value = "Low", CustomValueType = FieldCustomValueTypeEnum.Value }, + new() { FieldName = "Status", FieldDbType = DbType.String, Value = "Draft", CustomValueType = FieldCustomValueTypeEnum.Value }, + }), + CommandColumnJson = JsonSerializer.Serialize(new CommandColumnDto[] { + new() { + Hint = "Manage", + Text ="Manage", + UrlTarget="_blank", + AuthName = AppCodes.SupplyChain.Request + ".Update", + Url=$"/admin/form/{utils.GetDefaultFormCodes(ListFormCodes.Lists.Request)}/@Id" + }, + }), + }, autoSave: true); + + await _listFormFieldRepository.InsertManyAsync([ + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + Width = 120, + ListOrderNo = 1, + Visible = false, + IsActive = true, + IsDeleted = false, + SortIndex = 0, + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "RequestNumber", + Width = 130, + ListOrderNo = 2, + Visible = true, + IsActive = true, + IsDeleted = false, + SortIndex = 0, + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "RequestTypeId", + Width = 150, + ListOrderNo = 3, + Visible = true, + IsActive = true, + IsDeleted = false, + SortIndex = 1, + SortDirection = GridColumnOptions.SortOrderAsc, + AllowSearch = true, + LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.RequestType), "Id", "Name"), + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "DepartmentId", + Width = 150, + ListOrderNo = 4, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.Department), "Id", "Name"), + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "EmployeeId", + Width = 150, + ListOrderNo = 5, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.Employee), "Id", "FullName"), + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Date, + FieldName = "RequestDate", + Width = 100, + ListOrderNo = 6, + Visible = true, + IsActive = true, + IsDeleted = false, + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Date, + FieldName = "RequiredDate", + Width = 100, + ListOrderNo = 7, + Visible = true, + IsActive = true, + IsDeleted = false, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Priority", + Width = 150, + ListOrderNo = 8, + Visible = true, + IsActive = true, + IsDeleted = false, + LookupJson = JsonSerializer.Serialize(new LookupDto + { + DataSourceType = UiLookupDataSourceTypeEnum.StaticData, + DisplayExpr = "name", + ValueExpr = "key", + LookupQuery = JsonSerializer.Serialize(new LookupDataDto[] { + new() { Key="Low", Name="Low" }, + new() { Key="Normal", Name="Normal" }, + new() { Key="High", Name="High" }, + new() { Key="Urgent", Name="Urgent" }, + }), + }), + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Status", + Width = 100, + ListOrderNo = 9, + Visible = true, + IsActive = true, + IsDeleted = false, + LookupJson = JsonSerializer.Serialize(new LookupDto + { + DataSourceType = UiLookupDataSourceTypeEnum.StaticData, + DisplayExpr = "name", + ValueExpr = "key", + LookupQuery = JsonSerializer.Serialize(new LookupDataDto[] { + new() { Key="Draft", Name="Draft" }, + new() { Key="Submitted", Name="Submitted" }, + new() { Key="InReview", Name="InReview" }, + new() { Key="Approved", Name="Approved" }, + new() { Key="Rejected", Name="Rejected" }, + new() { Key="InQuotation", Name="InQuotation" }, + new() { Key="Ordered", Name="Ordered" }, + new() { Key="Completed", Name="Completed" }, + new() { Key="Cancelled", Name="Cancelled" }, + }), + }), + 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 = 10, + Visible = true, + IsActive = true, + IsDeleted = false, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + } + ], autoSave: true); + + // Sub Forms for Supply + await utils.CloneListFormWithFieldsAsync( + _listFormRepository, + _listFormFieldRepository, + listForm.ListFormCode, + JsonSerializer.Serialize(new List() { + new { + TabTitle = "Malzemeler", + TabType = ListFormTabTypeEnum.List, + Code = ListFormCodes.Lists.RequestItem, + Relation = new List() { + new { + ParentFieldName = "Id", + ChildFieldName = "RequestId" + } + } + } + }) + ); + } + #endregion + + #region Purchase Request Item + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.RequestItem)) + { + var listForm = await _listFormRepository.InsertAsync( + new ListForm() + { + ListFormType = ListFormTypeEnum.List, + IsSubForm = true, + ShowNote = true, + LayoutJson = DefaultLayoutJson, + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.RequestItem, + Name = AppCodes.SupplyChain.RequestItem, + Title = AppCodes.SupplyChain.RequestItem, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = true, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.SupplyChain.RequestItem, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.RequestItem)), + KeyFieldName = "Id", + KeyFieldDbSourceType = DbType.Guid, + DefaultFilter = DefaultFilterJson, + SortMode = GridOptions.SortModeSingle, + FilterRowJson = DefaultFilterRowJson, + HeaderFilterJson = DefaultHeaderFilterJson, + SearchPanelJson = DefaultSearchPanelJson, + GroupPanelJson = DefaultGroupPanelJson, + SelectionJson = DefaultSelectionSingleJson, + ColumnOptionJson = DefaultColumnOptionJson, + PermissionJson = DefaultPermissionJson(AppCodes.SupplyChain.RequestItem), + DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.RequestItem)), + DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson, + PagerOptionJson = DefaultPagerOptionJson, + EditingOptionJson = DefaultEditingOptionJson(AppCodes.SupplyChain.RequestItem, 500, 400, 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="MaterialId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 2, DataField="Quantity", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxNumberBox, EditorOptions = EditorOptionValues.NumberStandartFormat }, + new EditingFormItemDto { Order = 3, DataField="UomId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 4, DataField="EstimatedPrice", ColSpan = 1, EditorType2 = EditorTypes.dxNumberBox, EditorOptions = EditorOptionValues.NumberStandartFormat }, + new EditingFormItemDto { Order = 5, DataField="Specification", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 6, DataField="Justification", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 7, DataField="IsUrgent", ColSpan = 1, EditorType2 = EditorTypes.dxCheckBox }, + new EditingFormItemDto { Order = 8, DataField="RequestId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, + ]} + }), + FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + new() { FieldName = "Quantity", FieldDbType = DbType.Int32, Value = "1", CustomValueType = FieldCustomValueTypeEnum.Value }, + new() { FieldName = "EstimatedPrice", FieldDbType = DbType.Decimal, Value = "0", CustomValueType = FieldCustomValueTypeEnum.Value }, + new() { FieldName = "IsUrgent", FieldDbType = DbType.Boolean, Value = "false", CustomValueType = FieldCustomValueTypeEnum.Value } + }), + } + ); + + #region Purchase Request Item 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, + SortIndex = 0, + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "MaterialId", + Width = 300, + ListOrderNo = 2, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.Material), "Id", "Name"), + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Decimal, + FieldName = "Quantity", + Format = "fixedPoint", + Alignment = "right", + Width = 100, + ListOrderNo = 3, + 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.Guid, + FieldName = "UomId", + Width = 100, + ListOrderNo = 4, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.Uom), "Id", "Name"), + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Decimal, + FieldName = "EstimatedPrice", + Format = "fixedPoint", + Alignment = "right", + Width = 100, + ListOrderNo = 5, + 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 = "Specification", + 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.String, + FieldName = "Justification", + Width = 300, + ListOrderNo = 7, + 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 = "IsUrgent", + Width = 100, + ListOrderNo = 8, + 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 = "RequestId", + Width = 130, + ListOrderNo = 8, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.Request), "Id", "RequestNumber"), + 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 dda3e4db..7c475811 100644 --- a/api/src/Erp.Platform.DbMigrator/Seeds/MenusData.json +++ b/api/src/Erp.Platform.DbMigrator/Seeds/MenusData.json @@ -1211,326 +1211,6 @@ "RequiredPermissionName": "App.Setting", "IsDisabled": false }, - { - "ParentCode": "App.Administration", - "Code": "Abp.Identity", - "DisplayName": "Abp.Identity", - "Order": 3, - "Url": null, - "Icon": "FcConferenceCall", - "RequiredPermissionName": null, - "IsDisabled": false - }, - { - "ParentCode": "Abp.Identity", - "Code": "Abp.Identity.PermissionGroups", - "DisplayName": "Abp.Identity.PermissionGroups", - "Order": 1, - "Url": "/admin/list/list-permissiongroup", - "Icon": "FcEngineering", - "RequiredPermissionName": "Abp.Identity.PermissionGroups", - "IsDisabled": false - }, - { - "ParentCode": "Abp.Identity", - "Code": "Abp.Identity.Permissions", - "DisplayName": "Abp.Identity.Permissions", - "Order": 2, - "Url": "/admin/list/list-permission", - "Icon": "FcSupport", - "RequiredPermissionName": "Abp.Identity.Permissions", - "IsDisabled": false - }, - { - "ParentCode": "Abp.Identity", - "Code": "App.ClaimType", - "DisplayName": "App.ClaimType", - "Order": 3, - "Url": "/admin/list/list-claimtype", - "Icon": "FcOrganization", - "RequiredPermissionName": "App.ClaimType", - "IsDisabled": false - }, - { - "ParentCode": "Abp.Identity", - "Code": "AbpIdentity.Roles", - "DisplayName": "AbpIdentity.Roles", - "Order": 4, - "Url": "/admin/list/list-role", - "Icon": "FcFlowChart", - "RequiredPermissionName": "AbpIdentity.Roles", - "IsDisabled": false - }, - { - "ParentCode": "Abp.Identity", - "Code": "AbpIdentity.Users", - "DisplayName": "AbpIdentity.Users", - "Order": 5, - "Url": "/admin/list/list-user", - "Icon": "FcBusinessman", - "RequiredPermissionName": "AbpIdentity.Users", - "IsDisabled": false - }, - { - "ParentCode": "Abp.Identity", - "Code": "Abp.Identity.OrganizationUnits", - "DisplayName": "Abp.Identity.OrganizationUnits", - "Order": 6, - "Url": "/admin/ous", - "Icon": "FcOrganization", - "RequiredPermissionName": "Abp.Identity.OrganizationUnits", - "IsDisabled": false - }, - { - "ParentCode": "Abp.Identity", - "Code": "App.IpRestrictions", - "DisplayName": "App.IpRestrictions", - "Order": 7, - "Url": "/admin/list/list-iprestriction", - "Icon": "FcNfcSign", - "RequiredPermissionName": "App.IpRestrictions", - "IsDisabled": false - }, - { - "ParentCode": "Abp.Identity", - "Code": "App.AuditLogs", - "DisplayName": "App.AuditLogs", - "Order": 8, - "Url": "/admin/list/list-auditlog", - "Icon": "FcMultipleInputs", - "RequiredPermissionName": "App.AuditLogs", - "IsDisabled": false - }, - { - "ParentCode": "App.Administration", - "Code": "App.Forum", - "DisplayName": "App.Forum", - "Order": 5, - "Url": "/admin/forum", - "Icon": "FcLink", - "RequiredPermissionName": "App.ForumManagement.Publish", - "IsDisabled": false - }, - { - "ParentCode": "App.Administration", - "Code": "App.DeveloperKit", - "DisplayName": "App.DeveloperKit", - "Order": 8, - "Url": null, - "Icon": "FcAndroidOs", - "RequiredPermissionName": null, - "IsDisabled": false - }, - { - "ParentCode": "App.DeveloperKit", - "Code": "App.DeveloperKit.Dashboard", - "DisplayName": "App.Coordinator.Classroom.Dashboard", - "Order": 1, - "Url": "/admin/developerkit", - "Icon": "FcBinoculars", - "RequiredPermissionName": "App.DeveloperKit", - "IsDisabled": false - }, - { - "ParentCode": "App.DeveloperKit", - "Code": "App.DeveloperKit.Entity", - "DisplayName": "App.DeveloperKit.Entity", - "Order": 2, - "Url": "/admin/developerkit/entities", - "Icon": "FcAddRow", - "RequiredPermissionName": "App.DeveloperKit.Entity", - "IsDisabled": false - }, - { - "ParentCode": "App.DeveloperKit", - "Code": "App.DeveloperKit.Migrations", - "DisplayName": "App.DeveloperKit.Migrations", - "Order": 3, - "Url": "/admin/developerkit/migrations", - "Icon": "FcAddDatabase", - "RequiredPermissionName": "App.DeveloperKit.Migrations", - "IsDisabled": false - }, - { - "ParentCode": "App.DeveloperKit", - "Code": "App.DeveloperKit.CrudEndpoints", - "DisplayName": "App.DeveloperKit.CrudEndpoints", - "Order": 4, - "Url": "/admin/developerkit/endpoints", - "Icon": "FcOrgUnit", - "RequiredPermissionName": "App.DeveloperKit.CrudEndpoints", - "IsDisabled": false - }, - { - "ParentCode": "App.DeveloperKit", - "Code": "App.DeveloperKit.CustomEndpoints", - "DisplayName": "App.DeveloperKit.CustomEndpoints", - "Order": 5, - "Url": "/admin/list/list-customendpoint", - "Icon": "FcMindMap", - "RequiredPermissionName": "App.DeveloperKit.CustomEndpoints", - "IsDisabled": false - }, - { - "ParentCode": "App.DeveloperKit", - "Code": "App.DeveloperKit.Components", - "DisplayName": "App.DeveloperKit.Components", - "Order": 6, - "Url": "/admin/developerkit/components", - "Icon": "FcBiohazard", - "RequiredPermissionName": "App.DeveloperKit.Components", - "IsDisabled": false - }, - { - "ParentCode": "App.DeveloperKit", - "Code": "App.DeveloperKit.DynamicServices", - "DisplayName": "App.DeveloperKit.DynamicServices", - "Order": 7, - "Url": "/admin/developerkit/dynamic-services", - "Icon": "FcCommandLine", - "RequiredPermissionName": "App.DeveloperKit.DynamicServices", - "IsDisabled": false - }, - { - "ParentCode": "App.Administration", - "Code": "App.Reports.Management", - "DisplayName": "App.Reports.Management", - "Order": 6, - "Url": null, - "Icon": "FcDocument", - "RequiredPermissionName": null, - "IsDisabled": false - }, - { - "ParentCode": "App.Reports.Management", - "Code": "App.Reports.Categories", - "DisplayName": "App.Reports.Categories", - "Order": 1, - "Url": "/admin/list/list-reportcategory", - "Icon": "FcProcess", - "RequiredPermissionName": "App.Reports.Categories", - "IsDisabled": false - }, - { - "ParentCode": "App.Reports.Management", - "Code": "App.Reports", - "DisplayName": "App.Reports", - "Order": 2, - "Url": "/admin/reports/management", - "Icon": "FcSimCardChip", - "RequiredPermissionName": "App.Reports.Management", - "IsDisabled": false - }, - { - "ParentCode": "App.Administration", - "Code": "App.Public", - "DisplayName": "App.Public", - "Order": 7, - "Url": null, - "Icon": "FcGenealogy", - "RequiredPermissionName": null, - "IsDisabled": false - }, - { - "ParentCode": "App.Public", - "Code": "App.About", - "DisplayName": "App.About", - "Order": 1, - "Url": "/admin/list/list-about", - "Icon": "FcAbout", - "RequiredPermissionName": "App.About", - "IsDisabled": false - }, - { - "ParentCode": "App.Public", - "Code": "App.Services", - "DisplayName": "App.Services", - "Order": 2, - "Url": "/admin/list/list-service", - "Icon": "FcServices", - "RequiredPermissionName": "App.Services", - "IsDisabled": false - }, - { - "ParentCode": "App.Public", - "Code": "App.Orders.Products", - "DisplayName": "App.Orders.Products", - "Order": 3, - "Url": "/admin/list/list-product", - "Icon": "FcDiploma1", - "RequiredPermissionName": "App.Orders.Products", - "IsDisabled": false - }, - { - "ParentCode": "App.Public", - "Code": "App.Orders.PaymentMethods", - "DisplayName": "App.Orders.PaymentMethods", - "Order": 4, - "Url": "/admin/list/list-paymentmethod", - "Icon": "FcFeedIn", - "RequiredPermissionName": "App.Orders.PaymentMethods", - "IsDisabled": false - }, - { - "ParentCode": "App.Public", - "Code": "App.Orders.InstallmentOptions", - "DisplayName": "App.Orders.InstallmentOptions", - "Order": 5, - "Url": "/admin/list/list-installmentoption", - "Icon": "FcProcess", - "RequiredPermissionName": "App.Orders.InstallmentOptions", - "IsDisabled": false - }, - { - "ParentCode": "App.Public", - "Code": "App.Orders.PurchaseOrders", - "DisplayName": "App.Orders.PurchaseOrders", - "Order": 6, - "Url": "/admin/list/list-purchaseorder", - "Icon": "FcCollect", - "RequiredPermissionName": "App.Orders.PurchaseOrders", - "IsDisabled": false - }, - { - "ParentCode": "App.Public", - "Code": "App.BlogManagement.Category", - "DisplayName": "App.BlogManagement.Category", - "Order": 7, - "Url": "/admin/list/list-blogcategory", - "Icon": "FaCertificate", - "RequiredPermissionName": "App.BlogManagement.Category", - "IsDisabled": false - }, - { - "ParentCode": "App.Public", - "Code": "App.BlogManagement.Posts", - "DisplayName": "App.BlogManagement.Posts", - "Order": 8, - "Url": "/admin/list/list-blogpost", - "Icon": "FaWeixin", - "RequiredPermissionName": "App.BlogManagement.Posts", - "IsDisabled": false - }, - { - "ParentCode": "App.Public", - "Code": "App.Demos", - "DisplayName": "App.Demos", - "Order": 9, - "Url": "/admin/list/list-demo", - "Icon": "FcMissedCall", - "RequiredPermissionName": "App.Demos", - "IsDisabled": false - }, - { - "ParentCode": "App.Public", - "Code": "App.Contact", - "DisplayName": "App.Contact", - "Order": 10, - "Url": "/admin/list/list-contact", - "Icon": "FcContacts", - "RequiredPermissionName": "App.Contact", - "IsDisabled": false - }, { "ParentCode": "App.Administration", "Code": "App.Definitions", @@ -1541,16 +1221,6 @@ "RequiredPermissionName": null, "IsDisabled": false }, - { - "ParentCode": "App.Administration", - "Code": "App.Files", - "DisplayName": "App.Files", - "Order": 4, - "Url": "/admin/files", - "Icon": "FcFolder", - "RequiredPermissionName": "App.Files", - "IsDisabled": false - }, { "ParentCode": "App.Definitions", "Code": "App.Definitions.ContactTag", @@ -1742,10 +1412,230 @@ "IsDisabled": false }, { - "ParentCode": null, + "ParentCode": "App.Administration", + "Code": "Abp.Identity", + "DisplayName": "Abp.Identity", + "Order": 3, + "Url": null, + "Icon": "FcConferenceCall", + "RequiredPermissionName": null, + "IsDisabled": false + }, + { + "ParentCode": "Abp.Identity", + "Code": "Abp.Identity.PermissionGroups", + "DisplayName": "Abp.Identity.PermissionGroups", + "Order": 1, + "Url": "/admin/list/list-permissiongroup", + "Icon": "FcEngineering", + "RequiredPermissionName": "Abp.Identity.PermissionGroups", + "IsDisabled": false + }, + { + "ParentCode": "Abp.Identity", + "Code": "Abp.Identity.Permissions", + "DisplayName": "Abp.Identity.Permissions", + "Order": 2, + "Url": "/admin/list/list-permission", + "Icon": "FcSupport", + "RequiredPermissionName": "Abp.Identity.Permissions", + "IsDisabled": false + }, + { + "ParentCode": "Abp.Identity", + "Code": "App.ClaimType", + "DisplayName": "App.ClaimType", + "Order": 3, + "Url": "/admin/list/list-claimtype", + "Icon": "FcOrganization", + "RequiredPermissionName": "App.ClaimType", + "IsDisabled": false + }, + { + "ParentCode": "Abp.Identity", + "Code": "AbpIdentity.Roles", + "DisplayName": "AbpIdentity.Roles", + "Order": 4, + "Url": "/admin/list/list-role", + "Icon": "FcFlowChart", + "RequiredPermissionName": "AbpIdentity.Roles", + "IsDisabled": false + }, + { + "ParentCode": "Abp.Identity", + "Code": "AbpIdentity.Users", + "DisplayName": "AbpIdentity.Users", + "Order": 5, + "Url": "/admin/list/list-user", + "Icon": "FcBusinessman", + "RequiredPermissionName": "AbpIdentity.Users", + "IsDisabled": false + }, + { + "ParentCode": "Abp.Identity", + "Code": "Abp.Identity.OrganizationUnits", + "DisplayName": "Abp.Identity.OrganizationUnits", + "Order": 6, + "Url": "/admin/ous", + "Icon": "FcOrganization", + "RequiredPermissionName": "Abp.Identity.OrganizationUnits", + "IsDisabled": false + }, + { + "ParentCode": "Abp.Identity", + "Code": "App.IpRestrictions", + "DisplayName": "App.IpRestrictions", + "Order": 7, + "Url": "/admin/list/list-iprestriction", + "Icon": "FcNfcSign", + "RequiredPermissionName": "App.IpRestrictions", + "IsDisabled": false + }, + { + "ParentCode": "Abp.Identity", + "Code": "App.AuditLogs", + "DisplayName": "App.AuditLogs", + "Order": 8, + "Url": "/admin/list/list-auditlog", + "Icon": "FcMultipleInputs", + "RequiredPermissionName": "App.AuditLogs", + "IsDisabled": false + }, + { + "ParentCode": "App.Administration", + "Code": "App.Files", + "DisplayName": "App.Files", + "Order": 4, + "Url": "/admin/files", + "Icon": "FcFolder", + "RequiredPermissionName": "App.Files", + "IsDisabled": false + }, + { + "ParentCode": "App.Administration", + "Code": "App.Forum", + "DisplayName": "App.Forum", + "Order": 5, + "Url": "/admin/forum", + "Icon": "FcLink", + "RequiredPermissionName": "App.ForumManagement.Publish", + "IsDisabled": false + }, + { + "ParentCode": "App.Administration", + "Code": "App.Reports.Management", + "DisplayName": "App.Reports.Management", + "Order": 6, + "Url": null, + "Icon": "FcDocument", + "RequiredPermissionName": null, + "IsDisabled": false + }, + { + "ParentCode": "App.Reports.Management", + "Code": "App.Reports.Categories", + "DisplayName": "App.Reports.Categories", + "Order": 1, + "Url": "/admin/list/list-reportcategory", + "Icon": "FcProcess", + "RequiredPermissionName": "App.Reports.Categories", + "IsDisabled": false + }, + { + "ParentCode": "App.Reports.Management", + "Code": "App.Reports", + "DisplayName": "App.Reports", + "Order": 2, + "Url": "/admin/reports/management", + "Icon": "FcSimCardChip", + "RequiredPermissionName": "App.Reports.Management", + "IsDisabled": false + }, + { + "ParentCode": "App.Administration", + "Code": "App.DeveloperKit", + "DisplayName": "App.DeveloperKit", + "Order": 8, + "Url": null, + "Icon": "FcAndroidOs", + "RequiredPermissionName": null, + "IsDisabled": false + }, + { + "ParentCode": "App.DeveloperKit", + "Code": "App.DeveloperKit.Dashboard", + "DisplayName": "App.Coordinator.Classroom.Dashboard", + "Order": 1, + "Url": "/admin/developerkit", + "Icon": "FcBinoculars", + "RequiredPermissionName": "App.DeveloperKit", + "IsDisabled": false + }, + { + "ParentCode": "App.DeveloperKit", + "Code": "App.DeveloperKit.Entity", + "DisplayName": "App.DeveloperKit.Entity", + "Order": 2, + "Url": "/admin/developerkit/entities", + "Icon": "FcAddRow", + "RequiredPermissionName": "App.DeveloperKit.Entity", + "IsDisabled": false + }, + { + "ParentCode": "App.DeveloperKit", + "Code": "App.DeveloperKit.Migrations", + "DisplayName": "App.DeveloperKit.Migrations", + "Order": 3, + "Url": "/admin/developerkit/migrations", + "Icon": "FcAddDatabase", + "RequiredPermissionName": "App.DeveloperKit.Migrations", + "IsDisabled": false + }, + { + "ParentCode": "App.DeveloperKit", + "Code": "App.DeveloperKit.CrudEndpoints", + "DisplayName": "App.DeveloperKit.CrudEndpoints", + "Order": 4, + "Url": "/admin/developerkit/endpoints", + "Icon": "FcOrgUnit", + "RequiredPermissionName": "App.DeveloperKit.CrudEndpoints", + "IsDisabled": false + }, + { + "ParentCode": "App.DeveloperKit", + "Code": "App.DeveloperKit.CustomEndpoints", + "DisplayName": "App.DeveloperKit.CustomEndpoints", + "Order": 5, + "Url": "/admin/list/list-customendpoint", + "Icon": "FcMindMap", + "RequiredPermissionName": "App.DeveloperKit.CustomEndpoints", + "IsDisabled": false + }, + { + "ParentCode": "App.DeveloperKit", + "Code": "App.DeveloperKit.Components", + "DisplayName": "App.DeveloperKit.Components", + "Order": 6, + "Url": "/admin/developerkit/components", + "Icon": "FcBiohazard", + "RequiredPermissionName": "App.DeveloperKit.Components", + "IsDisabled": false + }, + { + "ParentCode": "App.DeveloperKit", + "Code": "App.DeveloperKit.DynamicServices", + "DisplayName": "App.DeveloperKit.DynamicServices", + "Order": 7, + "Url": "/admin/developerkit/dynamic-services", + "Icon": "FcCommandLine", + "RequiredPermissionName": "App.DeveloperKit.DynamicServices", + "IsDisabled": false + }, + { + "ParentCode": "App.Administration", "Code": "App.Intranet", "DisplayName": "App.Intranet", - "Order": 400, + "Order": 7, "Url": null, "Icon": "FcDataConfiguration", "RequiredPermissionName": null, @@ -1753,16 +1643,6 @@ }, { "ParentCode": "App.Intranet", - "Code": "App.Intranet.Events", - "DisplayName": "App.Intranet.Events", - "Order": 1, - "Url": null, - "Icon": "FcTodoList", - "RequiredPermissionName": null, - "IsDisabled": false - }, - { - "ParentCode": "App.Intranet.Events", "Code": "App.Intranet.Events.EventType", "DisplayName": "App.Intranet.Events.EventType", "Order": 1, @@ -1772,7 +1652,7 @@ "IsDisabled": false }, { - "ParentCode": "App.Intranet.Events", + "ParentCode": "App.Intranet", "Code": "App.Intranet.Events.EventCategory", "DisplayName": "App.Intranet.Events.EventCategory", "Order": 2, @@ -1782,7 +1662,7 @@ "IsDisabled": false }, { - "ParentCode": "App.Intranet.Events", + "ParentCode": "App.Intranet", "Code": "App.Intranet.Events.Event", "DisplayName": "App.Intranet.Events.Event", "Order": 3, @@ -1795,7 +1675,7 @@ "ParentCode": "App.Intranet", "Code": "App.Intranet.Meal", "DisplayName": "App.Intranet.Meal", - "Order": 3, + "Order": 4, "Url": "/admin/list/list-meal", "Icon": "FcLike", "RequiredPermissionName": "App.Intranet.Meal", @@ -1805,7 +1685,7 @@ "ParentCode": "App.Intranet", "Code": "App.Intranet.Reservation", "DisplayName": "App.Intranet.Reservation", - "Order": 4, + "Order": 5, "Url": "/admin/list/list-reservation", "Icon": "FcAlarmClock", "RequiredPermissionName": "App.Intranet.Reservation", @@ -1815,7 +1695,7 @@ "ParentCode": "App.Intranet", "Code": "App.Intranet.ShuttleRoute", "DisplayName": "App.Intranet.ShuttleRoute", - "Order": 5, + "Order": 6, "Url": "/admin/list/list-shuttleroute", "Icon": "FcAutomotive", "RequiredPermissionName": "App.Intranet.ShuttleRoute", @@ -1825,7 +1705,7 @@ "ParentCode": "App.Intranet", "Code": "App.Intranet.Announcement", "DisplayName": "App.Intranet.Announcement", - "Order": 6, + "Order": 7, "Url": "/admin/list/list-announcement", "Icon": "FcSpeaker", "RequiredPermissionName": "App.Intranet.Announcement", @@ -1835,7 +1715,7 @@ "ParentCode": "App.Intranet", "Code": "App.Intranet.Visitor", "DisplayName": "App.Intranet.Visitor", - "Order": 7, + "Order": 8, "Url": "/admin/list/list-visitor", "Icon": "FcContacts", "RequiredPermissionName": "App.Intranet.Visitor", @@ -1845,12 +1725,124 @@ "ParentCode": "App.Intranet", "Code": "App.Intranet.SocialPost", "DisplayName": "App.Intranet.SocialPost", - "Order": 7, + "Order": 9, "Url": "/admin/list/list-socialpost", "Icon": "FcShare", "RequiredPermissionName": "App.Intranet.SocialPost", "IsDisabled": false }, + + { + "ParentCode": "App.Administration", + "Code": "App.Public", + "DisplayName": "App.Public", + "Order": 8, + "Url": null, + "Icon": "FcGenealogy", + "RequiredPermissionName": null, + "IsDisabled": false + }, + + { + "ParentCode": "App.Public", + "Code": "App.About", + "DisplayName": "App.About", + "Order": 1, + "Url": "/admin/list/list-about", + "Icon": "FcAbout", + "RequiredPermissionName": "App.About", + "IsDisabled": false + }, + { + "ParentCode": "App.Public", + "Code": "App.Services", + "DisplayName": "App.Services", + "Order": 2, + "Url": "/admin/list/list-service", + "Icon": "FcServices", + "RequiredPermissionName": "App.Services", + "IsDisabled": false + }, + { + "ParentCode": "App.Public", + "Code": "App.Orders.Products", + "DisplayName": "App.Orders.Products", + "Order": 3, + "Url": "/admin/list/list-product", + "Icon": "FcDiploma1", + "RequiredPermissionName": "App.Orders.Products", + "IsDisabled": false + }, + { + "ParentCode": "App.Public", + "Code": "App.Orders.PaymentMethods", + "DisplayName": "App.Orders.PaymentMethods", + "Order": 4, + "Url": "/admin/list/list-paymentmethod", + "Icon": "FcFeedIn", + "RequiredPermissionName": "App.Orders.PaymentMethods", + "IsDisabled": false + }, + { + "ParentCode": "App.Public", + "Code": "App.Orders.InstallmentOptions", + "DisplayName": "App.Orders.InstallmentOptions", + "Order": 5, + "Url": "/admin/list/list-installmentoption", + "Icon": "FcProcess", + "RequiredPermissionName": "App.Orders.InstallmentOptions", + "IsDisabled": false + }, + { + "ParentCode": "App.Public", + "Code": "App.Orders.PurchaseOrders", + "DisplayName": "App.Orders.PurchaseOrders", + "Order": 6, + "Url": "/admin/list/list-purchaseorder", + "Icon": "FcCollect", + "RequiredPermissionName": "App.Orders.PurchaseOrders", + "IsDisabled": false + }, + { + "ParentCode": "App.Public", + "Code": "App.BlogManagement.Category", + "DisplayName": "App.BlogManagement.Category", + "Order": 7, + "Url": "/admin/list/list-blogcategory", + "Icon": "FaCertificate", + "RequiredPermissionName": "App.BlogManagement.Category", + "IsDisabled": false + }, + { + "ParentCode": "App.Public", + "Code": "App.BlogManagement.Posts", + "DisplayName": "App.BlogManagement.Posts", + "Order": 8, + "Url": "/admin/list/list-blogpost", + "Icon": "FaWeixin", + "RequiredPermissionName": "App.BlogManagement.Posts", + "IsDisabled": false + }, + { + "ParentCode": "App.Public", + "Code": "App.Demos", + "DisplayName": "App.Demos", + "Order": 9, + "Url": "/admin/list/list-demo", + "Icon": "FcMissedCall", + "RequiredPermissionName": "App.Demos", + "IsDisabled": false + }, + { + "ParentCode": "App.Public", + "Code": "App.Contact", + "DisplayName": "App.Contact", + "Order": 10, + "Url": "/admin/list/list-contact", + "Icon": "FcContacts", + "RequiredPermissionName": "App.Contact", + "IsDisabled": false + }, { "ParentCode": null, "Code": "App.Participant", @@ -2281,13 +2273,23 @@ "RequiredPermissionName": "App.SupplyChain.Approval", "IsDisabled": false }, + { + "ParentCode": "App.SupplyChain", + "Code": "App.SupplyChain.RequestType", + "DisplayName": "App.SupplyChain.RequestType", + "Order": 10, + "Url": "/admin/list/list-requesttype", + "Icon": "FcWorkflow", + "RequiredPermissionName": "App.SupplyChain.RequestType", + "IsDisabled": false + }, { "ParentCode": "App.SupplyChain", "Code": "App.SupplyChain.Request", "DisplayName": "App.SupplyChain.Request", - "Order": 9, - "Url": "/admin/supplychain/requests", - "Icon": "FcServices", + "Order": 11, + "Url": "/admin/list/list-request", + "Icon": "FcDataSheet", "RequiredPermissionName": "App.SupplyChain.Request", "IsDisabled": false }, @@ -2295,7 +2297,7 @@ "ParentCode": "App.SupplyChain", "Code": "App.SupplyChain.Quotation", "DisplayName": "App.SupplyChain.Quotation", - "Order": 10, + "Order": 12, "Url": "/admin/supplychain/quotations", "Icon": "FcSurvey", "RequiredPermissionName": "App.SupplyChain.Quotation", @@ -2305,7 +2307,7 @@ "ParentCode": "App.SupplyChain", "Code": "App.SupplyChain.Order", "DisplayName": "App.SupplyChain.Order", - "Order": 11, + "Order": 13, "Url": "/admin/supplychain/orders", "Icon": "FcShop", "RequiredPermissionName": "App.SupplyChain.Order", @@ -2315,7 +2317,7 @@ "ParentCode": "App.SupplyChain", "Code": "App.SupplyChain.Delivery", "DisplayName": "App.SupplyChain.Delivery", - "Order": 12, + "Order": 14, "Url": "/admin/supplychain/delivery", "Icon": "FcShipped", "RequiredPermissionName": "App.SupplyChain.Delivery", diff --git a/api/src/Erp.Platform.DbMigrator/Seeds/PermissionsData.json b/api/src/Erp.Platform.DbMigrator/Seeds/PermissionsData.json index 1f6f7933..701e2401 100644 --- a/api/src/Erp.Platform.DbMigrator/Seeds/PermissionsData.json +++ b/api/src/Erp.Platform.DbMigrator/Seeds/PermissionsData.json @@ -6061,6 +6061,69 @@ "MultiTenancySide": 3, "MenuGroup": "Erp" }, + { + "GroupName": "App.SupplyChain", + "Name": "App.SupplyChain.RequestType", + "ParentName": null, + "DisplayName": "App.SupplyChain.RequestType", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.SupplyChain", + "Name": "App.SupplyChain.RequestType.Create", + "ParentName": "App.SupplyChain.RequestType", + "DisplayName": "Create", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.SupplyChain", + "Name": "App.SupplyChain.RequestType.Update", + "ParentName": "App.SupplyChain.RequestType", + "DisplayName": "Update", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.SupplyChain", + "Name": "App.SupplyChain.RequestType.Delete", + "ParentName": "App.SupplyChain.RequestType", + "DisplayName": "Delete", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.SupplyChain", + "Name": "App.SupplyChain.RequestType.Export", + "ParentName": "App.SupplyChain.RequestType", + "DisplayName": "Export", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.SupplyChain", + "Name": "App.SupplyChain.RequestType.Import", + "ParentName": "App.SupplyChain.RequestType", + "DisplayName": "Import", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.SupplyChain", + "Name": "App.SupplyChain.RequestType.Note", + "ParentName": "App.SupplyChain.RequestType", + "DisplayName": "Note", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, { "GroupName": "App.SupplyChain", "Name": "App.SupplyChain.Request", @@ -6124,6 +6187,69 @@ "MultiTenancySide": 3, "MenuGroup": "Erp" }, + { + "GroupName": "App.SupplyChain", + "Name": "App.SupplyChain.RequestItem", + "ParentName": null, + "DisplayName": "App.SupplyChain.RequestItem", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.SupplyChain", + "Name": "App.SupplyChain.RequestItem.Create", + "ParentName": "App.SupplyChain.RequestItem", + "DisplayName": "Create", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.SupplyChain", + "Name": "App.SupplyChain.RequestItem.Update", + "ParentName": "App.SupplyChain.RequestItem", + "DisplayName": "Update", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.SupplyChain", + "Name": "App.SupplyChain.RequestItem.Delete", + "ParentName": "App.SupplyChain.RequestItem", + "DisplayName": "Delete", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.SupplyChain", + "Name": "App.SupplyChain.RequestItem.Export", + "ParentName": "App.SupplyChain.RequestItem", + "DisplayName": "Export", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.SupplyChain", + "Name": "App.SupplyChain.RequestItem.Import", + "ParentName": "App.SupplyChain.RequestItem", + "DisplayName": "Import", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.SupplyChain", + "Name": "App.SupplyChain.RequestItem.Note", + "ParentName": "App.SupplyChain.RequestItem", + "DisplayName": "Note", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, { "GroupName": "App.SupplyChain", "Name": "App.SupplyChain.Quotation", @@ -9967,7 +10093,6 @@ "MultiTenancySide": 3, "MenuGroup": "Erp" }, - { "GroupName": "App.Crm", "Name": "App.Crm.OpportunityActivity", @@ -10031,7 +10156,6 @@ "MultiTenancySide": 3, "MenuGroup": "Erp" }, - { "GroupName": "App.Crm", "Name": "App.Crm.OpportunityCompetitor", @@ -10095,7 +10219,6 @@ "MultiTenancySide": 3, "MenuGroup": "Erp" }, - { "GroupName": "App.Crm", "Name": "App.Crm.Activities", @@ -11168,4 +11291,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 6c53bafd..e20bbd3a 100644 --- a/api/src/Erp.Platform.Domain.Shared/Enums/TableNameEnum.cs +++ b/api/src/Erp.Platform.Domain.Shared/Enums/TableNameEnum.cs @@ -140,6 +140,9 @@ public enum TableNameEnum PaymentTerm, SupplyType, SupplyCardType, + RequestType, + Request, + RequestItem, CustomerType, CustomerSegment, Partner, diff --git a/api/src/Erp.Platform.Domain.Shared/PlatformConsts.cs b/api/src/Erp.Platform.Domain.Shared/PlatformConsts.cs index 95605123..2b8bdfbd 100644 --- a/api/src/Erp.Platform.Domain.Shared/PlatformConsts.cs +++ b/api/src/Erp.Platform.Domain.Shared/PlatformConsts.cs @@ -514,6 +514,9 @@ public static class PlatformConsts public const string SupplyCardType = "list-supplycardtype"; public const string Approval = "list-approval"; public const string ApprovalStep = "list-approvalstep"; + public const string RequestType = "list-requesttype"; + public const string Request = "list-request"; + public const string RequestItem = "list-requestitem"; public const string PartnerBank = "list-partnerbank"; public const string PartnerCertificate = "list-partnercertificate"; @@ -764,6 +767,7 @@ public static class PlatformConsts public const string NewId = "@NEWID"; public const string Selected_Ids = "@SELECTED_IDS"; public const string TenantId = "@TENANTID"; + public const string AutoNumber = "@AUTONUMBER"; } public static class EditorTypes diff --git a/api/src/Erp.Platform.Domain.Shared/TableNameResolver.cs b/api/src/Erp.Platform.Domain.Shared/TableNameResolver.cs index dbff3050..a93ed1c5 100644 --- a/api/src/Erp.Platform.Domain.Shared/TableNameResolver.cs +++ b/api/src/Erp.Platform.Domain.Shared/TableNameResolver.cs @@ -173,6 +173,9 @@ public static class TableNameResolver { nameof(TableNameEnum.SupplyCardType), (TablePrefix.TenantByName, MenuPrefix.SupplyChain) }, { nameof(TableNameEnum.Approval), (TablePrefix.TenantByName, MenuPrefix.SupplyChain) }, { nameof(TableNameEnum.ApprovalStep), (TablePrefix.TenantByName, MenuPrefix.SupplyChain) }, + { nameof(TableNameEnum.RequestType), (TablePrefix.TenantByName, MenuPrefix.SupplyChain) }, + { nameof(TableNameEnum.Request), (TablePrefix.TenantByName, MenuPrefix.SupplyChain) }, + { nameof(TableNameEnum.RequestItem), (TablePrefix.TenantByName, MenuPrefix.SupplyChain) }, //Crm { nameof(TableNameEnum.CustomerSegment), (TablePrefix.TenantByName, MenuPrefix.Crm) }, diff --git a/api/src/Erp.Platform.Domain/Data/SeedConsts.cs b/api/src/Erp.Platform.Domain/Data/SeedConsts.cs index 24d935b3..cb81b69e 100644 --- a/api/src/Erp.Platform.Domain/Data/SeedConsts.cs +++ b/api/src/Erp.Platform.Domain/Data/SeedConsts.cs @@ -514,6 +514,9 @@ public static class SeedConsts public const string PartnerContact = Default + ".PartnerContact"; public const string Approval = Default + ".Approval"; public const string ApprovalStep = Default + ".ApprovalStep"; + public const string RequestType = Default + ".RequestType"; + public const string Request = Default + ".Request"; + public const string RequestItem = Default + ".RequestItem"; } public static class Accounting diff --git a/api/src/Erp.Platform.Domain/Entities/Tenant/Administration/Uom.cs b/api/src/Erp.Platform.Domain/Entities/Tenant/Administration/Uom.cs index 5862fc4a..30310a91 100644 --- a/api/src/Erp.Platform.Domain/Entities/Tenant/Administration/Uom.cs +++ b/api/src/Erp.Platform.Domain/Entities/Tenant/Administration/Uom.cs @@ -1,5 +1,4 @@ using System; -using System.Collections; using System.Collections.Generic; using Volo.Abp.Domain.Entities.Auditing; using Volo.Abp.MultiTenancy; diff --git a/api/src/Erp.Platform.Domain/Entities/Tenant/SupplyChain/Approval.cs b/api/src/Erp.Platform.Domain/Entities/Tenant/SupplyChain/Approval.cs index e85e6abb..0b8e11d3 100644 --- a/api/src/Erp.Platform.Domain/Entities/Tenant/SupplyChain/Approval.cs +++ b/api/src/Erp.Platform.Domain/Entities/Tenant/SupplyChain/Approval.cs @@ -11,11 +11,11 @@ public class Approval : FullAuditedEntity, IMultiTenant public string Name { get; set; } - public Guid DepartmentId { get; set; } - public Department Department { get; set; } - - public Guid MaterialTypeId { get; set; } - public MaterialType MaterialType { get; set; } + public Guid? DepartmentId { get; set; } + public Department? Department { get; set; } + + public Guid? MaterialTypeId { get; set; } + public MaterialType? MaterialType { get; set; } public decimal AmountThreshold { get; set; } public bool IsActive { get; set; } diff --git a/api/src/Erp.Platform.Domain/Entities/Tenant/SupplyChain/Request.cs b/api/src/Erp.Platform.Domain/Entities/Tenant/SupplyChain/Request.cs new file mode 100644 index 00000000..c82b6fb9 --- /dev/null +++ b/api/src/Erp.Platform.Domain/Entities/Tenant/SupplyChain/Request.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using Volo.Abp.Domain.Entities.Auditing; +using Volo.Abp.MultiTenancy; + +namespace Erp.Platform.Entities; + +public class Request : FullAuditedEntity, IMultiTenant +{ + public Guid? TenantId { get; set; } + + public string RequestNumber { get; set; } + + public Guid RequestTypeId { get; set; } + public RequestType RequestType { get; set; } + + public Guid DepartmentId { get; set; } + public Department Department { get; set; } + + public Guid EmployeeId { get; set; } + public Employee Employee { get; set; } + + public DateTime RequestDate { get; set; } + public DateTime? RequiredDate { get; set; } + + public string Priority { get; set; } + public string Status { get; set; } + public string Description { get; set; } + + public List Items { get; set; } = []; +} + diff --git a/api/src/Erp.Platform.Domain/Entities/Tenant/SupplyChain/RequestItem.cs b/api/src/Erp.Platform.Domain/Entities/Tenant/SupplyChain/RequestItem.cs new file mode 100644 index 00000000..36034a38 --- /dev/null +++ b/api/src/Erp.Platform.Domain/Entities/Tenant/SupplyChain/RequestItem.cs @@ -0,0 +1,24 @@ +using System; +using Volo.Abp.Domain.Entities.Auditing; +using Volo.Abp.MultiTenancy; + +namespace Erp.Platform.Entities; + +public class RequestItem : FullAuditedEntity, IMultiTenant +{ + public Guid? TenantId { get; set; } + + public Guid RequestId { get; set; } + public Request Request { get; set; } + + public Guid MaterialId { get; set; } + public Material Material { get; set; } + + public decimal Quantity { get; set; } + public Guid UomId { get; set; } + public Uom Uom { get; set; } + public decimal EstimatedPrice { get; set; } + public string Specification { get; set; } + public string Justification { get; set; } + public bool IsUrgent { get; set; } +} \ No newline at end of file diff --git a/api/src/Erp.Platform.Domain/Entities/Tenant/SupplyChain/RequestType.cs b/api/src/Erp.Platform.Domain/Entities/Tenant/SupplyChain/RequestType.cs new file mode 100644 index 00000000..d8ed5272 --- /dev/null +++ b/api/src/Erp.Platform.Domain/Entities/Tenant/SupplyChain/RequestType.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 RequestType : FullAuditedEntity, IMultiTenant +{ + public Guid? TenantId { get; set; } + + public string Name { get; set; } + public string Description { get; set; } + public bool IsActive { get; set; } + + public ICollection PurchaseRequests { get; set; } +} + diff --git a/api/src/Erp.Platform.Domain/Queries/DefaultValueManager.cs b/api/src/Erp.Platform.Domain/Queries/DefaultValueManager.cs index 7ff0b724..e17e32ba 100644 --- a/api/src/Erp.Platform.Domain/Queries/DefaultValueManager.cs +++ b/api/src/Erp.Platform.Domain/Queries/DefaultValueManager.cs @@ -73,15 +73,15 @@ public class DefaultValueManager : PlatformDomainService, IDefaultValueManager else if (field.Value == PlatformConsts.DefaultValues.Roles) value = CurrentUser.Roles; //.JoinAsString("','"); else if (field.Value == PlatformConsts.DefaultValues.Date) - value = Clock.Now.Date; + value = Clock.Now.Date; else if (field.Value == PlatformConsts.DefaultValues.Now) - value = Clock.Now; + value = Clock.Now; else if (field.Value == PlatformConsts.DefaultValues.Day) - value = Clock.Now.Day; + value = Clock.Now.Day; else if (field.Value == PlatformConsts.DefaultValues.Month) - value = Clock.Now.Month; + value = Clock.Now.Month; else if (field.Value == PlatformConsts.DefaultValues.Year) - value = Clock.Now.Year; + value = Clock.Now.Year; else if (field.Value == PlatformConsts.DefaultValues.Id) value = keys?.FirstOrDefault(); else if (field.Value == PlatformConsts.DefaultValues.NewId) @@ -90,6 +90,8 @@ public class DefaultValueManager : PlatformDomainService, IDefaultValueManager value = keys; else if (field.Value == PlatformConsts.DefaultValues.TenantId) value = CurrentTenant.Id; + else + value = field.Value; //TODO: artirilabilir break; case FieldCustomValueTypeEnum.QueryParams: diff --git a/api/src/Erp.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs b/api/src/Erp.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs index cc978f2f..4ffbd24a 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs @@ -209,11 +209,14 @@ public class PlatformDbContext : public DbSet SupplyTypes { get; set; } public DbSet SupplyCardTypes { get; set; } + public DbSet RequestTypes { get; set; } public DbSet CustomerTypes { get; set; } public DbSet CustomerSegments { get; set; } public DbSet Approvals { get; set; } public DbSet ApprovalSteps { get; set; } + public DbSet PurchaseRequests { get; set; } + public DbSet PurchaseRequestItems { get; set; } #endregion #region Crm @@ -2316,6 +2319,16 @@ public class PlatformDbContext : b.Property(x => x.IsActive).HasDefaultValue(true); }); + builder.Entity(b => + { + b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.RequestType)), 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.CustomerType)), Prefix.DbSchema); @@ -2609,7 +2622,7 @@ public class PlatformDbContext : b.HasOne(x => x.Opportunity) .WithMany(x => x.Activities) .HasForeignKey(x => x.OpportunityId) - .OnDelete(DeleteBehavior.Cascade); + .OnDelete(DeleteBehavior.Cascade); }); builder.Entity(b => @@ -2627,6 +2640,38 @@ public class PlatformDbContext : .HasForeignKey(x => x.OpportunityId) .OnDelete(DeleteBehavior.Cascade); }); + + builder.Entity(b => + { + b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Request)), Prefix.DbSchema); + b.ConfigureByConvention(); + + b.Property(x => x.RequestTypeId).IsRequired(); + b.Property(x => x.DepartmentId).IsRequired(); + b.Property(x => x.EmployeeId).IsRequired(); + b.Property(x => x.RequestDate).IsRequired(); + b.Property(x => x.Priority).IsRequired().HasMaxLength(20); + b.Property(x => x.Status).IsRequired().HasMaxLength(20); + b.Property(x => x.Description).HasMaxLength(200); + }); + + builder.Entity(b => + { + b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.RequestItem)), Prefix.DbSchema); + b.ConfigureByConvention(); + + b.Property(x => x.MaterialId).IsRequired(); + b.Property(x => x.Quantity).HasPrecision(18, 2).HasDefaultValue(0); + b.Property(x => x.UomId).IsRequired(); + b.Property(x => x.EstimatedPrice).HasPrecision(18, 2).HasDefaultValue(0); + b.Property(x => x.Specification).HasMaxLength(500); + b.Property(x => x.Justification).HasMaxLength(500); + + b.HasOne(x => x.Request) + .WithMany(x => x.Items) + .HasForeignKey(x => x.RequestId) + .OnDelete(DeleteBehavior.Cascade); + }); } } diff --git a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251114204400_Initial.Designer.cs b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251116194718_Initial.Designer.cs similarity index 98% rename from api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251114204400_Initial.Designer.cs rename to api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251116194718_Initial.Designer.cs index fd06e043..2053a291 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251114204400_Initial.Designer.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251116194718_Initial.Designer.cs @@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore; namespace Erp.Platform.Migrations { [DbContext(typeof(PlatformDbContext))] - [Migration("20251114204400_Initial")] + [Migration("20251116194718_Initial")] partial class Initial { /// @@ -8718,6 +8718,228 @@ namespace Erp.Platform.Migrations b.ToTable("Sas_T_ReportTemplate", (string)null); }); + modelBuilder.Entity("Erp.Platform.Entities.Request", 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("DepartmentId") + .HasColumnType("uniqueidentifier"); + + b.Property("Description") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + 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("Priority") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("RequestDate") + .HasColumnType("datetime2"); + + b.Property("RequestNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("RequestTypeId") + .HasColumnType("uniqueidentifier"); + + b.Property("RequiredDate") + .HasColumnType("datetime2"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("DepartmentId"); + + b.HasIndex("EmployeeId"); + + b.HasIndex("RequestTypeId"); + + b.ToTable("Scp_T_Request", (string)null); + }); + + modelBuilder.Entity("Erp.Platform.Entities.RequestItem", 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("EstimatedPrice") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsUrgent") + .HasColumnType("bit"); + + b.Property("Justification") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialId") + .HasColumnType("uniqueidentifier"); + + b.Property("Quantity") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); + + b.Property("RequestId") + .HasColumnType("uniqueidentifier"); + + b.Property("Specification") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("UomId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("MaterialId"); + + b.HasIndex("RequestId"); + + b.HasIndex("UomId"); + + b.ToTable("Scp_T_RequestItem", (string)null); + }); + + modelBuilder.Entity("Erp.Platform.Entities.RequestType", 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("Scp_T_RequestType", (string)null); + }); + modelBuilder.Entity("Erp.Platform.Entities.Reservation", b => { b.Property("Id") @@ -13153,7 +13375,7 @@ namespace Erp.Platform.Migrations modelBuilder.Entity("Erp.Platform.Entities.Activity", b => { b.HasOne("Erp.Platform.Entities.Opportunity", "Opportunity") - .WithMany("Actions") + .WithMany("Activities") .HasForeignKey("OpportunityId") .OnDelete(DeleteBehavior.Cascade); @@ -13968,6 +14190,60 @@ namespace Erp.Platform.Migrations b.Navigation("ReportCategory"); }); + modelBuilder.Entity("Erp.Platform.Entities.Request", b => + { + b.HasOne("Erp.Platform.Entities.Department", "Department") + .WithMany() + .HasForeignKey("DepartmentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Erp.Platform.Entities.Employee", "Employee") + .WithMany() + .HasForeignKey("EmployeeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Erp.Platform.Entities.RequestType", "RequestType") + .WithMany("PurchaseRequests") + .HasForeignKey("RequestTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Department"); + + b.Navigation("Employee"); + + b.Navigation("RequestType"); + }); + + modelBuilder.Entity("Erp.Platform.Entities.RequestItem", b => + { + b.HasOne("Erp.Platform.Entities.Material", "Material") + .WithMany() + .HasForeignKey("MaterialId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Erp.Platform.Entities.Request", "Request") + .WithMany("Items") + .HasForeignKey("RequestId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Erp.Platform.Entities.Uom", "Uom") + .WithMany() + .HasForeignKey("UomId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Material"); + + b.Navigation("Request"); + + b.Navigation("Uom"); + }); + modelBuilder.Entity("Erp.Platform.Entities.Reservation", b => { b.HasOne("Erp.Platform.Entities.Employee", "Employee") @@ -14534,7 +14810,7 @@ namespace Erp.Platform.Migrations modelBuilder.Entity("Erp.Platform.Entities.Opportunity", b => { - b.Navigation("Actions"); + b.Navigation("Activities"); b.Navigation("Competitors"); }); @@ -14587,6 +14863,16 @@ namespace Erp.Platform.Migrations b.Navigation("Parameters"); }); + modelBuilder.Entity("Erp.Platform.Entities.Request", b => + { + b.Navigation("Items"); + }); + + modelBuilder.Entity("Erp.Platform.Entities.RequestType", b => + { + b.Navigation("PurchaseRequests"); + }); + modelBuilder.Entity("Erp.Platform.Entities.Schedule", b => { b.Navigation("Lessons"); diff --git a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251114204400_Initial.cs b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251116194718_Initial.cs similarity index 98% rename from api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251114204400_Initial.cs rename to api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251116194718_Initial.cs index f126fbf1..f9176ee4 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251114204400_Initial.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251116194718_Initial.cs @@ -2370,6 +2370,28 @@ namespace Erp.Platform.Migrations table.PrimaryKey("PK_Scp_T_PaymentTerm", x => x.Id); }); + migrationBuilder.CreateTable( + name: "Scp_T_RequestType", + 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_Scp_T_RequestType", x => x.Id); + }); + migrationBuilder.CreateTable( name: "Scp_T_SupplyCardType", columns: table => new @@ -5221,6 +5243,52 @@ namespace Erp.Platform.Migrations onDelete: ReferentialAction.Restrict); }); + migrationBuilder.CreateTable( + name: "Scp_T_Request", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + RequestNumber = table.Column(type: "nvarchar(max)", nullable: true), + RequestTypeId = table.Column(type: "uniqueidentifier", nullable: false), + DepartmentId = table.Column(type: "uniqueidentifier", nullable: false), + EmployeeId = table.Column(type: "uniqueidentifier", nullable: false), + RequestDate = table.Column(type: "datetime2", nullable: false), + RequiredDate = table.Column(type: "datetime2", nullable: true), + Priority = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: false), + Status = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: false), + Description = table.Column(type: "nvarchar(200)", maxLength: 200, 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_Scp_T_Request", x => x.Id); + table.ForeignKey( + name: "FK_Scp_T_Request_Hr_T_Department_DepartmentId", + column: x => x.DepartmentId, + principalTable: "Hr_T_Department", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_Scp_T_Request_Hr_T_Employee_EmployeeId", + column: x => x.EmployeeId, + principalTable: "Hr_T_Employee", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_Scp_T_Request_Scp_T_RequestType_RequestTypeId", + column: x => x.RequestTypeId, + principalTable: "Scp_T_RequestType", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + migrationBuilder.CreateTable( name: "Hr_T_SurveyAnswer", columns: table => new @@ -5440,6 +5508,51 @@ namespace Erp.Platform.Migrations onDelete: ReferentialAction.Cascade); }); + migrationBuilder.CreateTable( + name: "Scp_T_RequestItem", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + RequestId = table.Column(type: "uniqueidentifier", nullable: false), + MaterialId = table.Column(type: "uniqueidentifier", nullable: false), + Quantity = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m), + UomId = table.Column(type: "uniqueidentifier", nullable: false), + EstimatedPrice = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m), + Specification = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), + Justification = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), + IsUrgent = table.Column(type: "bit", nullable: false), + 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_Scp_T_RequestItem", x => x.Id); + table.ForeignKey( + name: "FK_Scp_T_RequestItem_Adm_T_Uom_UomId", + column: x => x.UomId, + principalTable: "Adm_T_Uom", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_Scp_T_RequestItem_Scp_T_Material_MaterialId", + column: x => x.MaterialId, + principalTable: "Scp_T_Material", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_Scp_T_RequestItem_Scp_T_Request_RequestId", + column: x => x.RequestId, + principalTable: "Scp_T_Request", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + migrationBuilder.CreateTable( name: "Net_T_SocialPollOption", columns: table => new @@ -6444,6 +6557,36 @@ namespace Erp.Platform.Migrations table: "Scp_T_MaterialSpecification", column: "UnitId"); + migrationBuilder.CreateIndex( + name: "IX_Scp_T_Request_DepartmentId", + table: "Scp_T_Request", + column: "DepartmentId"); + + migrationBuilder.CreateIndex( + name: "IX_Scp_T_Request_EmployeeId", + table: "Scp_T_Request", + column: "EmployeeId"); + + migrationBuilder.CreateIndex( + name: "IX_Scp_T_Request_RequestTypeId", + table: "Scp_T_Request", + column: "RequestTypeId"); + + migrationBuilder.CreateIndex( + name: "IX_Scp_T_RequestItem_MaterialId", + table: "Scp_T_RequestItem", + column: "MaterialId"); + + migrationBuilder.CreateIndex( + name: "IX_Scp_T_RequestItem_RequestId", + table: "Scp_T_RequestItem", + column: "RequestId"); + + migrationBuilder.CreateIndex( + name: "IX_Scp_T_RequestItem_UomId", + table: "Scp_T_RequestItem", + column: "UomId"); + migrationBuilder.AddForeignKey( name: "FK_Adm_T_BlogPost_Hr_T_Employee_EmployeeId", table: "Adm_T_BlogPost", @@ -6901,6 +7044,9 @@ namespace Erp.Platform.Migrations migrationBuilder.DropTable( name: "Scp_T_MaterialSpecification"); + migrationBuilder.DropTable( + name: "Scp_T_RequestItem"); + migrationBuilder.DropTable( name: "AbpEntityChanges"); @@ -6997,6 +7143,9 @@ namespace Erp.Platform.Migrations migrationBuilder.DropTable( name: "Scp_T_Approval"); + migrationBuilder.DropTable( + name: "Scp_T_Request"); + migrationBuilder.DropTable( name: "AbpAuditLogs"); @@ -7060,6 +7209,9 @@ namespace Erp.Platform.Migrations migrationBuilder.DropTable( name: "Sas_T_ReportCategory"); + migrationBuilder.DropTable( + name: "Scp_T_RequestType"); + migrationBuilder.DropTable( name: "Sas_T_Branch"); diff --git a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs index e598a025..e0d8ccf1 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs @@ -8715,6 +8715,228 @@ namespace Erp.Platform.Migrations b.ToTable("Sas_T_ReportTemplate", (string)null); }); + modelBuilder.Entity("Erp.Platform.Entities.Request", 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("DepartmentId") + .HasColumnType("uniqueidentifier"); + + b.Property("Description") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + 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("Priority") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("RequestDate") + .HasColumnType("datetime2"); + + b.Property("RequestNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("RequestTypeId") + .HasColumnType("uniqueidentifier"); + + b.Property("RequiredDate") + .HasColumnType("datetime2"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("DepartmentId"); + + b.HasIndex("EmployeeId"); + + b.HasIndex("RequestTypeId"); + + b.ToTable("Scp_T_Request", (string)null); + }); + + modelBuilder.Entity("Erp.Platform.Entities.RequestItem", 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("EstimatedPrice") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsUrgent") + .HasColumnType("bit"); + + b.Property("Justification") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialId") + .HasColumnType("uniqueidentifier"); + + b.Property("Quantity") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); + + b.Property("RequestId") + .HasColumnType("uniqueidentifier"); + + b.Property("Specification") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("UomId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("MaterialId"); + + b.HasIndex("RequestId"); + + b.HasIndex("UomId"); + + b.ToTable("Scp_T_RequestItem", (string)null); + }); + + modelBuilder.Entity("Erp.Platform.Entities.RequestType", 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("Scp_T_RequestType", (string)null); + }); + modelBuilder.Entity("Erp.Platform.Entities.Reservation", b => { b.Property("Id") @@ -13150,7 +13372,7 @@ namespace Erp.Platform.Migrations modelBuilder.Entity("Erp.Platform.Entities.Activity", b => { b.HasOne("Erp.Platform.Entities.Opportunity", "Opportunity") - .WithMany("Actions") + .WithMany("Activities") .HasForeignKey("OpportunityId") .OnDelete(DeleteBehavior.Cascade); @@ -13965,6 +14187,60 @@ namespace Erp.Platform.Migrations b.Navigation("ReportCategory"); }); + modelBuilder.Entity("Erp.Platform.Entities.Request", b => + { + b.HasOne("Erp.Platform.Entities.Department", "Department") + .WithMany() + .HasForeignKey("DepartmentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Erp.Platform.Entities.Employee", "Employee") + .WithMany() + .HasForeignKey("EmployeeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Erp.Platform.Entities.RequestType", "RequestType") + .WithMany("PurchaseRequests") + .HasForeignKey("RequestTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Department"); + + b.Navigation("Employee"); + + b.Navigation("RequestType"); + }); + + modelBuilder.Entity("Erp.Platform.Entities.RequestItem", b => + { + b.HasOne("Erp.Platform.Entities.Material", "Material") + .WithMany() + .HasForeignKey("MaterialId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Erp.Platform.Entities.Request", "Request") + .WithMany("Items") + .HasForeignKey("RequestId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Erp.Platform.Entities.Uom", "Uom") + .WithMany() + .HasForeignKey("UomId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Material"); + + b.Navigation("Request"); + + b.Navigation("Uom"); + }); + modelBuilder.Entity("Erp.Platform.Entities.Reservation", b => { b.HasOne("Erp.Platform.Entities.Employee", "Employee") @@ -14531,7 +14807,7 @@ namespace Erp.Platform.Migrations modelBuilder.Entity("Erp.Platform.Entities.Opportunity", b => { - b.Navigation("Actions"); + b.Navigation("Activities"); b.Navigation("Competitors"); }); @@ -14584,6 +14860,16 @@ namespace Erp.Platform.Migrations b.Navigation("Parameters"); }); + modelBuilder.Entity("Erp.Platform.Entities.Request", b => + { + b.Navigation("Items"); + }); + + modelBuilder.Entity("Erp.Platform.Entities.RequestType", b => + { + b.Navigation("PurchaseRequests"); + }); + modelBuilder.Entity("Erp.Platform.Entities.Schedule", b => { b.Navigation("Lessons"); diff --git a/api/src/Erp.Platform.EntityFrameworkCore/Tenants/Seeds/TenantData.json b/api/src/Erp.Platform.EntityFrameworkCore/Tenants/Seeds/TenantData.json index 3c28ca75..e4bcc108 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Tenants/Seeds/TenantData.json +++ b/api/src/Erp.Platform.EntityFrameworkCore/Tenants/Seeds/TenantData.json @@ -100,7 +100,9 @@ "props": null, "description": null, "isActive": true, - "dependencies": ["DynamicEntityComponent"] + "dependencies": [ + "DynamicEntityComponent" + ] } ], "ReportCategories": [ @@ -2406,7 +2408,12 @@ "minSalary": 80000, "maxSalary": 120000, "currencyCode": "USD", - "requiredSkills": ["JavaScript", "TypeScript", "React", "Node.js"], + "requiredSkills": [ + "JavaScript", + "TypeScript", + "React", + "Node.js" + ], "responsibilities": [ "Develop frontend and backend applications", "Write clean and maintainable code", @@ -4101,7 +4108,9 @@ { "postContent": "CI/CD pipeline güncellememiz tamamlandı! Deployment süremiz %40 azaldı. Otomasyonun gücü 💪", "type": "video", - "urls": ["https://www.w3schools.com/html/mov_bbb.mp4"] + "urls": [ + "https://www.w3schools.com/html/mov_bbb.mp4" + ] } ], "SocialPollOptions": [ @@ -4764,5 +4773,43 @@ { "displayName": "Satış Takımı" } + ], + "RequestTypes": [ + { + "name": "Material", + "description": "Malzeme talepleri için kullanılır", + "isActive": true + }, + { + "name": "Service", + "description": "Hizmet talepleri için kullanılır", + "isActive": true + }, + { + "name": "WorkCenter", + "description": "İş merkezi talepleri için kullanılır", + "isActive": true + }, + { + "name": "Maintenance", + "description": "Bakım talepleri için kullanılır", + "isActive": true + } + ], + "Approvals": [ + { + "name": "Üretim Malzeme Onayı", + "departmentCode": "ÜRT", + "materialTypeCode": "RAW", + "amountThreshold": "5000", + "isActive": true + }, + { + "name": "Kalite Kontrol Malzeme Onayı", + "departmentCode": "KAL", + "materialTypeCode": "CONSUMABLE", + "amountThreshold": "100000", + "isActive": true + } ] -} +} \ No newline at end of file diff --git a/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantDataSeeder.cs b/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantDataSeeder.cs index d8daf79e..13b0dfdf 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantDataSeeder.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantDataSeeder.cs @@ -104,6 +104,8 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency private readonly IRepository _lossReasonRepository; private readonly IRepository _organizationUnitRepository; private readonly OrganizationUnitManager _organizationUnitManager; + private readonly IRepository _requestTypeRepository; + private readonly IRepository _approvalRepository; public TenantDataSeeder( IClock clock, @@ -190,7 +192,9 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency IRepository partnerRepository, IRepository lossReasonRepository, IRepository organizationUnitRepository, - OrganizationUnitManager organizationUnitManager + OrganizationUnitManager organizationUnitManager, + IRepository requestTypeRepository, + IRepository approvalRepository ) { _clock = clock; @@ -279,6 +283,8 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency _partnerRepository = partnerRepository; _organizationUnitRepository = organizationUnitRepository; _organizationUnitManager = organizationUnitManager; + _requestTypeRepository = requestTypeRepository; + _approvalRepository = approvalRepository; } private static IConfigurationRoot BuildConfiguration() @@ -1872,6 +1878,39 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency DisplayName = item.DisplayName }); } + + foreach (var item in items.RequestTypes) + { + var exists = await _requestTypeRepository.AnyAsync(x => x.Name == item.Name); + if (exists) + continue; + + await _requestTypeRepository.InsertAsync(new RequestType + { + Name = item.Name, + Description = item.Description, + IsActive = item.IsActive + }); + } + + foreach (var item in items.Approvals) + { + var exists = await _approvalRepository.AnyAsync(x => x.Name == item.Name); + if (exists) + continue; + + var department = await _departmentRepository.FirstOrDefaultAsync(x => x.Code == item.DepartmentCode); + var materialType = await _materialTypeRepository.FirstOrDefaultAsync(x => x.Code == item.MaterialTypeCode); + + await _approvalRepository.InsertAsync(new Approval + { + Name = item.Name, + DepartmentId = department?.Id, + MaterialTypeId = materialType?.Id, + AmountThreshold = item.AmountThreshold, + IsActive = item.IsActive + }); + } } } diff --git a/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantSeederDto.cs b/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantSeederDto.cs index 0b5ff1a7..708024b0 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantSeederDto.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantSeederDto.cs @@ -87,6 +87,8 @@ public class TenantSeederDto public List PaymentTerms { get; set; } public List SupplyTypes { get; set; } public List SupplyCardTypes { get; set; } + public List RequestTypes { get; set; } + public List Approvals { get; set; } //Crm public List Partners { get; set; } @@ -96,6 +98,22 @@ public class TenantSeederDto public List OrganizationUnits { get; set; } } +public class ApprovalSeedDto +{ + public string Name { get; set; } + public string DepartmentCode { get; set; } + public string MaterialTypeCode { get; set; } + public decimal AmountThreshold { get; set; } + public bool IsActive { get; set; } +} + +public class RequestTypeSeedDto +{ + public string Name { get; set; } + public string Description { get; set; } + public bool IsActive { get; set; } +} + public class OrganizationUnitSeedDto { public string DisplayName { get; set; } diff --git a/ui/src/assets/styles/components/_menu-item.css b/ui/src/assets/styles/components/_menu-item.css index 1cf7f936..09e218dc 100644 --- a/ui/src/assets/styles/components/_menu-item.css +++ b/ui/src/assets/styles/components/_menu-item.css @@ -1,5 +1,5 @@ .menu-item { - @apply cursor-pointer font-medium rounded-md flex items-center w-full whitespace-nowrap px-1.5; + @apply cursor-pointer font-medium rounded-md flex items-center w-full whitespace-nowrap px-1; &.menu-item-light { @apply text-gray-600; diff --git a/ui/src/views/list/Grid.tsx b/ui/src/views/list/Grid.tsx index e4f85592..60b7c266 100644 --- a/ui/src/views/list/Grid.tsx +++ b/ui/src/views/list/Grid.tsx @@ -277,8 +277,23 @@ const Grid = (props: GridProps) => { // Grid'den gelen columnFormat'ları kullanarak default değerleri set et if (colFormat.defaultValue != null) { - console.log('Setting default value for', colFormat.fieldName, colFormat.defaultValue) - e.data[colFormat.fieldName] = colFormat.defaultValue + if (typeof colFormat.defaultValue === 'string' && colFormat.defaultValue === '@AUTONUMBER') { + const now = new Date() + const pad = (n: number, width: number) => n.toString().padStart(width, '0') + + const autoNumber = + `${now.getFullYear()}` + + `${pad(now.getMonth() + 1, 2)}` + + `${pad(now.getDate(), 2)}` + + `${pad(now.getHours(), 2)}` + + `${pad(now.getMinutes(), 2)}` + + `${pad(now.getSeconds(), 2)}` + + `${pad(now.getMilliseconds(), 3)}` + + e.data[colFormat.fieldName] = autoNumber + } else { + e.data[colFormat.fieldName] = colFormat.defaultValue + } } // ExtraFilters içerisinde ilgili Field varsa, default değerleri set etme