Continuo fix interfaces
This commit is contained in:
@@ -1,25 +1,68 @@
|
||||
namespace EgwCoreLib.Lux.Data.Repository.Items
|
||||
namespace EgwCoreLib.Lux.Data.Repository.Items
|
||||
{
|
||||
public interface IItemRepository : IBaseRepository
|
||||
{
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Inserisce un nuovo record Item nel database.
|
||||
/// </summary>
|
||||
/// <param name="entity">Record da inserire</param>
|
||||
Task<bool> AddAsync(ItemModel entity);
|
||||
|
||||
/// <summary>
|
||||
/// Elimina un record Item dal database.
|
||||
/// </summary>
|
||||
/// <param name="entity">Record da eliminare</param>
|
||||
Task<bool> DeleteAsync(ItemModel entity);
|
||||
|
||||
/// <summary>
|
||||
/// Recupera un record Item specifico per ID.
|
||||
/// </summary>
|
||||
/// <param name="recId">ID dell'item da recuperare</param>
|
||||
Task<ItemModel?> GetByIdAsync(int recId);
|
||||
|
||||
/// <summary>
|
||||
/// Recupera l'elenco degli item alternativi per un item specifico (stesso parent o child).
|
||||
/// </summary>
|
||||
/// <param name="recId">ID dell'item di riferimento</param>
|
||||
Task<List<ItemModel>> GetAltAsync(int recId);
|
||||
|
||||
/// <summary>
|
||||
/// Recupera gli item filtrati per gruppo e tipo classe.
|
||||
/// </summary>
|
||||
/// <param name="CodGroup">Codice del gruppo filtro (vuoto = tutti)</param>
|
||||
/// <param name="ItemType">Tipo di classe filtro (ND = tutti)</param>
|
||||
Task<List<ItemModel>> GetFiltAsync(string CodGroup, ItemClassType ItemType);
|
||||
|
||||
/// <summary>
|
||||
/// Cerca item per descrizione, codice esterno o codice fornitore.
|
||||
/// </summary>
|
||||
/// <param name="term">Termine di ricerca</param>
|
||||
Task<List<ItemModel>> GetSearchAsync(string term);
|
||||
|
||||
/// <summary>
|
||||
/// Aggiorna in massa costi e margini basati su dimensioni (larghezza x altezza).
|
||||
/// </summary>
|
||||
/// <param name="list2upd">Lista di item da aggiornare</param>
|
||||
/// <param name="setCost">Costo base per unità</param>
|
||||
/// <param name="defMargin">Margine predefinito</param>
|
||||
/// <param name="defQtyMax">Quantità massima predefinita</param>
|
||||
/// <param name="defUM">Unità di misura predefinita</param>
|
||||
/// <param name="roundVal">Value per arrotondamento (0 = nessun arrotondamento)</param>
|
||||
/// <param name="scaleFactor">Fattore di scala per il calcolo costo</param>
|
||||
Task<bool> MassUpdateAsync(List<BomItemDTO> list2upd, double setCost, double defMargin, double defQtyMax, string defUM, int roundVal = 0, double scaleFactor = 1_000_000.0);
|
||||
|
||||
/// <summary>
|
||||
/// Aggiorna un record Item esistente nel database.
|
||||
/// </summary>
|
||||
/// <param name="entity">Record aggiornato</param>
|
||||
Task<bool> UpdateAsync(ItemModel entity);
|
||||
|
||||
/// <summary>
|
||||
/// Inserisce item mancanti dalla BOM nel database con valori predefiniti.
|
||||
/// </summary>
|
||||
/// <param name="bomList">Lista BOM da processare</param>
|
||||
Task<bool> UpsertFromBomAsync(List<BomItemDTO> bomList);
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
@@ -1,19 +1,44 @@
|
||||
namespace EgwCoreLib.Lux.Data.Repository.Items
|
||||
namespace EgwCoreLib.Lux.Data.Repository.Items
|
||||
{
|
||||
public interface ISellingItemRepository : IBaseRepository
|
||||
{
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Inserisce un nuovo record SellingItem nel database.
|
||||
/// </summary>
|
||||
/// <param name="entity">Record da inserire</param>
|
||||
Task<bool> AddAsync(SellingItemModel entity);
|
||||
|
||||
/// <summary>
|
||||
/// Elimina un record SellingItem dal database.
|
||||
/// </summary>
|
||||
/// <param name="entity">Record da eliminare</param>
|
||||
Task<bool> DeleteAsync(SellingItemModel entity);
|
||||
|
||||
/// <summary>
|
||||
/// Recupera un record SellingItem specifico per ID.
|
||||
/// </summary>
|
||||
/// <param name="recId">ID dell'item di vendita da recuperare</param>
|
||||
Task<SellingItemModel?> GetByIdAsync(int recId);
|
||||
|
||||
/// <summary>
|
||||
/// Recupera tutti gli item di vendita per un ambiente specifico.
|
||||
/// </summary>
|
||||
/// <param name="envir">Ambiente di esecuzione</param>
|
||||
Task<List<SellingItemModel>> GetByEnvirAsync(EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS envir);
|
||||
|
||||
/// <summary>
|
||||
/// Recupera gli item di vendita filtrati per ambiente e tipo sorgente.
|
||||
/// </summary>
|
||||
/// <param name="envir">Ambiente di esecuzione (NULL = tutti)</param>
|
||||
/// <param name="sourceType">Tipo di sorgente (ND = tutti)</param>
|
||||
Task<List<SellingItemModel>> GetFiltAsync(EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS envir, ItemSourceType sourceType);
|
||||
|
||||
/// <summary>
|
||||
/// Aggiorna un record SellingItem esistente nel database.
|
||||
/// </summary>
|
||||
/// <param name="entity">Record aggiornato</param>
|
||||
Task<bool> UpdateAsync(SellingItemModel entity);
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
@@ -14,6 +14,7 @@ namespace EgwCoreLib.Lux.Data.Repository.Items
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<bool> AddAsync(ItemModel entity)
|
||||
{
|
||||
await using var dbCtx = await CreateContextAsync();
|
||||
@@ -21,6 +22,7 @@ namespace EgwCoreLib.Lux.Data.Repository.Items
|
||||
return await dbCtx.SaveChangesAsync() > 0;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<bool> DeleteAsync(ItemModel entity)
|
||||
{
|
||||
await using var dbCtx = await CreateContextAsync();
|
||||
@@ -28,6 +30,7 @@ namespace EgwCoreLib.Lux.Data.Repository.Items
|
||||
return await dbCtx.SaveChangesAsync() > 0;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<List<ItemModel>> GetAltAsync(int recId)
|
||||
{
|
||||
await using var dbCtx = await CreateContextAsync();
|
||||
@@ -61,6 +64,7 @@ namespace EgwCoreLib.Lux.Data.Repository.Items
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<ItemModel?> GetByIdAsync(int recId)
|
||||
{
|
||||
await using var dbCtx = await CreateContextAsync();
|
||||
@@ -69,6 +73,7 @@ namespace EgwCoreLib.Lux.Data.Repository.Items
|
||||
.FirstOrDefaultAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<List<ItemModel>> GetFiltAsync(string CodGroup, ItemClassType ItemType)
|
||||
{
|
||||
await using var dbCtx = await CreateContextAsync();
|
||||
@@ -79,6 +84,7 @@ namespace EgwCoreLib.Lux.Data.Repository.Items
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<List<ItemModel>> GetSearchAsync(string term)
|
||||
{
|
||||
await using var dbCtx = await CreateContextAsync();
|
||||
@@ -89,6 +95,7 @@ namespace EgwCoreLib.Lux.Data.Repository.Items
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<bool> MassUpdateAsync(List<BomItemDTO> list2upd, double setCost, double defMargin, double defQtyMax, string defUM, int roundVal = 0, double scaleFactor = 1_000_000.0)
|
||||
{
|
||||
bool answ = false;
|
||||
@@ -195,6 +202,7 @@ namespace EgwCoreLib.Lux.Data.Repository.Items
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<bool> UpdateAsync(ItemModel entity)
|
||||
{
|
||||
await using var dbCtx = await CreateContextAsync();
|
||||
@@ -213,6 +221,7 @@ namespace EgwCoreLib.Lux.Data.Repository.Items
|
||||
return await dbCtx.SaveChangesAsync() > 0;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<bool> UpsertFromBomAsync(List<BomItemDTO> bomList)
|
||||
{
|
||||
await using var dbCtx = await CreateContextAsync();
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<bool> AddAsync(SellingItemModel entity)
|
||||
{
|
||||
await using var dbCtx = await CreateContextAsync();
|
||||
@@ -19,6 +20,7 @@
|
||||
return await dbCtx.SaveChangesAsync() > 0;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<bool> DeleteAsync(SellingItemModel entity)
|
||||
{
|
||||
await using var dbCtx = await CreateContextAsync();
|
||||
@@ -26,6 +28,7 @@
|
||||
return await dbCtx.SaveChangesAsync() > 0;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<List<SellingItemModel>> GetByEnvirAsync(EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS envir)
|
||||
{
|
||||
await using var dbCtx = await CreateContextAsync();
|
||||
@@ -35,6 +38,7 @@
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<SellingItemModel?> GetByIdAsync(int recId)
|
||||
{
|
||||
await using var dbCtx = await CreateContextAsync();
|
||||
@@ -43,6 +47,7 @@
|
||||
.FirstOrDefaultAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<List<SellingItemModel>> GetFiltAsync(EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS envir, ItemSourceType sourceType)
|
||||
{
|
||||
await using var dbCtx = await CreateContextAsync();
|
||||
@@ -52,6 +57,7 @@
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<bool> UpdateAsync(SellingItemModel entity)
|
||||
{
|
||||
await using var dbCtx = await CreateContextAsync();
|
||||
|
||||
Reference in New Issue
Block a user