use json;
use json::object;
use crate::router::global;
use actix_web::{HttpResponse, HttpRequest};

pub fn purchase(_req: HttpRequest) -> HttpResponse {
    
    let resp = object!{
        "code": 0,
        "server_time": global::timestamp(),
        "data": {
            "product_list": [//Client will error if this is an empty array
                {
                    "product_id": "com.bushiroad.global.lovelive.sif2.google.promo.4199",
                    "name": "6000 Love Gems",
                    "description": "6000 Paid Love Gems",
                    "thumbnail_url": null,
                    "charge_gem": 6000,
                    "free_gem": 0,
                    "campaign_type": 2,
                    "campaign_mode": 5,
                    "priority": 1,
                    "price": "999999.99",
                    "currency_code": "USD",
                    "formatted_price": "USD$999999.99",
                    "consumable": 0,
                    "limited_count": 2,
                    "product_type": 0,
                    "amenity_label": null,
                    "ticket_valid_days": null,
                    "ticket_issuing_gem": null,
                    "start_datetime": "2024-02-01 00:00:00",
                    "end_datetime": "2024-02-29 23:59:59",
                    "total_gem": 6000
                }
            ]
        }
    };
    global::send(resp)
}

/*
resp.data = {
    "product_list": [
        {
            "product_id": "com.bushiroad.global.lovelive.sif2.google.promo.4199",
            "name": "6000 Love Gems",
            "description": "6000 Paid Love Gems",
            "thumbnail_url": null,
            "charge_gem": 6000,
            "free_gem": 0,
            "campaign_type": 2,
            "campaign_mode": 5,
            "priority": 1,
            "price": "34.99",
            "currency_code": "USD",
            "formatted_price": "USD$34.99",
            "consumable": 0,
            "limited_count": 2,
            "product_type": 0,
            "amenity_label": null,
            "ticket_valid_days": null,
            "ticket_issuing_gem": null,
            "start_datetime": "2024-02-01 00:00:00",
            "end_datetime": "2024-02-29 23:59:59",
            "total_gem": 6000
        },
        {
            "product_id": "com.bushiroad.global.lovelive.sif2.google.promo.8499",
            "name": "13000 Love Gems",
            "description": "13000 Paid Love Gems",
            "thumbnail_url": null,
            "charge_gem": 13000,
            "free_gem": 0,
            "campaign_type": 2,
            "campaign_mode": 5,
            "priority": 2,
            "price": "69.99",
            "currency_code": "USD",
            "formatted_price": "USD$69.99",
            "consumable": 0,
            "limited_count": 2,
            "product_type": 0,
            "amenity_label": null,
            "ticket_valid_days": null,
            "ticket_issuing_gem": null,
            "start_datetime": "2024-02-01 00:00:00",
            "end_datetime": "2024-02-29 23:59:59",
            "total_gem": 13000
        },
        {
            "product_id": "com.bushiroad.global.lovelive.sif2.google.gem.299",
            "name": "140 Love Gems",
            "description": "140 Paid Love Gems",
            "thumbnail_url": null,
            "charge_gem": 140,
            "free_gem": 0,
            "campaign_type": 0,
            "campaign_mode": 0,
            "priority": 11,
            "price": "0.99",
            "currency_code": "USD",
            "formatted_price": "USD$0.99",
            "consumable": 1,
            "limited_count": 0,
            "product_type": 0,
            "amenity_label": null,
            "ticket_valid_days": null,
            "ticket_issuing_gem": null,
            "start_datetime": null,
            "end_datetime": null,
            "total_gem": 140
        },
        {
            "product_id": "com.bushiroad.global.lovelive.sif2.google.gem.499",
            "name": "430 Love Gems",
            "description": "420 Paid Love Gems + 10 Free LoveGems",
            "thumbnail_url": null,
            "charge_gem": 420,
            "free_gem": 10,
            "campaign_type": 0,
            "campaign_mode": 0,
            "priority": 12,
            "price": "2.99",
            "currency_code": "USD",
            "formatted_price": "USD$2.99",
            "consumable": 1,
            "limited_count": 0,
            "product_type": 0,
            "amenity_label": null,
            "ticket_valid_days": null,
            "ticket_issuing_gem": null,
            "start_datetime": null,
            "end_datetime": null,
            "total_gem": 430
        },
        {
            "product_id": "com.bushiroad.global.lovelive.sif2.google.gem.899",
            "name": "910 Love Gems",
            "description": "870 Paid Love Gems + 40 Free LoveGems",
            "thumbnail_url": null,
            "charge_gem": 870,
            "free_gem": 40,
            "campaign_type": 0,
            "campaign_mode": 0,
            "priority": 13,
            "price": "6.99",
            "currency_code": "USD",
            "formatted_price": "USD$6.99",
            "consumable": 1,
            "limited_count": 0,
            "product_type": 0,
            "amenity_label": null,
            "ticket_valid_days": null,
            "ticket_issuing_gem": null,
            "start_datetime": null,
            "end_datetime": null,
            "total_gem": 910
        },
        {
            "product_id": "com.bushiroad.global.lovelive.sif2.google.gem.1299",
            "name": "1380 Love Gems",
            "description": "1310 Paid Love Gems + 70 Free LoveGems",
            "thumbnail_url": null,
            "charge_gem": 1310,
            "free_gem": 70,
            "campaign_type": 0,
            "campaign_mode": 0,
            "priority": 14,
            "price": "9.99",
            "currency_code": "USD",
            "formatted_price": "USD$9.99",
            "consumable": 1,
            "limited_count": 0,
            "product_type": 0,
            "amenity_label": null,
            "ticket_valid_days": null,
            "ticket_issuing_gem": null,
            "start_datetime": null,
            "end_datetime": null,
            "total_gem": 1380
        },
        {
            "product_id": "com.bushiroad.global.lovelive.sif2.google.gem.2499",
            "name": "2700 Love Gems",
            "description": "2530 Paid Love Gems + 170 Free LoveGems",
            "thumbnail_url": null,
            "charge_gem": 2530,
            "free_gem": 170,
            "campaign_type": 0,
            "campaign_mode": 0,
            "priority": 15,
            "price": "19.99",
            "currency_code": "USD",
            "formatted_price": "USD$19.99",
            "consumable": 1,
            "limited_count": 0,
            "product_type": 0,
            "amenity_label": null,
            "ticket_valid_days": null,
            "ticket_issuing_gem": null,
            "start_datetime": null,
            "end_datetime": null,
            "total_gem": 2700
        },
        {
            "product_id": "com.bushiroad.global.lovelive.sif2.google.gem.4199",
            "name": "4800 Love Gems",
            "description": "4460 Paid Love Gems + 340 Free LoveGems",
            "thumbnail_url": null,
            "charge_gem": 4460,
            "free_gem": 340,
            "campaign_type": 0,
            "campaign_mode": 0,
            "priority": 16,
            "price": "34.99",
            "currency_code": "USD",
            "formatted_price": "USD$34.99",
            "consumable": 1,
            "limited_count": 0,
            "product_type": 0,
            "amenity_label": null,
            "ticket_valid_days": null,
            "ticket_issuing_gem": null,
            "start_datetime": null,
            "end_datetime": null,
            "total_gem": 4800
        },
        {
            "product_id": "com.bushiroad.global.lovelive.sif2.google.gem.6499",
            "name": "7500 Love Gems",
            "description": "6730 Paid Love Gems + 770 Free LoveGems",
            "thumbnail_url": null,
            "charge_gem": 6730,
            "free_gem": 770,
            "campaign_type": 0,
            "campaign_mode": 0,
            "priority": 17,
            "price": "49.99",
            "currency_code": "USD",
            "formatted_price": "USD$49.99",
            "consumable": 1,
            "limited_count": 0,
            "product_type": 0,
            "amenity_label": null,
            "ticket_valid_days": null,
            "ticket_issuing_gem": null,
            "start_datetime": null,
            "end_datetime": null,
            "total_gem": 7500
        },
        {
            "product_id": "com.bushiroad.global.lovelive.sif2.google.gem.8499",
            "name": "10100 Love Gems",
            "description": "8910 Paid Love Gems + 1190 Free LoveGems",
            "thumbnail_url": null,
            "charge_gem": 8910,
            "free_gem": 1190,
            "campaign_type": 0,
            "campaign_mode": 0,
            "priority": 18,
            "price": "69.99",
            "currency_code": "USD",
            "formatted_price": "USD$69.99",
            "consumable": 1,
            "limited_count": 0,
            "product_type": 0,
            "amenity_label": null,
            "ticket_valid_days": null,
            "ticket_issuing_gem": null,
            "start_datetime": null,
            "end_datetime": null,
            "total_gem": 10100
        }
    ]
}
*/
