Add License Integration
This commit is contained in:
@@ -84,3 +84,14 @@ func (r *LicenseRepository) GetAll(ctx context.Context, limit, offset int, statu
|
||||
|
||||
return licenses, total, nil
|
||||
}
|
||||
|
||||
func (r *LicenseRepository) FindByPartnerIDMaxEndDate(ctx context.Context, partnerID *int64) (*entity.LicenseDB, error) {
|
||||
var licenseDB entity.LicenseDB
|
||||
if err := r.db.WithContext(ctx).
|
||||
Where("partner_id = ?", partnerID).
|
||||
Order("end_date DESC").
|
||||
First(&licenseDB).Error; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &licenseDB, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user