dev add api for payment
Test Workflow / test (push) Successful in 3s

This commit is contained in:
vladp
2026-02-19 14:15:59 +07:00
parent 9112854fea
commit e9cdc66f72
8 changed files with 98 additions and 19 deletions
@@ -180,6 +180,46 @@ public class TariffInitializationService {
tariff.setMaxUsers(10L);
tariff.setTariffAccountType("b2b");
break;
case TOKEN_100:
tariff.setName("token_100");
tariff.setPrice(299);
tariff.setTokens(100);
tariff.setMaxFilesCount(0);
tariff.setDiskSize(0L);
tariff.setMaxUsers(0L);
tariff.setTariffAccountType("token");
break;
case TOKEN_500:
tariff.setName("token_500");
tariff.setPrice(1299);
tariff.setTokens(500);
tariff.setMaxFilesCount(0);
tariff.setDiskSize(0L);
tariff.setMaxUsers(0L);
tariff.setTariffAccountType("token");
break;
case TOKEN_1000:
tariff.setName("token_1000");
tariff.setPrice(2399);
tariff.setTokens(1000);
tariff.setMaxFilesCount(0);
tariff.setDiskSize(0L);
tariff.setMaxUsers(0L);
tariff.setTariffAccountType("token");
break;
case TOKEN_5000:
tariff.setName("token_5000");
tariff.setPrice(9999);
tariff.setTokens(5000);
tariff.setMaxFilesCount(0);
tariff.setDiskSize(0L);
tariff.setMaxUsers(0L);
tariff.setTariffAccountType("token");
break;
}
tariffRepository.save(tariff);
@@ -42,6 +42,13 @@ public class TariffService {
.collect(Collectors.toList());
}
public List<TariffDTO> getTariffByType(String type) {
return tariffRepository.findByTariffAccountType(type)
.stream()
.map(this::convertToDTO)
.collect(Collectors.toList());
}
public List<TariffDTO> getAllTariffs() {
return tariffRepository.findAllByOrderByPriceAsc()
.stream()