From db0b19d919ebf31f901b355d5d9c96b4dac7b91a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sedat=20=C3=96ZT=C3=9CRK?= <76204082+iamsedatozturk@users.noreply.github.com> Date: Wed, 10 Dec 2025 14:16:39 +0300 Subject: [PATCH] Mrp Production Orders --- .../Seeds/LanguagesData.json | 18 + .../Seeds/ListFormSeeder_Crm.cs | 6 +- .../Seeds/ListFormSeeder_Mrp.cs | 907 +++++++++++++++++- .../Seeds/MenusData.json | 186 ++-- .../Seeds/PermissionsData.json | 193 ++++ .../Enums/TableNameEnum.cs | 6 +- .../TableNameResolver.cs | 4 + .../Erp.Platform.Domain/Data/SeedConsts.cs | 4 + .../Entities/Tenant/Mrp/ProductionOrder.cs | 36 + .../Tenant/Mrp/ProductionOrderItem.cs | 26 + .../Tenant/Mrp/ProductionOrderStatus.cs | 17 + .../Tenant/Mrp/ProductionOrderType.cs | 17 + .../Entities/Tenant/SupplyChain/Material.cs | 1 + .../EntityFrameworkCore/PlatformDbContext.cs | 99 +- ....cs => 20251210103609_Initial.Designer.cs} | 393 +++++++- ...6_Initial.cs => 20251210103609_Initial.cs} | 186 +++- .../PlatformDbContextModelSnapshot.cs | 391 ++++++++ .../Tenants/Seeds/TenantData.json | 73 +- .../Tenants/TenantDataSeeder.cs | 37 +- .../Tenants/TenantSeederDto.cs | 16 + .../mrp/components/ProductionOrderList.tsx | 1 - 21 files changed, 2446 insertions(+), 171 deletions(-) create mode 100644 api/src/Erp.Platform.Domain/Entities/Tenant/Mrp/ProductionOrder.cs create mode 100644 api/src/Erp.Platform.Domain/Entities/Tenant/Mrp/ProductionOrderItem.cs create mode 100644 api/src/Erp.Platform.Domain/Entities/Tenant/Mrp/ProductionOrderStatus.cs create mode 100644 api/src/Erp.Platform.Domain/Entities/Tenant/Mrp/ProductionOrderType.cs rename api/src/Erp.Platform.EntityFrameworkCore/Migrations/{20251210070936_Initial.Designer.cs => 20251210103609_Initial.Designer.cs} (98%) rename api/src/Erp.Platform.EntityFrameworkCore/Migrations/{20251210070936_Initial.cs => 20251210103609_Initial.cs} (98%) diff --git a/api/src/Erp.Platform.DbMigrator/Seeds/LanguagesData.json b/api/src/Erp.Platform.DbMigrator/Seeds/LanguagesData.json index 79de855e..7c55974f 100644 --- a/api/src/Erp.Platform.DbMigrator/Seeds/LanguagesData.json +++ b/api/src/Erp.Platform.DbMigrator/Seeds/LanguagesData.json @@ -10129,12 +10129,30 @@ "tr": "Ürün Ağaçları Operasyonları", "en": "Bill of Materials Operations" }, + { + "resourceName": "Platform", + "key": "App.Mrp.ProductionOrderType", + "tr": "Sipariş Türleri", + "en": "Order Types" + }, + { + "resourceName": "Platform", + "key": "App.Mrp.ProductionOrderStatus", + "tr": "Sipariş Durumları", + "en": "Order Statuses" + }, { "resourceName": "Platform", "key": "App.Mrp.ProductionOrder", "tr": "Üretim Emirleri", "en": "Production Orders" }, + { + "resourceName": "Platform", + "key": "App.Mrp.ProductionOrderItem", + "tr": "Üretim Emri Ürünleri", + "en": "Production Order Items" + }, { "resourceName": "Platform", "key": "App.Mrp.WorkOrder", diff --git a/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Crm.cs b/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Crm.cs index 727d9ffa..1f5fe6f6 100644 --- a/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Crm.cs +++ b/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Crm.cs @@ -2455,8 +2455,8 @@ public class ListFormSeeder_Crm : IDataSeedContributor, ITransientDependency new EditingFormItemDto { Order = 1, DataField="OrderNumber", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox, EditorOptions = EditorOptionValues.Disabled }, new EditingFormItemDto { Order = 2, DataField="OrderDate", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxDateBox, EditorOptions = EditorOptionValues.DateFormat }, new EditingFormItemDto { Order = 3, DataField="CustomerId", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, - new EditingFormItemDto { Order = 4, DataField="RequestedDeliveryDate", ColSpan = 1, EditorType2 = EditorTypes.dxDateBox, EditorOptions = EditorOptionValues.DateFormat }, - new EditingFormItemDto { Order = 5, DataField="ConfirmedDeliveryDate", ColSpan = 1, EditorType2 = EditorTypes.dxDateBox, EditorOptions = EditorOptionValues.DateFormat }, + new EditingFormItemDto { Order = 4, DataField="RequestedDeliveryDate", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxDateBox, EditorOptions = EditorOptionValues.DateFormat }, + new EditingFormItemDto { Order = 5, DataField="ConfirmedDeliveryDate", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxDateBox, EditorOptions = EditorOptionValues.DateFormat }, new EditingFormItemDto { Order = 6, DataField="Status", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, new EditingFormItemDto { Order = 7, DataField="Currency", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, new EditingFormItemDto { Order = 8, DataField="PaymentTermId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, @@ -2574,6 +2574,7 @@ public class ListFormSeeder_Crm : IDataSeedContributor, ITransientDependency IsActive = true, IsDeleted = false, AllowSearch = true, + ValidationRuleJson = DefaultValidationRuleRequiredJson, ColumnCustomizationJson = DefaultColumnCustomizationJson, PermissionJson = DefaultFieldPermissionJson(listForm.Name), PivotSettingsJson = DefaultPivotSettingsJson @@ -2589,6 +2590,7 @@ public class ListFormSeeder_Crm : IDataSeedContributor, ITransientDependency IsActive = true, IsDeleted = false, AllowSearch = true, + ValidationRuleJson = DefaultValidationRuleRequiredJson, ColumnCustomizationJson = DefaultColumnCustomizationJson, PermissionJson = DefaultFieldPermissionJson(listForm.Name), PivotSettingsJson = DefaultPivotSettingsJson diff --git a/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Mrp.cs b/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Mrp.cs index 35fff374..25e9fb5f 100644 --- a/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Mrp.cs +++ b/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Mrp.cs @@ -53,7 +53,8 @@ public class ListFormSeeder_Mrp : IDataSeedContributor, ITransientDependency var listForm = await _listFormRepository.InsertAsync( new ListForm() { - ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson, + ListFormType = ListFormTypeEnum.List, + ExportJson = DefaultExportJson, IsSubForm = false, ShowNote = true, LayoutJson = DefaultLayoutJson(), @@ -175,7 +176,8 @@ public class ListFormSeeder_Mrp : IDataSeedContributor, ITransientDependency var listForm = await _listFormRepository.InsertAsync( new ListForm() { - ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson, + ListFormType = ListFormTypeEnum.List, + ExportJson = DefaultExportJson, IsSubForm = false, ShowNote = true, LayoutJson = DefaultLayoutJson(), @@ -404,7 +406,8 @@ public class ListFormSeeder_Mrp : IDataSeedContributor, ITransientDependency var listForm = await _listFormRepository.InsertAsync( new ListForm() { - ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson, + ListFormType = ListFormTypeEnum.List, + ExportJson = DefaultExportJson, IsSubForm = false, ShowNote = true, LayoutJson = DefaultLayoutJson(), @@ -714,7 +717,8 @@ public class ListFormSeeder_Mrp : IDataSeedContributor, ITransientDependency var listForm = await _listFormRepository.InsertAsync( new ListForm() { - ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson, + ListFormType = ListFormTypeEnum.List, + ExportJson = DefaultExportJson, IsSubForm = false, ShowNote = true, LayoutJson = DefaultLayoutJson(), @@ -836,7 +840,8 @@ public class ListFormSeeder_Mrp : IDataSeedContributor, ITransientDependency var listForm = await _listFormRepository.InsertAsync( new ListForm() { - ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson, + ListFormType = ListFormTypeEnum.List, + ExportJson = DefaultExportJson, IsSubForm = false, ShowNote = true, LayoutJson = DefaultLayoutJson(), @@ -1057,7 +1062,8 @@ public class ListFormSeeder_Mrp : IDataSeedContributor, ITransientDependency var listForm = await _listFormRepository.InsertAsync( new ListForm() { - ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson, + ListFormType = ListFormTypeEnum.List, + ExportJson = DefaultExportJson, IsSubForm = false, ShowNote = true, LayoutJson = DefaultLayoutJson(), @@ -1302,7 +1308,8 @@ public class ListFormSeeder_Mrp : IDataSeedContributor, ITransientDependency var listForm = await _listFormRepository.InsertAsync( new ListForm() { - ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson, + ListFormType = ListFormTypeEnum.List, + ExportJson = DefaultExportJson, IsSubForm = false, ShowNote = true, LayoutJson = DefaultLayoutJson(), @@ -1566,6 +1573,888 @@ public class ListFormSeeder_Mrp : IDataSeedContributor, ITransientDependency } }) ); - } -} + #region Order Type + listFormName = AppCodes.Mrp.ProductionOrderType; + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName)) + { + var listForm = await _listFormRepository.InsertAsync( + new ListForm() + { + ListFormType = ListFormTypeEnum.List, + ExportJson = DefaultExportJson, + IsSubForm = false, + ShowNote = true, + LayoutJson = DefaultLayoutJson(), + CultureName = LanguageCodes.En, + ListFormCode = listFormName, + Name = listFormName, + Title = listFormName, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = true, + IsBranch = false, + IsOrganizationUnit = false, + Description = listFormName, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.ProductionOrderType)), + KeyFieldName = "Id", + KeyFieldDbSourceType = DbType.Guid, + DefaultFilter = DefaultFilterJson, + SortMode = GridOptions.SortModeSingle, + FilterRowJson = DefaultFilterRowJson, + HeaderFilterJson = DefaultHeaderFilterJson, + SearchPanelJson = DefaultSearchPanelJson, + GroupPanelJson = DefaultGroupPanelJson, + SelectionJson = DefaultSelectionSingleJson, + ColumnOptionJson = DefaultColumnOptionJson, + PermissionJson = DefaultPermissionJson(listFormName), + DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.ProductionOrderType)), + DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson, + PagerOptionJson = DefaultPagerOptionJson, + InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson, + EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 250, true, true, true, true, false), + 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 Production Order Type Fields + await _listFormFieldRepository.InsertManyAsync([ + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + Width = 100, + ListOrderNo = 1, + Visible = false, + IsActive = true, + IsDeleted = false, + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Name", + Width = 350, + ListOrderNo = 3, + Visible = true, + IsActive = true, + IsDeleted = false, + SortIndex = 1, + SortDirection = GridColumnOptions.SortOrderAsc, + 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 = 4, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Boolean, + FieldName = "IsActive", + Width = 100, + ListOrderNo = 5, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + } + ]); + #endregion + } + #endregion + + #region Production Order Status + listFormName = AppCodes.Mrp.ProductionOrderStatus; + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName)) + { + var listForm = await _listFormRepository.InsertAsync( + new ListForm() + { + ListFormType = ListFormTypeEnum.List, + ExportJson = DefaultExportJson, + IsSubForm = false, + ShowNote = true, + LayoutJson = DefaultLayoutJson(), + CultureName = LanguageCodes.En, + ListFormCode = listFormName, + Name = listFormName, + Title = listFormName, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = true, + IsBranch = false, + IsOrganizationUnit = false, + Description = listFormName, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.OrderStatus)), + KeyFieldName = "Id", + KeyFieldDbSourceType = DbType.Guid, + DefaultFilter = DefaultFilterJson, + SortMode = GridOptions.SortModeSingle, + FilterRowJson = DefaultFilterRowJson, + HeaderFilterJson = DefaultHeaderFilterJson, + SearchPanelJson = DefaultSearchPanelJson, + GroupPanelJson = DefaultGroupPanelJson, + SelectionJson = DefaultSelectionSingleJson, + ColumnOptionJson = DefaultColumnOptionJson, + PermissionJson = DefaultPermissionJson(listFormName), + DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.OrderStatus)), + DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson, + PagerOptionJson = DefaultPagerOptionJson, + InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson, + EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 250, true, true, true, true, false), + 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 Production Order Status Fields + await _listFormFieldRepository.InsertManyAsync([ + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + Width = 100, + ListOrderNo = 1, + Visible = false, + IsActive = true, + IsDeleted = false, + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Name", + Width = 350, + ListOrderNo = 3, + Visible = true, + IsActive = true, + IsDeleted = false, + SortIndex = 1, + SortDirection = GridColumnOptions.SortOrderAsc, + 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 = 4, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Boolean, + FieldName = "IsActive", + Width = 100, + ListOrderNo = 5, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + } + ]); + #endregion + } + #endregion + + #region Production Order + listFormName = AppCodes.Mrp.ProductionOrder; + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName)) + { + var listForm = await _listFormRepository.InsertAsync( + new ListForm() + { + ListFormType = ListFormTypeEnum.List, + ExportJson = DefaultExportJson, + IsSubForm = false, + ShowNote = true, + LayoutJson = DefaultLayoutJson(), + CultureName = LanguageCodes.En, + ListFormCode = listFormName, + Name = listFormName, + Title = listFormName, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = true, + IsBranch = false, + IsOrganizationUnit = false, + Description = listFormName, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.ProductionOrder)), + KeyFieldName = "Id", + KeyFieldDbSourceType = DbType.Guid, + DefaultFilter = DefaultFilterJson, + SortMode = GridOptions.SortModeSingle, + FilterRowJson = DefaultFilterRowJson, + HeaderFilterJson = DefaultHeaderFilterJson, + SearchPanelJson = DefaultSearchPanelJson, + GroupPanelJson = DefaultGroupPanelJson, + SelectionJson = DefaultSelectionSingleJson, + ColumnOptionJson = DefaultColumnOptionJson, + PermissionJson = DefaultPermissionJson(listFormName), + DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.ProductionOrder)), + DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson, + PagerOptionJson = DefaultPagerOptionJson, + InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson, + EditingOptionJson = DefaultEditingOptionJson(listFormName, 800, 450, true, true, true, true, false), + EditingFormJson = JsonSerializer.Serialize(new List() { + new() { + Order=1, ColCount=2, ColSpan=1, ItemType="group", Items= [ + new EditingFormItemDto { Order = 1, DataField = "OrderNumber", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 2, DataField = "OrderTypeId", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, + new EditingFormItemDto { Order = 3, DataField = "StatusId", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, + new EditingFormItemDto { Order = 4, DataField = "Priority", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, + new EditingFormItemDto { Order = 5, DataField = "PlannedStartDate", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxDateBox, EditorOptions=EditorOptionValues.DateTimeFormat }, + new EditingFormItemDto { Order = 6, DataField = "PlannedEndDate", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxDateBox, EditorOptions=EditorOptionValues.DateTimeFormat }, + new EditingFormItemDto { Order = 7, DataField = "ActualStartDate", ColSpan = 1, EditorType2=EditorTypes.dxDateBox, EditorOptions=EditorOptionValues.DateTimeFormat }, + new EditingFormItemDto { Order = 8, DataField = "ActualEndDate", ColSpan = 1, EditorType2=EditorTypes.dxDateBox, EditorOptions=EditorOptionValues.DateTimeFormat }, + new EditingFormItemDto { Order = 9, DataField = "PlannedQuantity", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxNumberBox, EditorOptions=EditorOptionValues.NumberStandartFormat }, + new EditingFormItemDto { Order = 10, DataField = "ConfirmedQuantity", ColSpan = 1, EditorType2=EditorTypes.dxNumberBox, EditorOptions=EditorOptionValues.NumberStandartFormat }, + new EditingFormItemDto { Order = 11, DataField = "RequiredQuantity", ColSpan = 1, EditorType2=EditorTypes.dxNumberBox, EditorOptions=EditorOptionValues.NumberStandartFormat }, + new EditingFormItemDto { Order = 12, DataField = "ScrapQuantity", ColSpan = 1, EditorType2=EditorTypes.dxNumberBox, EditorOptions=EditorOptionValues.NumberStandartFormat }, + new EditingFormItemDto { Order = 13, DataField = "Uom", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 14, DataField = "Currency", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 15, DataField = "PlannedCost", ColSpan = 1, EditorType2=EditorTypes.dxNumberBox, EditorOptions=EditorOptionValues.NumberStandartFormat }, + new EditingFormItemDto { Order = 16, DataField = "ActualCost", ColSpan = 1, EditorType2=EditorTypes.dxNumberBox, EditorOptions=EditorOptionValues.NumberStandartFormat }, + new EditingFormItemDto { Order = 17, DataField = "CustomerRequirement", ColSpan = 2, EditorType2=EditorTypes.dxTextArea }, + ]} + }), + FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + new() { FieldName = "OrderNumber", FieldDbType = DbType.String, Value = "@AUTONUMBER", CustomValueType = FieldCustomValueTypeEnum.CustomKey }, + new() { FieldName = "Priority", FieldDbType = DbType.String, Value = "Low", CustomValueType = FieldCustomValueTypeEnum.Value }, + new() { FieldName = "PlannedStartDate", FieldDbType = DbType.Date, Value = "@DATE", CustomValueType = FieldCustomValueTypeEnum.CustomKey }, + new() { FieldName = "PlannedEndDate", FieldDbType = DbType.Date, Value = "@DATE", CustomValueType = FieldCustomValueTypeEnum.CustomKey }, + new() { FieldName = "PlannedQuantity", FieldDbType = DbType.Decimal, Value = "0", CustomValueType = FieldCustomValueTypeEnum.Value }, + new() { FieldName = "ConfirmedQuantity", FieldDbType = DbType.Decimal, Value = "0", CustomValueType = FieldCustomValueTypeEnum.Value }, + new() { FieldName = "RequiredQuantity", FieldDbType = DbType.Decimal, Value = "0", CustomValueType = FieldCustomValueTypeEnum.Value }, + new() { FieldName = "ScrapQuantity", FieldDbType = DbType.Decimal, Value = "0", CustomValueType = FieldCustomValueTypeEnum.Value }, + new() { FieldName = "Uom", FieldDbType = DbType.String, Value = "Adet", CustomValueType = FieldCustomValueTypeEnum.Value }, + new() { FieldName = "PlannedCost", FieldDbType = DbType.Decimal, Value = "0", CustomValueType = FieldCustomValueTypeEnum.Value }, + new() { FieldName = "ActualCost", FieldDbType = DbType.Decimal, Value = "0", CustomValueType = FieldCustomValueTypeEnum.Value }, + new() { FieldName = "Currency", FieldDbType = DbType.String, Value = "TRY", CustomValueType = FieldCustomValueTypeEnum.Value }, + }), + CommandColumnJson = JsonSerializer.Serialize(new CommandColumnDto[] { + new() { + Hint = "Items", + Text ="Items", + UrlTarget="_blank", + AuthName = listFormName, + Url=$"/admin/form/{SeederUtils.GetDefaultFormCodes(listFormName)}/@Id", + IsVisible = true + }, + new() { + Hint = "Work Orders", + Text ="Work Orders", + UrlTarget="_blank", + AuthName = listFormName, + Url=$"/admin/form/{SeederUtils.GetDefaultFormCodes(listFormName)}/@Id", + IsVisible = true, + VisibleExpression = "(e) => e.row.data.ConfirmedQuantity == 0" + }, + }), + }, autoSave: true + ); + + #region Production Order Fields + await _listFormFieldRepository.InsertManyAsync([ + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + Width = 100, + ListOrderNo = 1, + Visible = false, + IsActive = true, + IsDeleted = false, + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "OrderNumber", + Width = 150, + ListOrderNo = 2, + Visible = true, + IsActive = true, + IsDeleted = false, + SortIndex = 1, + SortDirection = GridColumnOptions.SortOrderDesc, + AllowSearch = true, + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "OrderTypeId", + Width = 150, + ListOrderNo = 3, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.ProductionOrderType), "Id", "Name"), + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "StatusId", + Width = 100, + ListOrderNo = 4, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.ProductionOrderStatus), "Id", "Name"), + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Priority", + Width = 100, + ListOrderNo = 5, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = JsonSerializer.Serialize(new LookupDto + { + DataSourceType = UiLookupDataSourceTypeEnum.StaticData, + ValueExpr = "key", + DisplayExpr = "name", + LookupQuery = JsonSerializer.Serialize(new LookupDataDto[] { + new () { Key = "Low", Name = "Low" }, + new () { Key = "Medium", Name = "Medium" }, + 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.DateTime, + FieldName = "PlannedStartDate", + Width = 150, + ListOrderNo = 6, + 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.DateTime, + FieldName = "PlannedEndDate", + Width = 150, + ListOrderNo = 7, + 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.DateTime, + FieldName = "ActualStartDate", + Width = 150, + 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.DateTime, + FieldName = "ActualEndDate", + Width = 150, + ListOrderNo = 9, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Decimal, + FieldName = "PlannedQuantity", + Format = "fixedPoint", + Alignment = "right", + Width = 100, + ListOrderNo = 10, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Decimal, + FieldName = "ConfirmedQuantity", + Format = "fixedPoint", + Alignment = "right", + Width = 100, + ListOrderNo = 11, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Decimal, + FieldName = "RequiredQuantity", + Format = "fixedPoint", + Alignment = "right", + Width = 100, + ListOrderNo = 12, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Decimal, + FieldName = "ScrapQuantity", + Format = "fixedPoint", + Alignment = "right", + Width = 100, + ListOrderNo = 13, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Uom", + Width = 100, + ListOrderNo = 14, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.Uom), "Name", "Name"), + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Decimal, + FieldName = "PlannedCost", + Format = "fixedPoint", + Alignment = "right", + Width = 100, + ListOrderNo = 15, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Decimal, + FieldName = "ActualCost", + Format = "fixedPoint", + Alignment = "right", + Width = 100, + ListOrderNo = 16, + 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 = "Currency", + Width = 100, + ListOrderNo = 17, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.Currency), "Code", "Name"), + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "CustomerRequirement", + Width = 100, + ListOrderNo = 18, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + ], autoSave: true); + #endregion + } + #endregion + + #region Production Order Items + listFormName = AppCodes.Mrp.ProductionOrderItem; + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName)) + { + var listForm = await _listFormRepository.InsertAsync( + new ListForm() + { + ListFormType = ListFormTypeEnum.List, + ExportJson = DefaultExportJson, + IsSubForm = false, + ShowNote = true, + LayoutJson = DefaultLayoutJson(), + CultureName = LanguageCodes.En, + ListFormCode = listFormName, + Name = listFormName, + Title = listFormName, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = true, + IsBranch = false, + IsOrganizationUnit = false, + Description = listFormName, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.ProductionOrderItem)), + KeyFieldName = "Id", + KeyFieldDbSourceType = DbType.Guid, + DefaultFilter = DefaultFilterJson, + SortMode = GridOptions.SortModeSingle, + FilterRowJson = DefaultFilterRowJson, + HeaderFilterJson = DefaultHeaderFilterJson, + SearchPanelJson = DefaultSearchPanelJson, + GroupPanelJson = DefaultGroupPanelJson, + SelectionJson = DefaultSelectionSingleJson, + ColumnOptionJson = DefaultColumnOptionJson, + PermissionJson = DefaultPermissionJson(listFormName), + DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.ProductionOrderItem)), + DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson, + PagerOptionJson = DefaultPagerOptionJson, + InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson, + EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 400, true, true, true, true, false), + EditingFormJson = JsonSerializer.Serialize(new List() { + new() { + Order=1, ColCount=1, ColSpan=1, ItemType="group", Items= [ + new EditingFormItemDto { Order = 1, DataField = "SalesOrderId", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, + new EditingFormItemDto { Order = 2, DataField = "MaterialId", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, + new EditingFormItemDto { Order = 3, DataField = "Uom", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 4, DataField = "PlannedQuantity", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxNumberBox, EditorOptions=EditorOptionValues.NumberStandartFormat }, + new EditingFormItemDto { Order = 5, DataField = "ConfirmedQuantity", ColSpan = 1, EditorType2=EditorTypes.dxNumberBox, EditorOptions=EditorOptionValues.NumberStandartFormat }, + new EditingFormItemDto { Order = 6, DataField = "RequiredQuantity", ColSpan = 1, EditorType2=EditorTypes.dxNumberBox, EditorOptions=EditorOptionValues.NumberStandartFormat }, + new EditingFormItemDto { Order = 7, DataField = "ScrapQuantity", ColSpan = 1, EditorType2=EditorTypes.dxNumberBox, EditorOptions=EditorOptionValues.NumberStandartFormat }, + ]} + }), + FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + new() { FieldName = "Uom", FieldDbType = DbType.String, Value = "Adet", CustomValueType = FieldCustomValueTypeEnum.Value }, + new() { FieldName = "PlannedQuantity", FieldDbType = DbType.Decimal, Value = "0", CustomValueType = FieldCustomValueTypeEnum.Value }, + new() { FieldName = "ConfirmedQuantity", FieldDbType = DbType.Decimal, Value = "0", CustomValueType = FieldCustomValueTypeEnum.Value }, + new() { FieldName = "RequiredQuantity", FieldDbType = DbType.Decimal, Value = "0", CustomValueType = FieldCustomValueTypeEnum.Value }, + new() { FieldName = "ScrapQuantity", FieldDbType = DbType.Decimal, Value = "0", CustomValueType = FieldCustomValueTypeEnum.Value } + }) + }, autoSave: true + ); + + #region Production Order Items Fields + await _listFormFieldRepository.InsertManyAsync([ + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + Width = 100, + ListOrderNo = 1, + Visible = false, + IsActive = true, + IsDeleted = false, + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "SalesOrderId", + Width = 150, + ListOrderNo = 2, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.SalesOrder), "Id", "OrderNumber"), + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "MaterialId", + Width = 150, + ListOrderNo = 3, + 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.String, + FieldName = "Uom", + Width = 100, + ListOrderNo = 4, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.Uom), "Name", "Name"), + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Decimal, + FieldName = "PlannedQuantity", + Format = "fixedPoint", + Alignment = "right", + Width = 100, + ListOrderNo = 5, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Decimal, + FieldName = "ConfirmedQuantity", + Format = "fixedPoint", + Alignment = "right", + Width = 100, + 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.Decimal, + FieldName = "RequiredQuantity", + Format = "fixedPoint", + Alignment = "right", + Width = 100, + 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.Decimal, + FieldName = "ScrapQuantity", + Format = "fixedPoint", + Alignment = "right", + Width = 100, + ListOrderNo = 8, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + } + ], autoSave: true); + #endregion + } + #endregion + + // Production Order ve Production Order Item Sub Forms ilişkisinin kurulması + await utils.CloneFormLayoutAsync( + AppCodes.Mrp.ProductionOrder, + JsonSerializer.Serialize(new List() { + new { + TabType = ListFormTabTypeEnum.List, + TabTitle = AppCodes.Mrp.ProductionOrderItem, + Code = AppCodes.Mrp.ProductionOrderItem, + Relation = new List() { + new { + ParentFieldName = "Id", + DbType = DbType.Guid, + ChildFieldName = "ProductionOrderId" + } + } + } + }) + ); + + + } +} diff --git a/api/src/Erp.Platform.DbMigrator/Seeds/MenusData.json b/api/src/Erp.Platform.DbMigrator/Seeds/MenusData.json index 2fde024c..5a44402e 100644 --- a/api/src/Erp.Platform.DbMigrator/Seeds/MenusData.json +++ b/api/src/Erp.Platform.DbMigrator/Seeds/MenusData.json @@ -152,18 +152,14 @@ "path": "/admin/menuManager", "componentPath": "@/views/menu/MenuManager", "routeType": "protected", - "authority": [ - "App.Menus.Manager" - ] + "authority": ["App.Menus.Manager"] }, { "key": "admin.listFormManagement.wizard", "path": "/admin/listform/wizard", "componentPath": "@/views/admin/listForm/Wizard", "routeType": "protected", - "authority": [ - "App.Listforms.Wizard" - ] + "authority": ["App.Listforms.Wizard"] }, { "key": "admin.listFormManagement.edit", @@ -177,18 +173,14 @@ "path": "/admin/forumManagement", "componentPath": "@/views/forum/Management", "routeType": "protected", - "authority": [ - "App.ForumManagement" - ] + "authority": ["App.ForumManagement"] }, { "key": "admin.ai", "path": "/admin/ai", "componentPath": "@/views/ai/Assistant", "routeType": "protected", - "authority": [ - "Abp.Identity.Ai" - ] + "authority": ["Abp.Identity.Ai"] }, { "key": "admin.profile.general", @@ -230,36 +222,28 @@ "path": "/admin/settings", "componentPath": "@/views/settings/Settings", "routeType": "protected", - "authority": [ - "App.Setting" - ] + "authority": ["App.Setting"] }, { "key": "admin.identity.user.detail", "path": "/admin/users/detail/:userId", "componentPath": "@/views/admin/user-management/Details", "routeType": "protected", - "authority": [ - "AbpIdentity.Users.Update" - ] + "authority": ["AbpIdentity.Users.Update"] }, { "key": "admin.identity.ous", "path": "/admin/ous", "componentPath": "@/views/admin/organization-unit/OrganizationUnits", "routeType": "protected", - "authority": [ - "Abp.Identity.OrganizationUnits" - ] + "authority": ["Abp.Identity.OrganizationUnits"] }, { "key": "admin.forum", "path": "/admin/forum", "componentPath": "@/views/forum/Forum", "routeType": "protected", - "authority": [ - "App.ForumManagement.Publish" - ] + "authority": ["App.ForumManagement.Publish"] }, { "key": "admin.list", @@ -301,225 +285,175 @@ "path": "/admin/sqlQueryManager", "componentPath": "@/views/sqlQueryManager/SqlQueryManager", "routeType": "protected", - "authority": [ - "App.SqlQueryManager" - ] + "authority": ["App.SqlQueryManager"] }, { "key": "admin.developerkit", "path": "/admin/developerkit", "componentPath": "@/views/developerKit/DashboardPage", "routeType": "protected", - "authority": [ - "App.DeveloperKit" - ] + "authority": ["App.DeveloperKit"] }, { "key": "admin.developerkit.entities", "path": "/admin/developerkit/entities", "componentPath": "@/views/developerKit/EntityPage", "routeType": "protected", - "authority": [ - "App.DeveloperKit.Entity" - ] + "authority": ["App.DeveloperKit.Entity"] }, { "key": "admin.developerkit.entities.new", "path": "/admin/developerkit/entities/new", "componentPath": "@/views/developerKit/EntityDetailPage", "routeType": "protected", - "authority": [ - "App.DeveloperKit.Entity" - ] + "authority": ["App.DeveloperKit.Entity"] }, { "key": "admin.developerkit.entities.edit", "path": "/admin/developerkit/entities/edit/:id", "componentPath": "@/views/developerKit/EntityDetailPage", "routeType": "protected", - "authority": [ - "App.DeveloperKit.Entity" - ] + "authority": ["App.DeveloperKit.Entity"] }, { "key": "admin.developerkit.migrations", "path": "/admin/developerkit/migrations", "componentPath": "@/views/developerKit/MigrationPage", "routeType": "protected", - "authority": [ - "App.DeveloperKit.Migrations" - ] + "authority": ["App.DeveloperKit.Migrations"] }, { "key": "admin.developerkit.endpoints", "path": "/admin/developerkit/endpoints", "componentPath": "@/views/developerKit/CrudEndpointPage", "routeType": "protected", - "authority": [ - "App.DeveloperKit.CrudEndpoints" - ] + "authority": ["App.DeveloperKit.CrudEndpoints"] }, { "key": "admin.developerkit.dynamic-services", "path": "/admin/developerkit/dynamic-services", "componentPath": "@/views/developerKit/DynamicServicePage", "routeType": "protected", - "authority": [ - "App.DeveloperKit.DynamicServices" - ] + "authority": ["App.DeveloperKit.DynamicServices"] }, { "key": "admin.developerkit.components", "path": "/admin/developerkit/components", "componentPath": "@/views/developerKit/ComponentPage", "routeType": "protected", - "authority": [ - "App.DeveloperKit.Components" - ] + "authority": ["App.DeveloperKit.Components"] }, { "key": "admin.developerkit.components.new", "path": "/admin/developerkit/components/new", "componentPath": "@/views/developerKit/ComponentDetailPage", "routeType": "protected", - "authority": [ - "App.DeveloperKit.Components" - ] + "authority": ["App.DeveloperKit.Components"] }, { "key": "admin.developerkit.components.view", "path": "/admin/developerkit/components/view/:id", "componentPath": "@/views/developerKit/ComponentDetailPage", "routeType": "protected", - "authority": [ - "App.DeveloperKit.Components" - ] + "authority": ["App.DeveloperKit.Components"] }, { "key": "admin.developerkit.components.edit", "path": "/admin/developerkit/components/edit/:id", "componentPath": "@/views/developerKit/CodePage", "routeType": "protected", - "authority": [ - "App.DeveloperKit.Components" - ] + "authority": ["App.DeveloperKit.Components"] }, { "key": "admin.reportManagement", "path": "/admin/reports/management", "componentPath": "@/views/report/DashboardPage", "routeType": "protected", - "authority": [ - "App.Reports.Management" - ] + "authority": ["App.Reports.Management"] }, { "key": "admin.reports.view", "path": "/admin/reports/:id", "componentPath": "@/views/report/ReportViewerPage", "routeType": "protected", - "authority": [ - "App.Reports.Categories" - ] + "authority": ["App.Reports.Categories"] }, { "key": "admin.fileManagement", "path": "/admin/files", "componentPath": "@/views/admin/files/FileManager", "routeType": "protected", - "authority": [ - "App.Files" - ] + "authority": ["App.Files"] }, { "key": "admin.coordinator.classroom.dashboard", "path": "/admin/coordinator/classroom/dashboard", "componentPath": "@/views/coordinator/Classroom/Dashboard", "routeType": "protected", - "authority": [ - "App.Coordinator.Classroom.Dashboard" - ] + "authority": ["App.Coordinator.Classroom.Dashboard"] }, { "key": "admin.coordinator.classroom.classes", "path": "/admin/coordinator/classroom/classes", "componentPath": "@/views/coordinator/Classroom/ClassList", "routeType": "protected", - "authority": [ - "App.Coordinator.Classroom.List" - ] + "authority": ["App.Coordinator.Classroom.List"] }, { "key": "admin.coordinator.classroom.classroom", "path": "/admin/coordinator/classroom/room/:id", "componentPath": "@/views/coordinator/Classroom/RoomDetail", "routeType": "protected", - "authority": [ - "App.Coordinator.Classroom.RoomDetail" - ] + "authority": ["App.Coordinator.Classroom.RoomDetail"] }, { "key": "admin.coordinator.classroom.planning", "path": "/admin/coordinator/classroom/planning/:id", "componentPath": "@/views/coordinator/Classroom/PlanningPage", "routeType": "protected", - "authority": [ - "App.Coordinator.Classroom.Planning" - ] + "authority": ["App.Coordinator.Classroom.Planning"] }, { "key": "admin.coordinator.exams", "path": "/admin/coordinator/exams", "componentPath": "@/views/coordinator/Exams", "routeType": "protected", - "authority": [ - "App.Coordinator.Exams" - ] + "authority": ["App.Coordinator.Exams"] }, { "key": "admin.coordinator.examDetail", "path": "/admin/coordinator/exam/:id", "componentPath": "@/views/coordinator/ExamInterface/ExamInterface", "routeType": "protected", - "authority": [ - "App.Coordinator.Exams" - ] + "authority": ["App.Coordinator.Exams"] }, { "key": "admin.coordinator.assignments", "path": "/admin/coordinator/assignments", "componentPath": "@/views/coordinator/Assignments", "routeType": "protected", - "authority": [ - "App.Coordinator.Assignments" - ] + "authority": ["App.Coordinator.Assignments"] }, { "key": "admin.coordinator.assignmentDetail", "path": "/admin/coordinator/assignment/:id", "componentPath": "@/views/coordinator/ExamInterface/ExamInterface", "routeType": "protected", - "authority": [ - "App.Coordinator.Assignments" - ] + "authority": ["App.Coordinator.Assignments"] }, { "key": "admin.coordinator.tests", "path": "/admin/coordinator/tests", "componentPath": "@/views/coordinator/Tests", "routeType": "protected", - "authority": [ - "App.Coordinator.Tests" - ] + "authority": ["App.Coordinator.Tests"] }, { "key": "admin.coordinator.testDetail", "path": "/admin/coordinator/test/:id", "componentPath": "@/views/coordinator/ExamInterface/PDFTestInterface", "routeType": "protected", - "authority": [ - "App.Coordinator.Tests" - ] + "authority": ["App.Coordinator.Tests"] }, { "key": "admin.supplychain.requests", @@ -3063,7 +2997,7 @@ "DisplayName": "App.Mrp.OperationCategory", "Order": 1, "Url": "/admin/list/App.Mrp.OperationCategory", - "Icon": "FcEngineering", + "Icon": "FcDepartment", "RequiredPermissionName": "App.Mrp.OperationCategory", "IsDisabled": false }, @@ -3073,7 +3007,7 @@ "DisplayName": "App.Mrp.OperationType", "Order": 2, "Url": "/admin/list/App.Mrp.OperationType", - "Icon": "FcAutomatic", + "Icon": "FcTemplate", "RequiredPermissionName": "App.Mrp.OperationType", "IsDisabled": false }, @@ -3093,7 +3027,7 @@ "DisplayName": "App.Mrp.WorkcenterType", "Order": 4, "Url": "/admin/list/App.Mrp.WorkcenterType", - "Icon": "FcOrganization", + "Icon": "FcTreeStructure", "RequiredPermissionName": "App.Mrp.WorkcenterType", "IsDisabled": false }, @@ -3113,7 +3047,7 @@ "DisplayName": "App.Mrp.Workcenter", "Order": 6, "Url": "/admin/list/App.Mrp.Workcenter", - "Icon": "FcWorkflow", + "Icon": "FcFactory", "RequiredPermissionName": "App.Mrp.Workcenter", "IsDisabled": false }, @@ -3127,12 +3061,32 @@ "RequiredPermissionName": "App.Mrp.Bom", "IsDisabled": false }, + { + "ParentCode": "App.Mrp.Definitions", + "Code": "App.Mrp.ProductionOrderType", + "DisplayName": "App.Mrp.ProductionOrderType", + "Order": 8, + "Url": "/admin/list/App.Mrp.ProductionOrderType", + "Icon": "FcSettings", + "RequiredPermissionName": "App.Mrp.ProductionOrderType", + "IsDisabled": false + }, + { + "ParentCode": "App.Mrp.Definitions", + "Code": "App.Mrp.ProductionOrderStatus", + "DisplayName": "App.Mrp.ProductionOrderStatus", + "Order": 9, + "Url": "/admin/list/App.Mrp.ProductionOrderStatus", + "Icon": "FcApproval", + "RequiredPermissionName": "App.Mrp.ProductionOrderStatus", + "IsDisabled": false + }, { "ParentCode": "App.Mrp", "Code": "App.Mrp.ProductionOrder", "DisplayName": "App.Mrp.ProductionOrder", "Order": 2, - "Url": "/admin/mrp/production-orders", + "Url": "/admin/list/App.Mrp.ProductionOrder", "Icon": "FcFactory", "RequiredPermissionName": "App.Mrp.ProductionOrder", "IsDisabled": false @@ -3147,31 +3101,11 @@ "RequiredPermissionName": "App.Mrp.WorkOrder", "IsDisabled": false }, - { - "ParentCode": "App.Mrp", - "Code": "App.Mrp.DemandPlanning", - "DisplayName": "App.Mrp.DemandPlanning", - "Order": 4, - "Url": "/admin/mrp/demand-planning", - "Icon": "FcPlanner", - "RequiredPermissionName": "App.Mrp.DemandPlanning", - "IsDisabled": false - }, - { - "ParentCode": "App.Mrp", - "Code": "App.Mrp.MaterialRequirement", - "DisplayName": "App.Mrp.MaterialRequirement", - "Order": 5, - "Url": "/admin/mrp/material-requirements", - "Icon": "FcDataSheet", - "RequiredPermissionName": "App.Mrp.MaterialRequirement", - "IsDisabled": false - }, { "ParentCode": "App.Mrp", "Code": "App.Mrp.PlanningGantt", "DisplayName": "App.Mrp.PlanningGantt", - "Order": 6, + "Order": 4, "Url": "/admin/mrp/planning-gantt", "Icon": "FcTimeline", "RequiredPermissionName": "App.Mrp.PlanningGantt", @@ -3328,4 +3262,4 @@ "IsDisabled": false } ] -} \ No newline at end of file +} diff --git a/api/src/Erp.Platform.DbMigrator/Seeds/PermissionsData.json b/api/src/Erp.Platform.DbMigrator/Seeds/PermissionsData.json index 0e0698f7..bebafa04 100644 --- a/api/src/Erp.Platform.DbMigrator/Seeds/PermissionsData.json +++ b/api/src/Erp.Platform.DbMigrator/Seeds/PermissionsData.json @@ -12865,6 +12865,199 @@ "MultiTenancySide": 3, "MenuGroup": "Erp" }, + + { + "GroupName": "App.Mrp", + "Name": "App.Mrp.ProductionOrderType", + "ParentName": null, + "DisplayName": "App.Mrp.ProductionOrderType", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Mrp", + "Name": "App.Mrp.ProductionOrderType.Create", + "ParentName": "App.Mrp.ProductionOrderType", + "DisplayName": "Create", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Mrp", + "Name": "App.Mrp.ProductionOrderType.Update", + "ParentName": "App.Mrp.ProductionOrderType", + "DisplayName": "Update", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Mrp", + "Name": "App.Mrp.ProductionOrderType.Delete", + "ParentName": "App.Mrp.ProductionOrderType", + "DisplayName": "Delete", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Mrp", + "Name": "App.Mrp.ProductionOrderType.Export", + "ParentName": "App.Mrp.ProductionOrderType", + "DisplayName": "Export", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Mrp", + "Name": "App.Mrp.ProductionOrderType.Import", + "ParentName": "App.Mrp.ProductionOrderType", + "DisplayName": "Import", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Mrp", + "Name": "App.Mrp.ProductionOrderType.Note", + "ParentName": "App.Mrp.ProductionOrderType", + "DisplayName": "Note", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + + { + "GroupName": "App.Mrp", + "Name": "App.Mrp.ProductionOrderStatus", + "ParentName": null, + "DisplayName": "App.Mrp.ProductionOrderStatus", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Mrp", + "Name": "App.Mrp.ProductionOrderStatus.Create", + "ParentName": "App.Mrp.ProductionOrderStatus", + "DisplayName": "Create", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Mrp", + "Name": "App.Mrp.ProductionOrderStatus.Update", + "ParentName": "App.Mrp.ProductionOrderStatus", + "DisplayName": "Update", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Mrp", + "Name": "App.Mrp.ProductionOrderStatus.Delete", + "ParentName": "App.Mrp.ProductionOrderStatus", + "DisplayName": "Delete", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Mrp", + "Name": "App.Mrp.ProductionOrderStatus.Export", + "ParentName": "App.Mrp.ProductionOrderStatus", + "DisplayName": "Export", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Mrp", + "Name": "App.Mrp.ProductionOrderStatus.Import", + "ParentName": "App.Mrp.ProductionOrderStatus", + "DisplayName": "Import", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Mrp", + "Name": "App.Mrp.ProductionOrderStatus.Note", + "ParentName": "App.Mrp.ProductionOrderStatus", + "DisplayName": "Note", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + + { + "GroupName": "App.Mrp", + "Name": "App.Mrp.ProductionOrderItem", + "ParentName": null, + "DisplayName": "App.Mrp.ProductionOrderItem", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Mrp", + "Name": "App.Mrp.ProductionOrderItem.Create", + "ParentName": "App.Mrp.ProductionOrderItem", + "DisplayName": "Create", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Mrp", + "Name": "App.Mrp.ProductionOrderItem.Update", + "ParentName": "App.Mrp.ProductionOrderItem", + "DisplayName": "Update", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Mrp", + "Name": "App.Mrp.ProductionOrderItem.Delete", + "ParentName": "App.Mrp.ProductionOrderItem", + "DisplayName": "Delete", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Mrp", + "Name": "App.Mrp.ProductionOrderItem.Export", + "ParentName": "App.Mrp.ProductionOrderItem", + "DisplayName": "Export", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Mrp", + "Name": "App.Mrp.ProductionOrderItem.Import", + "ParentName": "App.Mrp.ProductionOrderItem", + "DisplayName": "Import", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Mrp", + "Name": "App.Mrp.ProductionOrderItem.Note", + "ParentName": "App.Mrp.ProductionOrderItem", + "DisplayName": "Note", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { "GroupName": "App.Mrp", "Name": "App.Mrp.WorkOrder", diff --git a/api/src/Erp.Platform.Domain.Shared/Enums/TableNameEnum.cs b/api/src/Erp.Platform.Domain.Shared/Enums/TableNameEnum.cs index f44e6011..8b3c293c 100644 --- a/api/src/Erp.Platform.Domain.Shared/Enums/TableNameEnum.cs +++ b/api/src/Erp.Platform.Domain.Shared/Enums/TableNameEnum.cs @@ -229,5 +229,9 @@ public enum TableNameEnum InvoiceItem, CheckStatus, CheckType, - CheckNote + CheckNote, + ProductionOrderType, + ProductionOrderStatus, + ProductionOrder, + ProductionOrderItem } diff --git a/api/src/Erp.Platform.Domain.Shared/TableNameResolver.cs b/api/src/Erp.Platform.Domain.Shared/TableNameResolver.cs index edefaed4..2ab4be95 100644 --- a/api/src/Erp.Platform.Domain.Shared/TableNameResolver.cs +++ b/api/src/Erp.Platform.Domain.Shared/TableNameResolver.cs @@ -254,6 +254,10 @@ public static class TableNameResolver { nameof(TableNameEnum.Bom), (TablePrefix.TenantByName, MenuPrefix.Mrp) }, { nameof(TableNameEnum.BomOperation), (TablePrefix.TenantByName, MenuPrefix.Mrp) }, { nameof(TableNameEnum.BomComponent), (TablePrefix.TenantByName, MenuPrefix.Mrp) }, + { nameof(TableNameEnum.ProductionOrderType), (TablePrefix.TenantByName, MenuPrefix.Mrp) }, + { nameof(TableNameEnum.ProductionOrderStatus), (TablePrefix.TenantByName, MenuPrefix.Mrp) }, + { nameof(TableNameEnum.ProductionOrder), (TablePrefix.TenantByName, MenuPrefix.Mrp) }, + { nameof(TableNameEnum.ProductionOrderItem), (TablePrefix.TenantByName, MenuPrefix.Mrp) }, // 🔹 R&D { nameof(TableNameEnum.Type), (TablePrefix.TenantByName, MenuPrefix.Project) }, diff --git a/api/src/Erp.Platform.Domain/Data/SeedConsts.cs b/api/src/Erp.Platform.Domain/Data/SeedConsts.cs index dbd9be64..e9294c6a 100644 --- a/api/src/Erp.Platform.Domain/Data/SeedConsts.cs +++ b/api/src/Erp.Platform.Domain/Data/SeedConsts.cs @@ -636,6 +636,10 @@ public static class SeedConsts public const string Bom = Default + ".Bom"; public const string BomComponent = Default + ".BomComponent"; public const string BomOperation = Default + ".BomOperation"; + public const string ProductionOrderType = Default + ".ProductionOrderType"; + public const string ProductionOrderStatus = Default + ".ProductionOrderStatus"; + public const string ProductionOrder = Default + ".ProductionOrder"; + public const string ProductionOrderItem = Default + ".ProductionOrderItem"; } } diff --git a/api/src/Erp.Platform.Domain/Entities/Tenant/Mrp/ProductionOrder.cs b/api/src/Erp.Platform.Domain/Entities/Tenant/Mrp/ProductionOrder.cs new file mode 100644 index 00000000..d8c5e2c8 --- /dev/null +++ b/api/src/Erp.Platform.Domain/Entities/Tenant/Mrp/ProductionOrder.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using Volo.Abp.Domain.Entities.Auditing; +using Volo.Abp.MultiTenancy; + +namespace Erp.Platform.Entities; + +public class ProductionOrder : FullAuditedEntity, IMultiTenant +{ + public Guid? TenantId { get; set; } + + public string OrderNumber { get; set; } + public Guid OrderTypeId { get; set; } + public ProductionOrderType OrderType { get; set; } + + public Guid StatusId { get; set; } + public ProductionOrderStatus Status { get; set; } + public string Priority { get; set; } + + public DateTime PlannedStartDate { get; set; } + public DateTime PlannedEndDate { get; set; } + public DateTime? ActualStartDate { get; set; } + public DateTime? ActualEndDate { get; set; } + + public decimal PlannedQuantity { get; set; } //Planlanan miktar + public decimal ConfirmedQuantity { get; set; } //Onaylanan miktar + public decimal RequiredQuantity { get; set; } //Gereken miktar + public decimal ScrapQuantity { get; set; } // Hurda miktarı + public string Uom { get; set; } + public decimal PlannedCost { get; set; } //Planlanan maliyet + public decimal ActualCost { get; set; } //Gerçekleşen maliyet + public string Currency { get; set; } //Para birimi + public string CustomerRequirement { get; set; } + + public ICollection Items { get; set; } +} diff --git a/api/src/Erp.Platform.Domain/Entities/Tenant/Mrp/ProductionOrderItem.cs b/api/src/Erp.Platform.Domain/Entities/Tenant/Mrp/ProductionOrderItem.cs new file mode 100644 index 00000000..c7ab3355 --- /dev/null +++ b/api/src/Erp.Platform.Domain/Entities/Tenant/Mrp/ProductionOrderItem.cs @@ -0,0 +1,26 @@ +using System; +using Volo.Abp.Domain.Entities.Auditing; +using Volo.Abp.MultiTenancy; + +namespace Erp.Platform.Entities; + +public class ProductionOrderItem : FullAuditedEntity, IMultiTenant +{ + public Guid? TenantId { get; set; } + + public Guid ProductionOrderId { get; set; } + public ProductionOrder ProductionOrder { get; set; } + + public Guid? SalesOrderId { get; set; } + public SalesOrder? SalesOrder { get; set; } + + public Guid MaterialId { get; set; } + public Material Material { get; set; } + + public string Uom { get; set; } + + public decimal PlannedQuantity { get; set; } + public decimal ConfirmedQuantity { get; set; } + public decimal RequiredQuantity { get; set; } + public decimal ScrapQuantity { get; set; } +} diff --git a/api/src/Erp.Platform.Domain/Entities/Tenant/Mrp/ProductionOrderStatus.cs b/api/src/Erp.Platform.Domain/Entities/Tenant/Mrp/ProductionOrderStatus.cs new file mode 100644 index 00000000..ec2badfd --- /dev/null +++ b/api/src/Erp.Platform.Domain/Entities/Tenant/Mrp/ProductionOrderStatus.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using Volo.Abp.Domain.Entities.Auditing; +using Volo.Abp.MultiTenancy; + +namespace Erp.Platform.Entities; + +public class ProductionOrderStatus : FullAuditedEntity, IMultiTenant +{ + public Guid? TenantId { get; set; } + + public string Name { get; set; } + public string Description { get; set; } + public bool IsActive { get; set; } + + public ICollection ProductionOrders { get; set; } +} diff --git a/api/src/Erp.Platform.Domain/Entities/Tenant/Mrp/ProductionOrderType.cs b/api/src/Erp.Platform.Domain/Entities/Tenant/Mrp/ProductionOrderType.cs new file mode 100644 index 00000000..dfa148e7 --- /dev/null +++ b/api/src/Erp.Platform.Domain/Entities/Tenant/Mrp/ProductionOrderType.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using Volo.Abp.Domain.Entities.Auditing; +using Volo.Abp.MultiTenancy; + +namespace Erp.Platform.Entities; + +public class ProductionOrderType : FullAuditedEntity, IMultiTenant +{ + public Guid? TenantId { get; set; } + + public string Name { get; set; } + public string Description { get; set; } + public bool IsActive { get; set; } + + public ICollection ProductionOrders { get; set; } +} diff --git a/api/src/Erp.Platform.Domain/Entities/Tenant/SupplyChain/Material.cs b/api/src/Erp.Platform.Domain/Entities/Tenant/SupplyChain/Material.cs index 50131833..52caca52 100644 --- a/api/src/Erp.Platform.Domain/Entities/Tenant/SupplyChain/Material.cs +++ b/api/src/Erp.Platform.Domain/Entities/Tenant/SupplyChain/Material.cs @@ -39,5 +39,6 @@ public class Material : FullAuditedEntity, IMultiTenant public List MovementItems { get; set; } public List WaybillItems { get; set; } public List InvoiceItems { get; set; } + public List ProductionOrderItems { get; set; } } diff --git a/api/src/Erp.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs b/api/src/Erp.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs index 3c46c230..c0f5b805 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs @@ -268,16 +268,6 @@ public class PlatformDbContext : public DbSet WorkorderActivities { get; set; } #endregion - #region Mrp - public DbSet OperationCategories { get; set; } - public DbSet OperationTypes { get; set; } - public DbSet Operations { get; set; } - public DbSet BomTypes { get; set; } - public DbSet Boms { get; set; } - public DbSet BomOperations { get; set; } - public DbSet BomComponents { get; set; } - #endregion - #region Project public DbSet Types { get; set; } public DbSet Statuses { get; set; } @@ -311,6 +301,20 @@ public class PlatformDbContext : public DbSet InvoiceItems { get; set; } #endregion + #region Mrp + public DbSet OperationCategories { get; set; } + public DbSet OperationTypes { get; set; } + public DbSet Operations { get; set; } + public DbSet BomTypes { get; set; } + public DbSet Boms { get; set; } + public DbSet BomOperations { get; set; } + public DbSet BomComponents { get; set; } + public DbSet ProductionOrderTypes { get; set; } + public DbSet ProductionOrderStatuses { get; set; } + public DbSet ProductionOrders { get; set; } + public DbSet ProductionOrderItems { get; set; } + #endregion + public PlatformDbContext(DbContextOptions options) : base(options) { @@ -4146,5 +4150,80 @@ public class PlatformDbContext : .HasForeignKey(x => x.TypeId) .OnDelete(DeleteBehavior.Restrict); }); + + builder.Entity(b => + { + b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.ProductionOrderType)), 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.ProductionOrderStatus)), 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.ProductionOrder)), Prefix.DbSchema); + b.ConfigureByConvention(); + + b.Property(x => x.OrderNumber).IsRequired().HasMaxLength(50); + b.Property(x => x.OrderTypeId).IsRequired(); + b.Property(x => x.StatusId).IsRequired(); + b.Property(x => x.Priority).IsRequired().HasMaxLength(50); + b.Property(x => x.Uom).HasMaxLength(64); + b.Property(x => x.Currency).HasMaxLength(10); + b.Property(x => x.CustomerRequirement).HasMaxLength(1000); + b.Property(x => x.PlannedQuantity).HasPrecision(18, 2).HasDefaultValue(0); + b.Property(x => x.ConfirmedQuantity).HasPrecision(18, 2).HasDefaultValue(0); + b.Property(x => x.RequiredQuantity).HasPrecision(18, 2).HasDefaultValue(0); + b.Property(x => x.ScrapQuantity).HasPrecision(18, 2).HasDefaultValue(0); + b.Property(x => x.PlannedCost).HasPrecision(18, 2).HasDefaultValue(0); + b.Property(x => x.ActualCost).HasPrecision(18, 2).HasDefaultValue(0); + + b.HasOne(x => x.OrderType) + .WithMany(po => po.ProductionOrders) + .HasForeignKey(x => x.OrderTypeId) + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne(x => x.Status) + .WithMany(po => po.ProductionOrders) + .HasForeignKey(x => x.StatusId) + .OnDelete(DeleteBehavior.Restrict); + }); + + builder.Entity(b => + { + b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.ProductionOrderItem)), Prefix.DbSchema); + b.ConfigureByConvention(); + + b.Property(x => x.ProductionOrderId).IsRequired(); + b.Property(x => x.SalesOrderId).IsRequired(); + b.Property(x => x.MaterialId).IsRequired(); + b.Property(x => x.Uom).IsRequired().HasMaxLength(64); + b.Property(x => x.PlannedQuantity).HasPrecision(18, 2).HasDefaultValue(0); + b.Property(x => x.ConfirmedQuantity).HasPrecision(18, 2).HasDefaultValue(0); + b.Property(x => x.RequiredQuantity).HasPrecision(18, 2).HasDefaultValue(0); + b.Property(x => x.ScrapQuantity).HasPrecision(18, 2).HasDefaultValue(0); + + b.HasOne(x => x.ProductionOrder) + .WithMany(po => po.Items) + .HasForeignKey(x => x.ProductionOrderId) + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne(x => x.Material) + .WithMany(po => po.ProductionOrderItems) + .HasForeignKey(x => x.MaterialId) + .OnDelete(DeleteBehavior.Restrict); + }); } } \ No newline at end of file diff --git a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251210070936_Initial.Designer.cs b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251210103609_Initial.Designer.cs similarity index 98% rename from api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251210070936_Initial.Designer.cs rename to api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251210103609_Initial.Designer.cs index 595d4730..82dba844 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251210070936_Initial.Designer.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251210103609_Initial.Designer.cs @@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore; namespace Erp.Platform.Migrations { [DbContext(typeof(PlatformDbContext))] - [Migration("20251210070936_Initial")] + [Migration("20251210103609_Initial")] partial class Initial { /// @@ -10515,6 +10515,334 @@ namespace Erp.Platform.Migrations b.ToTable("Adm_T_Product", (string)null); }); + modelBuilder.Entity("Erp.Platform.Entities.ProductionOrder", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ActualCost") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); + + b.Property("ActualEndDate") + .HasColumnType("datetime2"); + + b.Property("ActualStartDate") + .HasColumnType("datetime2"); + + b.Property("ConfirmedQuantity") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Currency") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("CustomerRequirement") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + 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("OrderNumber") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("OrderTypeId") + .HasColumnType("uniqueidentifier"); + + b.Property("PlannedCost") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); + + b.Property("PlannedEndDate") + .HasColumnType("datetime2"); + + b.Property("PlannedQuantity") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); + + b.Property("PlannedStartDate") + .HasColumnType("datetime2"); + + b.Property("Priority") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("RequiredQuantity") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); + + b.Property("ScrapQuantity") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); + + b.Property("StatusId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Uom") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("OrderTypeId"); + + b.HasIndex("StatusId"); + + b.ToTable("Mrp_T_ProductionOrder", (string)null); + }); + + modelBuilder.Entity("Erp.Platform.Entities.ProductionOrderItem", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ConfirmedQuantity") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); + + 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("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialId") + .HasColumnType("uniqueidentifier"); + + b.Property("PlannedQuantity") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); + + b.Property("ProductionOrderId") + .HasColumnType("uniqueidentifier"); + + b.Property("RequiredQuantity") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); + + b.Property("SalesOrderId") + .HasColumnType("uniqueidentifier"); + + b.Property("ScrapQuantity") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Uom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("MaterialId"); + + b.HasIndex("ProductionOrderId"); + + b.HasIndex("SalesOrderId"); + + b.ToTable("Mrp_T_ProductionOrderItem", (string)null); + }); + + modelBuilder.Entity("Erp.Platform.Entities.ProductionOrderStatus", 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("Mrp_T_ProductionOrderStatus", (string)null); + }); + + modelBuilder.Entity("Erp.Platform.Entities.ProductionOrderType", 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("Mrp_T_ProductionOrderType", (string)null); + }); + modelBuilder.Entity("Erp.Platform.Entities.Program", b => { b.Property("Id") @@ -20619,6 +20947,52 @@ namespace Erp.Platform.Migrations b.Navigation("PlanWizard"); }); + modelBuilder.Entity("Erp.Platform.Entities.ProductionOrder", b => + { + b.HasOne("Erp.Platform.Entities.ProductionOrderType", "OrderType") + .WithMany("ProductionOrders") + .HasForeignKey("OrderTypeId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("Erp.Platform.Entities.ProductionOrderStatus", "Status") + .WithMany("ProductionOrders") + .HasForeignKey("StatusId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("OrderType"); + + b.Navigation("Status"); + }); + + modelBuilder.Entity("Erp.Platform.Entities.ProductionOrderItem", b => + { + b.HasOne("Erp.Platform.Entities.Material", "Material") + .WithMany("ProductionOrderItems") + .HasForeignKey("MaterialId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("Erp.Platform.Entities.ProductionOrder", "ProductionOrder") + .WithMany("Items") + .HasForeignKey("ProductionOrderId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("Erp.Platform.Entities.SalesOrder", "SalesOrder") + .WithMany() + .HasForeignKey("SalesOrderId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Material"); + + b.Navigation("ProductionOrder"); + + b.Navigation("SalesOrder"); + }); + modelBuilder.Entity("Erp.Platform.Entities.Project", b => { b.HasOne("Erp.Platform.Entities.Partner", "Customer") @@ -21954,6 +22328,8 @@ namespace Erp.Platform.Migrations b.Navigation("MovementItems"); + b.Navigation("ProductionOrderItems"); + b.Navigation("PurchaseOrderItems"); b.Navigation("QuotationItems"); @@ -22061,6 +22437,21 @@ namespace Erp.Platform.Migrations b.Navigation("Materials"); }); + modelBuilder.Entity("Erp.Platform.Entities.ProductionOrder", b => + { + b.Navigation("Items"); + }); + + modelBuilder.Entity("Erp.Platform.Entities.ProductionOrderStatus", b => + { + b.Navigation("ProductionOrders"); + }); + + modelBuilder.Entity("Erp.Platform.Entities.ProductionOrderType", b => + { + b.Navigation("ProductionOrders"); + }); + modelBuilder.Entity("Erp.Platform.Entities.Project", b => { b.Navigation("Phases"); diff --git a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251210070936_Initial.cs b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251210103609_Initial.cs similarity index 98% rename from api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251210070936_Initial.cs rename to api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251210103609_Initial.cs index 1980addc..cb4fab73 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251210070936_Initial.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251210103609_Initial.cs @@ -1655,6 +1655,50 @@ namespace Erp.Platform.Migrations table.PrimaryKey("PK_Mrp_T_OperationCategory", x => x.Id); }); + migrationBuilder.CreateTable( + name: "Mrp_T_ProductionOrderStatus", + 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_Mrp_T_ProductionOrderStatus", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Mrp_T_ProductionOrderType", + 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_Mrp_T_ProductionOrderType", x => x.Id); + }); + migrationBuilder.CreateTable( name: "Net_T_EventCategory", columns: table => new @@ -3938,6 +3982,54 @@ namespace Erp.Platform.Migrations onDelete: ReferentialAction.Restrict); }); + migrationBuilder.CreateTable( + name: "Mrp_T_ProductionOrder", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + OrderNumber = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + OrderTypeId = table.Column(type: "uniqueidentifier", nullable: false), + StatusId = table.Column(type: "uniqueidentifier", nullable: false), + Priority = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + PlannedStartDate = table.Column(type: "datetime2", nullable: false), + PlannedEndDate = table.Column(type: "datetime2", nullable: false), + ActualStartDate = table.Column(type: "datetime2", nullable: true), + ActualEndDate = table.Column(type: "datetime2", nullable: true), + PlannedQuantity = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m), + ConfirmedQuantity = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m), + RequiredQuantity = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m), + ScrapQuantity = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m), + Uom = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), + PlannedCost = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m), + ActualCost = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m), + Currency = table.Column(type: "nvarchar(10)", maxLength: 10, nullable: true), + CustomerRequirement = table.Column(type: "nvarchar(1000)", maxLength: 1000, 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_Mrp_T_ProductionOrder", x => x.Id); + table.ForeignKey( + name: "FK_Mrp_T_ProductionOrder_Mrp_T_ProductionOrderStatus_StatusId", + column: x => x.StatusId, + principalTable: "Mrp_T_ProductionOrderStatus", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Mrp_T_ProductionOrder_Mrp_T_ProductionOrderType_OrderTypeId", + column: x => x.OrderTypeId, + principalTable: "Mrp_T_ProductionOrderType", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + migrationBuilder.CreateTable( name: "OpenIddictAuthorizations", columns: table => new @@ -5888,6 +5980,51 @@ namespace Erp.Platform.Migrations onDelete: ReferentialAction.Restrict); }); + migrationBuilder.CreateTable( + name: "Mrp_T_ProductionOrderItem", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + ProductionOrderId = table.Column(type: "uniqueidentifier", nullable: false), + SalesOrderId = table.Column(type: "uniqueidentifier", nullable: false), + MaterialId = table.Column(type: "uniqueidentifier", nullable: false), + Uom = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + PlannedQuantity = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m), + ConfirmedQuantity = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m), + RequiredQuantity = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m), + ScrapQuantity = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m), + 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_Mrp_T_ProductionOrderItem", x => x.Id); + table.ForeignKey( + name: "FK_Mrp_T_ProductionOrderItem_Crm_T_SalesOrder_SalesOrderId", + column: x => x.SalesOrderId, + principalTable: "Crm_T_SalesOrder", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_Mrp_T_ProductionOrderItem_Mrp_T_ProductionOrder_ProductionOrderId", + column: x => x.ProductionOrderId, + principalTable: "Mrp_T_ProductionOrder", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Mrp_T_ProductionOrderItem_Scp_T_Material_MaterialId", + column: x => x.MaterialId, + principalTable: "Scp_T_Material", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + migrationBuilder.CreateTable( name: "Crm_T_Activity", columns: table => new @@ -9104,6 +9241,31 @@ namespace Erp.Platform.Migrations table: "Mrp_T_OperationType", column: "CategoryId"); + migrationBuilder.CreateIndex( + name: "IX_Mrp_T_ProductionOrder_OrderTypeId", + table: "Mrp_T_ProductionOrder", + column: "OrderTypeId"); + + migrationBuilder.CreateIndex( + name: "IX_Mrp_T_ProductionOrder_StatusId", + table: "Mrp_T_ProductionOrder", + column: "StatusId"); + + migrationBuilder.CreateIndex( + name: "IX_Mrp_T_ProductionOrderItem_MaterialId", + table: "Mrp_T_ProductionOrderItem", + column: "MaterialId"); + + migrationBuilder.CreateIndex( + name: "IX_Mrp_T_ProductionOrderItem_ProductionOrderId", + table: "Mrp_T_ProductionOrderItem", + column: "ProductionOrderId"); + + migrationBuilder.CreateIndex( + name: "IX_Mrp_T_ProductionOrderItem_SalesOrderId", + table: "Mrp_T_ProductionOrderItem", + column: "SalesOrderId"); + migrationBuilder.CreateIndex( name: "IX_Net_B_Meal_BranchId", table: "Net_B_Meal", @@ -10186,6 +10348,9 @@ namespace Erp.Platform.Migrations migrationBuilder.DropTable( name: "Mrp_T_BomOperation"); + migrationBuilder.DropTable( + name: "Mrp_T_ProductionOrderItem"); + migrationBuilder.DropTable( name: "Net_B_Meal"); @@ -10435,9 +10600,6 @@ namespace Erp.Platform.Migrations migrationBuilder.DropTable( name: "Crm_T_Opportunity"); - migrationBuilder.DropTable( - name: "Crm_T_SalesOrder"); - migrationBuilder.DropTable( name: "Hr_T_Payroll"); @@ -10465,6 +10627,12 @@ namespace Erp.Platform.Migrations migrationBuilder.DropTable( name: "Mrp_T_Operation"); + migrationBuilder.DropTable( + name: "Crm_T_SalesOrder"); + + migrationBuilder.DropTable( + name: "Mrp_T_ProductionOrder"); + migrationBuilder.DropTable( name: "Net_T_Training"); @@ -10561,9 +10729,6 @@ namespace Erp.Platform.Migrations migrationBuilder.DropTable( name: "Prt_T_Source"); - migrationBuilder.DropTable( - name: "Crm_T_SalesOrderStatus"); - migrationBuilder.DropTable( name: "Hr_T_Survey"); @@ -10582,6 +10747,15 @@ namespace Erp.Platform.Migrations migrationBuilder.DropTable( name: "Mrp_T_OperationType"); + migrationBuilder.DropTable( + name: "Crm_T_SalesOrderStatus"); + + migrationBuilder.DropTable( + name: "Mrp_T_ProductionOrderStatus"); + + migrationBuilder.DropTable( + name: "Mrp_T_ProductionOrderType"); + migrationBuilder.DropTable( name: "Net_T_EventCategory"); diff --git a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs index 77d22837..42044230 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs @@ -10512,6 +10512,334 @@ namespace Erp.Platform.Migrations b.ToTable("Adm_T_Product", (string)null); }); + modelBuilder.Entity("Erp.Platform.Entities.ProductionOrder", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ActualCost") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); + + b.Property("ActualEndDate") + .HasColumnType("datetime2"); + + b.Property("ActualStartDate") + .HasColumnType("datetime2"); + + b.Property("ConfirmedQuantity") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Currency") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("CustomerRequirement") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + 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("OrderNumber") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("OrderTypeId") + .HasColumnType("uniqueidentifier"); + + b.Property("PlannedCost") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); + + b.Property("PlannedEndDate") + .HasColumnType("datetime2"); + + b.Property("PlannedQuantity") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); + + b.Property("PlannedStartDate") + .HasColumnType("datetime2"); + + b.Property("Priority") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("RequiredQuantity") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); + + b.Property("ScrapQuantity") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); + + b.Property("StatusId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Uom") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("OrderTypeId"); + + b.HasIndex("StatusId"); + + b.ToTable("Mrp_T_ProductionOrder", (string)null); + }); + + modelBuilder.Entity("Erp.Platform.Entities.ProductionOrderItem", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ConfirmedQuantity") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); + + 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("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialId") + .HasColumnType("uniqueidentifier"); + + b.Property("PlannedQuantity") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); + + b.Property("ProductionOrderId") + .HasColumnType("uniqueidentifier"); + + b.Property("RequiredQuantity") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); + + b.Property("SalesOrderId") + .HasColumnType("uniqueidentifier"); + + b.Property("ScrapQuantity") + .ValueGeneratedOnAdd() + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)") + .HasDefaultValue(0m); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Uom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("MaterialId"); + + b.HasIndex("ProductionOrderId"); + + b.HasIndex("SalesOrderId"); + + b.ToTable("Mrp_T_ProductionOrderItem", (string)null); + }); + + modelBuilder.Entity("Erp.Platform.Entities.ProductionOrderStatus", 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("Mrp_T_ProductionOrderStatus", (string)null); + }); + + modelBuilder.Entity("Erp.Platform.Entities.ProductionOrderType", 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("Mrp_T_ProductionOrderType", (string)null); + }); + modelBuilder.Entity("Erp.Platform.Entities.Program", b => { b.Property("Id") @@ -20616,6 +20944,52 @@ namespace Erp.Platform.Migrations b.Navigation("PlanWizard"); }); + modelBuilder.Entity("Erp.Platform.Entities.ProductionOrder", b => + { + b.HasOne("Erp.Platform.Entities.ProductionOrderType", "OrderType") + .WithMany("ProductionOrders") + .HasForeignKey("OrderTypeId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("Erp.Platform.Entities.ProductionOrderStatus", "Status") + .WithMany("ProductionOrders") + .HasForeignKey("StatusId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("OrderType"); + + b.Navigation("Status"); + }); + + modelBuilder.Entity("Erp.Platform.Entities.ProductionOrderItem", b => + { + b.HasOne("Erp.Platform.Entities.Material", "Material") + .WithMany("ProductionOrderItems") + .HasForeignKey("MaterialId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("Erp.Platform.Entities.ProductionOrder", "ProductionOrder") + .WithMany("Items") + .HasForeignKey("ProductionOrderId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("Erp.Platform.Entities.SalesOrder", "SalesOrder") + .WithMany() + .HasForeignKey("SalesOrderId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Material"); + + b.Navigation("ProductionOrder"); + + b.Navigation("SalesOrder"); + }); + modelBuilder.Entity("Erp.Platform.Entities.Project", b => { b.HasOne("Erp.Platform.Entities.Partner", "Customer") @@ -21951,6 +22325,8 @@ namespace Erp.Platform.Migrations b.Navigation("MovementItems"); + b.Navigation("ProductionOrderItems"); + b.Navigation("PurchaseOrderItems"); b.Navigation("QuotationItems"); @@ -22058,6 +22434,21 @@ namespace Erp.Platform.Migrations b.Navigation("Materials"); }); + modelBuilder.Entity("Erp.Platform.Entities.ProductionOrder", b => + { + b.Navigation("Items"); + }); + + modelBuilder.Entity("Erp.Platform.Entities.ProductionOrderStatus", b => + { + b.Navigation("ProductionOrders"); + }); + + modelBuilder.Entity("Erp.Platform.Entities.ProductionOrderType", b => + { + b.Navigation("ProductionOrders"); + }); + modelBuilder.Entity("Erp.Platform.Entities.Project", b => { b.Navigation("Phases"); diff --git a/api/src/Erp.Platform.EntityFrameworkCore/Tenants/Seeds/TenantData.json b/api/src/Erp.Platform.EntityFrameworkCore/Tenants/Seeds/TenantData.json index ac7d9bbc..e42ad979 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Tenants/Seeds/TenantData.json +++ b/api/src/Erp.Platform.EntityFrameworkCore/Tenants/Seeds/TenantData.json @@ -100,9 +100,7 @@ "props": null, "description": null, "isActive": true, - "dependencies": [ - "DynamicEntityComponent" - ] + "dependencies": ["DynamicEntityComponent"] } ], "ReportCategories": [ @@ -2431,12 +2429,7 @@ "minSalary": 80000, "maxSalary": 120000, "currency": "USD", - "requiredSkills": [ - "JavaScript", - "TypeScript", - "React", - "Node.js" - ], + "requiredSkills": ["JavaScript", "TypeScript", "React", "Node.js"], "responsibilities": [ "Develop frontend and backend applications", "Write clean and maintainable code", @@ -4131,9 +4124,7 @@ { "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": [ @@ -6847,5 +6838,59 @@ "description": "Verilen çekler", "isActive": true } - ] -} \ No newline at end of file + ], + "ProductionOrderTypes": [ + { + "name": "Standart", + "description": "Standart üretim siparişi türü", + "isActive": true + }, + { + "name": "Tamir", + "description": "Tamir üretim siparişi türü", + "isActive": true + }, + { + "name": "Bakım Emri", + "description": "Bakım emri üretim siparişi türü", + "isActive": true + }, + { + "name": "Numune", + "description": "Numune üretim siparişi türü", + "isActive": true + } + ], + "ProductionOrderStatuses": [ + { + "name": "Oluşturuldu", + "description": "Üretim siparişi oluşturuldu", + "isActive": true + }, + { + "name": "Serbest bırakıldı", + "description": "Üretim siparişi serbest bırakıldı", + "isActive": true + }, + { + "name": "İşlemde", + "description": "Üretim siparişi işlemde", + "isActive": true + }, + { + "name": "Tamamlandı", + "description": "Üretim siparişi tamamlandı", + "isActive": true + }, + { + "name": "İptal edildi", + "description": "Üretim siparişi iptal edildi", + "isActive": true + }, + { + "name": "Beklemede", + "description": "Üretim siparişi beklemede", + "isActive": true + } + ] +} diff --git a/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantDataSeeder.cs b/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantDataSeeder.cs index 250a46d8..7934c426 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantDataSeeder.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantDataSeeder.cs @@ -154,6 +154,8 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency private readonly IRepository _paymentStatusRepository; private readonly IRepository _checkStatusRepository; private readonly IRepository _checkTypeRepository; + private readonly IRepository _productionOrderTypeRepository; + private readonly IRepository _productionOrderStatusRepository; public TenantDataSeeder( IClock clock, @@ -289,7 +291,9 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency IRepository invoiceStatusRepository, IRepository paymentStatusRepository, IRepository checkStatusRepository, - IRepository checkTypeRepository + IRepository checkTypeRepository, + IRepository productionOrderTypeRepository, + IRepository productionOrderStatusRepository ) { _clock = clock; @@ -427,6 +431,8 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency _paymentStatusRepository = paymentStatusRepository; _checkStatusRepository = checkStatusRepository; _checkTypeRepository = checkTypeRepository; + _productionOrderTypeRepository = productionOrderTypeRepository; + _productionOrderStatusRepository = productionOrderStatusRepository; } private static IConfigurationRoot BuildConfiguration() @@ -2963,6 +2969,35 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency IsActive = item.IsActive }, autoSave: true); } + + foreach (var item in items.ProductionOrderTypes) + { + var exists = await _productionOrderTypeRepository.AnyAsync(x => x.Name == item.Name); + if (exists) + continue; + + await _productionOrderTypeRepository.InsertAsync(new ProductionOrderType + { + Name = item.Name, + Description = item.Description, + IsActive = item.IsActive + }, autoSave: true); + } + + foreach (var item in items.ProductionOrderStatuses) + { + var exists = await _productionOrderStatusRepository.AnyAsync(x => x.Name == item.Name); + if (exists) + continue; + + await _productionOrderStatusRepository.InsertAsync(new ProductionOrderStatus + { + Name = item.Name, + Description = item.Description, + IsActive = item.IsActive + }, autoSave: true); + } + } } diff --git a/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantSeederDto.cs b/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantSeederDto.cs index a2f8822f..8a12b745 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantSeederDto.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantSeederDto.cs @@ -156,6 +156,22 @@ public class TenantSeederDto public List PaymentStatuses { get; set; } public List CheckStatuses { get; set; } public List CheckTypes { get; set; } + public List ProductionOrderTypes { get; set; } + public List ProductionOrderStatuses { get; set; } +} + +public class ProductionOrderStatusSeedDto +{ + public string Name { get; set; } + public string Description { get; set; } + public bool IsActive { get; set; } +} + +public class ProductionOrderTypeSeedDto +{ + public string Name { get; set; } + public string Description { get; set; } + public bool IsActive { get; set; } } public class CheckTypeSeedDto diff --git a/ui/src/views/mrp/components/ProductionOrderList.tsx b/ui/src/views/mrp/components/ProductionOrderList.tsx index e4fa4230..e64a2ee4 100644 --- a/ui/src/views/mrp/components/ProductionOrderList.tsx +++ b/ui/src/views/mrp/components/ProductionOrderList.tsx @@ -19,7 +19,6 @@ import { } from 'react-icons/fa' import classNames from 'classnames' import { ProductionOrderStatusEnum, ProductionOrderTypeEnum } from '../../../types/mrp' -import dayjs from 'dayjs' import { mockProductionOrders } from '../../../mocks/mockProductionOrders' import { mockSalesOrders } from '../../../mocks/mockSalesOrders' import { mockBOMs } from '../../../mocks/mockBOMs'