namespace VideoStreamingService

features
    StreamingService {abstract}
        optional
            SubscriptionModel
                alternative
                    Free
                    Premium
        mandatory
            ContentLibrary
                alternative
                    Originals
                    Popular
                    Documentary
                        alternative
                            History
                            Science
                            Culture
            DeviceSupport
                alternative
                    Mobile
                    Desktop
                    TV
            FeatureSet
                or
                    Basic {Price 5}
                    Standard {Price 10}
                    PremiumAccess {Price 20, enabled false}
        optional
            ContentCategories
                mandatory
                    maxContentViews [1..3]
                        alternative
                            Daily
                            Weekly
                            Monthly
                    maxDurationPerSession [1..48]
                        alternative
                            Hours
                            Days
                            Months

UserSettings
    mandatory
        AccountDetails
            optional
                Username {maxLen 20}
                Email {format 'email'}
                Password
                DeviceID

    mandatory
        NotificationPreferences
            or
                EmailNotify {Frequency 'Daily' | 'Weekly' | 'Monthly'}
                SMSNotify {Enabled true | false}
                AppPushNotify {Enabled true | false}

    optional
        PaymentDetails
            mandatory
                CreditCard
                    or
                        DebitCard
                        PrepaidCard

constraints
    SubscriptionModel == 'Free' => !PremiumAccess
    ContentSet.PremiumAccess => SubscriptionModel == 'Premium'
    ContentCategories.maxContentViews == 'Monthly' & FeatureSet.Standard => maxDurationPerSession == 'Hours'