From a6374583522d7e752bb79e28a3ceb9801e51ccae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sedat=20=C3=96ZT=C3=9CRK?= <76204082+iamsedatozturk@users.noreply.github.com> Date: Mon, 8 Dec 2025 11:09:19 +0300 Subject: [PATCH] Store Stock Entry, Exit ve Transfer --- .../AiBots/AiBotDto.cs | 2 +- .../LookUpQueryValues.cs | 2 +- .../Seeds/HostData.json | 2 +- .../Seeds/HostDataSeeder.cs | 6 +- .../Seeds/LanguagesData.json | 4 +- .../Seeds/ListFormSeeder_Saas.cs | 4 +- .../Seeds/ListFormSeeder_Store.cs | 63 +++++++++++++++---- .../Entities/Host/AiBot.cs | 2 +- .../Entities/Tenant/Store/Movement.cs | 2 + .../EntityFrameworkCore/PlatformDbContext.cs | 4 +- ....cs => 20251208072106_Initial.Designer.cs} | 18 +++--- ...3_Initial.cs => 20251208072106_Initial.cs} | 5 +- .../PlatformDbContextModelSnapshot.cs | 16 +++-- .../Tenants/Seeds/TenantData.json | 50 +++++++++++---- .../Tenants/TenantDataSeeder.cs | 3 +- .../Tenants/TenantDatabaseViewCreator.cs | 2 + .../Tenants/TenantSeederDto.cs | 1 + ui/src/proxy/ai/models.ts | 2 +- ui/src/views/ai/Assistant.tsx | 4 +- 19 files changed, 137 insertions(+), 55 deletions(-) rename api/src/Erp.Platform.EntityFrameworkCore/Migrations/{20251207201503_Initial.Designer.cs => 20251208072106_Initial.Designer.cs} (99%) rename api/src/Erp.Platform.EntityFrameworkCore/Migrations/{20251207201503_Initial.cs => 20251208072106_Initial.cs} (99%) diff --git a/api/src/Erp.Platform.Application.Contracts/AiBots/AiBotDto.cs b/api/src/Erp.Platform.Application.Contracts/AiBots/AiBotDto.cs index 1c9a15fa..2c84727a 100644 --- a/api/src/Erp.Platform.Application.Contracts/AiBots/AiBotDto.cs +++ b/api/src/Erp.Platform.Application.Contracts/AiBots/AiBotDto.cs @@ -5,6 +5,6 @@ namespace Erp.Platform.AiBots; public class AiBotDto : FullAuditedEntityDto { - public string BotName { get; set; } + public string Name { get; set; } } diff --git a/api/src/Erp.Platform.Application.Contracts/LookUpQueryValues.cs b/api/src/Erp.Platform.Application.Contracts/LookUpQueryValues.cs index e5e0691f..bcb79bb6 100644 --- a/api/src/Erp.Platform.Application.Contracts/LookUpQueryValues.cs +++ b/api/src/Erp.Platform.Application.Contracts/LookUpQueryValues.cs @@ -272,7 +272,7 @@ public static class LookupQueryValues $"\"Name\" AS \"Name\" " + $"FROM \"{FullNameTable(TableNameEnum.ReferenceType)}\" " + $"WHERE " + - $"(\"MovementTypeName\" = '{movementTypeName}') " + + $"(\"MovementTypeName\" = N'{movementTypeName}') " + $"AND \"IsDeleted\" = 'false' " + $"ORDER BY \"Name\";"; } diff --git a/api/src/Erp.Platform.DbMigrator/Seeds/HostData.json b/api/src/Erp.Platform.DbMigrator/Seeds/HostData.json index ad2ed79c..73feb639 100644 --- a/api/src/Erp.Platform.DbMigrator/Seeds/HostData.json +++ b/api/src/Erp.Platform.DbMigrator/Seeds/HostData.json @@ -1,7 +1,7 @@ { "AiBots": [ { - "BotName": "Chat Bot", + "Name": "Chat Bot", "Description": "A general purpose chat bot that can answer questions and have conversations.", "ApiUrl": "https://api.openai.com/v1/chat/completions", "IsActive": true diff --git a/api/src/Erp.Platform.DbMigrator/Seeds/HostDataSeeder.cs b/api/src/Erp.Platform.DbMigrator/Seeds/HostDataSeeder.cs index 5b3689d3..fceaa6aa 100644 --- a/api/src/Erp.Platform.DbMigrator/Seeds/HostDataSeeder.cs +++ b/api/src/Erp.Platform.DbMigrator/Seeds/HostDataSeeder.cs @@ -26,7 +26,7 @@ namespace Erp.Platform.Data.Seeds; #region SeedDtos public class AiBotSeedDto { - public string BotName { get; set; } + public string Name { get; set; } public string Description { get; set; } public string ApiUrl { get; set; } public bool IsActive { get; set; } @@ -670,13 +670,13 @@ public class HostDataSeeder : IDataSeedContributor, ITransientDependency foreach (var item in items.AiBots) { - var exists = await _aiBotRepository.AnyAsync(x => x.BotName == item.BotName); + var exists = await _aiBotRepository.AnyAsync(x => x.Name == item.Name); if (!exists) { await _aiBotRepository.InsertAsync(new AiBot { - BotName = item.BotName, + Name = item.Name, Description = item.Description, ApiUrl = item.ApiUrl, IsActive = item.IsActive diff --git a/api/src/Erp.Platform.DbMigrator/Seeds/LanguagesData.json b/api/src/Erp.Platform.DbMigrator/Seeds/LanguagesData.json index 367a5a58..da97e9a3 100644 --- a/api/src/Erp.Platform.DbMigrator/Seeds/LanguagesData.json +++ b/api/src/Erp.Platform.DbMigrator/Seeds/LanguagesData.json @@ -9784,8 +9784,8 @@ { "resourceName": "Platform", "key": "App.Store.MovementItem", - "tr": "Stok Hareket Ürünleri", - "en": "Stock Movement Items" + "tr": "Stok Hareketleri", + "en": "Stock Movements" }, { "resourceName": "Platform", diff --git a/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Saas.cs b/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Saas.cs index e5287d95..5398764f 100644 --- a/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Saas.cs +++ b/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Saas.cs @@ -1552,7 +1552,7 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency EditingFormJson = JsonSerializer.Serialize(new List() { new() { Order=1, ColCount=1, ColSpan=1, ItemType="group", Items = [ - new EditingFormItemDto { Order=1, DataField="BotName", ColSpan=1, IsRequired=true, EditorType2=EditorTypes.dxTextBox }, + new EditingFormItemDto { Order=1, DataField="Name", ColSpan=1, IsRequired=true, EditorType2=EditorTypes.dxTextBox }, new EditingFormItemDto { Order=2, DataField="Description", ColSpan=1, IsRequired=true, EditorType2=EditorTypes.dxTextArea }, new EditingFormItemDto { Order=3, DataField="ApiUrl", ColSpan=1, IsRequired=true, EditorType2=EditorTypes.dxTextBox }, new EditingFormItemDto { Order=4, DataField="IsActive", ColSpan=1, IsRequired=true, EditorType2=EditorTypes.dxCheckBox } @@ -1587,7 +1587,7 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency ListFormCode = listForm.ListFormCode, CultureName = LanguageCodes.En, SourceDbType = DbType.String, - FieldName = "BotName", + FieldName = "Name", Width = 100, ListOrderNo = 2, Visible = true, diff --git a/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Store.cs b/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Store.cs index ae283f2f..f116a12b 100644 --- a/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Store.cs +++ b/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Store.cs @@ -45,7 +45,6 @@ public class ListFormSeeder_Warehouse : IDataSeedContributor, ITransientDependen { var utils = new SeederUtils(_listFormRepository, _listFormFieldRepository); var listFormName = String.Empty; - var movementType = String.Empty; #region Warehouse Type listFormName = AppCodes.Store.WarehouseType; @@ -2645,6 +2644,21 @@ public class ListFormSeeder_Warehouse : IDataSeedContributor, ITransientDependen PermissionJson = DefaultFieldPermissionJson(listForm.Name), PivotSettingsJson = DefaultPivotSettingsJson }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Boolean, + FieldName = "IsTransfer", + Width = 100, + ListOrderNo = 17, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, ]); #endregion } @@ -2652,7 +2666,6 @@ public class ListFormSeeder_Warehouse : IDataSeedContributor, ITransientDependen #region Stock Entry listFormName = AppCodes.Store.Entry; - movementType = "Giriş"; if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName)) { var listForm = await _listFormRepository.InsertAsync( @@ -2676,7 +2689,7 @@ public class ListFormSeeder_Warehouse : IDataSeedContributor, ITransientDependen SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.Movement)), KeyFieldName = "Id", KeyFieldDbSourceType = DbType.Guid, - DefaultFilter = $"\"IsDeleted\" = 'false' AND \"MovementType\" = '{movementType}'", + DefaultFilter = $"\"IsDeleted\" = 'false' AND \"MovementType\" = N'Giriş'", SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, @@ -2689,7 +2702,7 @@ public class ListFormSeeder_Warehouse : IDataSeedContributor, ITransientDependen DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson, PagerOptionJson = DefaultPagerOptionJson, InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson, - InsertAfterCommand = $"UPDATE {TableNameResolver.GetFullTableName(nameof(TableNameEnum.Movement))} SET \"MovementType\" = '{movementType}' WHERE \"Id\" = @Id;", + InsertAfterCommand = $"UPDATE {TableNameResolver.GetFullTableName(nameof(TableNameEnum.Movement))} SET \"MovementType\" = 'Giriş' WHERE \"Id\" = @Id;", EditingOptionJson = DefaultEditingOptionJson(listFormName, 600, 300, true, true, true, true, false), EditingFormJson = JsonSerializer.Serialize(new List() { new() { @@ -2809,7 +2822,7 @@ public class ListFormSeeder_Warehouse : IDataSeedContributor, ITransientDependen DataSourceType = UiLookupDataSourceTypeEnum.Query, DisplayExpr = "Name", ValueExpr = "Key", - LookupQuery = LookupQueryValues.ReferenceTypeValues(movementType), + LookupQuery = LookupQueryValues.ReferenceTypeValues("Giriş"), }), ValidationRuleJson = DefaultValidationRuleRequiredJson, ColumnCustomizationJson = DefaultColumnCustomizationJson, @@ -2846,6 +2859,21 @@ public class ListFormSeeder_Warehouse : IDataSeedContributor, ITransientDependen PermissionJson = DefaultFieldPermissionJson(listForm.Name), PivotSettingsJson = DefaultPivotSettingsJson }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Boolean, + FieldName = "IsTransfer", + Width = 100, + ListOrderNo = 8, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, ], autoSave: true); #endregion } @@ -3119,7 +3147,6 @@ public class ListFormSeeder_Warehouse : IDataSeedContributor, ITransientDependen #region Stock Exit listFormName = AppCodes.Store.Exit; - movementType = "Çıkış"; if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName)) { var listForm = await _listFormRepository.InsertAsync( @@ -3143,7 +3170,7 @@ public class ListFormSeeder_Warehouse : IDataSeedContributor, ITransientDependen SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.Movement)), KeyFieldName = "Id", KeyFieldDbSourceType = DbType.Guid, - DefaultFilter = $"\"IsDeleted\" = 'false' AND \"MovementType\" = '{movementType}'", + DefaultFilter = $"\"IsDeleted\" = 'false' AND \"MovementType\" = N'Çıkış'", SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, @@ -3156,7 +3183,7 @@ public class ListFormSeeder_Warehouse : IDataSeedContributor, ITransientDependen DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson, PagerOptionJson = DefaultPagerOptionJson, InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson, - InsertAfterCommand = $"UPDATE {TableNameResolver.GetFullTableName(nameof(TableNameEnum.Movement))} SET \"MovementType\" = '{movementType}' WHERE \"Id\" = @Id;", + InsertAfterCommand = $"UPDATE {TableNameResolver.GetFullTableName(nameof(TableNameEnum.Movement))} SET \"MovementType\" = 'Çıkış' WHERE \"Id\" = @Id;", EditingOptionJson = DefaultEditingOptionJson(listFormName, 600, 300, true, true, true, true, false), EditingFormJson = JsonSerializer.Serialize(new List() { new() { @@ -3276,7 +3303,7 @@ public class ListFormSeeder_Warehouse : IDataSeedContributor, ITransientDependen DataSourceType = UiLookupDataSourceTypeEnum.Query, DisplayExpr = "Name", ValueExpr = "Key", - LookupQuery = LookupQueryValues.ReferenceTypeValues(movementType), + LookupQuery = LookupQueryValues.ReferenceTypeValues("Çıkış"), }), ValidationRuleJson = DefaultValidationRuleRequiredJson, ColumnCustomizationJson = DefaultColumnCustomizationJson, @@ -3313,6 +3340,21 @@ public class ListFormSeeder_Warehouse : IDataSeedContributor, ITransientDependen PermissionJson = DefaultFieldPermissionJson(listForm.Name), PivotSettingsJson = DefaultPivotSettingsJson }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Boolean, + FieldName = "IsTransfer", + Width = 100, + ListOrderNo = 8, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, ], autoSave: true); #endregion } @@ -3587,7 +3629,6 @@ public class ListFormSeeder_Warehouse : IDataSeedContributor, ITransientDependen #region Stock Transfer listFormName = AppCodes.Store.Transfer; - movementType = "Transfer"; if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName)) { var listForm = await _listFormRepository.InsertAsync( @@ -3611,7 +3652,7 @@ public class ListFormSeeder_Warehouse : IDataSeedContributor, ITransientDependen SelectCommand = TableNameResolver.GetFullSpecialViewName(MenuPrefix.Store, TablePrefix.TenantPrefix, nameof(TableNameEnum.TransferItem)), KeyFieldName = "Id", KeyFieldDbSourceType = DbType.Guid, - DefaultFilter = $"\"IsDeleted\" = 'false' AND \"MovementType\" = '{movementType}'", + DefaultFilter = $"\"IsDeleted\" = 'false' AND \"IsTransfer\" = 'true'", SortMode = GridOptions.SortModeSingle, FilterRowJson = DefaultFilterRowJson, HeaderFilterJson = DefaultHeaderFilterJson, diff --git a/api/src/Erp.Platform.Domain/Entities/Host/AiBot.cs b/api/src/Erp.Platform.Domain/Entities/Host/AiBot.cs index 0ab8e589..0a78cbbb 100644 --- a/api/src/Erp.Platform.Domain/Entities/Host/AiBot.cs +++ b/api/src/Erp.Platform.Domain/Entities/Host/AiBot.cs @@ -5,7 +5,7 @@ namespace Erp.Platform.Entities; public class AiBot : Entity { - public string BotName { get; set; } + public string Name { get; set; } public string Description { get; set; } public string ApiUrl { get; set; } public bool IsActive { get; set; } diff --git a/api/src/Erp.Platform.Domain/Entities/Tenant/Store/Movement.cs b/api/src/Erp.Platform.Domain/Entities/Tenant/Store/Movement.cs index ac47a82c..da073f2b 100644 --- a/api/src/Erp.Platform.Domain/Entities/Tenant/Store/Movement.cs +++ b/api/src/Erp.Platform.Domain/Entities/Tenant/Store/Movement.cs @@ -23,5 +23,7 @@ public class Movement : FullAuditedEntity, IMultiTenant public string ReferenceDocument { get; set; } public string Description { get; set; } + public bool IsTransfer { get; set; } + public ICollection MovementItems { get; set; } } diff --git a/api/src/Erp.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs b/api/src/Erp.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs index 442dbeb5..9674d3c9 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs @@ -342,7 +342,7 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.AiBot)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(a => a.BotName).IsRequired().HasMaxLength(128); + b.Property(a => a.Name).IsRequired().HasMaxLength(128); }); builder.Entity(b => @@ -479,7 +479,7 @@ public class PlatformDbContext : // Uzun JSON alanları için nvarchar(max) b.Property(a => a.SelectCommand).HasColumnType("text"); b.Property(a => a.SelectFieldsDefaultValueJson).HasColumnType("text"); - b.Property(a => a.DefaultFilter).HasColumnType("text"); + b.Property(a => a.DefaultFilter).IsUnicode(true); b.Property(a => a.ColumnOptionJson).HasColumnType("text"); b.Property(a => a.PivotOptionJson).HasColumnType("text"); b.Property(a => a.FilterRowJson).HasColumnType("text"); diff --git a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251207201503_Initial.Designer.cs b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251208072106_Initial.Designer.cs similarity index 99% rename from api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251207201503_Initial.Designer.cs rename to api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251208072106_Initial.Designer.cs index 17785939..69ea2ff9 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251207201503_Initial.Designer.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251208072106_Initial.Designer.cs @@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore; namespace Erp.Platform.Migrations { [DbContext(typeof(PlatformDbContext))] - [Migration("20251207201503_Initial")] + [Migration("20251208072106_Initial")] partial class Initial { /// @@ -723,17 +723,17 @@ namespace Erp.Platform.Migrations b.Property("ApiUrl") .HasColumnType("nvarchar(max)"); - b.Property("BotName") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("nvarchar(128)"); - b.Property("Description") .HasColumnType("nvarchar(max)"); b.Property("IsActive") .HasColumnType("bit"); + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + b.HasKey("Id"); b.ToTable("Plat_H_AiBot", (string)null); @@ -6232,7 +6232,8 @@ namespace Erp.Platform.Migrations .HasColumnType("text"); b.Property("DefaultFilter") - .HasColumnType("text"); + .IsUnicode(true) + .HasColumnType("nvarchar(max)"); b.Property("DeleteAfterCommand") .HasColumnType("nvarchar(max)"); @@ -7716,6 +7717,9 @@ namespace Erp.Platform.Migrations .HasDefaultValue(false) .HasColumnName("IsDeleted"); + b.Property("IsTransfer") + .HasColumnType("bit"); + b.Property("LastModificationTime") .HasColumnType("datetime2") .HasColumnName("LastModificationTime"); diff --git a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251207201503_Initial.cs b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251208072106_Initial.cs similarity index 99% rename from api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251207201503_Initial.cs rename to api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251208072106_Initial.cs index 73374fd3..837a6d1d 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251207201503_Initial.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251208072106_Initial.cs @@ -1667,7 +1667,7 @@ namespace Erp.Platform.Migrations columns: table => new { Id = table.Column(type: "uniqueidentifier", nullable: false), - BotName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), Description = table.Column(type: "nvarchar(max)", nullable: true), ApiUrl = table.Column(type: "nvarchar(max)", nullable: true), IsActive = table.Column(type: "bit", nullable: false) @@ -2267,7 +2267,7 @@ namespace Erp.Platform.Migrations Width = table.Column(type: "int", nullable: true), Height = table.Column(type: "int", nullable: true), FullHeight = table.Column(type: "bit", nullable: false), - DefaultFilter = table.Column(type: "text", nullable: true), + DefaultFilter = table.Column(type: "nvarchar(max)", nullable: true), ColumnOptionJson = table.Column(type: "text", nullable: true), PivotOptionJson = table.Column(type: "text", nullable: true), TreeOptionJson = table.Column(type: "nvarchar(max)", nullable: true), @@ -5411,6 +5411,7 @@ namespace Erp.Platform.Migrations ReferenceTypeId = table.Column(type: "uniqueidentifier", nullable: false), ReferenceDocument = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), Description = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true), + IsTransfer = table.Column(type: "bit", nullable: false), CreationTime = table.Column(type: "datetime2", nullable: false), CreatorId = table.Column(type: "uniqueidentifier", nullable: true), LastModificationTime = table.Column(type: "datetime2", nullable: true), diff --git a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs index ad709e22..28880598 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs @@ -720,17 +720,17 @@ namespace Erp.Platform.Migrations b.Property("ApiUrl") .HasColumnType("nvarchar(max)"); - b.Property("BotName") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("nvarchar(128)"); - b.Property("Description") .HasColumnType("nvarchar(max)"); b.Property("IsActive") .HasColumnType("bit"); + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + b.HasKey("Id"); b.ToTable("Plat_H_AiBot", (string)null); @@ -6229,7 +6229,8 @@ namespace Erp.Platform.Migrations .HasColumnType("text"); b.Property("DefaultFilter") - .HasColumnType("text"); + .IsUnicode(true) + .HasColumnType("nvarchar(max)"); b.Property("DeleteAfterCommand") .HasColumnType("nvarchar(max)"); @@ -7713,6 +7714,9 @@ namespace Erp.Platform.Migrations .HasDefaultValue(false) .HasColumnName("IsDeleted"); + b.Property("IsTransfer") + .HasColumnType("bit"); + b.Property("LastModificationTime") .HasColumnType("datetime2") .HasColumnName("LastModificationTime"); diff --git a/api/src/Erp.Platform.EntityFrameworkCore/Tenants/Seeds/TenantData.json b/api/src/Erp.Platform.EntityFrameworkCore/Tenants/Seeds/TenantData.json index 0a26564d..11705cc2 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Tenants/Seeds/TenantData.json +++ b/api/src/Erp.Platform.EntityFrameworkCore/Tenants/Seeds/TenantData.json @@ -6545,11 +6545,6 @@ "name": "Çıkış", "description": "Envanterden malzeme çıkışı için kullanılan hareket türü", "isActive": true - }, - { - "name": "Transfer", - "description": "Malzemelerin bir depo veya lokasyondan diğerine transferi için kullanılan hareket türü", - "isActive": true } ], "ReferenceTypes": [ @@ -6572,8 +6567,14 @@ "isActive": true }, { - "name": "Transfer Emri", - "movementTypeName": "Transfer", + "name": "Transfer Giriş", + "movementTypeName": "Giriş", + "description": "Transfer emirleri için kullanılan referans türü", + "isActive": true + }, + { + "name": "Transfer Çıkış", + "movementTypeName": "Çıkış", "description": "Transfer emirleri için kullanılan referans türü", "isActive": true }, @@ -6604,7 +6605,8 @@ "movementType": "Giriş", "referenceType": "Satın Alma Siparişi", "referenceDocument": "PO-2024-001", - "description": "Satın Alma Siparişi" + "description": "Satın Alma Siparişi", + "isTransfer": false }, { "movementNumber": "CI-2024-001", @@ -6613,16 +6615,28 @@ "movementType": "Çıkış", "referenceType": "Satış Siparişi", "referenceDocument": "SO-2024-001", - "description": "Satış çıkışı" + "description": "Satış çıkışı", + "isTransfer": false }, { "movementNumber": "TR-2024-001", "movementDate": "2024-01-17T10:30:00", - "movementType": "Transfer", + "movementType": "Çıkış", "partnerCode": null, - "referenceType": "Transfer Emri", + "referenceType": "Transfer Çıkış", "referenceDocument": "TR-2024-001", - "description": "Depo transferi" + "description": "Depo transferi", + "isTransfer": true + }, + { + "movementNumber": "TR-2024-002", + "movementDate": "2024-01-17T10:30:00", + "movementType": "Giriş", + "partnerCode": null, + "referenceType": "Transfer Giriş", + "referenceDocument": "TR-2024-001", + "description": "Depo transferi", + "isTransfer": true } ], "MovementItems": [ @@ -6661,6 +6675,18 @@ "lotNumber": "LOT2024002", "serialNumber": null, "description": "Depo transferi" + }, + { + "movementNumber": "TR-2024-002", + "materialCode": "PR001", + "warehouseCode": "WH-001", + "zoneCode": "Z002", + "locationCode": "A01-01-02", + "quantity": 10, + "uom": "m", + "lotNumber": "LOT2024002", + "serialNumber": null, + "description": "Depo transferi" } ] } \ 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 850ed52d..935d5cc1 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantDataSeeder.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantDataSeeder.cs @@ -2813,7 +2813,8 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency ReferenceTypeId = referenceType?.Id, PartnerId = partner?.Id, ReferenceDocument = item.ReferenceDocument, - Description = item.Description + Description = item.Description, + IsTransfer = item.IsTransfer }, autoSave: true); } diff --git a/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantDatabaseViewCreator.cs b/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantDatabaseViewCreator.cs index 269ea06d..e801d5ca 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantDatabaseViewCreator.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantDatabaseViewCreator.cs @@ -202,6 +202,7 @@ public class DatabaseViewSeeder : IDataSeedContributor, ITransientDependency m.PartnerId, m.ReferenceTypeId, m.ReferenceDocument, + m.IsTransfer, m.Description AS MainDescription, mi.Id, @@ -255,6 +256,7 @@ public class DatabaseViewSeeder : IDataSeedContributor, ITransientDependency m.PartnerId, m.ReferenceTypeId, m.ReferenceDocument, + m.IsTransfer, m.Description AS MainDescription, mi.Id, diff --git a/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantSeederDto.cs b/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantSeederDto.cs index 519648c1..b4999355 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantSeederDto.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/Tenants/TenantSeederDto.cs @@ -158,6 +158,7 @@ public class MovementSeedDto public string ReferenceType { get; set; } public string ReferenceDocument { get; set; } public string Description { get; set; } + public bool IsTransfer { get; set; } } public class MovementItemSeedDto diff --git a/ui/src/proxy/ai/models.ts b/ui/src/proxy/ai/models.ts index 35ee4f54..eb535f35 100644 --- a/ui/src/proxy/ai/models.ts +++ b/ui/src/proxy/ai/models.ts @@ -1,5 +1,5 @@ import { FullAuditedEntityDto } from '../abp' export interface AiDto extends FullAuditedEntityDto { - botName: string + name: string } diff --git a/ui/src/views/ai/Assistant.tsx b/ui/src/views/ai/Assistant.tsx index dae13494..c7940136 100644 --- a/ui/src/views/ai/Assistant.tsx +++ b/ui/src/views/ai/Assistant.tsx @@ -63,12 +63,12 @@ const Assistant = () => { const result = await aiService.getList({ skipCount: 0, maxResultCount: 1000, - sorting: 'botName', + sorting: 'name', }) const items = result?.data?.items?.map((bot: AiDto) => ({ key: bot.id!, - name: bot.botName, + name: bot.name, })) ?? [] setBot(items)