diff --git a/api/src/Erp.Platform.DbMigrator/Seeds/LanguagesData.json b/api/src/Erp.Platform.DbMigrator/Seeds/LanguagesData.json index 684e0091..6b47cd01 100644 --- a/api/src/Erp.Platform.DbMigrator/Seeds/LanguagesData.json +++ b/api/src/Erp.Platform.DbMigrator/Seeds/LanguagesData.json @@ -9313,6 +9313,24 @@ "tr": "Ödeme Koşulları", "en": "Payment Terms" }, + { + "resourceName": "Platform", + "key": "App.SupplyChain.DeliveryTerm", + "tr": "Teslimat Koşulları", + "en": "Delivery Terms" + }, + { + "resourceName": "Platform", + "key": "App.SupplyChain.QuotationStatus", + "tr": "Teklif Durumları", + "en": "Quotation Status" + }, + { + "resourceName": "Platform", + "key": "App.SupplyChain.Quotation", + "tr": "Teklifler", + "en": "Quotations" + }, { "resourceName": "Platform", "key": "App.SupplyChain.MaterialType", diff --git a/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_SupplyChain.cs b/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_SupplyChain.cs index 3164cc24..037a8228 100644 --- a/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_SupplyChain.cs +++ b/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_SupplyChain.cs @@ -53,7 +53,8 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend var listForm = await _listFormRepository.InsertAsync( new ListForm() { - ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson, + ListFormType = ListFormTypeEnum.List, + ExportJson = DefaultExportJson, IsSubForm = false, ShowNote = true, LayoutJson = DefaultLayoutJson, @@ -193,7 +194,8 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend var listForm = await _listFormRepository.InsertAsync( new ListForm() { - ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson, + ListFormType = ListFormTypeEnum.List, + ExportJson = DefaultExportJson, IsSubForm = false, ShowNote = true, LayoutJson = DefaultLayoutJson, @@ -362,7 +364,8 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend { var listForm = await _listFormRepository.InsertAsync(new ListForm() { - ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson, + ListFormType = ListFormTypeEnum.List, + ExportJson = DefaultExportJson, IsSubForm = false, ShowNote = true, LayoutJson = DefaultLayoutJson, @@ -678,7 +681,8 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend var listForm = await _listFormRepository.InsertAsync( new ListForm() { - ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson, + ListFormType = ListFormTypeEnum.List, + ExportJson = DefaultExportJson, IsSubForm = false, ShowNote = true, LayoutJson = DefaultLayoutJson, @@ -800,7 +804,8 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend var listForm = await _listFormRepository.InsertAsync( new ListForm() { - ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson, + ListFormType = ListFormTypeEnum.List, + ExportJson = DefaultExportJson, IsSubForm = false, ShowNote = true, LayoutJson = DefaultLayoutJson, @@ -924,7 +929,8 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend var listForm = await _listFormRepository.InsertAsync( new ListForm() { - ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson, + ListFormType = ListFormTypeEnum.List, + ExportJson = DefaultExportJson, IsSubForm = false, ShowNote = true, LayoutJson = DefaultLayoutJson, @@ -1048,7 +1054,8 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend var listForm = await _listFormRepository.InsertAsync( new ListForm() { - ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson, + ListFormType = ListFormTypeEnum.List, + ExportJson = DefaultExportJson, IsSubForm = false, ShowNote = true, LayoutJson = DefaultLayoutJson, @@ -1701,7 +1708,8 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend var listForm = await _listFormRepository.InsertAsync( new ListForm() { - ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson, + ListFormType = ListFormTypeEnum.List, + ExportJson = DefaultExportJson, IsSubForm = true, ShowNote = true, LayoutJson = DefaultLayoutJson, @@ -2011,7 +2019,8 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend var listForm = await _listFormRepository.InsertAsync( new ListForm() { - ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson, + ListFormType = ListFormTypeEnum.List, + ExportJson = DefaultExportJson, IsSubForm = true, ShowNote = true, LayoutJson = DefaultLayoutJson, @@ -2149,7 +2158,8 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend var listForm = await _listFormRepository.InsertAsync( new ListForm() { - ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson, + ListFormType = ListFormTypeEnum.List, + ExportJson = DefaultExportJson, IsSubForm = true, ShowNote = true, LayoutJson = DefaultLayoutJson, @@ -2443,7 +2453,8 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend var listForm = await _listFormRepository.InsertAsync( new ListForm() { - ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson, + ListFormType = ListFormTypeEnum.List, + ExportJson = DefaultExportJson, IsSubForm = false, ShowNote = true, LayoutJson = DefaultLayoutJson, @@ -2612,7 +2623,8 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend var listForm = await _listFormRepository.InsertAsync( new ListForm() { - ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson, + ListFormType = ListFormTypeEnum.List, + ExportJson = DefaultExportJson, IsSubForm = true, ShowNote = true, LayoutJson = DefaultLayoutJson, @@ -2781,7 +2793,7 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend } }) ); - + #region Request Type listFormName = AppCodes.SupplyChain.RequestType; if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName)) @@ -2789,7 +2801,8 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend var listForm = await _listFormRepository.InsertAsync( new ListForm() { - ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson, + ListFormType = ListFormTypeEnum.List, + ExportJson = DefaultExportJson, IsSubForm = false, ShowNote = true, LayoutJson = DefaultLayoutJson, @@ -2913,7 +2926,8 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend var listForm = await _listFormRepository.InsertAsync( new ListForm() { - ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson, + ListFormType = ListFormTypeEnum.List, + ExportJson = DefaultExportJson, IsSubForm = false, ShowNote = true, LayoutJson = DefaultLayoutJson, @@ -3181,7 +3195,8 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend var listForm = await _listFormRepository.InsertAsync( new ListForm() { - ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson, + ListFormType = ListFormTypeEnum.List, + ExportJson = DefaultExportJson, IsSubForm = true, ShowNote = true, LayoutJson = DefaultLayoutJson, @@ -3388,5 +3403,251 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend } }) ); + + #region Quotation Status + listFormName = AppCodes.SupplyChain.QuotationStatus; + 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.QuotationStatus)), + 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.QuotationStatus)), + DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson, + PagerOptionJson = DefaultPagerOptionJson, + EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 300, true, true, true, true, false), + InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson, + EditingFormJson = JsonSerializer.Serialize(new List() + { + new() { + Order=1, ColCount=1, ColSpan=1, ItemType="group", Items =[ + new EditingFormItemDto { Order = 1, DataField="Name", ColSpan = 1, IsRequired =true, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 2, DataField="Description", ColSpan = 1, EditorType2 = EditorTypes.dxTextArea }, + new EditingFormItemDto { Order = 3, DataField="IsActive", ColSpan = 1, EditorType2 = EditorTypes.dxCheckBox }, + ]} + }), + FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + new() { FieldName = "IsActive", FieldDbType = DbType.Boolean, Value = "true", CustomValueType = FieldCustomValueTypeEnum.Value } + }), + } + ); + + #region Quotation 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, + SortIndex = 0, + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Name", + Width = 300, + ListOrderNo = 2, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Description", + Width = 500, + ListOrderNo = 3, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Boolean, + FieldName = "IsActive", + Width = 100, + ListOrderNo = 4, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + ]); + #endregion + } + #endregion + + #region Delivery Terms + listFormName = AppCodes.SupplyChain.DeliveryTerm; + 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.DeliveryTerm)), + 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.DeliveryTerm)), + DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson, + PagerOptionJson = DefaultPagerOptionJson, + EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 300, true, true, true, true, false), + InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson, + EditingFormJson = JsonSerializer.Serialize(new List() + { + new() { + Order=1, ColCount=1, ColSpan=1, ItemType="group", Items =[ + new EditingFormItemDto { Order = 1, DataField="Name", ColSpan = 1, IsRequired =true, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 2, DataField="Description", ColSpan = 1, EditorType2 = EditorTypes.dxTextArea }, + new EditingFormItemDto { Order = 3, DataField="IsActive", ColSpan = 1, EditorType2 = EditorTypes.dxCheckBox }, + ]} + }), + FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + new() { FieldName = "IsActive", FieldDbType = DbType.Boolean, Value = "true", CustomValueType = FieldCustomValueTypeEnum.Value } + }), + } + ); + + #region Delivery Term Fields + await _listFormFieldRepository.InsertManyAsync([ + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + Width = 100, + ListOrderNo = 1, + Visible = false, + IsActive = true, + IsDeleted = false, + SortIndex = 0, + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Name", + Width = 300, + ListOrderNo = 2, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Description", + Width = 500, + ListOrderNo = 3, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Boolean, + FieldName = "IsActive", + Width = 100, + ListOrderNo = 4, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + ]); + #endregion + } + #endregion } } diff --git a/api/src/Erp.Platform.DbMigrator/Seeds/MenusData.json b/api/src/Erp.Platform.DbMigrator/Seeds/MenusData.json index fee8453c..fac8069d 100644 --- a/api/src/Erp.Platform.DbMigrator/Seeds/MenusData.json +++ b/api/src/Erp.Platform.DbMigrator/Seeds/MenusData.json @@ -2298,11 +2298,21 @@ "RequiredPermissionName": "App.SupplyChain.PaymentTerm", "IsDisabled": false }, + { + "ParentCode": "App.SupplyChain.Definitions", + "Code": "App.SupplyChain.DeliveryTerm", + "DisplayName": "App.SupplyChain.DeliveryTerm", + "Order": 5, + "Url": "/admin/list/App.SupplyChain.DeliveryTerm", + "Icon": "FcShipped", + "RequiredPermissionName": "App.SupplyChain.DeliveryTerm", + "IsDisabled": false + }, { "ParentCode": "App.SupplyChain.Definitions", "Code": "App.SupplyChain.SupplyType", "DisplayName": "App.SupplyChain.SupplyType", - "Order": 5, + "Order": 6, "Url": "/admin/list/App.SupplyChain.SupplyType", "Icon": "FcTreeStructure", "RequiredPermissionName": "App.SupplyChain.SupplyType", @@ -2312,7 +2322,7 @@ "ParentCode": "App.SupplyChain.Definitions", "Code": "App.SupplyChain.SupplyCardType", "DisplayName": "App.SupplyChain.SupplyCardType", - "Order": 6, + "Order": 7, "Url": "/admin/list/App.SupplyChain.SupplyCardType", "Icon": "FcComboChart", "RequiredPermissionName": "App.SupplyChain.SupplyCardType", @@ -2322,7 +2332,7 @@ "ParentCode": "App.SupplyChain.Definitions", "Code": "App.SupplyChain.Supply", "DisplayName": "App.SupplyChain.Supply", - "Order": 7, + "Order": 8, "Url": "/admin/list/App.SupplyChain.Supply", "Icon": "FcBusiness", "RequiredPermissionName": "App.SupplyChain.Supply", @@ -2332,7 +2342,7 @@ "ParentCode": "App.SupplyChain.Definitions", "Code": "App.SupplyChain.Approval", "DisplayName": "App.SupplyChain.Approval", - "Order": 8, + "Order": 9, "Url": "/admin/list/App.SupplyChain.Approval", "Icon": "FcApproval", "RequiredPermissionName": "App.SupplyChain.Approval", @@ -2342,12 +2352,22 @@ "ParentCode": "App.SupplyChain.Definitions", "Code": "App.SupplyChain.RequestType", "DisplayName": "App.SupplyChain.RequestType", - "Order": 9, + "Order": 10, "Url": "/admin/list/App.SupplyChain.RequestType", "Icon": "FcWorkflow", "RequiredPermissionName": "App.SupplyChain.RequestType", "IsDisabled": false }, + { + "ParentCode": "App.SupplyChain.Definitions", + "Code": "App.SupplyChain.QuotationStatus", + "DisplayName": "App.SupplyChain.QuotationStatus", + "Order": 11, + "Url": "/admin/list/App.SupplyChain.QuotationStatus", + "Icon": "FcStatistics", + "RequiredPermissionName": "App.SupplyChain.QuotationStatus", + "IsDisabled": false + }, { "ParentCode": "App.SupplyChain", "Code": "App.SupplyChain.Request", diff --git a/api/src/Erp.Platform.DbMigrator/Seeds/PermissionsData.json b/api/src/Erp.Platform.DbMigrator/Seeds/PermissionsData.json index d32d4d11..0395c12d 100644 --- a/api/src/Erp.Platform.DbMigrator/Seeds/PermissionsData.json +++ b/api/src/Erp.Platform.DbMigrator/Seeds/PermissionsData.json @@ -5494,6 +5494,70 @@ "MultiTenancySide": 3, "MenuGroup": "Erp" }, + { + "GroupName": "App.SupplyChain", + "Name": "App.SupplyChain.DeliveryTerm", + "ParentName": null, + "DisplayName": "App.SupplyChain.DeliveryTerm", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.SupplyChain", + "Name": "App.SupplyChain.DeliveryTerm.Create", + "ParentName": "App.SupplyChain.DeliveryTerm", + "DisplayName": "Create", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.SupplyChain", + "Name": "App.SupplyChain.DeliveryTerm.Update", + "ParentName": "App.SupplyChain.DeliveryTerm", + "DisplayName": "Update", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.SupplyChain", + "Name": "App.SupplyChain.DeliveryTerm.Delete", + "ParentName": "App.SupplyChain.DeliveryTerm", + "DisplayName": "Delete", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.SupplyChain", + "Name": "App.SupplyChain.DeliveryTerm.Export", + "ParentName": "App.SupplyChain.DeliveryTerm", + "DisplayName": "Export", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.SupplyChain", + "Name": "App.SupplyChain.DeliveryTerm.Import", + "ParentName": "App.SupplyChain.DeliveryTerm", + "DisplayName": "Import", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.SupplyChain", + "Name": "App.SupplyChain.DeliveryTerm.Note", + "ParentName": "App.SupplyChain.DeliveryTerm", + "DisplayName": "Note", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { "GroupName": "App.SupplyChain", "Name": "App.SupplyChain.SupplyType", @@ -5935,6 +5999,135 @@ "MultiTenancySide": 3, "MenuGroup": "Erp" }, + + { + "GroupName": "App.SupplyChain", + "Name": "App.SupplyChain.QuotationStatus", + "ParentName": null, + "DisplayName": "App.SupplyChain.QuotationStatus", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.SupplyChain", + "Name": "App.SupplyChain.QuotationStatus.Create", + "ParentName": "App.SupplyChain.QuotationStatus", + "DisplayName": "Create", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.SupplyChain", + "Name": "App.SupplyChain.QuotationStatus.Update", + "ParentName": "App.SupplyChain.QuotationStatus", + "DisplayName": "Update", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.SupplyChain", + "Name": "App.SupplyChain.QuotationStatus.Delete", + "ParentName": "App.SupplyChain.QuotationStatus", + "DisplayName": "Delete", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.SupplyChain", + "Name": "App.SupplyChain.QuotationStatus.Export", + "ParentName": "App.SupplyChain.QuotationStatus", + "DisplayName": "Export", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.SupplyChain", + "Name": "App.SupplyChain.QuotationStatus.Import", + "ParentName": "App.SupplyChain.QuotationStatus", + "DisplayName": "Import", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.SupplyChain", + "Name": "App.SupplyChain.QuotationStatus.Note", + "ParentName": "App.SupplyChain.QuotationStatus", + "DisplayName": "Note", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + + { + "GroupName": "App.SupplyChain", + "Name": "App.SupplyChain.Quotation", + "ParentName": null, + "DisplayName": "App.SupplyChain.Quotation", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.SupplyChain", + "Name": "App.SupplyChain.Quotation.Create", + "ParentName": "App.SupplyChain.Quotation", + "DisplayName": "Create", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.SupplyChain", + "Name": "App.SupplyChain.Quotation.Update", + "ParentName": "App.SupplyChain.Quotation", + "DisplayName": "Update", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.SupplyChain", + "Name": "App.SupplyChain.Quotation.Delete", + "ParentName": "App.SupplyChain.Quotation", + "DisplayName": "Delete", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.SupplyChain", + "Name": "App.SupplyChain.Quotation.Export", + "ParentName": "App.SupplyChain.Quotation", + "DisplayName": "Export", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.SupplyChain", + "Name": "App.SupplyChain.Quotation.Import", + "ParentName": "App.SupplyChain.Quotation", + "DisplayName": "Import", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { + "GroupName": "App.SupplyChain", + "Name": "App.SupplyChain.Quotation.Note", + "ParentName": "App.SupplyChain.Quotation", + "DisplayName": "Note", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp" + }, + { "GroupName": "App.SupplyChain", "Name": "App.SupplyChain.Material", @@ -12866,4 +13059,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 87798360..5cc10b8c 100644 --- a/api/src/Erp.Platform.Domain.Shared/Enums/TableNameEnum.cs +++ b/api/src/Erp.Platform.Domain.Shared/Enums/TableNameEnum.cs @@ -199,5 +199,9 @@ public enum TableNameEnum ProjectTeam, ProjectPhase, ProjectTask, - ProjectTaskDaily + ProjectTaskDaily, + Quotation, + QuotationItem, + QuotationStatus, + DeliveryTerm } diff --git a/api/src/Erp.Platform.Domain.Shared/TableNameResolver.cs b/api/src/Erp.Platform.Domain.Shared/TableNameResolver.cs index 5b41767a..57a0519d 100644 --- a/api/src/Erp.Platform.Domain.Shared/TableNameResolver.cs +++ b/api/src/Erp.Platform.Domain.Shared/TableNameResolver.cs @@ -163,12 +163,13 @@ public static class TableNameResolver { nameof(TableNameEnum.SocialComment), (TablePrefix.TenantByName, MenuPrefix.Intranet) }, { nameof(TableNameEnum.SocialLike), (TablePrefix.TenantByName, MenuPrefix.Intranet) }, - // 🔹 Supply Chain + // 🔹 SUPPLY CHAIN { nameof(TableNameEnum.MaterialType), (TablePrefix.TenantByName, MenuPrefix.SupplyChain) }, { nameof(TableNameEnum.MaterialGroup), (TablePrefix.TenantByName, MenuPrefix.SupplyChain) }, { nameof(TableNameEnum.Material), (TablePrefix.TenantByName, MenuPrefix.SupplyChain) }, { nameof(TableNameEnum.MaterialSpecification), (TablePrefix.TenantByName, MenuPrefix.SupplyChain) }, { nameof(TableNameEnum.PaymentTerm), (TablePrefix.TenantByName, MenuPrefix.SupplyChain) }, + { nameof(TableNameEnum.DeliveryTerm), (TablePrefix.TenantByName, MenuPrefix.SupplyChain) }, { nameof(TableNameEnum.SupplyType), (TablePrefix.TenantByName, MenuPrefix.SupplyChain) }, { nameof(TableNameEnum.SupplyCardType), (TablePrefix.TenantByName, MenuPrefix.SupplyChain) }, { nameof(TableNameEnum.Approval), (TablePrefix.TenantByName, MenuPrefix.SupplyChain) }, @@ -176,6 +177,9 @@ public static class TableNameResolver { nameof(TableNameEnum.RequestType), (TablePrefix.TenantByName, MenuPrefix.SupplyChain) }, { nameof(TableNameEnum.Request), (TablePrefix.TenantByName, MenuPrefix.SupplyChain) }, { nameof(TableNameEnum.RequestItem), (TablePrefix.TenantByName, MenuPrefix.SupplyChain) }, + { nameof(TableNameEnum.Quotation), (TablePrefix.TenantByName, MenuPrefix.SupplyChain) }, + { nameof(TableNameEnum.QuotationItem), (TablePrefix.TenantByName, MenuPrefix.SupplyChain) }, + { nameof(TableNameEnum.QuotationStatus), (TablePrefix.TenantByName, MenuPrefix.SupplyChain) }, // CRM { nameof(TableNameEnum.CustomerSegment), (TablePrefix.TenantByName, MenuPrefix.Crm) }, diff --git a/api/src/Erp.Platform.Domain/Data/SeedConsts.cs b/api/src/Erp.Platform.Domain/Data/SeedConsts.cs index ab5936ea..ab9c08e5 100644 --- a/api/src/Erp.Platform.Domain/Data/SeedConsts.cs +++ b/api/src/Erp.Platform.Domain/Data/SeedConsts.cs @@ -516,6 +516,7 @@ public static class SeedConsts public const string Material = Default + ".Material"; public const string Supply = Default + ".Supply"; public const string PaymentTerm = Default + ".PaymentTerm"; + public const string DeliveryTerm = Default + ".DeliveryTerm"; public const string SupplyType = Default + ".SupplyType"; public const string SupplyCardType = Default + ".SupplyCardType"; public const string PartnerBank = Default + ".PartnerBank"; @@ -526,6 +527,9 @@ public static class SeedConsts public const string RequestType = Default + ".RequestType"; public const string Request = Default + ".Request"; public const string RequestItem = Default + ".RequestItem"; + public const string QuotationStatus = Default + ".QuotationStatus"; + public const string Quotation = Default + ".Quotation"; + public const string QuotationItem = Default + ".QuotationItem"; } public static class Maintenance diff --git a/api/src/Erp.Platform.Domain/Entities/Tenant/Administration/PaymentMethod.cs b/api/src/Erp.Platform.Domain/Entities/Tenant/Administration/PaymentMethod.cs index a3c5ff49..92adc984 100644 --- a/api/src/Erp.Platform.Domain/Entities/Tenant/Administration/PaymentMethod.cs +++ b/api/src/Erp.Platform.Domain/Entities/Tenant/Administration/PaymentMethod.cs @@ -1,4 +1,6 @@ using System; +using System.Collections; +using System.Collections.Generic; using Volo.Abp.Domain.Entities.Auditing; using Volo.Abp.MultiTenancy; @@ -11,5 +13,7 @@ public class PaymentMethod : FullAuditedEntity, IMultiTenant public string Name { get; set; } public decimal Commission { get; set; } public string Logo { get; set; } + + public ICollection Quotations { get; set; } } diff --git a/api/src/Erp.Platform.Domain/Entities/Tenant/SupplyChain/DeliveryTerm.cs b/api/src/Erp.Platform.Domain/Entities/Tenant/SupplyChain/DeliveryTerm.cs new file mode 100644 index 00000000..d9d972be --- /dev/null +++ b/api/src/Erp.Platform.Domain/Entities/Tenant/SupplyChain/DeliveryTerm.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using Volo.Abp.Domain.Entities.Auditing; +using Volo.Abp.MultiTenancy; + +namespace Erp.Platform.Entities; + +public class DeliveryTerm : FullAuditedEntity, IMultiTenant +{ + public Guid? TenantId { get; set; } + + public string Name { get; set; } + public string Description { get; set; } + + public bool IsActive { get; set; } + + public ICollection Quotations { get; set; } +} diff --git a/api/src/Erp.Platform.Domain/Entities/Tenant/SupplyChain/PaymentTerm.cs b/api/src/Erp.Platform.Domain/Entities/Tenant/SupplyChain/PaymentTerm.cs index 1e90cd18..3b050758 100644 --- a/api/src/Erp.Platform.Domain/Entities/Tenant/SupplyChain/PaymentTerm.cs +++ b/api/src/Erp.Platform.Domain/Entities/Tenant/SupplyChain/PaymentTerm.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using Volo.Abp.Domain.Entities.Auditing; using Volo.Abp.MultiTenancy; @@ -12,6 +13,8 @@ public class PaymentTerm : FullAuditedEntity, IMultiTenant public string Description { get; set; } public bool IsActive { get; set; } + + public ICollection Quotations { get; set; } } diff --git a/api/src/Erp.Platform.Domain/Entities/Tenant/SupplyChain/Quotation.cs b/api/src/Erp.Platform.Domain/Entities/Tenant/SupplyChain/Quotation.cs new file mode 100644 index 00000000..611e490a --- /dev/null +++ b/api/src/Erp.Platform.Domain/Entities/Tenant/SupplyChain/Quotation.cs @@ -0,0 +1,52 @@ +// Domain/Entities/MmQuotation.cs +using System; +using System.Collections.Generic; +using Volo.Abp.Domain.Entities.Auditing; +using Volo.Abp.MultiTenancy; + +namespace Erp.Platform.Entities; + +public class Quotation : FullAuditedEntity, IMultiTenant +{ + public Guid? TenantId { get; set; } + + public string QuotationNumber { get; set; } + public string RequestId { get; set; } + public string RequestTitle { get; set; } + public Guid RequestTypeId { get; set; } + public RequestType RequestType { get; set; } + + public Guid SupplierId { get; set; } + public Partner Supplier { get; set; } + + public DateTime QuotationDate { get; set; } + public DateTime ValidUntil { get; set; } + + public Guid StatusId { get; set; } + public QuotationStatus Status { get; set; } + + public decimal TotalAmount { get; set; } + public string Currency { get; set; } + + public Guid PaymentTermId { get; set; } + public PaymentTerm PaymentTerm { get; set; } + + public Guid DeliveryTermId { get; set; } + public DeliveryTerm DeliveryTerm { get; set; } + + public int? DeliveryTime { get; set; } + + public int? EvaluationScore { get; set; } //Değerlendirme Puanı + public string EvaluationComments { get; set; } //Değerlendirme Yorumları + public string EvaluationNotes { get; set; } //Değerlendirme Notlar + + public string Notes { get; set; } //Notlar + + public string SubmittedBy { get; set; } //Teklif Veren + public DateTime SubmittedAt { get; set; } //Teklif Tarihi + + public string EvaluatedBy { get; set; } //Değerlendiren + public DateTime? EvaluatedAt { get; set; } //Değerlendirme Tarihi + + public ICollection Items { get; set; } +} diff --git a/api/src/Erp.Platform.Domain/Entities/Tenant/SupplyChain/QuotationItem.cs b/api/src/Erp.Platform.Domain/Entities/Tenant/SupplyChain/QuotationItem.cs new file mode 100644 index 00000000..41acc67b --- /dev/null +++ b/api/src/Erp.Platform.Domain/Entities/Tenant/SupplyChain/QuotationItem.cs @@ -0,0 +1,27 @@ +using System; +using Volo.Abp.Domain.Entities.Auditing; +using Volo.Abp.MultiTenancy; + +namespace Erp.Platform.Entities; + +public class QuotationItem : FullAuditedEntity, IMultiTenant +{ + public Guid? TenantId { get; set; } + + public Guid QuotationId { get; set; } + public Quotation Quotation { get; set; } + + public Guid MaterialId { get; set; } + public Material Material { get; set; } + + public decimal Quantity { get; set; } + public Guid UomId { get; set; } + public Uom Uom { get; set; } + + public decimal UnitPrice { get; set; } + public decimal TotalPrice { get; set; } + + public int? LeadTime { get; set; } + + public string Description { get; set; } +} diff --git a/api/src/Erp.Platform.Domain/Entities/Tenant/SupplyChain/QuotationStatus.cs b/api/src/Erp.Platform.Domain/Entities/Tenant/SupplyChain/QuotationStatus.cs new file mode 100644 index 00000000..8bc8edc5 --- /dev/null +++ b/api/src/Erp.Platform.Domain/Entities/Tenant/SupplyChain/QuotationStatus.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using Volo.Abp.Domain.Entities.Auditing; +using Volo.Abp.MultiTenancy; + +namespace Erp.Platform.Entities; + +public class QuotationStatus : FullAuditedEntity, IMultiTenant +{ + public Guid? TenantId { get; set; } + + public string Name { get; set; } + public string Description { get; set; } + + public bool IsActive { get; set; } + + public ICollection Quotations { get; set; } +} diff --git a/api/src/Erp.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs b/api/src/Erp.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs index 6a391b39..2370930e 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs @@ -200,6 +200,7 @@ public class PlatformDbContext : public DbSet Materials { get; set; } public DbSet MaterialSpecifications { get; set; } public DbSet PaymentTerms { get; set; } + public DbSet DeliveryTerms { get; set; } public DbSet Partners { get; set; } public DbSet PartnerBanks { get; set; } @@ -216,6 +217,9 @@ public class PlatformDbContext : public DbSet ApprovalSteps { get; set; } public DbSet PurchaseRequests { get; set; } public DbSet PurchaseRequestItems { get; set; } + public DbSet QuotationStatuses { get; set; } + public DbSet Quotations { get; set; } + public DbSet QuotationItems { get; set; } #endregion #region Crm @@ -267,7 +271,7 @@ public class PlatformDbContext : public DbSet BomComponents { get; set; } #endregion - #region Rd + #region Project public DbSet Types { get; set; } public DbSet Statuses { get; set; } public DbSet TaskTypes { get; set; } @@ -3426,5 +3430,97 @@ public class PlatformDbContext : .HasForeignKey(x => x.ProjectId) .OnDelete(DeleteBehavior.Restrict); }); + + builder.Entity(b => + { + b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.QuotationStatus)), 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.DeliveryTerm)), 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.Quotation)), Prefix.DbSchema); + b.ConfigureByConvention(); + + b.Property(x => x.QuotationNumber).IsRequired().HasMaxLength(50); + b.Property(x => x.RequestId).IsRequired().HasMaxLength(50); + b.Property(x => x.RequestTitle).IsRequired().HasMaxLength(200); + + b.Property(x => x.RequestTypeId).IsRequired(); + b.Property(x => x.SupplierId).IsRequired(); + + b.Property(x => x.QuotationDate).IsRequired(); + b.Property(x => x.ValidUntil).IsRequired(); + + b.Property(x => x.StatusId).IsRequired(); + + b.Property(x => x.TotalAmount).HasPrecision(18, 2).IsRequired(); + b.Property(x => x.Currency).IsRequired().HasMaxLength(10); + + b.Property(x => x.PaymentTermId).IsRequired(); + b.Property(x => x.DeliveryTermId).IsRequired(); + + b.Property(x => x.DeliveryTime).HasDefaultValue(0); + + b.Property(x => x.EvaluationScore).HasDefaultValue(0); + b.Property(x => x.EvaluationComments).HasMaxLength(1000); + b.Property(x => x.EvaluationNotes).HasMaxLength(1000); + b.Property(x => x.SubmittedBy).IsRequired().HasMaxLength(100); + b.Property(x => x.SubmittedAt).IsRequired(); + + b.Property(x => x.EvaluatedBy).HasMaxLength(100); + b.Property(x => x.EvaluatedAt); + + b.HasOne(x => x.Status) + .WithMany(x => x.Quotations) + .HasForeignKey(x => x.StatusId) + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne(x => x.DeliveryTerm) + .WithMany(x => x.Quotations) + .HasForeignKey(x => x.DeliveryTermId) + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne(x => x.PaymentTerm) + .WithMany(x => x.Quotations) + .HasForeignKey(x => x.PaymentTermId) + .OnDelete(DeleteBehavior.Restrict); + }); + + builder.Entity(b => + { + b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.QuotationItem)), Prefix.DbSchema); + b.ConfigureByConvention(); + + b.Property(x => x.QuotationId).IsRequired(); + b.Property(x => x.MaterialId).IsRequired(); + b.Property(x => x.Description).HasMaxLength(500); + + b.Property(x => x.Quantity).HasPrecision(18, 2).IsRequired(); + b.Property(x => x.UomId).IsRequired(); + + b.Property(x => x.UnitPrice).HasPrecision(18, 2).IsRequired(); + b.Property(x => x.TotalPrice).HasPrecision(18, 2).IsRequired(); + b.Property(x => x.LeadTime).HasDefaultValue(0); + + b.HasOne(x => x.Quotation) + .WithMany(x => x.Items) + .HasForeignKey(x => x.QuotationId) + .OnDelete(DeleteBehavior.Cascade); + }); } } \ No newline at end of file diff --git a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251127214637_Initial.Designer.cs b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251201070744_Initial.Designer.cs similarity index 97% rename from api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251127214637_Initial.Designer.cs rename to api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251201070744_Initial.Designer.cs index c1c33c52..7400f50f 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251127214637_Initial.Designer.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251201070744_Initial.Designer.cs @@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore; namespace Erp.Platform.Migrations { [DbContext(typeof(PlatformDbContext))] - [Migration("20251127214637_Initial")] + [Migration("20251201070744_Initial")] partial class Initial { /// @@ -4038,6 +4038,64 @@ namespace Erp.Platform.Migrations b.ToTable("Sas_H_DataSource", (string)null); }); + modelBuilder.Entity("Erp.Platform.Entities.DeliveryTerm", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("IsActive") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(true); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("Scp_T_DeliveryTerm", (string)null); + }); + modelBuilder.Entity("Erp.Platform.Entities.Demo", b => { b.Property("Id") @@ -10849,6 +10907,285 @@ namespace Erp.Platform.Migrations b.ToTable("Crd_T_QuestionTag", (string)null); }); + modelBuilder.Entity("Erp.Platform.Entities.Quotation", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Currency") + .IsRequired() + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DeliveryTermId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeliveryTime") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("EvaluatedAt") + .HasColumnType("datetime2"); + + b.Property("EvaluatedBy") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("EvaluationComments") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("EvaluationNotes") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("EvaluationScore") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + 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("Notes") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("PaymentMethodId") + .HasColumnType("uniqueidentifier"); + + b.Property("PaymentTermId") + .HasColumnType("uniqueidentifier"); + + b.Property("QuotationDate") + .HasColumnType("datetime2"); + + b.Property("QuotationNumber") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("RequestId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("RequestTitle") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("RequestTypeId") + .HasColumnType("uniqueidentifier"); + + b.Property("StatusId") + .HasColumnType("uniqueidentifier"); + + b.Property("SubmittedAt") + .HasColumnType("datetime2"); + + b.Property("SubmittedBy") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("SupplierId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("TotalAmount") + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)"); + + b.Property("ValidUntil") + .HasColumnType("datetime2"); + + b.HasKey("Id"); + + b.HasIndex("DeliveryTermId"); + + b.HasIndex("PaymentMethodId"); + + b.HasIndex("PaymentTermId"); + + b.HasIndex("RequestTypeId"); + + b.HasIndex("StatusId"); + + b.HasIndex("SupplierId"); + + b.ToTable("Scp_T_Quotation", (string)null); + }); + + modelBuilder.Entity("Erp.Platform.Entities.QuotationItem", 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("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LeadTime") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("MaterialId") + .HasColumnType("uniqueidentifier"); + + b.Property("Quantity") + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)"); + + b.Property("QuotationId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("TotalPrice") + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)"); + + b.Property("UnitPrice") + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)"); + + b.Property("UomId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("MaterialId"); + + b.HasIndex("QuotationId"); + + b.HasIndex("UomId"); + + b.ToTable("Scp_T_QuotationItem", (string)null); + }); + + modelBuilder.Entity("Erp.Platform.Entities.QuotationStatus", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("IsActive") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(true); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("Scp_T_QuotationStatus", (string)null); + }); + modelBuilder.Entity("Erp.Platform.Entities.RegistrationMethod", b => { b.Property("Id") @@ -17995,6 +18332,80 @@ namespace Erp.Platform.Migrations b.Navigation("Question"); }); + modelBuilder.Entity("Erp.Platform.Entities.Quotation", b => + { + b.HasOne("Erp.Platform.Entities.DeliveryTerm", "DeliveryTerm") + .WithMany("Quotations") + .HasForeignKey("DeliveryTermId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("Erp.Platform.Entities.PaymentMethod", null) + .WithMany("Quotations") + .HasForeignKey("PaymentMethodId"); + + b.HasOne("Erp.Platform.Entities.PaymentTerm", "PaymentTerm") + .WithMany("Quotations") + .HasForeignKey("PaymentTermId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("Erp.Platform.Entities.RequestType", "RequestType") + .WithMany() + .HasForeignKey("RequestTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Erp.Platform.Entities.QuotationStatus", "Status") + .WithMany("Quotations") + .HasForeignKey("StatusId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("Erp.Platform.Entities.Partner", "Supplier") + .WithMany() + .HasForeignKey("SupplierId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DeliveryTerm"); + + b.Navigation("PaymentTerm"); + + b.Navigation("RequestType"); + + b.Navigation("Status"); + + b.Navigation("Supplier"); + }); + + modelBuilder.Entity("Erp.Platform.Entities.QuotationItem", b => + { + b.HasOne("Erp.Platform.Entities.Material", "Material") + .WithMany() + .HasForeignKey("MaterialId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Erp.Platform.Entities.Quotation", "Quotation") + .WithMany("Items") + .HasForeignKey("QuotationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Erp.Platform.Entities.Uom", "Uom") + .WithMany() + .HasForeignKey("UomId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Material"); + + b.Navigation("Quotation"); + + b.Navigation("Uom"); + }); + modelBuilder.Entity("Erp.Platform.Entities.RegistrationMethod", b => { b.HasOne("Erp.Platform.Entities.Branch", "Branch") @@ -18683,6 +19094,11 @@ namespace Erp.Platform.Migrations b.Navigation("Partners"); }); + modelBuilder.Entity("Erp.Platform.Entities.DeliveryTerm", b => + { + b.Navigation("Quotations"); + }); + modelBuilder.Entity("Erp.Platform.Entities.Department", b => { b.Navigation("Performans360s"); @@ -18839,6 +19255,16 @@ namespace Erp.Platform.Migrations b.Navigation("Contacts"); }); + modelBuilder.Entity("Erp.Platform.Entities.PaymentMethod", b => + { + b.Navigation("Quotations"); + }); + + modelBuilder.Entity("Erp.Platform.Entities.PaymentTerm", b => + { + b.Navigation("Quotations"); + }); + modelBuilder.Entity("Erp.Platform.Entities.Payroll", b => { b.Navigation("Items"); @@ -18880,6 +19306,16 @@ namespace Erp.Platform.Migrations b.Navigation("Questions"); }); + modelBuilder.Entity("Erp.Platform.Entities.Quotation", b => + { + b.Navigation("Items"); + }); + + modelBuilder.Entity("Erp.Platform.Entities.QuotationStatus", b => + { + b.Navigation("Quotations"); + }); + modelBuilder.Entity("Erp.Platform.Entities.RegistrationType", b => { b.Navigation("ClassTypes"); diff --git a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251127214637_Initial.cs b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251201070744_Initial.cs similarity index 97% rename from api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251127214637_Initial.cs rename to api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251201070744_Initial.cs index a692fb5e..d2eaf486 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251127214637_Initial.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251201070744_Initial.cs @@ -2630,6 +2630,28 @@ namespace Erp.Platform.Migrations table.PrimaryKey("PK_Sas_T_Sector", x => x.Id); }); + migrationBuilder.CreateTable( + name: "Scp_T_DeliveryTerm", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + Name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + Description = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), + IsActive = table.Column(type: "bit", nullable: false, defaultValue: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Scp_T_DeliveryTerm", x => x.Id); + }); + migrationBuilder.CreateTable( name: "Scp_T_MaterialGroup", columns: table => new @@ -2705,6 +2727,28 @@ namespace Erp.Platform.Migrations table.PrimaryKey("PK_Scp_T_PaymentTerm", x => x.Id); }); + migrationBuilder.CreateTable( + name: "Scp_T_QuotationStatus", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + Name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + Description = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), + IsActive = table.Column(type: "bit", nullable: false, defaultValue: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Scp_T_QuotationStatus", x => x.Id); + }); + migrationBuilder.CreateTable( name: "Scp_T_RequestType", columns: table => new @@ -5038,6 +5082,127 @@ namespace Erp.Platform.Migrations onDelete: ReferentialAction.Restrict); }); + migrationBuilder.CreateTable( + name: "Scp_T_Quotation", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + QuotationNumber = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + RequestId = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + RequestTitle = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), + RequestTypeId = table.Column(type: "uniqueidentifier", nullable: false), + SupplierId = table.Column(type: "uniqueidentifier", nullable: false), + QuotationDate = table.Column(type: "datetime2", nullable: false), + ValidUntil = table.Column(type: "datetime2", nullable: false), + StatusId = table.Column(type: "uniqueidentifier", nullable: false), + TotalAmount = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false), + Currency = table.Column(type: "nvarchar(10)", maxLength: 10, nullable: false), + PaymentTermId = table.Column(type: "uniqueidentifier", nullable: false), + DeliveryTermId = table.Column(type: "uniqueidentifier", nullable: false), + DeliveryTime = table.Column(type: "int", nullable: true, defaultValue: 0), + EvaluationScore = table.Column(type: "int", nullable: true, defaultValue: 0), + EvaluationComments = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true), + EvaluationNotes = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true), + Notes = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true), + SubmittedBy = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), + SubmittedAt = table.Column(type: "datetime2", nullable: false), + EvaluatedBy = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), + EvaluatedAt = table.Column(type: "datetime2", nullable: true), + PaymentMethodId = table.Column(type: "uniqueidentifier", nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Scp_T_Quotation", x => x.Id); + table.ForeignKey( + name: "FK_Scp_T_Quotation_Adm_T_Partner_SupplierId", + column: x => x.SupplierId, + principalTable: "Adm_T_Partner", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_Scp_T_Quotation_Adm_T_PaymentMethod_PaymentMethodId", + column: x => x.PaymentMethodId, + principalTable: "Adm_T_PaymentMethod", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_Scp_T_Quotation_Scp_T_DeliveryTerm_DeliveryTermId", + column: x => x.DeliveryTermId, + principalTable: "Scp_T_DeliveryTerm", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Scp_T_Quotation_Scp_T_PaymentTerm_PaymentTermId", + column: x => x.PaymentTermId, + principalTable: "Scp_T_PaymentTerm", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Scp_T_Quotation_Scp_T_QuotationStatus_StatusId", + column: x => x.StatusId, + principalTable: "Scp_T_QuotationStatus", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Scp_T_Quotation_Scp_T_RequestType_RequestTypeId", + column: x => x.RequestTypeId, + principalTable: "Scp_T_RequestType", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "Scp_T_QuotationItem", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + QuotationId = table.Column(type: "uniqueidentifier", nullable: false), + MaterialId = table.Column(type: "uniqueidentifier", nullable: false), + Quantity = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false), + UomId = table.Column(type: "uniqueidentifier", nullable: false), + UnitPrice = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false), + TotalPrice = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false), + LeadTime = table.Column(type: "int", nullable: true, defaultValue: 0), + Description = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Scp_T_QuotationItem", x => x.Id); + table.ForeignKey( + name: "FK_Scp_T_QuotationItem_Adm_T_Uom_UomId", + column: x => x.UomId, + principalTable: "Adm_T_Uom", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_Scp_T_QuotationItem_Scp_T_Material_MaterialId", + column: x => x.MaterialId, + principalTable: "Scp_T_Material", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_Scp_T_QuotationItem_Scp_T_Quotation_QuotationId", + column: x => x.QuotationId, + principalTable: "Scp_T_Quotation", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + migrationBuilder.CreateTable( name: "Crm_T_Activity", columns: table => new @@ -8294,6 +8459,51 @@ namespace Erp.Platform.Migrations table: "Scp_T_MaterialSpecification", column: "UnitId"); + migrationBuilder.CreateIndex( + name: "IX_Scp_T_Quotation_DeliveryTermId", + table: "Scp_T_Quotation", + column: "DeliveryTermId"); + + migrationBuilder.CreateIndex( + name: "IX_Scp_T_Quotation_PaymentMethodId", + table: "Scp_T_Quotation", + column: "PaymentMethodId"); + + migrationBuilder.CreateIndex( + name: "IX_Scp_T_Quotation_PaymentTermId", + table: "Scp_T_Quotation", + column: "PaymentTermId"); + + migrationBuilder.CreateIndex( + name: "IX_Scp_T_Quotation_RequestTypeId", + table: "Scp_T_Quotation", + column: "RequestTypeId"); + + migrationBuilder.CreateIndex( + name: "IX_Scp_T_Quotation_StatusId", + table: "Scp_T_Quotation", + column: "StatusId"); + + migrationBuilder.CreateIndex( + name: "IX_Scp_T_Quotation_SupplierId", + table: "Scp_T_Quotation", + column: "SupplierId"); + + migrationBuilder.CreateIndex( + name: "IX_Scp_T_QuotationItem_MaterialId", + table: "Scp_T_QuotationItem", + column: "MaterialId"); + + migrationBuilder.CreateIndex( + name: "IX_Scp_T_QuotationItem_QuotationId", + table: "Scp_T_QuotationItem", + column: "QuotationId"); + + migrationBuilder.CreateIndex( + name: "IX_Scp_T_QuotationItem_UomId", + table: "Scp_T_QuotationItem", + column: "UomId"); + migrationBuilder.CreateIndex( name: "IX_Scp_T_Request_DepartmentId", table: "Scp_T_Request", @@ -8614,9 +8824,6 @@ namespace Erp.Platform.Migrations migrationBuilder.DropTable( name: "Adm_T_PartnerContact"); - migrationBuilder.DropTable( - name: "Adm_T_PaymentMethod"); - migrationBuilder.DropTable( name: "Adm_T_Product"); @@ -8893,6 +9100,9 @@ namespace Erp.Platform.Migrations migrationBuilder.DropTable( name: "Scp_T_MaterialSpecification"); + migrationBuilder.DropTable( + name: "Scp_T_QuotationItem"); + migrationBuilder.DropTable( name: "Scp_T_RequestItem"); @@ -9019,6 +9229,9 @@ namespace Erp.Platform.Migrations migrationBuilder.DropTable( name: "Adm_T_Uom"); + migrationBuilder.DropTable( + name: "Scp_T_Quotation"); + migrationBuilder.DropTable( name: "Scp_T_Request"); @@ -9094,6 +9307,15 @@ namespace Erp.Platform.Migrations migrationBuilder.DropTable( name: "Adm_T_UomCategory"); + migrationBuilder.DropTable( + name: "Adm_T_PaymentMethod"); + + migrationBuilder.DropTable( + name: "Scp_T_DeliveryTerm"); + + migrationBuilder.DropTable( + name: "Scp_T_QuotationStatus"); + migrationBuilder.DropTable( name: "Scp_T_RequestType"); diff --git a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs index c34346e6..f08be558 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs @@ -4035,6 +4035,64 @@ namespace Erp.Platform.Migrations b.ToTable("Sas_H_DataSource", (string)null); }); + modelBuilder.Entity("Erp.Platform.Entities.DeliveryTerm", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("IsActive") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(true); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("Scp_T_DeliveryTerm", (string)null); + }); + modelBuilder.Entity("Erp.Platform.Entities.Demo", b => { b.Property("Id") @@ -10846,6 +10904,285 @@ namespace Erp.Platform.Migrations b.ToTable("Crd_T_QuestionTag", (string)null); }); + modelBuilder.Entity("Erp.Platform.Entities.Quotation", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Currency") + .IsRequired() + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DeliveryTermId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeliveryTime") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("EvaluatedAt") + .HasColumnType("datetime2"); + + b.Property("EvaluatedBy") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("EvaluationComments") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("EvaluationNotes") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("EvaluationScore") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + 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("Notes") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("PaymentMethodId") + .HasColumnType("uniqueidentifier"); + + b.Property("PaymentTermId") + .HasColumnType("uniqueidentifier"); + + b.Property("QuotationDate") + .HasColumnType("datetime2"); + + b.Property("QuotationNumber") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("RequestId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("RequestTitle") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("RequestTypeId") + .HasColumnType("uniqueidentifier"); + + b.Property("StatusId") + .HasColumnType("uniqueidentifier"); + + b.Property("SubmittedAt") + .HasColumnType("datetime2"); + + b.Property("SubmittedBy") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("SupplierId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("TotalAmount") + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)"); + + b.Property("ValidUntil") + .HasColumnType("datetime2"); + + b.HasKey("Id"); + + b.HasIndex("DeliveryTermId"); + + b.HasIndex("PaymentMethodId"); + + b.HasIndex("PaymentTermId"); + + b.HasIndex("RequestTypeId"); + + b.HasIndex("StatusId"); + + b.HasIndex("SupplierId"); + + b.ToTable("Scp_T_Quotation", (string)null); + }); + + modelBuilder.Entity("Erp.Platform.Entities.QuotationItem", 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("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LeadTime") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("MaterialId") + .HasColumnType("uniqueidentifier"); + + b.Property("Quantity") + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)"); + + b.Property("QuotationId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("TotalPrice") + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)"); + + b.Property("UnitPrice") + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)"); + + b.Property("UomId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("MaterialId"); + + b.HasIndex("QuotationId"); + + b.HasIndex("UomId"); + + b.ToTable("Scp_T_QuotationItem", (string)null); + }); + + modelBuilder.Entity("Erp.Platform.Entities.QuotationStatus", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("IsActive") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(true); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("Scp_T_QuotationStatus", (string)null); + }); + modelBuilder.Entity("Erp.Platform.Entities.RegistrationMethod", b => { b.Property("Id") @@ -17992,6 +18329,80 @@ namespace Erp.Platform.Migrations b.Navigation("Question"); }); + modelBuilder.Entity("Erp.Platform.Entities.Quotation", b => + { + b.HasOne("Erp.Platform.Entities.DeliveryTerm", "DeliveryTerm") + .WithMany("Quotations") + .HasForeignKey("DeliveryTermId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("Erp.Platform.Entities.PaymentMethod", null) + .WithMany("Quotations") + .HasForeignKey("PaymentMethodId"); + + b.HasOne("Erp.Platform.Entities.PaymentTerm", "PaymentTerm") + .WithMany("Quotations") + .HasForeignKey("PaymentTermId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("Erp.Platform.Entities.RequestType", "RequestType") + .WithMany() + .HasForeignKey("RequestTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Erp.Platform.Entities.QuotationStatus", "Status") + .WithMany("Quotations") + .HasForeignKey("StatusId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("Erp.Platform.Entities.Partner", "Supplier") + .WithMany() + .HasForeignKey("SupplierId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DeliveryTerm"); + + b.Navigation("PaymentTerm"); + + b.Navigation("RequestType"); + + b.Navigation("Status"); + + b.Navigation("Supplier"); + }); + + modelBuilder.Entity("Erp.Platform.Entities.QuotationItem", b => + { + b.HasOne("Erp.Platform.Entities.Material", "Material") + .WithMany() + .HasForeignKey("MaterialId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Erp.Platform.Entities.Quotation", "Quotation") + .WithMany("Items") + .HasForeignKey("QuotationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Erp.Platform.Entities.Uom", "Uom") + .WithMany() + .HasForeignKey("UomId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Material"); + + b.Navigation("Quotation"); + + b.Navigation("Uom"); + }); + modelBuilder.Entity("Erp.Platform.Entities.RegistrationMethod", b => { b.HasOne("Erp.Platform.Entities.Branch", "Branch") @@ -18680,6 +19091,11 @@ namespace Erp.Platform.Migrations b.Navigation("Partners"); }); + modelBuilder.Entity("Erp.Platform.Entities.DeliveryTerm", b => + { + b.Navigation("Quotations"); + }); + modelBuilder.Entity("Erp.Platform.Entities.Department", b => { b.Navigation("Performans360s"); @@ -18836,6 +19252,16 @@ namespace Erp.Platform.Migrations b.Navigation("Contacts"); }); + modelBuilder.Entity("Erp.Platform.Entities.PaymentMethod", b => + { + b.Navigation("Quotations"); + }); + + modelBuilder.Entity("Erp.Platform.Entities.PaymentTerm", b => + { + b.Navigation("Quotations"); + }); + modelBuilder.Entity("Erp.Platform.Entities.Payroll", b => { b.Navigation("Items"); @@ -18877,6 +19303,16 @@ namespace Erp.Platform.Migrations b.Navigation("Questions"); }); + modelBuilder.Entity("Erp.Platform.Entities.Quotation", b => + { + b.Navigation("Items"); + }); + + modelBuilder.Entity("Erp.Platform.Entities.QuotationStatus", b => + { + b.Navigation("Quotations"); + }); + modelBuilder.Entity("Erp.Platform.Entities.RegistrationType", b => { b.Navigation("ClassTypes"); diff --git a/api/src/Erp.Platform.EntityFrameworkCore/Tenants/Seeds/TenantData.json b/api/src/Erp.Platform.EntityFrameworkCore/Tenants/Seeds/TenantData.json index f7e1faa4..88a6255a 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Tenants/Seeds/TenantData.json +++ b/api/src/Erp.Platform.EntityFrameworkCore/Tenants/Seeds/TenantData.json @@ -6301,5 +6301,59 @@ ], "ProjectTaskDailies" : [ + ], + "DeliveryTerms": [ + { + "name": "15 Gün", + "description": "Teslimatın sipariş tarihinden itibaren 15 gün içinde yapılacağını ifade eder", + "isActive": true + }, + { + "name": "21 Gün", + "description": "Teslimatın sipariş tarihinden itibaren 21 gün içinde yapılacağını ifade eder", + "isActive": true + }, + { + "name": "30 Gün", + "description": "Teslimatın sipariş tarihinden itibaren 30 gün içinde yapılacağını ifade eder", + "isActive": true + } + ], + "QuotationStatuses": [ + { + "name": "Taslak", + "description": "Teklifin taslak aşamasında olduğunu ifade eder", + "isActive": true + }, + { + "name": "Beklemede", + "description": "Teklifin beklemede olduğunu ifade eder", + "isActive": true + }, + { + "name": "İnceleme Aşamasında", + "description": "Teklifin inceleme aşamasında olduğunu ifade eder", + "isActive": true + }, + { + "name": "Gönderildi", + "description": "Teklifin gönderildiğini ifade eder", + "isActive": true + }, + { + "name": "Onaylandı", + "description": "Teklifin onaylandığını ifade eder", + "isActive": true + }, + { + "name": "Reddedildi", + "description": "Teklifin reddedildiğini ifade eder", + "isActive": true + }, + { + "name": "Süresi Dolmuş", + "description": "Teklifin süresinin dolduğunu ifade eder", + "isActive": true + } ] } \ No newline at end of file diff --git a/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantDataSeeder.cs b/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantDataSeeder.cs index b76c433d..dcc2250e 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantDataSeeder.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantDataSeeder.cs @@ -137,6 +137,8 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency private readonly IRepository _projectRepository; private readonly IRepository _projectPhaseRepository; private readonly IRepository _projectTaskRepository; + private readonly IRepository _deliveryTermRepository; + private readonly IRepository _quotationStatusRepository; public TenantDataSeeder( IClock clock, @@ -256,7 +258,9 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency IRepository projectTaskTypeRepository, IRepository projectRepository, IRepository projectPhaseRepository, - IRepository projectTaskRepository + IRepository projectTaskRepository, + IRepository deliveryTermRepository, + IRepository quotationStatusRepository ) { _clock = clock; @@ -378,6 +382,8 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency _projectRepository = projectRepository; _projectPhaseRepository = projectPhaseRepository; _projectTaskRepository = projectTaskRepository; + _deliveryTermRepository = deliveryTermRepository; + _quotationStatusRepository = quotationStatusRepository; } private static IConfigurationRoot BuildConfiguration() @@ -2650,6 +2656,34 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency IsActive = item.IsActive }, autoSave: true); } + + foreach (var item in items.DeliveryTerms) + { + var exists = await _deliveryTermRepository.AnyAsync(x => x.Name == item.Name); + if (exists) + continue; + + await _deliveryTermRepository.InsertAsync(new DeliveryTerm + { + Name = item.Name, + Description = item.Description, + IsActive = item.IsActive + }, autoSave: true); + } + + foreach (var item in items.QuotationStatuses) + { + var exists = await _quotationStatusRepository.AnyAsync(x => x.Name == item.Name); + if (exists) + continue; + + await _quotationStatusRepository.InsertAsync(new QuotationStatus + { + 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 e7b6926d..8d38114a 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantSeederDto.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantSeederDto.cs @@ -90,6 +90,8 @@ public class TenantSeederDto public List SupplyCardTypes { get; set; } public List RequestTypes { get; set; } public List Approvals { get; set; } + public List DeliveryTerms { get; set; } + public List QuotationStatuses { get; set; } //Crm public List Partners { get; set; } @@ -140,6 +142,20 @@ public class TenantSeederDto public List ProjectTaskDailies { get; set; } } +public class DeliveryTermSeedDto +{ + public string Name { get; set; } + public string Description { get; set; } + public bool IsActive { get; set; } +} + +public class QuotationStatusSeedDto +{ + public string Name { get; set; } + public string Description { get; set; } + public bool IsActive { get; set; } +} + public class ProjectTaskDailySeedDto { public string EmployeeCode { get; set; }