Skip to content

Conversation

@jkrizsan
Copy link
Contributor

Brief description

Add price for selling item voting

Change list

  • Add the SellFleaMarketItemDto (item id, price)
  • Use the new Dto with the handleSellItem method
  • handleSellItem: update the fleaMarketItem price after voting was started
  • Update the relevant tests

@jkrizsan jkrizsan added change Change of the existing functionality PR Pull request labels Aug 15, 2025
@MikhailDeriabin MikhailDeriabin linked an issue Aug 17, 2025 that may be closed by this pull request
1 task
@MikhailDeriabin MikhailDeriabin moved this from Backlog to In progress in Altzone-Server Aug 17, 2025
@MikhailDeriabin MikhailDeriabin changed the title Change/add a selling price for selling items votings 612 Added a selling price for selling items votings Aug 17, 2025
Copy link
Collaborator

@MikhailDeriabin MikhailDeriabin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job

@github-project-automation github-project-automation bot moved this from In progress to Done in Altzone-Server Aug 17, 2025
@MikhailDeriabin MikhailDeriabin merged commit 64211e3 into dev Aug 17, 2025
3 of 4 checks passed
@MikhailDeriabin MikhailDeriabin deleted the change/add-a-selling-price-for-selling-items-votings-612 branch August 17, 2025 10:02
@PlayJeri
Copy link
Member

Doesn't this cause an issue where users can change the item price with this endpoint? You could start the voting with new price of 999999 and that will be updated as item price no matter the outcome of the voting and since the old value is replaced with the new one it can't be changed back. Also like I asked earlier in ossue comments why is this price field even necessary? Why isn't the item sold at the price that is already present for all items. And the price changing would be handled with the change item price voting?

@MikhailDeriabin
@jkrizsan

@MikhailDeriabin
Copy link
Collaborator

@PlayJeri

There is a need to set the price for a flea market in this voting, mostly for convenience and that the right price from the beginning. If you set the price later with another voting, it will take some time and in theory item can be bought cheaper by someone.

There can be a price voting as well sure.

You are right, actually the price can be set for any item. I have a look on how to fix it

@PlayJeri
Copy link
Member

I mean you could vote on the price before you put the item on sale for fleamarket

@MikhailDeriabin
Copy link
Collaborator

@PlayJeri

I mean you could vote on the price before you put the item on sale for fleamarket

It was requested by the game UI team to have it that way.


On the second thought, it is actually not possible to set any price for any flea market item via this endpoint. There are multiple places where it will fail to be updated.

  • FleaMarketService line 129. If item is already in the flea market. It will not be found from the clan stock => error returned

  • FleaMarketService line 202. It is not possible to buy an item, which dies not have status AVAILABLE. When player starts a voting for selling, the status is set to SHIPPING (line 140).

Does it make sense or I have missed something?

@PlayJeri
Copy link
Member

PlayJeri commented Aug 17, 2025

HandleSellItem line 159 calls the update function with dto price field. This updates the price when voting starts. If the voting fails the price would still be the updated value pthers didnt agree on. The item doesnt go on sale to fleamarket but the price would still get updated.

Since the failes voting calls handleRejectedSellVoting that creates item based on fm item from voting

@MikhailDeriabin

@MikhailDeriabin
Copy link
Collaborator

@PlayJeri

Ok, I see now.

It is fine to have any price in the flea market. It is up to clan members, but problems can happen when the price of item in the stock can be set by the members.

How about changing the handleRejectedSellVoting() line 394, to set the default price of an item from the clanInventory/item/const/itemProperties.ts based on the item name?

@PlayJeri
Copy link
Member

That works but if there is a changed price already from passed voting that would then get overwritten. Maybe the fleamarket item voting schema could hold a sell price value that is used for successful votings?

@MikhailDeriabin

@MikhailDeriabin
Copy link
Collaborator

@PlayJeri

Ok, probably it is the most straight forward way. I do it now then

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change Change of the existing functionality PR Pull request

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Add a selling price for selling items votings

4 participants