hopfenspace / MateBot

Micro service providing an API for MateBot clients

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Who should be able to add externals to a communism?

CrsiX opened this issue · comments

commented

In the old implementation, only the creator of a communism was able to add or remove externals (e.g. users without Telegram).

Should it be possible for anyone to add and remove externals (it's just about changing an integer value, actually)? Or do we accept the old behavior that only the creator can change this counter?

So if I unstand this correctly, each person who have added an external has to pay the amount of themselfes plus the amount of the externals they added? If this is the case, I see no problem there.

commented

No, the number of externals is just a counter. There's no relation between who clicked the + or - button and the number of externals. Therefore, some "malicious" user could just add some externals right before the creator accepts the communism. However, this is actually pretty hard to achieve (the creator can revert the external counter easily).

So in this case the feature wouldn't make any sense. The whole point about adding externals to the communism is, that the creator, instead of receiving complete_amount - portion is only receiving complete_amount - portion * x where x is the number of externals plus the creator, as well as reducing the portion to complete_amount / (count_interal_users + count_externals).

To make the feature actually work, there must be a relation between users and the externals they added.

commented

Well, this needs some more adjustments and additions to the database layout, then. But am I right that only the creator needs to collect money from externals?

Actually, the old implementation didn't have a relation between button clicking users and the number of externals, it has been a plain counter all the time. However, only the creator of the communism was able to change that counter.

Yes, if we leave the functionality untouched, only the creator has to collect money from the externals.

commented

29f6dc4 fixes this issue. Only creators can now change the number of external users.