From 34d336f43e8570035488c6cbb85cc35f17dd212e Mon Sep 17 00:00:00 2001 From: gozareshgir Date: Tue, 27 Jan 2026 18:39:59 +0330 Subject: [PATCH] add bugsection Workflow --- .../Providers/BugSectionWorkflowProvider.cs | 32 +++++++++++++++++++ .../Queries/WorkflowList/WorkflowListQuery.cs | 6 ++-- .../FileManagementAgg/Enums/FileCategory.cs | 1 + ServiceHost/Properties/launchSettings.json | 2 +- 4 files changed, 37 insertions(+), 4 deletions(-) create mode 100644 ProgramManager/src/Application/GozareshgirProgramManager.Application/Modules/Workflows/Queries/WorkflowList/Providers/BugSectionWorkflowProvider.cs diff --git a/ProgramManager/src/Application/GozareshgirProgramManager.Application/Modules/Workflows/Queries/WorkflowList/Providers/BugSectionWorkflowProvider.cs b/ProgramManager/src/Application/GozareshgirProgramManager.Application/Modules/Workflows/Queries/WorkflowList/Providers/BugSectionWorkflowProvider.cs new file mode 100644 index 00000000..f3366bda --- /dev/null +++ b/ProgramManager/src/Application/GozareshgirProgramManager.Application/Modules/Workflows/Queries/WorkflowList/Providers/BugSectionWorkflowProvider.cs @@ -0,0 +1,32 @@ +using GozareshgirProgramManager.Application._Common.Interfaces; +using GozareshgirProgramManager.Domain.ProjectAgg.Enums; +using Microsoft.EntityFrameworkCore; + +namespace GozareshgirProgramManager.Application.Modules.Workflows.Queries.WorkflowList.Providers; + +public class BugSectionWorkflowProvider : IWorkflowProvider +{ + public WorkflowType Type => WorkflowType.BugSection; + public async Task> GetItems(long currentUserId, IProgramManagerDbContext context, CancellationToken cancellationToken) + { + var bugs =context.BugSections + .Where(b=>b.Status == TaskSectionStatus.ReadyToStart) + .Include(x => x.ProjectTask).AsNoTracking(); + + return await bugs.Select(x => new WorkflowListItem + { + EntityId = x.Id, + Title = x.ProjectTask.Name, + Type = WorkflowType.BugSection + }).ToListAsync(cancellationToken); + + } + + public async Task GetCount(long currentUserId, IProgramManagerDbContext context, CancellationToken cancellationToken) + { + var query = context.BugSections + .Where(b => b.Status == TaskSectionStatus.ReadyToStart); + + return await query.CountAsync(cancellationToken); + } +} \ No newline at end of file diff --git a/ProgramManager/src/Application/GozareshgirProgramManager.Application/Modules/Workflows/Queries/WorkflowList/WorkflowListQuery.cs b/ProgramManager/src/Application/GozareshgirProgramManager.Application/Modules/Workflows/Queries/WorkflowList/WorkflowListQuery.cs index 18ee2e60..e50be2b4 100644 --- a/ProgramManager/src/Application/GozareshgirProgramManager.Application/Modules/Workflows/Queries/WorkflowList/WorkflowListQuery.cs +++ b/ProgramManager/src/Application/GozareshgirProgramManager.Application/Modules/Workflows/Queries/WorkflowList/WorkflowListQuery.cs @@ -19,6 +19,7 @@ public enum WorkflowType Rejected, NotAssigned, PendingForApproval, + BugSection, } public record WorkflowListQuery():IBaseQuery; @@ -42,7 +43,7 @@ public class WorkflowListQueryHandler:IBaseQueryHandler(); - + var response = new WorkflowListResponse(items); foreach (var provider in _providers) { var providerItems = await provider.GetItems(currentUserId, _context, cancellationToken); @@ -50,7 +51,6 @@ public class WorkflowListQueryHandler:IBaseQueryHandler.Success(res); + return OperationResult.Success(response); } } \ No newline at end of file diff --git a/ProgramManager/src/Domain/GozareshgirProgramManager.Domain/FileManagementAgg/Enums/FileCategory.cs b/ProgramManager/src/Domain/GozareshgirProgramManager.Domain/FileManagementAgg/Enums/FileCategory.cs index 3bb774d5..176e68fb 100644 --- a/ProgramManager/src/Domain/GozareshgirProgramManager.Domain/FileManagementAgg/Enums/FileCategory.cs +++ b/ProgramManager/src/Domain/GozareshgirProgramManager.Domain/FileManagementAgg/Enums/FileCategory.cs @@ -12,5 +12,6 @@ public enum FileCategory Report = 5, // گزارش Other = 6, // سایر BugSection = 7, // تسک باگ + TaskSectionRevision } diff --git a/ServiceHost/Properties/launchSettings.json b/ServiceHost/Properties/launchSettings.json index 18aaf56a..7a417116 100644 --- a/ServiceHost/Properties/launchSettings.json +++ b/ServiceHost/Properties/launchSettings.json @@ -19,7 +19,7 @@ "sqlDebugging": true, "dotnetRunMessages": "true", "nativeDebugging": true, - "applicationUrl": "https://localhost:5004;http://localhost:5003;https://192.168.0.117:5006", + "applicationUrl": "https://localhost:5004;http://localhost:5003;", "jsWebView2Debugging": false, "hotReloadEnabled": true },