Update License And partner
This commit is contained in:
@@ -62,13 +62,19 @@ func (u *AuthServiceImpl) AuthenticateUser(ctx context.Context, email, password
|
||||
var licensePartner entity.PartnerLicense
|
||||
|
||||
if user.PartnerID != nil && *user.PartnerID != 0 {
|
||||
parterLicense, err := u.license.FindByPartnerIDMaxEndDate(ctx, user.PartnerID)
|
||||
partnerLicense, err := u.license.FindByPartnerIDMaxEndDate(ctx, user.PartnerID)
|
||||
if err != nil {
|
||||
logger.ContextLogger(ctx).Error("error when get user license", zap.Error(err))
|
||||
return nil, errors.ErrorInternalServer
|
||||
}
|
||||
if parterLicense != nil {
|
||||
licensePartner = parterLicense.ToPartnerLicense()
|
||||
|
||||
if partnerLicense == nil {
|
||||
return nil, errors.ErrorInvalidLicense
|
||||
}
|
||||
|
||||
licensePartner = partnerLicense.ToPartnerLicense()
|
||||
if licensePartner.LicenseStatus == "EXPIRED" {
|
||||
return nil, errors.ErrorInvalidLicense
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user