ff14-advanced-market-search / saddlebag-with-pockets

This is the Frontend for the FF14 Marketplace
https://saddlebagexchange.com/
Apache License 2.0
29 stars 13 forks source link

Sale alert generator and Allagan Tools Import #224

Closed cohenaj194 closed 1 year ago

cohenaj194 commented 1 year ago

api path is api/parseallagan

So there is an in game plugin called Allagan Tools that can generate tables of information on a users item inventory. It tells whats in their bags, on the market and the quantity/item id/quality. I asked the creator to have an export to json and copy to clipboard button in the next version.

The api requires only 2 inputs:

Below an example of input/output it gives back 3 fields any of these can be empty:

1) undercut_alert_json a json object for the undercut alert, it should go in a copy text box as it does now 2) sale_alert_json a json object for the sale alert, should be able to copy it similar to the other alerts 3) in_bags_report: A list that needs to be shown in a table. Is the each item in the list has the following format:

outcome

So heres how the page should look.

  1. The 2 alert jsons dont need to be displayed, just add a button that when clicked copys the json to your clipboard
  2. The in_bags_report should be in a table
  3. I'm also adding 2 new lists that should also be shown in tables: sale_items_not_up_to_date and undercut_items_not_up_to_date these are also 2 lists. If the lists are empty it should say "All items are up to date no undercuts found!" or "All items are up to date no sales yet!"

For the sale items the list will show this, the description should be:

"We did not find your retainers selling these items! Please go to your home marketboard and search for these with Dalamud Plugins installed to update the market data":

        {
            "link": "https://universalis.app/market/35562",
            "min_price": 18582,
            "name": "Round Wooden Loft"
        }

For the undercut items the items will show up like this, the description should be:

"You appear to be undercut on these items! Please go to your home marketboard and search for these with Dalamud Plugins installed to update the market data and make sure you are not undercut."

        {
            "link": "https://universalis.app/market/2662",
            "my_last_update_time": "2023-04-06 03:14:11",
            "my_ppu": "73499",
            "my_retainer": "Yinyleon",
            "ppu": "1050",
            "real_name": "Bronze Sallet",
            "undercut": true,
            "undercut_last_update_time": "2023-04-06 12:50:32",
            "undercut_retainer": "Rhaju"
        },

Json post data

{
  "server": "Famfrit",
  "allagan_json_data": [
    {
      "Id": 4745,
      "Name": "Orange Juice",
      "MB Average Price NQ/HQ": "11/631",
      "Type": "NQ",
      "Quantity": 532,
      "Source": "foo bar",
      "Location": "Bag 2 - 1"
    },
    {
      "Id": 4745,
      "Name": "Orange Juice",
      "MB Average Price NQ/HQ": "11/631",
      "Type": "NQ",
      "Quantity": 499,
      "Source": "foo bar",
      "Location": "Bag 2 - 2"
    },
    {
      "Id": 4745,
      "Name": "Orange Juice",
      "MB Average Price NQ/HQ": "11/631",
      "Type": "NQ",
      "Quantity": 500,
      "Source": "foo bar",
      "Location": "Bag 2 - 3"
    },
    {
      "Id": 7671,
      "Name": "Clear Prism",
      "Type": "NQ",
      "Quantity": "13",
      "Source": "Character Name",
      "Location": "Bag 3 - 7",
      "Destination": "Retainer 1 - Bags"
    },
    {
      "Id": 7621,
      "Name": "Glamour Dispeller",
      "Type": "NQ",
      "Quantity": "7",
      "Source": "Character Name",
      "Location": "Bag 3 - 10",
      "Destination": "Retainer 1 - Bags"
    },
    {
      "Id": 13117,
      "Name": "General-purpose Metallic Gold Dye",
      "Type": "NQ",
      "Quantity": "2",
      "Source": "Character Name",
      "Location": "Bag 3 - 12",
      "Destination": "Retainer 1 - Bags"
    },
    {
      "Id": 38273,
      "Name": "Prime Loaghtan Rump",
      "Type": "NQ",
      "Quantity": "1",
      "Source": "Character Name",
      "Location": "Bag 3 - 19",
      "Destination": "Retainer 1 - Bags"
    },
    {
      "Id": 14955,
      "Name": "Lumythrite Sand",
      "Type": "NQ",
      "Quantity": "20",
      "Source": "Character Name",
      "Location": "Bag 3 - 21",
      "Destination": "Retainer 1 - Bags"
    },
    {
      "Id": 24246,
      "Name": "Tatara Iron Sand",
      "Type": "NQ",
      "Quantity": "1",
      "Source": "Character Name",
      "Location": "Bag 3 - 22",
      "Destination": "Retainer 1 - Bags"
    },
    {
      "Id": 7013,
      "Name": "Firebricks",
      "Type": "NQ",
      "Quantity": "1",
      "Source": "Character Name",
      "Location": "Bag 3 - 23",
      "Destination": "Retainer 3 - Bags"
    },
    {
      "Id": 37831,
      "Name": "Paldao Lumber",
      "Type": "NQ",
      "Quantity": "1",
      "Source": "Character Name",
      "Location": "Bag 3 - 27",
      "Destination": "Retainer 1 - Bags"
    },
    {
      "Id": 5512,
      "Name": "Clear Glass Lens",
      "Type": "NQ",
      "Quantity": "6",
      "Source": "Character Name",
      "Location": "Bag 3 - 28",
      "Destination": "Retainer 1 - Bags"
    },
    {
      "Id": 12221,
      "Name": "Cassia Log",
      "Type": "NQ",
      "Quantity": "5",
      "Source": "Character Name",
      "Location": "Bag 4 - 22",
      "Destination": "Retainer 3 - Bags"
    },
    {
      "Id": 12927,
      "Name": "Aetherochemical Fiber",
      "Type": "NQ",
      "Quantity": "2",
      "Source": "Character Name",
      "Location": "Bag 4 - 24",
      "Destination": "Retainer 2 - Bags"
    },
    {
      "Id": 12222,
      "Name": "Chemically Treated Chimera Hide",
      "Type": "HQ",
      "Quantity": "7",
      "Source": "Character Name",
      "Location": "Bag 4 - 25",
      "Destination": "Retainer 2 - Bags"
    },
    {
      "Id": 2236,
      "Name": "Iron Hoplon",
      "MB Average Price NQ/HQ": "0/0",
      "Type": "NQ",
      "Quantity": 1,
      "Source": "random retainer name",
      "Location": "Market - 1"
    },
    {
      "Id": 2776,
      "Name": "Linen Turban",
      "MB Average Price NQ/HQ": "0/0",
      "Type": "NQ",
      "Quantity": 1,
      "Source": "Van-helsing",
      "Location": "Market - 2"
    },
    {
      "Id": 2776,
      "Name": "Linen Turban",
      "MB Average Price NQ/HQ": "0/0",
      "Type": "HQ",
      "Quantity": 1,
      "Source": "Van-helsing",
      "Location": "Market - 2"
    },
    {
      "Id": 2236,
      "Name": "Iron Hoplon",
      "MB Average Price NQ/HQ": "0/0",
      "Type": "NQ",
      "Quantity": 1,
      "Source": "random retainer name",
      "Location": "Bag - 1"
    },
    {
      "Id": 2631,
      "Name": "Leather Calot",
      "MB Average Price NQ/HQ": "0/0",
      "Type": "NQ",
      "Quantity": 1,
      "Source": "random retainer name",
      "Location": "Market - 3"
    },
    {
      "Id": 9746,
      "Name": "Riviera Garden Table Set",
      "MB Average Price NQ/HQ": "0/0",
      "Type": "NQ",
      "Quantity": 1,
      "Source": "random retainer name",
      "Location": "Market - 13"
    },
    {
      "Id": 8821,
      "Name": "Oasis Lamppost",
      "MB Average Price NQ/HQ": "0/0",
      "Type": "NQ",
      "Quantity": 1,
      "Source": "random retainer name",
      "Location": "Market - 14"
    },
    {
      "Id": 32215,
      "Name": "Spring Meadow Partition",
      "MB Average Price NQ/HQ": "0/0",
      "Type": "NQ",
      "Quantity": 1,
      "Source": "random retainer name",
      "Location": "Market - 15"
    },
    {
      "Id": 32215,
      "Name": "Spring Meadow Partition",
      "MB Average Price NQ/HQ": "0/0",
      "Type": "NQ",
      "Quantity": 1,
      "Source": "random retainer name",
      "Location": "Market - 16"
    },
    {
      "Id": 12109,
      "Name": "Star Ruby Music Box",
      "MB Average Price NQ/HQ": "0/0",
      "Type": "NQ",
      "Quantity": 1,
      "Source": "random retainer name",
      "Location": "Market - 17"
    },
    {
      "Id": 6637,
      "Name": "Glade Lantern",
      "MB Average Price NQ/HQ": "0/0",
      "Type": "NQ",
      "Quantity": 1,
      "Source": "random retainer name",
      "Location": "Market - 18"
    },
    {
      "Id": 15148,
      "Name": "Ashtray",
      "MB Average Price NQ/HQ": "0/0",
      "Type": "NQ",
      "Quantity": 1,
      "Source": "random retainer name",
      "Location": "Market - 19"
    },
    {
      "Id": 15148,
      "Name": "Ashtray",
      "MB Average Price NQ/HQ": "0/0",
      "Type": "NQ",
      "Quantity": 1,
      "Source": "random retainer name",
      "Location": "Market - 20"
    }
  ]
}

Response data

{
    "in_bags_report": [
        {
            "hq": false,
            "itemID": "2236",
            "min_price": 999999999,
            "name": "Iron Hoplon",
            "value": 999999999
        },
        {
            "hq": false,
            "itemID": "37831",
            "min_price": 15750,
            "name": "Paldao Lumber",
            "value": 15750
        },
        {
            "hq": false,
            "itemID": "13117",
            "min_price": 10492,
            "name": "General-purpose Metallic Gold Dye",
            "value": 20984
        },
        {
            "hq": false,
            "itemID": "7013",
            "min_price": 2098,
            "name": "Firebricks",
            "value": 2098
        },
        {
            "hq": false,
            "itemID": "7621",
            "min_price": 231,
            "name": "Glamour Dispeller",
            "value": 1617
        },
        {
            "hq": false,
            "itemID": "24246",
            "min_price": 105,
            "name": "Tatara Iron Sand",
            "value": 105
        },
        {
            "hq": true,
            "itemID": "12222",
            "min_price": 68,
            "name": "Chemically Treated Chimera Hide",
            "value": 476
        },
        {
            "hq": false,
            "itemID": "5512",
            "min_price": 62,
            "name": "Clear Glass Lens",
            "value": 372
        },
        {
            "hq": false,
            "itemID": "4745",
            "min_price": 53,
            "name": "Orange Juice",
            "value": 81143
        },
        {
            "hq": false,
            "itemID": "12221",
            "min_price": 34,
            "name": "Cassia Log",
            "value": 170
        },
        {
            "hq": false,
            "itemID": "38273",
            "min_price": 20,
            "name": "Prime Loaghtan Rump",
            "value": 20
        },
        {
            "hq": false,
            "itemID": "7671",
            "min_price": 6,
            "name": "Clear Prism",
            "value": 78
        },
        {
            "hq": false,
            "itemID": "14955",
            "min_price": 2,
            "name": "Lumythrite Sand",
            "value": 40
        }
    ],
    "sale_alert_json": {
        "item_ids": [
            2631,
            15148,
            12109,
            6637,
            9746,
            8821,
            32215,
            2776,
            2236
        ],
        "seller_id": "74faa48d2130a51064746fb2ec8d215b42bfddb3f1aff54f840a9cdaa701e4bb",
        "server": "Famfrit"
    },
    "undercut_alert_json": {
        "add_ids": [],
        "hq_only": false,
        "ignore_data_after_hours": 720,
        "ignore_ids": [],
        "ignore_undercuts_with_quantity_over": 9999,
        "seller_id": "74faa48d2130a51064746fb2ec8d215b42bfddb3f1aff54f840a9cdaa701e4bb",
        "server": "Famfrit"
    }
}
cohenaj194 commented 1 year ago

These are the only 2 manditory fields the api needs for each entry in the list from the allagan_json_data:

These are optional but can be used as well: