Add License

This commit is contained in:
aditya.siregar
2024-07-29 22:30:29 +07:00
parent 6a987f78b9
commit f645f23fd4
9 changed files with 82 additions and 30 deletions
+2 -2
View File
@@ -61,8 +61,8 @@ func (s *LicenseService) GetByID(ctx context.Context, id string) (*entity.Licens
return licenseDB.ToLicense(), nil
}
func (s *LicenseService) GetAll(ctx context.Context, limit, offset int) ([]*entity.License, int64, error) {
licenses, total, err := s.repo.GetAll(ctx, limit, offset)
func (s *LicenseService) GetAll(ctx context.Context, limit, offset int, status string) ([]*entity.License, int64, error) {
licenses, total, err := s.repo.GetAll(ctx, limit, offset, status)
if err != nil {
logger.ContextLogger(ctx).Error("error when getting all licenses", zap.Error(err))
return nil, 0, err
+1 -1
View File
@@ -134,5 +134,5 @@ type License interface {
Create(ctx mycontext.Context, licenseReq *entity.License) (*entity.License, error)
Update(ctx mycontext.Context, id string, licenseReq *entity.License) (*entity.License, error)
GetByID(ctx context.Context, id string) (*entity.License, error)
GetAll(ctx context.Context, limit, offset int) ([]*entity.License, int64, error)
GetAll(ctx context.Context, limit, offset int, status string) ([]*entity.License, int64, error)
}