Conversation
|
Hi @Naramsim! Could you share your thoughts on the new |
0d594ce to
4423e08
Compare
|
Hi! Thanks for the implementation. Would it be fine to remove the By looking at the value of |
| ), | ||
| ), | ||
| ("name", models.CharField(max_length=100)), | ||
| ("cost", models.IntegerField(null=True, blank=True)), |
There was a problem hiding this comment.
We shouldn't touch old migration files.
There was a problem hiding this comment.
Should we remove the cost field in a new migration since it's no longer used?
I think it's fine to remove I'm also wondering how we should handle items that can be obtained via other “currencies” instead of Poké Dollars, like candies or similar resources (for example, TM001). Do you have any ideas on how we could represent that in the pricing model? I'm also unsure. We would first need a list of all available methods and then discuss the best solution. |
|
Add script to scrape Poké Ball prices from Bulbapedia. If this works well, I'll handle other item categories in separate PRs |
|
Hi! I posted a reply but it doesn't show up. Maybe I lost my connection while I submitted it. Anyways, regarding all the possible way for obtaining items in the game and all possible currencies that can be used, I'd say: let's understand all possible ways for obtaining items. There are surely many ways, for TM100 I see Spheres, League Points, Berry points, Candies... So it's a mess. We could either have the {
"id": 305,
"name": "some-item-name",
"fling_power": null,
"fling_effect": null,
"category": {
"name": "held-items"
},
"prices": [
{
"purchase_price": "$3000",
"sell_price": "$1500",
"version_group": {
"name": "red-blue",
"url": "https://pokeapi.co/api/v2/version-group/1/"
}
},
{
"purchase_price": "5 Spheres",
"sell_price": "3 candies",
"version_group": {
"name": "red-blue",
"url": "https://pokeapi.co/api/v2/version-group/1/"
}
},
...
]
}or {
"id": 305,
"name": "some-item-name",
"fling_power": null,
"fling_effect": null,
"category": {
"name": "held-items"
},
"prices": [
{
"purchase_price": ["$3000","2 Battle exp point"],
"sell_price": ["$1500","3 Candies"],
"version_group": {
"name": "red-blue",
"url": "https://pokeapi.co/api/v2/version-group/1/"
}
},
...
]
}This way doesn't account for conditions though. More over the price maybe changes based on the location where it's purchased. I'm not that knowledgable. |
This might be difficult for users to parse and work with. Could we add a new id,identifier,name
1,poke-dollar,Poké Dollar
2,battle-point,Battle Point
3,sphere,Sphere
4,candy,Candy
5,berry-point,Berry Point{
"purchase_price": 3000,
"sell_price": 1500,
"currency_id": 1,
"version_group": {
"name": "red-blue",
"url": "https://pokeapi.co/api/v2/version-group/1/"
}
} |
|
Could be good! Let's list them here first |
id,identifier
1,poke-dollar
2,coin
3,volcanic-ash
4,poke-coupon
5,berry-powder
6,battle-point
7,sphere
8,castle-point
9,watt
10,athlete-point
11,dream-point
12,dream-world-berry
13,poke-mile
14,festival-coin
15,poke-bean
16,home-point
17,merit-point
18,league-point
19,blueberry-pointid,language_id,name
1,9,Pokémon Dollar
2,9,Coin
3,9,Volcanic Ash
4,9,Poké Coupon
5,9,Berry Powder
6,9,Battle Point
7,9,Sphere
8,9,Castle Point
9,9,Watt
10,9,Athlete Point
11,9,Dream Point
12,9,Berry (Dream World)
13,9,Poké Mile
14,9,Festival Coin
15,9,Poké Bean
16,9,Pokémon HOME Point
17,9,Merit Point
18,9,League Point
19,9,Blueberry PointI think we can go with these options from Bulbapedia. Some of them might not be very popular, but I believe it's better to list them all. |
|
Ok as a starting point. In future we can extend the currency table with info about which game was introduced in, or in which game it is usable. We can even add the prose so we can translate it and have a small description. |
|
@Naramsim I have tested and updated response for both REST and GraphQL. Please review again |
Naramsim
left a comment
There was a problem hiding this comment.
We could also:
- Announce the change with an alert on the website
- Keep the current property as it is now and the new one alongside each other for a limited period so to give people time to update? Maybe this is not possible since the property name is the same?
| router.register(r"item-attribute", ItemAttributeResource) | ||
| router.register(r"item-fling-effect", ItemFlingEffectResource) | ||
| router.register(r"item-pocket", ItemPocketResource) | ||
| router.register(r"currency", CurrencyResource) |
There was a problem hiding this comment.
Hi @anhthang sorry for coming back after so long. Could you prepare a PR over at pokeapi with the new endpoint and the new properties documented?
There was a problem hiding this comment.
Where I should go to document the new endpoint?
| @@ -0,0 +1,240 @@ | |||
| import requests | |||
There was a problem hiding this comment.
Could you add a comment on top of this file stating that it's you that created it and is able ot understand it? Can you create a separate PR doing the same for all the other script you created in this repo and in the sprites repo as well?
There was a problem hiding this comment.
Yes, I can do it. For the sprites, I think I did it already previously and the new PR is just rerun the script
Yes we can do that
I dont think this is needed since lot of data is missing now and incorrect value. So removing it mean data is missing again and people can update to the new one with the announcement above |
Add ItemPrice model and exposes per-version item pricing data
data/v2/csv/item_prices.csvItem.costfield in favor of the new structured pricing model.currencyAPICloses #1406 and #1397, #1398
Example REST API response
{ "id": 305, "name": "some-item-name", "fling_power": null, "fling_effect": null, "category": { "name": "held-items" }, "prices": [ { "currency": { "name": "poke-dollar", "url": "http://localhost:8000/api/v2/currency/1/" }, "purchase_price": 3000, "sell_price": 1500, "version_group": { "name": "red-blue", "url": "http://localhost:8000/api/v2/version-group/1/" } }, { "currency": { "name": "poke-dollar", "url": "http://localhost:8000/api/v2/currency/1/" }, "purchase_price": 3000, "sell_price": 1500, "version_group": { "name": "yellow", "url": "http://localhost:8000/api/v2/version-group/2/" } }, { "currency": { "name": "poke-dollar", "url": "http://localhost:8000/api/v2/currency/1/" }, "purchase_price": null, "sell_price": 1500, "version_group": { "name": "gold-silver", "url": "http://localhost:8000/api/v2/version-group/3/" } } ] }Example GraphQL queries
v1beta: item with prices
v1beta2: item with itemprice relation
{ "data": { "item": [ { "id": 305, "name": "tm01", "cost": null, "itemnames": [ { "name": "TM01" } ], "itemprices": [ { "purchase_price": 3000, "sell_price": 1500, "currency_id": 1, "currency": { "name": "poke-dollar", "currencynames": [ { "name": "Pokémon Dollar" } ] }, "versiongroup": { "id": 1, "name": "red-blue" } }, { "purchase_price": 3000, "sell_price": 1500, "currency_id": 1, "currency": { "name": "poke-dollar", "currencynames": [ { "name": "Pokémon Dollar" } ] }, "versiongroup": { "id": 2, "name": "yellow" } }, { "purchase_price": null, "sell_price": 1500, "currency_id": 1, "currency": { "name": "poke-dollar", "currencynames": [ { "name": "Pokémon Dollar" } ] }, "versiongroup": { "id": 3, "name": "gold-silver" } } ] } ] } }