fix : Add RevisionId For Insignia Period
Some checks failed
release-dev / release-dev (push) Failing after 13s

This commit is contained in:
Suphonchai Phoonsawat 2024-08-30 13:07:40 +07:00
parent 722a1e33a8
commit 689c425acb
10 changed files with 18272 additions and 63 deletions

View file

@ -1,5 +1,8 @@
using BMA.EHR.Application.Repositories;
using BMA.EHR.Domain.Models.Insignias;
using BMA.EHR.Domain.Shared;
using Microsoft.AspNetCore.Http;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
@ -85,7 +88,13 @@ namespace BMA.EHR.Infrastructure.MessageQueue
var userRepo = scope.ServiceProvider.GetRequiredService<UserProfileRepository>();
var insigniaRepo = scope.ServiceProvider.GetRequiredService<InsigniaPeriodsRepository>();
var organizations = await userRepo.GetActiveRootAsync(AccessToken);
var selectPeriod = await _insigniaPeriodsRepository.GetByIdAsync(periodId);
if (selectPeriod == null)
{
throw new Exception(GlobalMessages.InsigniaPeriodNotFound);
}
var organizations = await userRepo.GetActiveRootAsync(AccessToken, selectPeriod.RevisionId);
foreach (var organization in organizations)
{
@ -108,7 +117,7 @@ namespace BMA.EHR.Infrastructure.MessageQueue
}
}
}
}
}
}
#endregion
@ -117,7 +126,7 @@ namespace BMA.EHR.Infrastructure.MessageQueue
protected override Task ExecuteAsync(CancellationToken stoppingToken)
{
Console.WriteLine("ExecuteAsync started."); // Log ตรวจสอบ
var consumer = new EventingBasicConsumer(_channel);
consumer.Received += (model, ea) =>

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,30 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class AddRevisionIdtoInsigniaPeriod : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<Guid>(
name: "RevisionId",
table: "InsigniaPeriods",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "RevisionId",
table: "InsigniaPeriods");
}
}
}

View file

@ -6262,6 +6262,9 @@ namespace BMA.EHR.Infrastructure.Migrations
b.Property<Guid?>("ReliefDocId")
.HasColumnType("char(36)");
b.Property<Guid?>("RevisionId")
.HasColumnType("char(36)");
b.Property<int>("Round")
.HasColumnType("int")
.HasComment("ราบการยื่นขอ");