diff --git a/app/saas/src/main/java/stirling/software/saas/service/CreditBackfillRunner.java b/app/saas/src/main/java/stirling/software/saas/service/CreditBackfillRunner.java deleted file mode 100644 index 008a7e937..000000000 --- a/app/saas/src/main/java/stirling/software/saas/service/CreditBackfillRunner.java +++ /dev/null @@ -1,78 +0,0 @@ -package stirling.software.saas.service; - -import java.util.List; - -import org.springframework.boot.ApplicationArguments; -import org.springframework.boot.ApplicationRunner; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.context.annotation.Profile; -import org.springframework.stereotype.Component; -import org.springframework.transaction.annotation.Transactional; - -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; - -import stirling.software.proprietary.security.database.repository.UserRepository; -import stirling.software.proprietary.security.model.User; - -/** - * ApplicationRunner that backfills user_credits table for existing users who don't have credit rows - * yet. This prevents existing users from being hard-blocked when the credit system is enabled. - * - *
This runs once at application startup after the database schema is ready.
- */
-@Component
-@Profile("saas")
-@ConditionalOnProperty(name = "credits.enabled", havingValue = "true", matchIfMissing = true)
-@RequiredArgsConstructor
-@Slf4j
-public class CreditBackfillRunner implements ApplicationRunner {
-
- private final UserRepository userRepository;
- private final CreditService creditService;
-
- @Override
- @Transactional
- public void run(ApplicationArguments args) {
- try {
- backfillUserCredits();
- } catch (Exception e) {
- log.error("Failed to backfill user credits", e);
- // Don't throw; this shouldn't prevent app startup
- }
- }
-
- private void backfillUserCredits() {
- log.info("Starting user credits backfill for existing users...");
-
- List