RELEASE VER 1.0.0.1 , complete version 1 , add scalarUi
parent
ab343077bd
commit
91a73cbcef
|
@ -6,8 +6,8 @@
|
|||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
||||
<DockerComposeProjectPath>..\docker-compose.dcproj</DockerComposeProjectPath>
|
||||
<AssemblyVersion>0.6.10.11</AssemblyVersion>
|
||||
<FileVersion>0.6.10.11</FileVersion>
|
||||
<AssemblyVersion>1.0.0.1</AssemblyVersion>
|
||||
<FileVersion>1.0.0.1</FileVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -7,6 +7,7 @@ using Brizco.Domain.Models.Settings;
|
|||
using Brizco.Infrastructure;
|
||||
using Brizco.Repository;
|
||||
using System.Configuration;
|
||||
using Brizco.Api.WebFramework.ScalarUi;
|
||||
using Carter;
|
||||
using FluentValidation;
|
||||
using MediatR.Extensions.Autofac.DependencyInjection;
|
||||
|
@ -109,7 +110,9 @@ if (app.Environment.IsDevelopment())
|
|||
}
|
||||
app.UseCors("CorsPolicy");
|
||||
|
||||
app.UseCustomSwagger(siteSetting.BaseUrl);
|
||||
//app.UseCustomSwagger(siteSetting.BaseUrl);
|
||||
app.UseSwagger();
|
||||
app.MapScalarUi();
|
||||
|
||||
app.UseAuthorization();
|
||||
app.UseAuthentication();
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
"Docker": {
|
||||
"commandName": "Docker",
|
||||
"launchBrowser": true,
|
||||
"launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/swagger",
|
||||
"launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/scalar/v1",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_URLS": "http://+:80"
|
||||
},
|
||||
|
|
|
@ -0,0 +1,44 @@
|
|||
namespace Brizco.Api.WebFramework.ScalarUi;
|
||||
|
||||
public static class ScalarUiConfiguration
|
||||
{
|
||||
public static void MapScalarUi(this IEndpointRouteBuilder app)
|
||||
{
|
||||
app.MapGet("/scalar/{documentName}", (string documentName) =>
|
||||
{
|
||||
|
||||
var scalarScript = $$"""
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Scalar API Reference</title>
|
||||
<meta charset="utf-8" />
|
||||
<meta
|
||||
name="viewport"
|
||||
content="width=device-width, initial-scale=1" />
|
||||
</head>
|
||||
<body>
|
||||
<!-- Add your own OpenAPI/Swagger specification URL here: -->
|
||||
<!-- Note: The example is our public proxy (to avoid CORS issues). You can remove the `data-proxy-url` attribute if you don’t need it. -->
|
||||
<script
|
||||
id="api-reference"
|
||||
data-url="/swagger/{{documentName}}/swagger.json"></script>
|
||||
|
||||
<!-- Optional: You can set a full configuration object like this: -->
|
||||
<script>
|
||||
var configuration = {
|
||||
theme: 'purple',
|
||||
}
|
||||
|
||||
document.getElementById('api-reference').dataset.configuration =
|
||||
JSON.stringify(configuration)
|
||||
</script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/@scalar/api-reference"></script>
|
||||
</body>
|
||||
</html>
|
||||
""";
|
||||
|
||||
return Results.Content(scalarScript, "text/html");
|
||||
}).ExcludeFromDescription();
|
||||
}
|
||||
}
|
|
@ -37,7 +37,7 @@
|
|||
<Using Include="Brizco.Core.EntityServices.Abstracts" />
|
||||
<Using Include="Brizco.Domain.CommandQueries.Commands" />
|
||||
<Using Include="Brizco.Domain.CommandQueries.Queries" />
|
||||
<Using Include="Brizco.Domain.Dtos.LargDtos" />
|
||||
<Using Include="Brizco.Domain.Dtos.LargeDtos" />
|
||||
<Using Include="Brizco.Domain.Dtos.PageDto" />
|
||||
<Using Include="Brizco.Domain.Dtos.RequestDtos" />
|
||||
<Using Include="Brizco.Domain.Dtos.ResponseDto" />
|
||||
|
|
|
@ -50,7 +50,7 @@ public class PageService : IPageService
|
|||
UnDoneActivitiesToday = todayTasks.Count(t => t.IsDone!),
|
||||
TotalShiftToday = todayShiftPlans.Count,
|
||||
TodayStaffNames = names,
|
||||
TotalStaffToday = todayShiftPlans.SelectMany(sp => sp.Users).Count()
|
||||
TotalStaffToday = todayShiftPlans.SelectMany(sp => sp.Users).GroupBy(u=>u.UserId).Count()
|
||||
};
|
||||
|
||||
var currentShift = todayShiftPlans.FirstOrDefault(s => s.EndAt >= DateTime.Now.TimeOfDay && s.StartAt <= DateTime.Now.TimeOfDay);
|
||||
|
@ -164,7 +164,7 @@ public class PageService : IPageService
|
|||
}
|
||||
}
|
||||
|
||||
page.SignUpCompletePercent = ((totalStepCount * 100) / completeStepCount);
|
||||
page.SignUpCompletePercent = completeStepCount != 0 ? ((totalStepCount * 100) / completeStepCount) : 0;
|
||||
page.CurrentSignUpStep = currentStep;
|
||||
|
||||
}
|
||||
|
@ -185,13 +185,14 @@ public class PageService : IPageService
|
|||
var shifts = await _mediator.Send(new GetRoutineShiftsQuery(routineId, 0),
|
||||
cancellationToken);
|
||||
|
||||
for (int i = 0 ; i < 15; i++ , day = day.AddDays(i))
|
||||
for (int i = 0 ; i < 15; i++ , day = day.AddDays(1))
|
||||
{
|
||||
var item = new AppShiftingPageDayDto
|
||||
{
|
||||
DateTime = DateTimeExtensions.DateTimeToUnixTimeStamp(day)
|
||||
};
|
||||
shifts.Where(s=>s.Day == day.DayOfWeek).SelectMany(s=>s.Shifts).ToList().ForEach(s=>item.Shifts.Add(s.Clone()));
|
||||
shifts.Where(s=>s.Day == day.DayOfWeek)
|
||||
.SelectMany(s=>s.Shifts).OrderBy(s=>s.StartAt).ToList().ForEach(s=>item.Shifts.Add(s.Clone()));
|
||||
foreach (var shift in item.Shifts)
|
||||
{
|
||||
var existedShiftPlan = await _repositoryWrapper.SetRepository<Domain.Entities.Shift.ShiftPlan>()
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using Brizco.Domain.Entities.Task;
|
||||
using Brizco.Domain.Dtos.LargeDtos;
|
||||
using Brizco.Domain.Entities.Task;
|
||||
using Task = System.Threading.Tasks.Task;
|
||||
|
||||
namespace Brizco.Core.CoreServices.ReportServices;
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
<Using Include="Brizco.Common.Extensions" />
|
||||
<Using Include="Brizco.Common.Models.Entity" />
|
||||
<Using Include="Brizco.Common.Models.Mapper" />
|
||||
<Using Include="Brizco.Domain.Dtos.LargDtos" />
|
||||
<Using Include="Brizco.Domain.Dtos.LargeDtos" />
|
||||
<Using Include="Brizco.Domain.Dtos.ResponseDto" />
|
||||
<Using Include="Brizco.Domain.Dtos.SmallDtos" />
|
||||
<Using Include="Brizco.Domain.Entities.Complex" />
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
namespace Brizco.Domain.CommandQueries.Commands;
|
||||
using Brizco.Domain.Dtos.LargeDtos;
|
||||
|
||||
namespace Brizco.Domain.CommandQueries.Commands;
|
||||
|
||||
public sealed record CreateActivityCommand(
|
||||
TaskType Type,
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
namespace Brizco.Domain.CommandQueries.Commands;
|
||||
using Brizco.Domain.Dtos.LargeDtos;
|
||||
|
||||
namespace Brizco.Domain.CommandQueries.Commands;
|
||||
|
||||
public record CreateShiftPlanCommand(long PlanDate,Guid ShiftId,Guid RoutineId,Guid SupervisionUserId, List<KeyValuePair<Guid,Guid>> UserAndPositionIds)
|
||||
:IRequest<ShiftPlanLDto>;
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
namespace Brizco.Domain.CommandQueries.Commands;
|
||||
using Brizco.Domain.Dtos.LargeDtos;
|
||||
|
||||
namespace Brizco.Domain.CommandQueries.Commands;
|
||||
|
||||
public sealed record CreateTaskCommand(TaskType Type,
|
||||
string Title,
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
namespace Brizco.Domain.CommandQueries.Queries;
|
||||
using Brizco.Domain.Dtos.LargeDtos;
|
||||
|
||||
namespace Brizco.Domain.CommandQueries.Queries;
|
||||
|
||||
public sealed record GetActivitiesQuery(int Page = 0 , long SelectedDate = 0 , Guid SelectedShiftPlanId = default , DateQueryFilter? DateQueryFilter = null) : IRequest<List<ActivitySDto>>;
|
||||
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
namespace Brizco.Domain.CommandQueries.Queries;
|
||||
using Brizco.Domain.Dtos.LargeDtos;
|
||||
|
||||
namespace Brizco.Domain.CommandQueries.Queries;
|
||||
|
||||
public sealed record GetPositionsQuery(int Page = 0) :
|
||||
IRequest<List<PositionSDto>>;
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
namespace Brizco.Domain.CommandQueries.Queries;
|
||||
using Brizco.Domain.Dtos.LargeDtos;
|
||||
|
||||
namespace Brizco.Domain.CommandQueries.Queries;
|
||||
|
||||
public sealed record GetSectionsQuery(int Page = 0) :
|
||||
IRequest<List<SectionSDto>>;
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
namespace Brizco.Domain.CommandQueries.Queries;
|
||||
using Brizco.Domain.Dtos.LargeDtos;
|
||||
|
||||
namespace Brizco.Domain.CommandQueries.Queries;
|
||||
|
||||
public sealed record GetShiftPlansQuery(int Page = 0 , long SelectedDate = 0 , DateTimeQueryFilter? DateTimeQueryFilter = DateTimeQueryFilter.CustomDate) :
|
||||
IRequest<List<ShiftPlanSDto>>;
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
namespace Brizco.Domain.CommandQueries.Queries;
|
||||
using Brizco.Domain.Dtos.LargeDtos;
|
||||
|
||||
namespace Brizco.Domain.CommandQueries.Queries;
|
||||
|
||||
public sealed record GetShiftsQuery(int Page = 0,long SelectedDate = 0) :
|
||||
IRequest<List<ShiftSDto>>;
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
namespace Brizco.Domain.CommandQueries.Queries;
|
||||
using Brizco.Domain.Dtos.LargeDtos;
|
||||
|
||||
namespace Brizco.Domain.CommandQueries.Queries;
|
||||
|
||||
public sealed record GetTasksQuery(int Page = 0) :
|
||||
IRequest<List<TaskSDto>>;
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
using Brizco.Domain.Entities.Task;
|
||||
|
||||
namespace Brizco.Domain.Dtos.LargDtos;
|
||||
namespace Brizco.Domain.Dtos.LargeDtos;
|
||||
|
||||
public class ActivityLDto : BaseDto<ActivityLDto , Activity>
|
||||
{
|
|
@ -1,6 +1,4 @@
|
|||
using Brizco.Domain.Entities.Complex;
|
||||
|
||||
namespace Brizco.Domain.Dtos.LargDtos;
|
||||
namespace Brizco.Domain.Dtos.LargeDtos;
|
||||
|
||||
public class ComplexLDto : BaseDto<ComplexLDto,Complex>
|
||||
{
|
|
@ -1,4 +1,4 @@
|
|||
namespace Brizco.Domain.Dtos.LargDtos;
|
||||
namespace Brizco.Domain.Dtos.LargeDtos;
|
||||
|
||||
public class PositionLDto : BaseDto<PositionLDto, Position>
|
||||
{
|
|
@ -1,4 +1,4 @@
|
|||
namespace Brizco.Domain.Dtos.LargDtos;
|
||||
namespace Brizco.Domain.Dtos.LargeDtos;
|
||||
|
||||
public class SectionLDto : BaseDto<SectionLDto, Section>
|
||||
{
|
|
@ -1,4 +1,4 @@
|
|||
namespace Brizco.Domain.Dtos.LargDtos;
|
||||
namespace Brizco.Domain.Dtos.LargeDtos;
|
||||
|
||||
public class ShiftLDto : BaseDto<ShiftLDto,Shift>
|
||||
{
|
|
@ -1,6 +1,4 @@
|
|||
using Brizco.Domain.Entities.Shift;
|
||||
|
||||
namespace Brizco.Domain.Dtos.LargDtos;
|
||||
namespace Brizco.Domain.Dtos.LargeDtos;
|
||||
|
||||
public class ShiftPlanLDto : BaseDto<ShiftPlanLDto , ShiftPlan>
|
||||
{
|
|
@ -1,6 +1,4 @@
|
|||
using Brizco.Domain.Entities.Task;
|
||||
|
||||
namespace Brizco.Domain.Dtos.LargDtos;
|
||||
namespace Brizco.Domain.Dtos.LargeDtos;
|
||||
|
||||
public class TaskLDto : BaseDto<TaskLDto, Entities.Task.Task>
|
||||
{
|
|
@ -1,6 +1,6 @@
|
|||
using System;
|
||||
using System.Linq.Expressions;
|
||||
using Brizco.Domain.Dtos.LargDtos;
|
||||
using Brizco.Domain.Dtos.LargeDtos;
|
||||
using Brizco.Domain.Dtos.SmallDtos;
|
||||
using Brizco.Domain.Entities.Shift;
|
||||
using Brizco.Domain.Entities.Task;
|
||||
|
|
|
@ -2,7 +2,7 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using Brizco.Domain.Dtos.LargDtos;
|
||||
using Brizco.Domain.Dtos.LargeDtos;
|
||||
using Brizco.Domain.Dtos.SmallDtos;
|
||||
using Brizco.Domain.Entities.Complex;
|
||||
using Brizco.Domain.Entities.User;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
using System;
|
||||
using System.Linq.Expressions;
|
||||
using Brizco.Domain.Dtos.LargDtos;
|
||||
using Brizco.Domain.Dtos.LargeDtos;
|
||||
using Brizco.Domain.Dtos.SmallDtos;
|
||||
using Brizco.Domain.Entities.Complex;
|
||||
using Mapster.Models;
|
||||
|
|
|
@ -2,7 +2,7 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using Brizco.Domain.Dtos.LargDtos;
|
||||
using Brizco.Domain.Dtos.LargeDtos;
|
||||
using Brizco.Domain.Dtos.SmallDtos;
|
||||
using Brizco.Domain.Entities.Complex;
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using Brizco.Domain.Dtos.LargDtos;
|
||||
using Brizco.Domain.Dtos.LargeDtos;
|
||||
using Brizco.Domain.Dtos.SmallDtos;
|
||||
using Brizco.Domain.Entities.Complex;
|
||||
using Brizco.Domain.Entities.Shift;
|
||||
|
|
|
@ -2,7 +2,7 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using Brizco.Domain.Dtos.LargDtos;
|
||||
using Brizco.Domain.Dtos.LargeDtos;
|
||||
using Brizco.Domain.Dtos.SmallDtos;
|
||||
using Brizco.Domain.Entities.Complex;
|
||||
using Brizco.Domain.Entities.Routine;
|
||||
|
|
|
@ -3,7 +3,7 @@ using System.Collections.Generic;
|
|||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using Brizco.Common.Extensions;
|
||||
using Brizco.Domain.Dtos.LargDtos;
|
||||
using Brizco.Domain.Dtos.LargeDtos;
|
||||
using Brizco.Domain.Dtos.SmallDtos;
|
||||
using Brizco.Domain.Entities.Complex;
|
||||
using Brizco.Domain.Entities.Shift;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using MD.PersianDateTime.Standard;
|
||||
using Brizco.Domain.Dtos.LargeDtos;
|
||||
using MD.PersianDateTime.Standard;
|
||||
using Task = Brizco.Domain.Entities.Task.Task;
|
||||
|
||||
namespace Brizco.Domain;
|
||||
|
|
|
@ -6,13 +6,14 @@
|
|||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Refit" Version="7.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Brizco.Core\Brizco.Core.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Refit" Version="7.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Models\RestApi\KaveNegar\" />
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
<Using Include="Brizco.Common.Models.Exception" />
|
||||
<Using Include="Brizco.Domain.CommandQueries.Commands" />
|
||||
<Using Include="Brizco.Domain.CommandQueries.Queries" />
|
||||
<Using Include="Brizco.Domain.Dtos.LargDtos" />
|
||||
<Using Include="Brizco.Domain.Dtos.LargeDtos" />
|
||||
<Using Include="Brizco.Domain.Dtos.ResponseDto" />
|
||||
<Using Include="Brizco.Domain.Dtos.SmallDtos" />
|
||||
<Using Include="Brizco.Domain.Entities.Complex" />
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
namespace Brizco.Repository.Handlers.Activity;
|
||||
using Brizco.Domain.Dtos.LargeDtos;
|
||||
|
||||
namespace Brizco.Repository.Handlers.Activity;
|
||||
|
||||
public class CreateActivityCommandHandler : IRequestHandler<CreateActivityCommand, ActivityLDto>
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using Brizco.Domain.Dtos.LargDtos;
|
||||
using Brizco.Domain.Dtos.LargeDtos;
|
||||
|
||||
namespace Brizco.Repository.Handlers.Activity;
|
||||
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
namespace Brizco.Repository.Handlers.Position;
|
||||
using Brizco.Domain.Dtos.LargeDtos;
|
||||
|
||||
namespace Brizco.Repository.Handlers.Position;
|
||||
|
||||
public class GetPositionQueryHandler : IRequestHandler<GetPositionQuery, PositionLDto>
|
||||
{
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
namespace Brizco.Repository.Handlers.Section;
|
||||
using Brizco.Domain.Dtos.LargeDtos;
|
||||
|
||||
namespace Brizco.Repository.Handlers.Section;
|
||||
|
||||
public class GetSectionQueryHandler : IRequestHandler<GetSectionQuery, SectionLDto>
|
||||
{
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using Brizco.Domain.Entities.Shift;
|
||||
using Brizco.Domain.Dtos.LargeDtos;
|
||||
using Brizco.Domain.Entities.Shift;
|
||||
|
||||
namespace Brizco.Repository.Handlers.Shift;
|
||||
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
namespace Brizco.Repository.Handlers.ShiftPlan;
|
||||
using Brizco.Domain.Dtos.LargeDtos;
|
||||
|
||||
namespace Brizco.Repository.Handlers.ShiftPlan;
|
||||
|
||||
public class CreateShiftPlanCommandHandler : IRequestHandler<CreateShiftPlanCommand, ShiftPlanLDto>
|
||||
{
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
namespace Brizco.Repository.Handlers.ShiftPlan;
|
||||
using Brizco.Domain.Dtos.LargeDtos;
|
||||
|
||||
namespace Brizco.Repository.Handlers.ShiftPlan;
|
||||
|
||||
public class GetShiftPlanQueryHandler : IRequestHandler<GetShiftPlanQuery, ShiftPlanLDto>
|
||||
{
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
namespace Brizco.Repository.Handlers.Task;
|
||||
using Brizco.Domain.Dtos.LargeDtos;
|
||||
|
||||
namespace Brizco.Repository.Handlers.Task;
|
||||
|
||||
public class CreateActivityCommandHandler : IRequestHandler<CreateTaskCommand, TaskLDto>
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using Brizco.Domain.Dtos.LargDtos;
|
||||
using Brizco.Domain.Dtos.LargeDtos;
|
||||
|
||||
namespace Brizco.Repository.Handlers.Task;
|
||||
|
||||
|
|
Loading…
Reference in New Issue