{
    "customer_subscription_v1": {
        "mappings": {
            "dynamic": "strict",
            "properties": {
                "app_id": {
                    "type": "integer"
                },
                "app_version": {
                    "type": "keyword"
                },
                "city": {
                    "type": "keyword"
                },
                "country": {
                    "type": "keyword"
                },
                "country_code": {
                    "type": "integer"
                },
                "created_at": {
                    "type": "date",
                    "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd'T'HH:mm:ss||yyyy-MM-dd HH:mm:ss.SSS||epoch_millis"
                },
                "customer_id": {
                    "type": "long"
                },
                "customer_status": {
                    "type": "byte"
                },
                "device_type": {
                    "type": "keyword"
                },
                "dob": {
                    "type": "date",
                    "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd'T'HH:mm:ss||yyyy-MM-dd HH:mm:ss.SSS||yyyy-MM-dd||epoch_millis"
                },
                "email_id": {
                    "type": "keyword"
                },
                "first_name": {
                    "type": "text",
                    "fields": {
                        "keyword": {
                            "type": "keyword"
                        }
                    }
                },
                "gender": {
                    "type": "keyword"
                },
                "has_active_subscription": {
                    "type": "boolean"
                },
                "has_ever_subscribed": {
                    "type": "boolean"
                },
                "ip": {
                    "type": "ip"
                },
                "last_activity_time": {
                    "type": "integer"
                },
                "last_login_time": {
                    "type": "date",
                    "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd'T'HH:mm:ss||yyyy-MM-dd HH:mm:ss.SSS||epoch_millis"
                },
                "last_name": {
                    "type": "text",
                    "fields": {
                        "keyword": {
                            "type": "keyword"
                        }
                    }
                },
                "lat": {
                    "type": "half_float"
                },
                "latest_subscription_end_date": {
                    "type": "date",
                    "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd'T'HH:mm:ss||yyyy-MM-dd HH:mm:ss.SSS||yyyy-MM-dd||epoch_millis"
                },
                "latest_subscription_start_date": {
                    "type": "date",
                    "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd'T'HH:mm:ss||yyyy-MM-dd HH:mm:ss.SSS||yyyy-MM-dd||epoch_millis"
                },
                "latest_subscription_status": {
                    "type": "byte"
                },
                "long": {
                    "type": "half_float"
                },
                "orders": {
                    "type": "nested",
                    "dynamic": "strict",
                    "properties": {
                        "app_version": {
                            "type": "keyword"
                        },
                        "cgst": {
                            "type": "scaled_float",
                            "scaling_factor": 100.0
                        },
                        "convenience_fee": {
                            "type": "integer"
                        },
                        "coupon_amount": {
                            "type": "scaled_float",
                            "scaling_factor": 100.0
                        },
                        "coupon_code": {
                            "type": "keyword"
                        },
                        "currency": {
                            "type": "keyword"
                        },
                        "currency_code": {
                            "type": "keyword"
                        },
                        "gateway_id": {
                            "type": "integer"
                        },
                        "gateway_name": {
                            "type": "keyword"
                        },
                        "igst": {
                            "type": "scaled_float",
                            "scaling_factor": 100.0
                        },
                        "is_converted": {
                            "type": "boolean"
                        },
                        "order_city": {
                            "type": "keyword"
                        },
                        "order_country": {
                            "type": "keyword"
                        },
                        "order_created_at": {
                            "type": "date",
                            "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd'T'HH:mm:ss||yyyy-MM-dd HH:mm:ss.SSS||yyyy-MM-dd||epoch_millis"
                        },
                        "order_device_type": {
                            "type": "keyword"
                        },
                        "order_id": {
                            "type": "long"
                        },
                        "order_ip": {
                            "type": "ip"
                        },
                        "order_lat": {
                            "type": "half_float"
                        },
                        "order_long": {
                            "type": "half_float"
                        },
                        "order_platform": {
                            "type": "keyword"
                        },
                        "order_state": {
                            "type": "keyword"
                        },
                        "order_status": {
                            "type": "integer"
                        },
                        "package_name": {
                            "type": "text"
                        },
                        "price": {
                            "type": "scaled_float",
                            "scaling_factor": 100.0
                        },
                        "sgst": {
                            "type": "scaled_float",
                            "scaling_factor": 100.0
                        },
                        "sms_cust_id": {
                            "type": "text",
                            "fields": {
                                "keyword": {
                                    "type": "keyword",
                                    "ignore_above": 256
                                }
                            }
                        },
                        "sms_order_id": {
                            "type": "keyword"
                        },
                        "sms_package_id": {
                            "type": "keyword"
                        },
                        "subscription": {
                            "type": "nested",
                            "dynamic": "strict",
                            "properties": {
                                "cancelled_at": {
                                    "type": "date",
                                    "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd'T'HH:mm:ss||yyyy-MM-dd HH:mm:ss.SSS||yyyy-MM-dd||epoch_millis"
                                },
                                "device_restrictions": {
                                    "dynamic": "strict",
                                    "properties": {
                                        "global_limit": {
                                            "type": "integer"
                                        },
                                        "per_device_limit": {
                                            "type": "nested",
                                            "dynamic": "strict",
                                            "properties": {
                                                "device_type": {
                                                    "type": "keyword"
                                                },
                                                "limit": {
                                                    "type": "integer"
                                                }
                                            }
                                        },
                                        "type": {
                                            "type": "keyword"
                                        }
                                    }
                                },
                                "end_date": {
                                    "type": "date",
                                    "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd'T'HH:mm:ss||yyyy-MM-dd HH:mm:ss.SSS||yyyy-MM-dd||epoch_millis"
                                },
                                "free_trial": {
                                    "type": "byte"
                                },
                                "gateway_subscription_id": {
                                    "type": "integer"
                                },
                                "grace": {
                                    "type": "short"
                                },
                                "is_cancelled": {
                                    "type": "byte"
                                },
                                "order_platform": {
                                    "type": "keyword"
                                },
                                "purchase_type": {
                                    "type": "keyword"
                                },
                                "sms_order_id": {
                                    "type": "text",
                                    "fields": {
                                        "keyword": {
                                            "type": "keyword",
                                            "ignore_above": 256
                                        }
                                    }
                                },
                                "start_date": {
                                    "type": "date",
                                    "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd'T'HH:mm:ss||yyyy-MM-dd HH:mm:ss.SSS||yyyy-MM-dd||epoch_millis"
                                },
                                "subscription_app_id": {
                                    "type": "integer"
                                },
                                "subscription_created_at": {
                                    "type": "date",
                                    "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd'T'HH:mm:ss||yyyy-MM-dd HH:mm:ss.SSS||yyyy-MM-dd||epoch_millis"
                                },
                                "subscription_id": {
                                    "type": "long"
                                },
                                "subscription_status": {
                                    "type": "integer"
                                },
                                "subscription_updated_at": {
                                    "type": "date",
                                    "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd'T'HH:mm:ss||yyyy-MM-dd HH:mm:ss.SSS||yyyy-MM-dd||epoch_millis"
                                },
                                "token": {
                                    "type": "keyword"
                                },
                                "transaction_id": {
                                    "type": "text",
                                    "fields": {
                                        "keyword": {
                                            "type": "keyword",
                                            "ignore_above": 256
                                        }
                                    }
                                }
                            }
                        },
                        "transaction_id": {
                            "type": "keyword"
                        },
                        "updated_at": {
                            "type": "date",
                            "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd'T'HH:mm:ss||yyyy-MM-dd HH:mm:ss.SSS||yyyy-MM-dd||epoch_millis"
                        }
                    }
                },
                "phone_number": {
                    "type": "keyword"
                },
                "platform": {
                    "type": "keyword"
                },
                "sms_cust_id": {
                    "type": "keyword"
                },
                "state": {
                    "type": "keyword"
                },
                "total_order_count": {
                    "type": "integer"
                },
                "total_revenue": {
                    "type": "scaled_float",
                    "scaling_factor": 100.0
                },
                "total_subscription_count": {
                    "type": "integer"
                }
            }
        }
    }
}