namespace DocuMed.PWA.Services.RestServices;

public interface ICrudApiRest<T, in TKey> where T : class
{
    [Post("")]
    Task<T> Create([Body] T payload, [Header("Authorization")] string authorization);

    [Get("")]
    Task<List<T>> ReadAll([Query] int page,[Header("Authorization")] string authorization);

    [Get("/{key}")]
    Task<T> ReadOne(TKey key, [Header("Authorization")] string authorization);

    [Put("")]
    Task Update([Body] T payload, [Header("Authorization")] string authorization);

    [Delete("/{key}")]
    Task Delete(TKey key, [Header("Authorization")] string authorization);

}
public interface ICrudDtoApiRest<T, TDto, in TKey> where T : class where TDto : class
{
    [Post("")]
    Task<T> Create([Body] T payload, [Header("Authorization")] string authorization);
    [Post("")]
    Task<T> Create([Body] TDto payload, [Header("Authorization")] string authorization);

    [Get("")]
    Task<List<TDto>> ReadAll([Query]int page,[Header("Authorization")] string authorization);

    [Get("/{key}")]
    Task<TDto> ReadOne(TKey key, [Header("Authorization")] string authorization);

    [Put("")]
    Task Update([Body] T payload, [Header("Authorization")] string authorization);
    [Put("")]
    Task Update([Body] TDto payload, [Header("Authorization")] string authorization);

    [Delete("/{key}")]
    Task Delete(TKey key, [Header("Authorization")] string authorization);

}