Adding
This commit is contained in:
+6
@@ -1,5 +1,6 @@
|
||||
using LCU.API.Internal.MemberPreferencesApiLib.Persistence;
|
||||
using LCU.Library.Internal.MemberPreferencesApiModels.Entities;
|
||||
using LCU.Library.Internal.MemberPreferencesApiModels.Enums;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace LCU.API.Internal.MemberPreferencesApiLib.Repositories;
|
||||
@@ -15,6 +16,11 @@ public class DnaAuditProcessRepository : BaseRepository, IDnaAuditProcessReposit
|
||||
return await _context.DnaAuditProcesses.ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<DnaAuditProcess> GetDnaAuditProcessByDnaProcessType(DnaAuditProcessType type)
|
||||
{
|
||||
return await _context.DnaAuditProcesses.Where(d => d.DnaProcessType == type).FirstOrDefaultAsync();
|
||||
}
|
||||
|
||||
public async Task Update(DnaAuditProcess existing)
|
||||
{
|
||||
_context.DnaAuditProcesses.Update(existing);
|
||||
|
||||
+2
@@ -1,9 +1,11 @@
|
||||
using LCU.Library.Internal.MemberPreferencesApiModels.Entities;
|
||||
using LCU.Library.Internal.MemberPreferencesApiModels.Enums;
|
||||
|
||||
namespace LCU.API.Internal.MemberPreferencesApiLib.Repositories;
|
||||
|
||||
public interface IDnaAuditProcessRepository
|
||||
{
|
||||
Task<IReadOnlyCollection<DnaAuditProcess>> GetAllDnaAuditProcesses();
|
||||
Task<DnaAuditProcess> GetDnaAuditProcessByDnaProcessType(DnaAuditProcessType type);
|
||||
Task Update(DnaAuditProcess existing);
|
||||
}
|
||||
|
||||
+1
@@ -8,6 +8,7 @@ public interface IXdiBatchItemsRepository
|
||||
Task<IReadOnlyCollection<XdiBatchItem>> GetXdiBatchItems();
|
||||
Task<IReadOnlyCollection<XdiBatchItem>> GetNewXdiBatchItems();
|
||||
Task<XdiBatchItem> SaveAsync(XdiBatchItem batchItem);
|
||||
Task<List<XdiBatchItem>> SaveRangeAsync(List<XdiBatchItem> batchItemList);
|
||||
Task<XdiBatchItem> FindExistingItem(string memberId, BatchState batchState);
|
||||
void Update(XdiBatchItem existing);
|
||||
void Delete(XdiBatchItem item);
|
||||
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
using LCU.Library.Internal.LcuClassPatterns.Crud.Repositories;
|
||||
using LCU.Library.Internal.MemberPreferencesApiModels.Entities;
|
||||
using LCU.Library.Internal.MemberPreferencesApiModels.Enums;
|
||||
|
||||
namespace LCU.API.Internal.MemberPreferencesApiLib.Repositories;
|
||||
|
||||
public interface IXdiBatchProcessInfoRepository: ICrudRepository<XdiBatchProcessInfo>
|
||||
{
|
||||
Task<IEnumerable<XdiBatchProcessInfo>> FindBatchProcessInfoByStatus(XdiBatchProcessStatus xdiProcessStatus);
|
||||
}
|
||||
+6
@@ -27,6 +27,12 @@ public class XdiBatchItemsRepository : BaseRepository, IXdiBatchItemsRepository
|
||||
return batchItem;
|
||||
}
|
||||
|
||||
public async Task<List<XdiBatchItem>> SaveRangeAsync(List<XdiBatchItem> batchItemList)
|
||||
{
|
||||
await _context.XdiBatchItems.AddRangeAsync(batchItemList);
|
||||
return batchItemList;
|
||||
}
|
||||
|
||||
public async Task<XdiBatchItem> FindExistingItem(string userId, BatchState batchState)
|
||||
{
|
||||
return await _context.XdiBatchItems.Where(p => p.UserId == userId && p.BatchState == batchState)
|
||||
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
using LCU.API.Internal.MemberPreferencesApiLib.Persistence;
|
||||
using LCU.Library.Internal.LcuClassPatterns.Crud.Repositories;
|
||||
using LCU.Library.Internal.MemberPreferencesApiModels.Entities;
|
||||
using LCU.Library.Internal.MemberPreferencesApiModels.Enums;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace LCU.API.Internal.MemberPreferencesApiLib.Repositories;
|
||||
|
||||
public class XdiBatchProcessInfoRepository : CrudRepository<XdiBatchProcessInfo>, IXdiBatchProcessInfoRepository
|
||||
{
|
||||
private readonly IApplicationDbContext _context;
|
||||
public XdiBatchProcessInfoRepository(ApplicationDbContext context) : base(context)
|
||||
{
|
||||
_context = context;
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<XdiBatchProcessInfo>> FindBatchProcessInfoByStatus(XdiBatchProcessStatus xdiProcessStatus)
|
||||
{
|
||||
return await _context.XdiBatchProcessInfos.Where(p => p.XdiBatchProcessStatus == xdiProcessStatus).ToListAsync();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user