This commit is contained in:
Zeeshaun
2026-03-13 09:27:34 -05:00
parent 256f579489
commit a675c5f5b0
381 changed files with 20992 additions and 0 deletions
@@ -0,0 +1,17 @@
using LCU.Library.Internal.LcuClassPatterns.Crud.Repositories;
using LCU.Library.Internal.RepoApiModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LCU.API.Internal.RepoApi.Repos.Repositories.Batch
{
public interface IRepoSyncBatchRepository: ICrudRepository<RepoSyncBatch>
{
Task<IEnumerable<RepoSyncBatch>> FindAllByRunInfoIdAsync(int id);
Task<RepoSyncBatch> FindUncompletedByAuditId(string auditItemKey);
Task<RepoSyncBatch> FindByBatchIdAndAuditIdAsync(int batchId, string auditItemKey);
}
}
@@ -0,0 +1,9 @@
using LCU.Library.Internal.LcuClassPatterns.Crud.Repositories;
using LCU.Library.Internal.RepoApiModels.Models;
namespace LCU.API.Internal.RepoApi.Repos.Repositories.Batch
{
public interface IRepoSyncRunInfoRepository: ICrudRepository<RepoSyncRunInfo>
{
}
}
@@ -0,0 +1,34 @@
using LCU.API.Internal.RepoApi.Repos.Persistence;
using LCU.Library.Internal.LcuClassPatterns.Crud.Repositories;
using LCU.Library.Internal.RepoApiModels.Models;
using Microsoft.EntityFrameworkCore;
namespace LCU.API.Internal.RepoApi.Repos.Repositories.Batch;
public class RepoSyncBatchRepository : CrudRepository<RepoSyncBatch>, IRepoSyncBatchRepository
{
private readonly AppDbContext _context;
public RepoSyncBatchRepository(AppDbContext context) : base(context) {
_context = context;
}
public async Task<IEnumerable<RepoSyncBatch>> FindAllByRunInfoIdAsync(int id)
{
return await _context.RepoSyncBatch.Where(repoSyncBatch => repoSyncBatch.RepoSyncRunInfoId == id).ToListAsync();
}
public async Task<RepoSyncBatch> FindByIdAsync(int id)
{
return await _context.RepoSyncBatch.Where(repoSyncBatch => repoSyncBatch.RepoSyncBatchId == id).FirstOrDefaultAsync();
}
public async Task<RepoSyncBatch> FindUncompletedByAuditId(string auditItemKey) =>
await _context.RepoSyncBatch
.Where(repoSyncBatch => repoSyncBatch.AuditItemKey == auditItemKey && repoSyncBatch.RepoSyncCompletionDateTime == null)
.FirstOrDefaultAsync();
public async Task<RepoSyncBatch> FindByBatchIdAndAuditIdAsync(int batchId, string auditItemKey) =>
await _context.RepoSyncBatch
.Where(repoSyncBatch => repoSyncBatch.RepoSyncBatchId == batchId && repoSyncBatch.AuditItemKey == auditItemKey)
.FirstOrDefaultAsync();
}
@@ -0,0 +1,14 @@
using LCU.API.Internal.RepoApi.Repos.Persistence;
using LCU.Library.Internal.LcuClassPatterns.Crud.Repositories;
using LCU.Library.Internal.RepoApiModels.Models;
using Microsoft.EntityFrameworkCore;
namespace LCU.API.Internal.RepoApi.Repos.Repositories.Batch;
public class RepoSyncRunInfoRepository : CrudRepository<RepoSyncRunInfo>, IRepoSyncRunInfoRepository
{
private readonly AppDbContext _context;
public RepoSyncRunInfoRepository(AppDbContext context) : base(context) {
_context = context;
}
}