extend type Query {
    settings(language: String): Settings
        @field(
            resolver: "Marvel\\GraphQL\\Queries\\SettingsQuery@fetchSettings"
        )
}

type SeoSettings {
    metaTitle: String
    metaDescription: String
    metaTags: String
    canonicalUrl: String
    ogTitle: String
    ogDescription: String
    ogImage: Attachment
    twitterHandle: String
    twitterCardType: String
}

type ContactDetails {
    socials: [ShopSocials]
    contact: String
    location: Location
    website: String
}
input ContactDetailsInput {
    socials: [ShopSocialInput]
    contact: String
    location: LocationInput
    website: String
}

type GoogleSettings {
    isEnable: Boolean
    tagManagerId: String
}
type FacebookSettings {
    isEnable: Boolean
    appId: String
    pageId: String
}

type SettingsOptions {
    siteTitle: String
    siteSubtitle: String
    currency: String
    useOtp: Boolean
    useCashOnDelivery: Boolean
    paymentGateway: String
    contactDetails: ContactDetails
    minimumOrderAmount: Float
    currencyToWalletRatio: Int
    signupPoints: Int
    maximumQuestionLimit: Int
    deliveryTime: [DeliveryTime]
    logo: Attachment
    taxClass: String
    shippingClass: String
    freeShipping: Boolean
    freeShippingAmount:Float
    seo: SeoSettings
    google: GoogleSettings
    facebook: FacebookSettings
}

type Settings {
    id: ID
    language: String
    options: SettingsOptions
}

input DeliveryTimeInput {
    title: String
    description: String
}

input GoogleSettingsInput {
    isEnable: Boolean
    tagManagerId: String
}
input FacebookSettingsInput {
    isEnable: Boolean
    appId: String
    pageId: String
}

input SeoSettingsInput {
    metaTitle: String
    metaDescription: String
    metaTags: String
    canonicalUrl: String
    ogTitle: String
    ogDescription: String
    ogImage: AttachmentInput
    twitterHandle: String
    twitterCardType: String
}

input SettingsOptionsInput {
    siteTitle: String
    siteSubtitle: String
    currency: String
    useOtp: Boolean
    useCashOnDelivery: Boolean
    paymentGateway: String
    contactDetails: ContactDetailsInput
    minimumOrderAmount: Float
    currencyToWalletRatio: Int
    signupPoints: Int
    maximumQuestionLimit: Int
    deliveryTime: [DeliveryTimeInput]
    logo: AttachmentInput
    taxClass: String
    shippingClass: String
    freeShipping: Boolean
    freeShippingAmount:Float
    seo: SeoSettingsInput
    google: GoogleSettingsInput
    facebook: FacebookSettingsInput
}

input SettingsInput {
    language: String!
    options: SettingsOptionsInput
}

extend type Mutation {
    updateSettings(input: SettingsInput! @spread): Settings
        @field(resolver: "SettingsMutator@update")
        @can(ability: "super_admin")
}
