Skip to content

Commit

Permalink
[drop ratings]: clean things up a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
Roman Bekkiev committed Jan 26, 2022
1 parent 83d65fb commit b4faacb
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 40 deletions.
57 changes: 33 additions & 24 deletions docs/specs.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,33 +21,33 @@
7. ❗️ An _astral tribe_ gets incarnated in city as soon as there 5 (or 3?) members
8. Initiation
1. ✅ A _user_ fills an _application_ to join a _tribe_
2. ❗️ A randomly chosen _member_ receives _candidate members_ _application_ and requests the
2. A randomly chosen _member_ receives _candidate members_ _application_ and requests the
_initiation quest_ with proposed date and place
3. ❕ A _member_ views _users_ profile
4. A _candidate member_ gets quest proposal and can accept it or propose another date/place
5. A _(candidate) member_ gets notified that quest accepted
6. A _member_ approves or declines _application_,
7. ❗️ A next _member_ is randomly chosen and the process repeats 2 times (3 member in total). It
4. A _candidate member_ gets quest proposal and can accept it or propose another date/place
5. A _(candidate) member_ gets notified that quest accepted
6. A _member_ approves or declines _application_,
7. A next _member_ is randomly chosen and the process repeats 2 times (3 member in total). It
is enough 1 decline to decline candidate. It is needed 3 approves to approve a candidate
9. Brainstorm
1. ❗️ The _system_ gathers a _brainstorm_ when there is not very much ongoing quests left (e.g. <
20% members)
2. ✅ A _member_ gets notification about declared _brainstorm_ (note: skip _candidates_)
3. ✅ A _member_ gets invite to just started _brainstorm_
4. ✅ A _member_ adds a _quest idea_
5. ✅ The _system_ transitions _brainstorm_ to voting state
6. ✅ A _member_ vote for a _quest idea_
7. ✅ The _system_ transitions _brainstorm_ to finished state
1. ❕ The _system_ gathers a _brainstorm_ when there is not very much ongoing quests left (e.g.
< 20% members)
2. ✅ The _admin_ gathers a _brainstorm_
3. ✅ A _member_ gets notification about declared _brainstorm_ (note: skip _candidates_)
4. ✅ A _member_ gets invite to just started _brainstorm_
5. ✅ A _member_ adds a _quest idea_
6. ✅ The _system_ transitions _brainstorm_ to voting state
7. ✅ A _member_ vote for a _quest idea_
8. ✅ The _system_ transitions _brainstorm_ to finished state
10. Coordination
1. ✅ The _system_ makes a coordination _quest_ from popular _quest ideas_ and assigns it to entry
starter and most charismatic or most wise up-voted _member_; it balances amount of assigned
quests; ~~it uses random noise;~~ it assign quest without date and place
than 200 members)
1. ✅ The _system_ makes a coordination _quest_ from popular _quest ideas_ and assigns it to
idea starter and a random _member_; it balances amount of assigned quests; it assign quest
without date and place than 200 members)
2. ✅ A _member_ creates a sub-quest, edits its description
3. ✅ The _system_ assigns sub-quest to one of up-voted _member_
4. ✅ A _member_ rejects _quest_ (except initiation)
5. ✅ A _member_ declares _gathering_; all members of the tribe or all upwoters are notified about
time, place and theme of the gathering
5. ✅ A _member_ declares _gathering_; all members of the tribe or all upwoters are notified
about time, place and theme of the gathering
6. ✅ A _member_ creates a re-quest (repeat of the same quest) if more discussion is needed
7. ❕ A _member_ who made a coordination _sub-quest_ may request a kick-off quest
8. ❕ A _member_ who made a coordination _sub-quest_ may request a report on its completion
Expand All @@ -62,7 +62,19 @@
15. ❕ A _tribe chief_ wants to rename tribe and change description
16. ❕ A _member_ wants to list all their quests

Done: 20, In progress: 0, Must: 4, Must check: 3, Should: 10, total: 37
Done: 26, In progress: 0, Must: 1, Must check: 0, Should: 11, total: 37

### Tribes incarnation & astral

- When user is in city C and that city has tribe T incarnation TC in user's tribe list only TC is
shown
- When in astral not enough users to initiate new one, random users from incarnated tribes are
borrowed
- When in C incarnates T all T members in C added to TC. In T those members are 'on hold'.
- When in C new user joined TC it also joined T but 'on hold'
- When users leave C and TC has not enough members, T members of city C are now not 'on hold', but
TC's members now 'on hold'
-

## Entities

Expand Down Expand Up @@ -108,10 +120,7 @@ Done: 20, In progress: 0, Must: 4, Must check: 3, Should: 10, total: 37
7. What if user leaves their area temporary, or temporary get's in other area and became chief
there?
8. Re-voting for ideas in TG is kinda hard to do (no disabled buttons)
9. There is a positive feedback loop: the more charism & wisdom person have, more often they will be
assigned to coordination quests, if not other members are busy. Which will lead to increase
their charism & wisdom. But maybe it's a good thing. ┐( ˘_˘)┌
10. consider this: we have 10 members tribe, three of them suggest 9 ideas (3 each) and up-vote all 9. Thus we will have 5 quests assigned between these 3 members (each have 3-4) while other 7
9. consider this: we have 10 members tribe, three of them suggest 9 ideas (3 each) and up-vote all 9. Thus we will have 5 quests assigned between these 3 members (each have 3-4) while other 7
passive tribesmen won't have any. ┐( ˘_˘)┌ maybe that's OK.

## TODO
Expand Down
1 change: 0 additions & 1 deletion src/plugins/ui/i18n/en/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ const en: BaseTranslation = {
},

errors: {
// TODO fill other errors texts!!
UpdateFinishedBrainstormError: '🚫 This brainstorm is already over.',
SelfVotingIdeaError: '🚫 You cannot vote for your own idea.',
DoubleVotingError: 'Cannot vote twice.',
Expand Down
2 changes: 0 additions & 2 deletions src/plugins/ui/i18n/ru/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { Translation } from '../i18n-types'

// TODO don't forget to enable this:
const ru: Translation = {
unhandledText: '🗿 Духи слышат тебя...',
buttons: {
Expand Down Expand Up @@ -201,7 +200,6 @@ const ru: Translation = {
},

errors: {
// TODO fill other errors texts!!
UpdateFinishedBrainstormError: '🚫 Мозгоштурм уже окончен.',
SelfVotingIdeaError: '🚫 Вы не можете голосовать за свою идею.',
DoubleVotingError: 'Нельзя оценивать что-то дважды.',
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/ui/telegram/screens/views/tribe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ interface TribeViewProps {
showHelp?: boolean
}

// TODO for first time user show "what is tribalizm button"
// TODO [now] for first time user show "what is tribalizm button"
export function tribeView(ctx: TribeCtx, props: TribeViewProps) {
const texts = i18n(ctx).tribesList

Expand Down
1 change: 0 additions & 1 deletion src/specs/tg-bot-scenarios/brainstorm.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,6 @@ describe('Brainstorm [integration]', () => {
await userToPropose.chatLast('Tarantulae Inn')
await userToPropose.chat('confirm-proposal', true)
// TODO note that here userToAccept still have button to start negotiation
// TODO also users are now picked in line, should be random
const spawnedProposeUpd = await userToAgree.chatLast()
const spawnedProposeBtns = getInlineKeyCallbacks(spawnedProposeUpd)
await userToAgree.chat(spawnedProposeBtns[0])
Expand Down
6 changes: 1 addition & 5 deletions src/use-cases/entities/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@ export interface IApplicationData {
elderIds: string[]
approvedIds: string[]
}
// TODO MIGRATE: drop chiefId, shamanId, phase
// replace status => phase != finished : in-progress
// add elders: [tribe.chief, tribe.shaman]
// add currentElder: phase => tribe.chief | tribe.shaman
// add approvedIds: phase => [?tribe.chief, ?tribe.shaman]

export interface IApplication extends IApplicationData {
approve: (elderId: string) => void
decline: (elderId: string) => void
Expand Down
1 change: 0 additions & 1 deletion src/use-cases/entities/member.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ export interface IMemberData {
tribeId: string
isCandidate: boolean
}
// TODO MIGRATE: drop votes, charisma, wisdom

export interface IMember extends IMemberData {}
export type SavedMember = IMember & Storable
Expand Down
1 change: 0 additions & 1 deletion src/use-cases/entities/quest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ export interface QuestStore extends Store<IQuest> {
getActiveQuestsCount: (
memberIds: string[]
) => Promise<{ [id: string]: number }>
// TODO: add pagination
/**
* get all introduction and initiation quests for a particular tribe member (so you can decide
* with whom they didn't met yet)
Expand Down
2 changes: 0 additions & 2 deletions src/use-cases/entities/tribe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ export interface ITribeData {
cityId: string | null
}

// TODO MIGRATE: drop shamanId, chiefId, vocabulary

export interface ITribe extends ITribeData {}

export type RequiredParams = Pick<ITribe, 'name'>
Expand Down
3 changes: 1 addition & 2 deletions src/use-cases/utils/members-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ export function getBestFreeMember(
`Cannot assign quest: not enough members (${members.length})`
)
}
// TODO randomize
return freeMembersFiltered[0]
return freeMembersFiltered.sort(() => Math.random() - 0.5)[0]
}
/**
* Get minimal assigned quests count (e.g. 0 if there is a free member, 1 if at least one quest
Expand Down

0 comments on commit b4faacb

Please sign in to comment.