diff --git a/api/src/Erp.Platform.DbMigrator/Seeds/LanguagesData.json b/api/src/Erp.Platform.DbMigrator/Seeds/LanguagesData.json index 6b4c4468..1f7091d8 100644 --- a/api/src/Erp.Platform.DbMigrator/Seeds/LanguagesData.json +++ b/api/src/Erp.Platform.DbMigrator/Seeds/LanguagesData.json @@ -9751,6 +9751,12 @@ "tr": "Satış Siparişleri", "en": "Sales Orders" }, + { + "resourceName": "Platform", + "key": "App.Mrp.OperationCategory", + "tr": "Operasyon Kategorileri", + "en": "Operation Categories" + }, { "resourceName": "Platform", "key": "App.Mrp.OperationType", @@ -9836,4 +9842,4 @@ "en": "Check & Notes" } ] -} \ No newline at end of file +} diff --git a/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Mrp.cs b/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Mrp.cs index ed792cb6..c63f98c0 100644 --- a/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Mrp.cs +++ b/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Mrp.cs @@ -13,8 +13,6 @@ using Volo.Abp.Data; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Repositories; using Volo.Abp.Identity; -using Volo.Abp.TenantManagement; -using AbpIdentity = Erp.Platform.Data.Seeds.SeedConsts.AbpIdentity; using AppCodes = Erp.Platform.Data.Seeds.SeedConsts.AppCodes; using static Erp.Platform.PlatformConsts; using static Erp.Platform.PlatformSeeder.SeederDefaults; @@ -47,128 +45,652 @@ public class ListFormSeeder_Mrp : IDataSeedContributor, ITransientDependency { var listFormName = String.Empty; - // #region Workcenter Type - // listFormName = AppCodes.Maintenance.WorkcenterType; - // if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName)) - // { - // var listForm = await _listFormRepository.InsertAsync( - // new ListForm() - // { - // ListFormType = ListFormTypeEnum.List, - // IsSubForm = false, - // ShowNote = true, - // LayoutJson = DefaultLayoutJson, - // CultureName = LanguageCodes.En, - // ListFormCode = listFormName, - // Name = listFormName, - // Title = listFormName, - // DataSourceCode = SeedConsts.DataSources.DefaultCode, - // IsTenant = true, - // IsBranch = false, - // IsOrganizationUnit = false, - // Description = listFormName, - // SelectCommandType = SelectCommandTypeEnum.Table, - // SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.WorkcenterType)), - // 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.WorkcenterType)), - // 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 = 2, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, - // new EditingFormItemDto { Order = 3, DataField = "Description", ColSpan = 1, EditorType2=EditorTypes.dxTextArea }, - // new EditingFormItemDto { Order = 4, DataField = "IsActive", ColSpan = 1, EditorType2=EditorTypes.dxCheckBox }, - // ]} - // }), - // FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { - // new() { FieldName = "IsActive", FieldDbType = DbType.Boolean, Value = "true", CustomValueType = FieldCustomValueTypeEnum.Value } - // }), - // } - // ); + #region Operation Category + listFormName = AppCodes.Mrp.OperationCategory; + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName)) + { + var listForm = await _listFormRepository.InsertAsync( + new ListForm() + { + ListFormType = ListFormTypeEnum.List, + IsSubForm = false, + ShowNote = true, + LayoutJson = DefaultLayoutJson, + CultureName = LanguageCodes.En, + ListFormCode = listFormName, + Name = listFormName, + Title = listFormName, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = true, + IsBranch = false, + IsOrganizationUnit = false, + Description = listFormName, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.OperationCategory)), + 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.OperationCategory)), + 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 WorkcenterType 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 - // }, + #region Operation Category Fields + await _listFormFieldRepository.InsertManyAsync([ + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + Width = 100, + ListOrderNo = 1, + Visible = false, + IsActive = true, + IsDeleted = false, + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Name", + Width = 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 - // 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 Operation Type + listFormName = AppCodes.Mrp.OperationType; + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName)) + { + var listForm = await _listFormRepository.InsertAsync( + new ListForm() + { + ListFormType = ListFormTypeEnum.List, + IsSubForm = false, + ShowNote = true, + LayoutJson = DefaultLayoutJson, + CultureName = LanguageCodes.En, + ListFormCode = listFormName, + Name = listFormName, + Title = listFormName, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = true, + IsBranch = false, + IsOrganizationUnit = false, + Description = listFormName, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.OperationType)), + 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.OperationType)), + DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson, + PagerOptionJson = DefaultPagerOptionJson, + InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson, + EditingOptionJson = DefaultEditingOptionJson(listFormName, 800, 300, 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 = "Code", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 2, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 3, DataField = "Description", ColSpan = 2, EditorType2=EditorTypes.dxTextArea }, + new EditingFormItemDto { Order = 4, DataField = "CategoryId", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 5, DataField = "DefaultDuration", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxNumberBox }, + new EditingFormItemDto { Order = 6, DataField = "RequiresSetup", ColSpan = 1, EditorType2=EditorTypes.dxCheckBox }, + new EditingFormItemDto { Order = 7, DataField = "AllowsParallelOperation", ColSpan = 1, EditorType2=EditorTypes.dxCheckBox }, + new EditingFormItemDto { Order = 8, DataField = "QualityCheckRequired", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxCheckBox }, + new EditingFormItemDto { Order = 9, DataField = "IsActive", ColSpan = 1, EditorType2=EditorTypes.dxCheckBox }, + ]} + }), + FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + new() { FieldName = "DefaultDuration", FieldDbType = DbType.Int32, Value = "0", CustomValueType = FieldCustomValueTypeEnum.Value }, + new() { FieldName = "RequiresSetup", FieldDbType = DbType.Boolean, Value = "false", CustomValueType = FieldCustomValueTypeEnum.Value }, + new() { FieldName = "AllowsParallelOperation", FieldDbType = DbType.Boolean, Value = "false", CustomValueType = FieldCustomValueTypeEnum.Value }, + new() { FieldName = "IsActQualityCheckRequiredive", FieldDbType = DbType.Boolean, Value = "false", CustomValueType = FieldCustomValueTypeEnum.Value }, + new() { FieldName = "QualityCheckRequired", FieldDbType = DbType.Boolean, Value = "false", CustomValueType = FieldCustomValueTypeEnum.Value }, + new() { FieldName = "IsActive", FieldDbType = DbType.Boolean, Value = "true", CustomValueType = FieldCustomValueTypeEnum.Value } + }), + } + ); + + #region Operation 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 = "Code", + Width = 150, + ListOrderNo = 2, + 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 = "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.Guid, + FieldName = "CategoryId", + Width = 100, + ListOrderNo = 5, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.OperationCategory), "Id", "Name"), + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Int32, + FieldName = "DefaultDuration", + Width = 100, + 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.Boolean, + FieldName = "RequiresSetup", + 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.Boolean, + FieldName = "AllowsParallelOperation", + Width = 100, + ListOrderNo = 8, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Boolean, + FieldName = "QualityCheckRequired", + Width = 100, + 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.Boolean, + FieldName = "IsActive", + Width = 100, + ListOrderNo = 10, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + } + ]); + #endregion + } + #endregion + + #region Operation + listFormName = AppCodes.Mrp.Operation; + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName)) + { + var listForm = await _listFormRepository.InsertAsync( + new ListForm() + { + ListFormType = ListFormTypeEnum.List, + IsSubForm = false, + ShowNote = true, + LayoutJson = DefaultLayoutJson, + CultureName = LanguageCodes.En, + ListFormCode = listFormName, + Name = listFormName, + Title = listFormName, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = true, + IsBranch = false, + IsOrganizationUnit = false, + Description = listFormName, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.Operation)), + 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.Operation)), + DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson, + PagerOptionJson = DefaultPagerOptionJson, + InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson, + EditingOptionJson = DefaultEditingOptionJson(listFormName, 800, 400, 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 = "Code", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 2, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 3, DataField = "Description", ColSpan = 2, EditorType2=EditorTypes.dxTextArea }, + new EditingFormItemDto { Order = 4, DataField = "OperationTypeId", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 5, DataField = "WorkCenterId", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 6, DataField = "StandardTime", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxNumberBox }, + new EditingFormItemDto { Order = 7, DataField = "SetupTime", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxNumberBox }, + new EditingFormItemDto { Order = 8, DataField = "LaborCost", ColSpan = 1, EditorType2=EditorTypes.dxNumberBox, EditorOptions=EditorOptionValues.NumberStandartFormat }, + new EditingFormItemDto { Order = 9, DataField = "MachineCost", ColSpan = 1, EditorType2=EditorTypes.dxNumberBox, EditorOptions=EditorOptionValues.NumberStandartFormat }, + new EditingFormItemDto { Order = 10, DataField = "OverheadCost", ColSpan = 1, EditorType2=EditorTypes.dxNumberBox, EditorOptions=EditorOptionValues.NumberStandartFormat }, + new EditingFormItemDto { Order = 11, DataField = "Instructions", ColSpan = 1, EditorType2=EditorTypes.dxTextArea }, + new EditingFormItemDto { Order = 12, DataField = "QualityCheckRequired", ColSpan = 1, EditorType2=EditorTypes.dxCheckBox }, + new EditingFormItemDto { Order = 13, DataField = "IsActive", ColSpan = 1, EditorType2=EditorTypes.dxCheckBox }, + ]} + }), + FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + new() { FieldName = "StandardTime", FieldDbType = DbType.Int32, Value = "0", CustomValueType = FieldCustomValueTypeEnum.Value }, + new() { FieldName = "SetupTime", FieldDbType = DbType.Int32, Value = "0", CustomValueType = FieldCustomValueTypeEnum.Value }, + new() { FieldName = "LaborCost", FieldDbType = DbType.Decimal, Value = "0", CustomValueType = FieldCustomValueTypeEnum.Value }, + new() { FieldName = "MachineCost", FieldDbType = DbType.Decimal, Value = "0", CustomValueType = FieldCustomValueTypeEnum.Value }, + new() { FieldName = "OverheadCost", FieldDbType = DbType.Decimal, Value = "0", CustomValueType = FieldCustomValueTypeEnum.Value }, + new() { FieldName = "QualityCheckRequired", FieldDbType = DbType.Boolean, Value = "false", CustomValueType = FieldCustomValueTypeEnum.Value }, + new() { FieldName = "IsActive", FieldDbType = DbType.Boolean, Value = "true", CustomValueType = FieldCustomValueTypeEnum.Value } + }), + } + ); + + #region Operation Category Fields + await _listFormFieldRepository.InsertManyAsync([ + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + Width = 100, + ListOrderNo = 1, + Visible = false, + IsActive = true, + IsDeleted = false, + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Code", + Width = 100, + ListOrderNo = 2, + 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 = "Name", + Width = 150, + 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 = 300, + 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.Guid, + FieldName = "OperationTypeId", + Width = 100, + ListOrderNo = 5, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.OperationType), "Id", "Name"), + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "WorkCenterId", + Width = 150, + ListOrderNo = 6, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.Workcenter), "Id", "Name"), + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Int32, + FieldName = "StandardTime", + Width = 100, + 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.Boolean, + FieldName = "SetupTime", + Width = 100, + ListOrderNo = 8, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Decimal, + FieldName = "LaborCost", + Width = 100, + 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 = "MachineCost", + Width = 100, + ListOrderNo = 10, + 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 = "OverheadCost", + 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.String, + FieldName = "Instructions", + Width = 500, + 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.Boolean, + FieldName = "QualityCheckRequired", + 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.Boolean, + FieldName = "IsActive", + Width = 100, + ListOrderNo = 14, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + } + ]); + #endregion + } + #endregion } } diff --git a/api/src/Erp.Platform.DbMigrator/Seeds/MenusData.json b/api/src/Erp.Platform.DbMigrator/Seeds/MenusData.json index e97f267e..65482ad6 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,216 +285,168 @@ "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", @@ -2870,22 +2806,22 @@ }, { "ParentCode": "App.Mrp", - "Code": "App.Mrp.OperationType", - "DisplayName": "App.Mrp.OperationType", + "Code": "App.Mrp.OperationCategory", + "DisplayName": "App.Mrp.OperationCategory", "Order": 1, - "Url": "/admin/mrp/operation-types", + "Url": "/admin/list/App.Mrp.OperationCategory", "Icon": "FcEngineering", - "RequiredPermissionName": "App.Mrp.OperationType", + "RequiredPermissionName": "App.Mrp.OperationCategory", "IsDisabled": false }, { "ParentCode": "App.Mrp", - "Code": "App.Mrp.Workcenter", - "DisplayName": "App.Mrp.Workcenter", + "Code": "App.Mrp.OperationType", + "DisplayName": "App.Mrp.OperationType", "Order": 2, - "Url": "/admin/mrp/workcenters", - "Icon": "FcWorkflow", - "RequiredPermissionName": "App.Mrp.Workcenter", + "Url": "/admin/list/App.Mrp.OperationType", + "Icon": "FcAutomatic", + "RequiredPermissionName": "App.Mrp.OperationType", "IsDisabled": false }, { @@ -2893,16 +2829,26 @@ "Code": "App.Mrp.Operation", "DisplayName": "App.Mrp.Operation", "Order": 3, - "Url": "/admin/mrp/operations", + "Url": "/admin/list/App.Mrp.Operation", "Icon": "FcFlashOn", "RequiredPermissionName": "App.Mrp.Operation", "IsDisabled": false }, + { + "ParentCode": "App.Mrp", + "Code": "App.Mrp.Workcenter", + "DisplayName": "App.Mrp.Workcenter", + "Order": 4, + "Url": "/admin/mrp/workcenters", + "Icon": "FcWorkflow", + "RequiredPermissionName": "App.Mrp.Workcenter", + "IsDisabled": false + }, { "ParentCode": "App.Mrp", "Code": "App.Mrp.Bom", "DisplayName": "App.Mrp.Bom", - "Order": 4, + "Order": 5, "Url": "/admin/mrp/bom", "Icon": "FcFlowChart", "RequiredPermissionName": "App.Mrp.Bom", @@ -2912,7 +2858,7 @@ "ParentCode": "App.Mrp", "Code": "App.Mrp.ProductionOrder", "DisplayName": "App.Mrp.ProductionOrder", - "Order": 5, + "Order": 6, "Url": "/admin/mrp/production-orders", "Icon": "FcFactory", "RequiredPermissionName": "App.Mrp.ProductionOrder", @@ -2922,7 +2868,7 @@ "ParentCode": "App.Mrp", "Code": "App.Mrp.WorkOrder", "DisplayName": "App.Mrp.WorkOrder", - "Order": 6, + "Order": 7, "Url": "/admin/mrp/work-orders", "Icon": "FcList", "RequiredPermissionName": "App.Mrp.WorkOrder", @@ -2932,7 +2878,7 @@ "ParentCode": "App.Mrp", "Code": "App.Mrp.DemandPlanning", "DisplayName": "App.Mrp.DemandPlanning", - "Order": 7, + "Order": 8, "Url": "/admin/mrp/demand-planning", "Icon": "FcPlanner", "RequiredPermissionName": "App.Mrp.DemandPlanning", @@ -2942,7 +2888,7 @@ "ParentCode": "App.Mrp", "Code": "App.Mrp.MaterialRequirement", "DisplayName": "App.Mrp.MaterialRequirement", - "Order": 8, + "Order": 9, "Url": "/admin/mrp/material-requirements", "Icon": "FcDataSheet", "RequiredPermissionName": "App.Mrp.MaterialRequirement", @@ -2952,7 +2898,7 @@ "ParentCode": "App.Mrp", "Code": "App.Mrp.PlanningGantt", "DisplayName": "App.Mrp.PlanningGantt", - "Order": 9, + "Order": 10, "Url": "/admin/mrp/planning-gantt", "Icon": "FcTimeline", "RequiredPermissionName": "App.Mrp.PlanningGantt", @@ -3029,4 +2975,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 9d3262c2..a54373f9 100644 --- a/api/src/Erp.Platform.DbMigrator/Seeds/PermissionsData.json +++ b/api/src/Erp.Platform.DbMigrator/Seeds/PermissionsData.json @@ -10914,6 +10914,71 @@ "MultiTenancySide": 3, "MenuGroup": "Erp" }, + + { + "GroupName": "App.Mrp", + "Name": "App.Mrp.OperationCategory", + "ParentName": null, + "DisplayName": "App.Mrp.OperationCategory", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Mrp", + "Name": "App.Mrp.OperationCategory.Create", + "ParentName": "App.Mrp.OperationCategory", + "DisplayName": "Create", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Mrp", + "Name": "App.Mrp.OperationCategory.Update", + "ParentName": "App.Mrp.OperationCategory", + "DisplayName": "Update", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Mrp", + "Name": "App.Mrp.OperationCategory.Delete", + "ParentName": "App.Mrp.OperationCategory", + "DisplayName": "Delete", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Mrp", + "Name": "App.Mrp.OperationCategory.Export", + "ParentName": "App.Mrp.OperationCategory", + "DisplayName": "Export", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Mrp", + "Name": "App.Mrp.OperationCategory.Import", + "ParentName": "App.Mrp.OperationCategory", + "DisplayName": "Import", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.Mrp", + "Name": "App.Mrp.OperationCategory.Note", + "ParentName": "App.Mrp.OperationCategory", + "DisplayName": "Note", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { "GroupName": "App.Mrp", "Name": "App.Mrp.OperationType", @@ -12112,4 +12177,4 @@ "MenuGroup": "Erp" } ] -} \ No newline at end of file +} diff --git a/api/src/Erp.Platform.Domain.Shared/Enums/TableNameEnum.cs b/api/src/Erp.Platform.Domain.Shared/Enums/TableNameEnum.cs index 150a079a..4c75023d 100644 --- a/api/src/Erp.Platform.Domain.Shared/Enums/TableNameEnum.cs +++ b/api/src/Erp.Platform.Domain.Shared/Enums/TableNameEnum.cs @@ -181,4 +181,7 @@ public enum TableNameEnum Location, Putaway, PutawayCondition, + OperationCategory, + OperationType, + Operation } diff --git a/api/src/Erp.Platform.Domain.Shared/TableNameResolver.cs b/api/src/Erp.Platform.Domain.Shared/TableNameResolver.cs index 35c20155..32434d12 100644 --- a/api/src/Erp.Platform.Domain.Shared/TableNameResolver.cs +++ b/api/src/Erp.Platform.Domain.Shared/TableNameResolver.cs @@ -177,7 +177,7 @@ public static class TableNameResolver { nameof(TableNameEnum.Request), (TablePrefix.TenantByName, MenuPrefix.SupplyChain) }, { nameof(TableNameEnum.RequestItem), (TablePrefix.TenantByName, MenuPrefix.SupplyChain) }, - //Crm + // CRM { nameof(TableNameEnum.CustomerSegment), (TablePrefix.TenantByName, MenuPrefix.Crm) }, { nameof(TableNameEnum.CustomerType), (TablePrefix.TenantByName, MenuPrefix.Crm) }, { nameof(TableNameEnum.LossReason), (TablePrefix.TenantByName, MenuPrefix.Crm) }, @@ -217,6 +217,10 @@ public static class TableNameResolver { nameof(TableNameEnum.Putaway), (TablePrefix.TenantByName, MenuPrefix.Store) }, { nameof(TableNameEnum.PutawayCondition), (TablePrefix.TenantByName, MenuPrefix.Store) }, + // 🔹 MRP + { nameof(TableNameEnum.OperationCategory), (TablePrefix.TenantByName, MenuPrefix.Mrp) }, + { nameof(TableNameEnum.OperationType), (TablePrefix.TenantByName, MenuPrefix.Mrp) }, + { nameof(TableNameEnum.Operation), (TablePrefix.TenantByName, MenuPrefix.Mrp) }, }; public static string GetFullTableName(string tableName) diff --git a/api/src/Erp.Platform.Domain/Data/SeedConsts.cs b/api/src/Erp.Platform.Domain/Data/SeedConsts.cs index caa9c119..86b66bda 100644 --- a/api/src/Erp.Platform.Domain/Data/SeedConsts.cs +++ b/api/src/Erp.Platform.Domain/Data/SeedConsts.cs @@ -558,6 +558,14 @@ public static class SeedConsts public const string Putaway = Default + ".Putaway"; public const string PutawayCondition = Default + ".PutawayCondition"; } + + public static class Mrp + { + public const string Default = Prefix.App + ".Mrp"; + public const string OperationCategory = Default + ".OperationCategory"; + public const string OperationType = Default + ".OperationType"; + public const string Operation = Default + ".Operation"; + } } public static class DataSources diff --git a/api/src/Erp.Platform.Domain/Entities/Tenant/Maintenance/Workcenter.cs b/api/src/Erp.Platform.Domain/Entities/Tenant/Maintenance/Workcenter.cs index be30eb9c..06d19de7 100644 --- a/api/src/Erp.Platform.Domain/Entities/Tenant/Maintenance/Workcenter.cs +++ b/api/src/Erp.Platform.Domain/Entities/Tenant/Maintenance/Workcenter.cs @@ -34,6 +34,7 @@ public class Workcenter : FullAuditedEntity, IMultiTenant public bool IsActive { get; set; } public ICollection Specifications { get; set; } + public ICollection Operations { get; set; } // public virtual ICollection MaintenancePlans { get; set; } // public virtual ICollection WorkOrders { get; set; } // public virtual ICollection DownTimeHistory { get; set; } diff --git a/api/src/Erp.Platform.Domain/Entities/Tenant/Mrp/Operation.cs b/api/src/Erp.Platform.Domain/Entities/Tenant/Mrp/Operation.cs new file mode 100644 index 00000000..82b35c16 --- /dev/null +++ b/api/src/Erp.Platform.Domain/Entities/Tenant/Mrp/Operation.cs @@ -0,0 +1,30 @@ +using System; +using Volo.Abp.Domain.Entities.Auditing; +using Volo.Abp.MultiTenancy; + +namespace Erp.Platform.Entities; + +public class Operation : FullAuditedEntity, IMultiTenant +{ + public Guid? TenantId { get; set; } + + public string Code { get; set; } + public string Name { get; set; } + public string Description { get; set; } + + public Guid? OperationTypeId { get; set; } + public OperationType? OperationType { get; set; } + + public Guid? WorkCenterId { get; set; } + public Workcenter? WorkCenter { get; set; } + + public int StandardTime { get; set; } + public int SetupTime { get; set; } + public decimal LaborCost { get; set; } + public decimal MachineCost { get; set; } + public decimal OverheadCost { get; set; } + public string Instructions { get; set; } + public bool QualityCheckRequired { get; set; } + + public bool IsActive { get; set; } +} diff --git a/api/src/Erp.Platform.Domain/Entities/Tenant/Mrp/OperationCategory.cs b/api/src/Erp.Platform.Domain/Entities/Tenant/Mrp/OperationCategory.cs new file mode 100644 index 00000000..4684ad4f --- /dev/null +++ b/api/src/Erp.Platform.Domain/Entities/Tenant/Mrp/OperationCategory.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using Volo.Abp.Domain.Entities.Auditing; +using Volo.Abp.MultiTenancy; + +namespace Erp.Platform.Entities; + +public class OperationCategory : FullAuditedEntity, IMultiTenant +{ + public Guid? TenantId { get; set; } + + public string Name { get; set; } + public string Description { get; set; } + + public bool IsActive { get; set; } + + public ICollection OperationTypes { get; set; } +} + diff --git a/api/src/Erp.Platform.Domain/Entities/Tenant/Mrp/OperationType.cs b/api/src/Erp.Platform.Domain/Entities/Tenant/Mrp/OperationType.cs new file mode 100644 index 00000000..fc8f6ff5 --- /dev/null +++ b/api/src/Erp.Platform.Domain/Entities/Tenant/Mrp/OperationType.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using Volo.Abp.Domain.Entities.Auditing; +using Volo.Abp.MultiTenancy; + +namespace Erp.Platform.Entities; + +public class OperationType : FullAuditedEntity, IMultiTenant +{ + public Guid? TenantId { get; set; } + + public string Code { get; set; } + public string Name { get; set; } + public string Description { get; set; } + + public Guid? CategoryId { get; set; } + public OperationCategory? Category { get; set; } + + public int DefaultDuration { get; set; } + public bool RequiresSetup { get; set; } + public bool AllowsParallelOperation { get; set; } + public bool QualityCheckRequired { get; set; } + + public bool IsActive { get; set; } + + public ICollection Operations { get; set; } +} diff --git a/api/src/Erp.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs b/api/src/Erp.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs index 965c8157..e863333f 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs @@ -257,6 +257,12 @@ public class PlatformDbContext : public DbSet Workorders { get; set; } #endregion + #region Mrp + public DbSet OperationCategories { get; set; } + public DbSet OperationTypes { get; set; } + public DbSet Operations { get; set; } + #endregion + public PlatformDbContext(DbContextOptions options) : base(options) { @@ -3060,5 +3066,61 @@ public class PlatformDbContext : b.Property(x => x.Operator).IsRequired().HasMaxLength(20); b.Property(x => x.Value).HasMaxLength(200); }); + + builder.Entity(b => + { + b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.OperationCategory)), Prefix.DbSchema); + b.ConfigureByConvention(); + + b.Property(x => x.Name).IsRequired().HasMaxLength(100); + b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.IsActive).HasDefaultValue(true); + }); + + builder.Entity(b => + { + b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.OperationType)), Prefix.DbSchema); + b.ConfigureByConvention(); + + b.Property(x => x.Code).IsRequired().HasMaxLength(100); + b.Property(x => x.Name).IsRequired().HasMaxLength(200); + b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.CategoryId).IsRequired(); + b.Property(x => x.DefaultDuration).HasDefaultValue(0); + b.Property(x => x.RequiresSetup).HasDefaultValue(false); + b.Property(x => x.AllowsParallelOperation).HasDefaultValue(false); + b.Property(x => x.QualityCheckRequired).HasDefaultValue(false); + b.Property(x => x.IsActive).HasDefaultValue(true); + + b.HasOne(x => x.Category) + .WithMany(x => x.OperationTypes) + .HasForeignKey(x => x.CategoryId) + .OnDelete(DeleteBehavior.Restrict); + }); + + builder.Entity(b => + { + b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Operation)), Prefix.DbSchema); + b.ConfigureByConvention(); + + b.Property(x => x.Code).IsRequired().HasMaxLength(100); + b.Property(x => x.Name).IsRequired().HasMaxLength(200); + b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.OperationTypeId).IsRequired(); + b.Property(x => x.WorkCenterId).IsRequired(); + b.Property(x => x.StandardTime).HasDefaultValue(0); + b.Property(x => x.SetupTime).HasDefaultValue(0); + b.Property(x => x.LaborCost).HasPrecision(18, 2).HasDefaultValue(0); + b.Property(x => x.MachineCost).HasPrecision(18, 2).HasDefaultValue(0); + b.Property(x => x.OverheadCost).HasPrecision(18, 2).HasDefaultValue(0); + b.Property(x => x.Instructions).HasMaxLength(1000); + b.Property(x => x.QualityCheckRequired).HasDefaultValue(false); + b.Property(x => x.IsActive).HasDefaultValue(true); + + b.HasOne(x => x.OperationType) + .WithMany(x => x.Operations) + .HasForeignKey(x => x.OperationTypeId) + .OnDelete(DeleteBehavior.Restrict); + }); } -} +} \ No newline at end of file diff --git a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251125193313_Initial.Designer.cs b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251126071128_Initial.Designer.cs similarity index 98% rename from api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251125193313_Initial.Designer.cs rename to api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251126071128_Initial.Designer.cs index 096817c0..c60e9c10 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251125193313_Initial.Designer.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251126071128_Initial.Designer.cs @@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore; namespace Erp.Platform.Migrations { [DbContext(typeof(PlatformDbContext))] - [Migration("20251125193313_Initial")] + [Migration("20251126071128_Initial")] partial class Initial { /// @@ -7783,6 +7783,259 @@ namespace Erp.Platform.Migrations b.ToTable("Prt_T_NoteType", (string)null); }); + modelBuilder.Entity("Erp.Platform.Entities.Operation", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("Instructions") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("IsActive") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(true); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LaborCost") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MachineCost") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("OperationTypeId") + .HasColumnType("uniqueidentifier"); + + b.Property("OverheadCost") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("QualityCheckRequired") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("SetupTime") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("StandardTime") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("WorkCenterId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("OperationTypeId"); + + b.HasIndex("WorkCenterId"); + + b.ToTable("Mrp_T_Operation", (string)null); + }); + + modelBuilder.Entity("Erp.Platform.Entities.OperationCategory", 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(100) + .HasColumnType("nvarchar(100)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("Mrp_T_OperationCategory", (string)null); + }); + + modelBuilder.Entity("Erp.Platform.Entities.OperationType", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AllowsParallelOperation") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("CategoryId") + .HasColumnType("uniqueidentifier"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DefaultDuration") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + 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(200) + .HasColumnType("nvarchar(200)"); + + b.Property("QualityCheckRequired") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("RequiresSetup") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("CategoryId"); + + b.ToTable("Mrp_T_OperationType", (string)null); + }); + modelBuilder.Entity("Erp.Platform.Entities.Opportunity", b => { b.Property("Id") @@ -16013,6 +16266,36 @@ namespace Erp.Platform.Migrations b.Navigation("Branch"); }); + modelBuilder.Entity("Erp.Platform.Entities.Operation", b => + { + b.HasOne("Erp.Platform.Entities.OperationType", "OperationType") + .WithMany("Operations") + .HasForeignKey("OperationTypeId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("Erp.Platform.Entities.Workcenter", "WorkCenter") + .WithMany("Operations") + .HasForeignKey("WorkCenterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("OperationType"); + + b.Navigation("WorkCenter"); + }); + + modelBuilder.Entity("Erp.Platform.Entities.OperationType", b => + { + b.HasOne("Erp.Platform.Entities.OperationCategory", "Category") + .WithMany("OperationTypes") + .HasForeignKey("CategoryId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Category"); + }); + modelBuilder.Entity("Erp.Platform.Entities.Opportunity", b => { b.HasOne("Erp.Platform.Entities.Employee", "Employee") @@ -17004,6 +17287,16 @@ namespace Erp.Platform.Migrations b.Navigation("Materials"); }); + modelBuilder.Entity("Erp.Platform.Entities.OperationCategory", b => + { + b.Navigation("OperationTypes"); + }); + + modelBuilder.Entity("Erp.Platform.Entities.OperationType", b => + { + b.Navigation("Operations"); + }); + modelBuilder.Entity("Erp.Platform.Entities.Opportunity", b => { b.Navigation("Activities"); @@ -17170,6 +17463,8 @@ namespace Erp.Platform.Migrations modelBuilder.Entity("Erp.Platform.Entities.Workcenter", b => { + b.Navigation("Operations"); + b.Navigation("Specifications"); }); diff --git a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251125193313_Initial.cs b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251126071128_Initial.cs similarity index 98% rename from api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251125193313_Initial.cs rename to api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251126071128_Initial.cs index 2bbce0c0..ee68fd66 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251125193313_Initial.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251126071128_Initial.cs @@ -1435,6 +1435,28 @@ namespace Erp.Platform.Migrations table.PrimaryKey("PK_Mnt_T_WorkorderType", x => x.Id); }); + migrationBuilder.CreateTable( + name: "Mrp_T_OperationCategory", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + Name = table.Column(type: "nvarchar(100)", maxLength: 100, 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_OperationCategory", x => x.Id); + }); + migrationBuilder.CreateTable( name: "Net_T_EventCategory", columns: table => new @@ -3244,6 +3266,40 @@ namespace Erp.Platform.Migrations onDelete: ReferentialAction.Cascade); }); + migrationBuilder.CreateTable( + name: "Mrp_T_OperationType", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + Code = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), + Name = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), + Description = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), + CategoryId = table.Column(type: "uniqueidentifier", nullable: false), + DefaultDuration = table.Column(type: "int", nullable: false, defaultValue: 0), + RequiresSetup = table.Column(type: "bit", nullable: false, defaultValue: false), + AllowsParallelOperation = table.Column(type: "bit", nullable: false, defaultValue: false), + QualityCheckRequired = table.Column(type: "bit", nullable: false, defaultValue: false), + 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_OperationType", x => x.Id); + table.ForeignKey( + name: "FK_Mrp_T_OperationType_Mrp_T_OperationCategory_CategoryId", + column: x => x.CategoryId, + principalTable: "Mrp_T_OperationCategory", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + migrationBuilder.CreateTable( name: "OpenIddictAuthorizations", columns: table => new @@ -5322,6 +5378,50 @@ namespace Erp.Platform.Migrations onDelete: ReferentialAction.Cascade); }); + migrationBuilder.CreateTable( + name: "Mrp_T_Operation", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + Code = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), + Name = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), + Description = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), + OperationTypeId = table.Column(type: "uniqueidentifier", nullable: false), + WorkCenterId = table.Column(type: "uniqueidentifier", nullable: false), + StandardTime = table.Column(type: "int", nullable: false, defaultValue: 0), + SetupTime = table.Column(type: "int", nullable: false, defaultValue: 0), + LaborCost = table.Column(type: "int", nullable: false, defaultValue: 0), + MachineCost = table.Column(type: "int", nullable: false, defaultValue: 0), + OverheadCost = table.Column(type: "int", nullable: false, defaultValue: 0), + Instructions = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true), + QualityCheckRequired = table.Column(type: "bit", nullable: false, defaultValue: false), + 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_Operation", x => x.Id); + table.ForeignKey( + name: "FK_Mrp_T_Operation_Mnt_T_Workcenter_WorkCenterId", + column: x => x.WorkCenterId, + principalTable: "Mnt_T_Workcenter", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_Mrp_T_Operation_Mrp_T_OperationType_OperationTypeId", + column: x => x.OperationTypeId, + principalTable: "Mrp_T_OperationType", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + migrationBuilder.CreateTable( name: "Scp_T_ApprovalStep", columns: table => new @@ -7083,6 +7183,21 @@ namespace Erp.Platform.Migrations table: "Mnt_T_WorkcenterSpecification", column: "WorkcenterId"); + migrationBuilder.CreateIndex( + name: "IX_Mrp_T_Operation_OperationTypeId", + table: "Mrp_T_Operation", + column: "OperationTypeId"); + + migrationBuilder.CreateIndex( + name: "IX_Mrp_T_Operation_WorkCenterId", + table: "Mrp_T_Operation", + column: "WorkCenterId"); + + migrationBuilder.CreateIndex( + name: "IX_Mrp_T_OperationType_CategoryId", + table: "Mrp_T_OperationType", + column: "CategoryId"); + migrationBuilder.CreateIndex( name: "IX_Net_B_Meal_BranchId", table: "Net_B_Meal", @@ -7853,6 +7968,9 @@ namespace Erp.Platform.Migrations migrationBuilder.DropTable( name: "Mnt_T_WorkcenterSpecification"); + migrationBuilder.DropTable( + name: "Mrp_T_Operation"); + migrationBuilder.DropTable( name: "Net_B_Meal"); @@ -8078,6 +8196,9 @@ namespace Erp.Platform.Migrations migrationBuilder.DropTable( name: "Mnt_T_FaultType"); + migrationBuilder.DropTable( + name: "Mrp_T_OperationType"); + migrationBuilder.DropTable( name: "Net_T_Training"); @@ -8177,6 +8298,9 @@ namespace Erp.Platform.Migrations migrationBuilder.DropTable( name: "Mnt_T_WorkorderType"); + migrationBuilder.DropTable( + name: "Mrp_T_OperationCategory"); + 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 31c238aa..7df7bced 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs @@ -7780,6 +7780,259 @@ namespace Erp.Platform.Migrations b.ToTable("Prt_T_NoteType", (string)null); }); + modelBuilder.Entity("Erp.Platform.Entities.Operation", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("Instructions") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("IsActive") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(true); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LaborCost") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MachineCost") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("OperationTypeId") + .HasColumnType("uniqueidentifier"); + + b.Property("OverheadCost") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("QualityCheckRequired") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("SetupTime") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("StandardTime") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("WorkCenterId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("OperationTypeId"); + + b.HasIndex("WorkCenterId"); + + b.ToTable("Mrp_T_Operation", (string)null); + }); + + modelBuilder.Entity("Erp.Platform.Entities.OperationCategory", 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(100) + .HasColumnType("nvarchar(100)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("Mrp_T_OperationCategory", (string)null); + }); + + modelBuilder.Entity("Erp.Platform.Entities.OperationType", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AllowsParallelOperation") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("CategoryId") + .HasColumnType("uniqueidentifier"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DefaultDuration") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + 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(200) + .HasColumnType("nvarchar(200)"); + + b.Property("QualityCheckRequired") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("RequiresSetup") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("CategoryId"); + + b.ToTable("Mrp_T_OperationType", (string)null); + }); + modelBuilder.Entity("Erp.Platform.Entities.Opportunity", b => { b.Property("Id") @@ -16010,6 +16263,36 @@ namespace Erp.Platform.Migrations b.Navigation("Branch"); }); + modelBuilder.Entity("Erp.Platform.Entities.Operation", b => + { + b.HasOne("Erp.Platform.Entities.OperationType", "OperationType") + .WithMany("Operations") + .HasForeignKey("OperationTypeId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("Erp.Platform.Entities.Workcenter", "WorkCenter") + .WithMany("Operations") + .HasForeignKey("WorkCenterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("OperationType"); + + b.Navigation("WorkCenter"); + }); + + modelBuilder.Entity("Erp.Platform.Entities.OperationType", b => + { + b.HasOne("Erp.Platform.Entities.OperationCategory", "Category") + .WithMany("OperationTypes") + .HasForeignKey("CategoryId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Category"); + }); + modelBuilder.Entity("Erp.Platform.Entities.Opportunity", b => { b.HasOne("Erp.Platform.Entities.Employee", "Employee") @@ -17001,6 +17284,16 @@ namespace Erp.Platform.Migrations b.Navigation("Materials"); }); + modelBuilder.Entity("Erp.Platform.Entities.OperationCategory", b => + { + b.Navigation("OperationTypes"); + }); + + modelBuilder.Entity("Erp.Platform.Entities.OperationType", b => + { + b.Navigation("Operations"); + }); + modelBuilder.Entity("Erp.Platform.Entities.Opportunity", b => { b.Navigation("Activities"); @@ -17167,6 +17460,8 @@ namespace Erp.Platform.Migrations modelBuilder.Entity("Erp.Platform.Entities.Workcenter", b => { + b.Navigation("Operations"); + b.Navigation("Specifications"); }); diff --git a/api/src/Erp.Platform.EntityFrameworkCore/Tenants/Seeds/TenantData.json b/api/src/Erp.Platform.EntityFrameworkCore/Tenants/Seeds/TenantData.json index 293703ee..a35c0c13 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Tenants/Seeds/TenantData.json +++ b/api/src/Erp.Platform.EntityFrameworkCore/Tenants/Seeds/TenantData.json @@ -5475,5 +5475,166 @@ "strategy": "FIFO", "isActive": true } + ], + "OperationCategories": [ + { + "name": "Üretim", + "description": "Üretim süreçleri ile ilgili operasyonlar", + "isActive": true + }, + { + "name": "Montaj", + "description": "Montaj süreçleri ile ilgili operasyonlar", + "isActive": true + }, + { + "name": "Muayene", + "description": "Muayene süreçleri ile ilgili operasyonlar", + "isActive": true + }, + { + "name": "Ambalajlama", + "description": "Ambalajlama süreçleri ile ilgili operasyonlar", + "isActive": true + }, + { + "name": "Kurulum", + "description": "Kurulum süreçleri ile ilgili operasyonlar", + "isActive": true + }, + { + "name": "Bakım", + "description": "Bakım süreçleri ile ilgili operasyonlar", + "isActive": true + }, + { + "name": "Taşıma", + "description": "Taşıma süreçleri ile ilgili operasyonlar", + "isActive": true + }, + { + "name": "Kalite", + "description": "Kalite süreçleri ile ilgili operasyonlar", + "isActive": true + } + ], + "OperationTypes": [ + { + "code": "CUT001", + "name": "Kesme İşlemi", + "description": "Malzeme kesme operasyonu", + "categoryName": "Üretim", + "defaultDuration": 30, + "requiresSetup": true, + "allowsParallelOperation": false, + "qualityCheckRequired": true, + "isActive": true + }, + { + "code": "WELD001", + "name": "Kaynak İşlemi", + "description": "Metal kaynak operasyonu", + "categoryName": "Muayene", + "defaultDuration": 45, + "requiresSetup": true, + "allowsParallelOperation": false, + "qualityCheckRequired": true, + "isActive": true + }, + { + "code": "ASSY001", + "name": "Montaj İşlemi", + "description": "Parça montaj operasyonu", + "categoryName": "Montaj", + "defaultDuration": 20, + "requiresSetup": false, + "allowsParallelOperation": true, + "qualityCheckRequired": false, + "isActive": true + }, + { + "code": "QC001", + "name": "Kalite Kontrolü", + "description": "Ürün kalite kontrol işlemi", + "categoryName": "Kalite", + "defaultDuration": 15, + "requiresSetup": false, + "allowsParallelOperation": false, + "qualityCheckRequired": true, + "isActive": true + }, + { + "code": "PACK001", + "name": "Paketleme", + "description": "Ürün paketleme işlemi", + "categoryName": "Kurulum", + "defaultDuration": 10, + "requiresSetup": false, + "allowsParallelOperation": true, + "qualityCheckRequired": false, + "isActive": true + } + ], + "Operations": [ + { + "code": "OP001", + "name": "CNC Torna Tezgahı İşlemi", + "description": "Metal parçaların CNC torna tezgahında işlenmesi", + "operationTypeCode": "ASSY001", + "workCenterCode": "CNC-001", + "standardTime": 45, + "setupTime": 30, + "laborCost": 50, + "machineCost": 100, + "overheadCost": 25, + "isActive": true, + "instructions": "Torna tezgahında hassas işleme yapılacak", + "qualityCheckRequired": true + }, + { + "code": "OP002", + "name": "Kaynak İşlemi", + "description": "Argon kaynak ile metal birleştirme", + "operationTypeCode": "WELD001", + "workCenterCode": "CNC-001", + "standardTime": 60, + "setupTime": 15, + "laborCost": 80, + "machineCost": 40, + "overheadCost": 20, + "isActive": true, + "instructions": "Argon gazı ile koruyucu atmosferde kaynak yapılacak", + "qualityCheckRequired": true + }, + { + "code": "OP003", + "name": "Kalite Kontrolü", + "description": "Boyutsal ve görsel kalite kontrolü", + "operationTypeCode": "QC001", + "workCenterCode": "COMP-001", + "standardTime": 20, + "setupTime": 5, + "laborCost": 60, + "machineCost": 20, + "overheadCost": 10, + "isActive": true, + "instructions": "Teknik çizimlere göre boyutsal kontrol yapılacak", + "qualityCheckRequired": false + }, + { + "code": "OP004", + "name": "Paketleme İşlemi", + "description": "Ürünlerin paketlenmesi", + "operationTypeCode": "PACK001", + "workCenterCode": "CONV-001", + "standardTime": 20, + "setupTime": 5, + "laborCost": 60, + "machineCost": 20, + "overheadCost": 10, + "isActive": true, + "instructions": "Teknik çizimlere göre boyutsal kontrol yapılacak", + "qualityCheckRequired": false + } ] } diff --git a/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantDataSeeder.cs b/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantDataSeeder.cs index 286d2d56..4af1ce82 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantDataSeeder.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantDataSeeder.cs @@ -122,6 +122,9 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency private readonly IRepository _locationTypeRepository; private readonly IRepository _locationRepository; private readonly IRepository _putawayRepository; + private readonly IRepository _operationCategoryRepository; + private readonly IRepository _operationTypeRepository; + private readonly IRepository _operationRepository; public TenantDataSeeder( IClock clock, @@ -226,7 +229,10 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency IRepository zoneRepository, IRepository locationTypeRepository, IRepository locationRepository, - IRepository putawayRepository + IRepository putawayRepository, + IRepository operationCategoryRepository, + IRepository operationTypeRepository, + IRepository operationRepository ) { _clock = clock; @@ -333,6 +339,9 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency _locationTypeRepository = locationTypeRepository; _locationRepository = locationRepository; _putawayRepository = putawayRepository; + _operationCategoryRepository = operationCategoryRepository; + _operationTypeRepository = operationTypeRepository; + _operationRepository = operationRepository; } private static IConfigurationRoot BuildConfiguration() @@ -2275,6 +2284,69 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency }, autoSave: true); } + + foreach (var item in items.OperationCategories) + { + var exists = await _operationCategoryRepository.AnyAsync(x => x.Name == item.Name); + if (exists) + continue; + + await _operationCategoryRepository.InsertAsync(new OperationCategory + { + Name = item.Name, + Description = item.Description, + IsActive = item.IsActive + }, autoSave: true); + } + + foreach (var item in items.OperationTypes) + { + var exists = await _operationTypeRepository.AnyAsync(x => x.Name == item.Name); + if (exists) + continue; + + var operationCategory = await _operationCategoryRepository.FirstOrDefaultAsync(x => x.Name == item.CategoryName); + + await _operationTypeRepository.InsertAsync(new OperationType + { + Code = item.Code, + Name = item.Name, + Description = item.Description, + CategoryId = operationCategory?.Id, + DefaultDuration = item.DefaultDuration, + RequiresSetup = item.RequiresSetup, + AllowsParallelOperation = item.AllowsParallelOperation, + QualityCheckRequired = item.QualityCheckRequired, + IsActive = item.IsActive + }, autoSave: true); + } + + foreach (var item in items.Operations) + { + var exists = await _operationRepository.AnyAsync(x => x.Code == item.Code); + if (exists) + continue; + + var operationType = await _operationTypeRepository.FirstOrDefaultAsync(x => x.Code == item.OperationTypeCode); + var workcenter = await _workcenterRepository.FirstOrDefaultAsync(x => x.Code == item.WorkCenterCode); + + await _operationRepository.InsertAsync(new Operation + { + Code = item.Code, + Name = item.Name, + Description = item.Description, + OperationTypeId = operationType?.Id, + WorkCenterId = workcenter?.Id, + StandardTime = item.StandardTime, + SetupTime = item.SetupTime, + LaborCost = item.LaborCost, + MachineCost = item.MachineCost, + OverheadCost = item.OverheadCost, + Instructions = item.Instructions, + QualityCheckRequired = item.QualityCheckRequired, + 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 6e480229..134a3e3a 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantSeederDto.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantSeederDto.cs @@ -116,6 +116,46 @@ public class TenantSeederDto public List LocationTypes { get; set; } public List Locations { get; set; } public List Putaways { get; set; } + public List OperationCategories { get; set; } + public List OperationTypes { get; set; } + public List Operations { get; set; } +} + +public class OperationSeedDto +{ + public string Code { get; set; } + public string Name { get; set; } + public string Description { get; set; } + public string OperationTypeCode { get; set; } + public string WorkCenterCode { get; set; } + public int StandardTime { get; set; } + public int SetupTime { get; set; } + public decimal LaborCost { get; set; } + public decimal MachineCost { get; set; } + public decimal OverheadCost { get; set; } + public string Instructions { get; set; } + public bool QualityCheckRequired { get; set; } + public bool IsActive { get; set; } +} + +public class OperationTypeSeedDto +{ + public string Code { get; set; } + public string Name { get; set; } + public string Description { get; set; } + public string CategoryName { get; set; } + public int DefaultDuration { get; set; } + public bool RequiresSetup { get; set; } + public bool AllowsParallelOperation { get; set; } + public bool QualityCheckRequired { get; set; } + public bool IsActive { get; set; } +} + +public class OperationCategorySeedDto +{ + public string Name { get; set; } + public string Description { get; set; } + public bool IsActive { get; set; } } public class PutawaySeedDto