|
|
|
@ -30,21 +30,17 @@ public class MobileAppDataValidator extends DataValidator<MobileApp> { |
|
|
|
|
|
|
|
@Override |
|
|
|
protected void validateDataImpl(TenantId tenantId, MobileApp mobileApp) { |
|
|
|
if (mobileApp.getPlatformType() == PlatformType.ANDROID) { |
|
|
|
if (mobileApp.getStoreInfo() != null && |
|
|
|
if (mobileApp.getStatus() == MobileAppStatus.PUBLISHED) { |
|
|
|
if (mobileApp.getStoreInfo() == null) { |
|
|
|
throw new DataValidationException("Store info is required for published apps"); |
|
|
|
} |
|
|
|
if (mobileApp.getPlatformType() == PlatformType.ANDROID && |
|
|
|
(mobileApp.getStoreInfo().getSha256CertFingerprints() == null || mobileApp.getStoreInfo().getStoreLink() == null)) { |
|
|
|
throw new DataValidationException("Sha256CertFingerprints and store link are required"); |
|
|
|
} |
|
|
|
} else if (mobileApp.getPlatformType() == PlatformType.IOS) { |
|
|
|
if (mobileApp.getStoreInfo() != null && |
|
|
|
} else if (mobileApp.getPlatformType() == PlatformType.IOS && |
|
|
|
(mobileApp.getStoreInfo().getAppId() == null || mobileApp.getStoreInfo().getStoreLink() == null)) { |
|
|
|
throw new DataValidationException("AppId and store link are required"); |
|
|
|
} |
|
|
|
} else { |
|
|
|
throw new DataValidationException("Wrong application platform type"); |
|
|
|
} |
|
|
|
if (mobileApp.getStatus() == MobileAppStatus.PUBLISHED && mobileApp.getStoreInfo() == null) { |
|
|
|
throw new DataValidationException("Store info is required for published apps"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|