from rest_framework import serializers
from taggit.models import Tag

from module_cms.models import Faqs, Organization


class FaqSerializer(serializers.ModelSerializer):
    class Meta:
        model = Faqs
        fields = ["id", "question", "answer"]

class OrganizationSerializer(serializers.ModelSerializer):
    about_us = serializers.CharField(source='about_us.html', read_only=True)
    terms_condition = serializers.CharField(source='terms_condition.html', read_only=True)
    terms_condition_user = serializers.CharField(source='terms_condition_user.html', read_only=True)
    terms_condition_merchant = serializers.CharField(source='terms_condition_merchant.html', read_only=True)
    privacy_policy = serializers.CharField(source='privacy_policy.html', read_only=True)
    privacy_policy_user = serializers.CharField(source='privacy_policy_user.html', read_only=True)
    privacy_policy_merchant = serializers.CharField(source='privacy_policy_merchant.html', read_only=True)
    subscription_agreement = serializers.CharField(source='subscription_agreement.html', read_only=True)
    license_agreement_user = serializers.CharField(source='license_agreement_user.html', read_only=True)
    license_agreement_merchant = serializers.CharField(source='license_agreement_merchant.html', read_only=True)

    class Meta:
        model = Organization
        fields = [
            "about_us",
            "terms_condition",
            "terms_condition_user",
            "terms_condition_merchant",
            "privacy_policy",
            "privacy_policy_user",
            "privacy_policy_merchant",
            "subscription_agreement",
            "license_agreement_user",
            "license_agreement_merchant",
        ]