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/"
}
} |
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.Closes #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": [ { "is_purchasable": true, "purchase_price": 3000, "sell_price": 1500, "version_group": { "name": "red-blue", "url": "https://pokeapi.co/api/v2/version-group/1/" } }, { "is_purchasable": false, "purchase_price": null, "sell_price": 1500, "version_group": { "name": "ruby-sapphire", "url": "https://pokeapi.co/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": [ { "is_purchasable": true, "purchase_price": 3000, "sell_price": 1500, "versiongroup": { "id": 1, "name": "red-blue", } }, { "is_purchasable": false, "purchase_price": null, "sell_price": 1500, "versiongroup": { "id": 5, "name": "ruby-sapphire", } } ] } ] } }