phronCare/Core/Services/Stock/LSUnitOfMeasureService.cs
Leandro Hernan Rojas 6e592bd034
All checks were successful
CI/CD Pipeline / Build and Deploy with Docker Compose (push) Successful in 6m50s
Add UnitOfMeasure Search and Form
2025-07-15 12:42:30 -03:00

36 lines
1.0 KiB
C#

using Core.Interfaces.Stock;
using Domain.Entities;
using Domain.Generics;
using Models.Interfaces;
namespace Core.Services.Stock
{
public class LSUnitOfMeasureService : ILSUnitOfMeasureDom
{
private readonly IPhLSMUnitOfMeasureRepository _repo;
public LSUnitOfMeasureService(IPhLSMUnitOfMeasureRepository repo)
{
_repo = repo;
}
public Task<PagedResult<ELSUnitOfMeasure>> SearchAsync(string? text, int page = 1, int pageSize = 100)
=> _repo.SearchAsync(text, page, pageSize);
public Task<ELSUnitOfMeasure?> GetByIdAsync(int id)
=> _repo.GetByIdAsync(id);
public Task<int> AddAsync(ELSUnitOfMeasure model)
=> _repo.AddAsync(model);
public Task UpdateAsync(ELSUnitOfMeasure model)
=> _repo.UpdateAsync(model);
public Task<bool> ExistsByCodeAsync(string code)
=> _repo.ExistsByCodeAsync(code);
public Task<List<string>> GetAllCodesAsync()
=> _repo.GetAllCodesAsync();
}
}