Browse Source

fixed mobile app store info validation

pull/12414/head
dashevchenko 1 year ago
parent
commit
796632d6f9
  1. 16
      dao/src/main/java/org/thingsboard/server/dao/service/validator/MobileAppDataValidator.java

16
dao/src/main/java/org/thingsboard/server/dao/service/validator/MobileAppDataValidator.java

@ -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");
}
}
}

Loading…
Cancel
Save