package ru.soune.nocopy.configuration;

import lombok.Getter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.Map;

@Component
@ConfigurationProperties(prefix = "subscription")
@Getter
public class SubscriptionConfig {

    private final Map<SubscriptionType, SubscriptionLimits> limits = Map.of(
            SubscriptionType.START, new SubscriptionLimits(50, 5.0),
            SubscriptionType.BASIC, new SubscriptionLimits(200, 20.0),
            SubscriptionType.PRO, new SubscriptionLimits(1000, 100.0),
            SubscriptionType.ENTERPRISE, new SubscriptionLimits(-1, 500.0)
    );

    @Getter
    public static class SubscriptionLimits {
        private final int monthlyFiles;
        private final double storageGB;

        public SubscriptionLimits(int monthlyFiles, double storageGB) {
            this.monthlyFiles = monthlyFiles;
            this.storageGB = storageGB;
        }
    }

    public enum SubscriptionType {
        START, BASIC, PRO, ENTERPRISE
    }
}
