add bugsection Workflow
This commit is contained in:
@@ -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<List<WorkflowListItem>> 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<int> GetCount(long currentUserId, IProgramManagerDbContext context, CancellationToken cancellationToken)
|
||||
{
|
||||
var query = context.BugSections
|
||||
.Where(b => b.Status == TaskSectionStatus.ReadyToStart);
|
||||
|
||||
return await query.CountAsync(cancellationToken);
|
||||
}
|
||||
}
|
||||
@@ -19,6 +19,7 @@ public enum WorkflowType
|
||||
Rejected,
|
||||
NotAssigned,
|
||||
PendingForApproval,
|
||||
BugSection,
|
||||
}
|
||||
|
||||
public record WorkflowListQuery():IBaseQuery<WorkflowListResponse>;
|
||||
@@ -42,7 +43,7 @@ public class WorkflowListQueryHandler:IBaseQueryHandler<WorkflowListQuery,Workfl
|
||||
{
|
||||
var currentUserId = _authHelper.GetCurrentUserId()!.Value;
|
||||
var items = new List<WorkflowListItem>();
|
||||
|
||||
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<WorkflowListQuery,Workfl
|
||||
items.AddRange(providerItems);
|
||||
}
|
||||
|
||||
var res = new WorkflowListResponse(items);
|
||||
return OperationResult<WorkflowListResponse>.Success(res);
|
||||
return OperationResult<WorkflowListResponse>.Success(response);
|
||||
}
|
||||
}
|
||||
@@ -12,5 +12,6 @@ public enum FileCategory
|
||||
Report = 5, // گزارش
|
||||
Other = 6, // سایر
|
||||
BugSection = 7, // تسک باگ
|
||||
TaskSectionRevision
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user