Skip to content

904 the goal of box session gameplay - #1028

Merged
CapoMK25 merged 15 commits into
devfrom
904-the-goal-of-box-session-gameplay
Oct 7, 2026
Merged

CapoMK25 merged 15 commits into
devfrom
904-the-goal-of-box-session-gameplay

Conversation

@tickBit

@tickBit tickBit commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

Brief description

Related issue #904

Updates Box testing sessions to support fixed clan score targets, complete daily-task availability, and locked clan membership.

Each session now creates two clans with a maximum of 15 participants each. Clan target scores are calculated when the session starts using 420 × planned clan members. Both clans receive all 29 unique server and UI daily tasks.

Normal clan membership mutations are blocked during testing sessions, and the daily reset scheduler preserves Box-session tasks and progression.

Change list

  • Added shared Box-session constants.
  • Limited testersAmount to 1–30 at DTO and service levels.
  • Added boxMemberLimit and targetPoints to the clan schema and API DTO.
  • Added deterministic clan planning for even and odd participant counts.
  • Persisted clan member limits and target scores when a session starts.
  • Enforced Box-clan capacity during tester account claiming.
  • Made concurrent clan assignment capacity-safe and deterministic.
  • Added all 12 server and 17 UI task types to both Box clans.
  • Added the missing INNER_DISCUSSION task definition and chat progression event.
  • Deprecated the legacy Box dailyTasks configuration for session task selection.
  • Added a stable CLAN_ACTION_BLOCKED_DURING_TESTING_SESSION API error.
  • Blocked normal clan creation, deletion, joining, leaving, and member removal during testing sessions.
  • Excluded Box tasks, clans, and players from the midnight daily reset.
  • Added unit, regression, and full 30-player lifecycle integration tests.
  • Added coverage for task uniqueness, 15/15 distribution, score targets, capacity enforcement, and blocked clan mutations.

Testing output from Postman

All the daily tasks are created for a tester:

{
    "data": {
        "DailyTask": [
            {
                "_id": "6ac604bd1c1d5e0f2cd97af3",
                "clan_id": "6ac604bd1c1d5e0f2cd97aa5",
                "player_id": null,
                "title": {
                    "fi": "Karkoita korvamato 8 kertaa."
                },
                "type": "banish_the_earworm",
                "points": 20,
                "coins": 10,
                "amount": 8,
                "amountLeft": 8,
                "progress": {},
                "timeLimitMinutes": 16,
                "box_id": "6ac603841c1d5e0f2cd97960"
            },
            {
                "_id": "6ac604bd1c1d5e0f2cd97af5",
                "clan_id": "6ac604bd1c1d5e0f2cd97aa5",
                "player_id": null,
                "title": {
                    "fi": "Pelaa 17 taistelua."
                },
                "type": "go_to_battle",
                "points": 20,
                "coins": 10,
                "amount": 17,
                "amountLeft": 17,
                "progress": {},
                "timeLimitMinutes": 34,
                "box_id": "6ac603841c1d5e0f2cd97960"
            },
            {
                "_id": "6ac604bd1c1d5e0f2cd97af7",
                "clan_id": "6ac604bd1c1d5e0f2cd97aa5",
                "player_id": null,
                "title": {
                    "fi": "Kasvata puolustussotilaan hyökkäysarvoa ja pelaa sen jälkeen taistelu."
                },
                "type": "stronger_soldier",
                "points": 20,
                "coins": 10,
                "amount": 2,
                "amountLeft": 2,
                "progress": {},
                "timeLimitMinutes": 4,
                "box_id": "6ac603841c1d5e0f2cd97960"
            },
            {
                "_id": "6ac604bd1c1d5e0f2cd97af9",
                "clan_id": "6ac604bd1c1d5e0f2cd97aa5",
                "player_id": null,
                "title": {
                    "fi": "Avaa klaanin chat ja lähetä viesti. Huomaa, miltä tuntuu aloittaa vuorovaikutus. Opit, että viestintä pelissä rakentaa suhteita ja merkityksiä, ei vain siirrä tietoa."
                },
                "type": "form_an_inner_connection",
                "points": 20,
                "coins": 10,
                "amount": 1,
                "amountLeft": 1,
                "progress": {},
                "timeLimitMinutes": 2,
                "box_id": "6ac603841c1d5e0f2cd97960"
            },
            {
                "_id": "6ac604bd1c1d5e0f2cd97afb",
                "clan_id": "6ac604bd1c1d5e0f2cd97aa5",
                "player_id": null,
                "title": {
                    "fi": "Avaa klaanin chat. Lähetä viestejä käyttämällä kaikkia eri tunnevaihtoehtoja. Huomaa, miten sama viesti muuttuu eri tunteilla."
                },
                "type": "play_with_emotions",
                "points": 20,
                "coins": 10,
                "amount": 6,
                "amountLeft": 6,
                "progress": {},
                "timeLimitMinutes": 12,
                "box_id": "6ac603841c1d5e0f2cd97960"
            },
            {
                "_id": "6ac604bd1c1d5e0f2cd97afd",
                "clan_id": "6ac604bd1c1d5e0f2cd97aa5",
                "player_id": null,
                "title": {
                    "fi": "Äänestä klaanin äänestyksessä."
                },
                "type": "your_voice",
                "points": 20,
                "coins": 10,
                "amount": 1,
                "amountLeft": 1,
                "progress": {},
                "timeLimitMinutes": 2,
                "box_id": "6ac603841c1d5e0f2cd97960"
            },
            {
                "_id": "6ac604bd1c1d5e0f2cd97aff",
                "clan_id": "6ac604bd1c1d5e0f2cd97aa5",
                "player_id": null,
                "title": {
                    "fi": "Avaa klaanin äänestys. Valitse vaihtoehto, ja anna äänesi. Huomaa, miten oma valintasi vaikuttaa yhteiseen päätökseen."
                },
                "type": "letting_go_of_the_old",
                "points": 20,
                "coins": 10,
                "amount": 1,
                "amountLeft": 1,
                "progress": {},
                "timeLimitMinutes": 2,
                "box_id": "6ac603841c1d5e0f2cd97960"
            },
            {
                "_id": "6ac604bd1c1d5e0f2cd97b01",
                "clan_id": "6ac604bd1c1d5e0f2cd97aa5",
                "player_id": null,
                "title": {
                    "fi": "Avaa klaanin kirpputori. Valitse äänestyksessä myytäväksi hyväksytty tavara ja lisää se myytäväksi. Katso, miten muut reagoivat ja miltä tuntuu kun tavara alkaa liikkua pelaajien välillä."
                },
                "type": "recycling_experiences",
                "points": 20,
                "coins": 10,
                "amount": 1,
                "amountLeft": 1,
                "progress": {},
                "timeLimitMinutes": 2,
                "box_id": "6ac603841c1d5e0f2cd97960"
            },
            {
                "_id": "6ac604bd1c1d5e0f2cd97b03",
                "clan_id": "6ac604bd1c1d5e0f2cd97aa5",
                "player_id": null,
                "title": {
                    "fi": "Avaa klaanin asetukset. Muokkaa klaanin mottoa ja tallenna muutos. Mieti, mitä haluatte viestiä toisillenne ja muille."
                },
                "type": "inner_voice",
                "points": 20,
                "coins": 10,
                "amount": 1,
                "amountLeft": 1,
                "progress": {},
                "timeLimitMinutes": 2,
                "box_id": "6ac603841c1d5e0f2cd97960"
            },
            {
                "_id": "6ac604bd1c1d5e0f2cd97b05",
                "clan_id": "6ac604bd1c1d5e0f2cd97aa5",
                "player_id": null,
                "title": {
                    "fi": "Osallistu klaanin sisäiseen keskusteluun."
                },
                "type": "inner_discussion",
                "points": 20,
                "coins": 10,
                "amount": 1,
                "amountLeft": 1,
                "progress": {},
                "timeLimitMinutes": 2,
                "box_id": "6ac603841c1d5e0f2cd97960"
            },
            {
                "_id": "6ac604bd1c1d5e0f2cd97b07",
                "clan_id": "6ac604bd1c1d5e0f2cd97aa5",
                "player_id": null,
                "title": {
                    "fi": "Sisusta yksi klaanin Turvapaikan huone vähintään kolmella saman malliston huonekalulla."
                },
                "type": "build_your_world",
                "points": 20,
                "coins": 10,
                "amount": 1,
                "amountLeft": 1,
                "progress": {},
                "timeLimitMinutes": 2,
                "box_id": "6ac603841c1d5e0f2cd97960"
            },
            {
                "_id": "6ac604bd1c1d5e0f2cd97b09",
                "clan_id": "6ac604bd1c1d5e0f2cd97aa5",
                "player_id": null,
                "title": {
                    "fi": "Avaa klaanin säännöt ja muokkaa niitä. Säännöt muovaavat sitä, millainen yhteisö te olette. Mieti, mitä toimintaa haluatte vahvistaa."
                },
                "type": "set_boundaries",
                "points": 20,
                "coins": 10,
                "amount": 1,
                "amountLeft": 1,
                "progress": {},
                "timeLimitMinutes": 60,
                "box_id": "6ac603841c1d5e0f2cd97960"
            },
            {
                "_id": "6ac604bd1c1d5e0f2cd97b0b",
                "clan_id": "6ac604bd1c1d5e0f2cd97aa5",
                "player_id": null,
                "title": {
                    "fi": "Etsi sisäinen toimintahäiriö."
                },
                "type": "find_the_error",
                "points": 20,
                "coins": 10,
                "amount": 1,
                "amountLeft": 1,
                "progress": {},
                "timeLimitMinutes": 60,
                "box_id": "6ac603841c1d5e0f2cd97960"
            },
            {
                "_id": "6ac604bd1c1d5e0f2cd97b0d",
                "clan_id": "6ac604bd1c1d5e0f2cd97aa5",
                "player_id": null,
                "title": {
                    "fi": "Soita sävelmä."
                },
                "type": "play_melody",
                "points": 20,
                "coins": 10,
                "amount": 1,
                "amountLeft": 1,
                "progress": {},
                "timeLimitMinutes": 60,
                "box_id": "6ac603841c1d5e0f2cd97960"
            },
            {
                "_id": "6ac604bd1c1d5e0f2cd97b0f",
                "clan_id": "6ac604bd1c1d5e0f2cd97aa5",
                "player_id": null,
                "title": {
                    "fi": "Valitse prologin näkymä, joka herättää eniten tunnistettavan tunteen."
                },
                "type": "choose_your_truth",
                "points": 20,
                "coins": 10,
                "amount": 1,
                "amountLeft": 1,
                "progress": {},
                "timeLimitMinutes": 60,
                "box_id": "6ac603841c1d5e0f2cd97960"
            },
            {
                "_id": "6ac604bd1c1d5e0f2cd97b11",
                "clan_id": "6ac604bd1c1d5e0f2cd97aa5",
                "player_id": null,
                "title": {
                    "fi": "Pysähdy defenssisoturin äärelle ja kuuntele sen taustaa."
                },
                "type": "hold_the_character",
                "points": 20,
                "coins": 10,
                "amount": 1,
                "amountLeft": 1,
                "progress": {},
                "timeLimitMinutes": 60,
                "box_id": "6ac603841c1d5e0f2cd97960"
            },
            {
                "_id": "6ac604bd1c1d5e0f2cd97b13",
                "clan_id": "6ac604bd1c1d5e0f2cd97aa5",
                "player_id": null,
                "title": {
                    "fi": "Tunnista tila, jossa sisäinen tapahtuma tapahtuu."
                },
                "type": "where_are_you",
                "points": 20,
                "coins": 10,
                "amount": 1,
                "amountLeft": 1,
                "progress": {},
                "timeLimitMinutes": 60,
                "box_id": "6ac603841c1d5e0f2cd97960"
            },
            {
                "_id": "6ac604bd1c1d5e0f2cd97b15",
                "clan_id": "6ac604bd1c1d5e0f2cd97aa5",
                "player_id": null,
                "title": {
                    "fi": "Etsi ohjeet, jotka oikeasti ohjaavat toimintaasi."
                },
                "type": "follow_the_voice",
                "points": 20,
                "coins": 10,
                "amount": 1,
                "amountLeft": 1,
                "progress": {},
                "timeLimitMinutes": 60,
                "box_id": "6ac603841c1d5e0f2cd97960"
            },
            {
                "_id": "6ac604bd1c1d5e0f2cd97b17",
                "clan_id": "6ac604bd1c1d5e0f2cd97aa5",
                "player_id": null,
                "title": {
                    "fi": "Etsi symboli, joka ei selitä itseään vaan ehdottaa."
                },
                "type": "read_the_signs",
                "points": 20,
                "coins": 10,
                "amount": 1,
                "amountLeft": 1,
                "progress": {},
                "timeLimitMinutes": 60,
                "box_id": "6ac603841c1d5e0f2cd97960"
            },
            {
                "_id": "6ac604bd1c1d5e0f2cd97b19",
                "clan_id": "6ac604bd1c1d5e0f2cd97aa5",
                "player_id": null,
                "title": {
                    "fi": "Löydä osa, jossa toisen vaikutus on muokannut sinua."
                },
                "type": "find_the_roots",
                "points": 20,
                "coins": 10,
                "amount": 1,
                "amountLeft": 1,
                "progress": {},
                "timeLimitMinutes": 60,
                "box_id": "6ac603841c1d5e0f2cd97960"
            },
            {
                "_id": "6ac604bd1c1d5e0f2cd97b1b",
                "clan_id": "6ac604bd1c1d5e0f2cd97aa5",
                "player_id": null,
                "title": {
                    "fi": "Tunnista, millainen rakenne sinua ohjaa."
                },
                "type": "look_inside",
                "points": 20,
                "coins": 10,
                "amount": 1,
                "amountLeft": 1,
                "progress": {},
                "timeLimitMinutes": 60,
                "box_id": "6ac603841c1d5e0f2cd97960"
            },
            {
                "_id": "6ac604bd1c1d5e0f2cd97b1d",
                "clan_id": "6ac604bd1c1d5e0f2cd97aa5",
                "player_id": null,
                "title": {
                    "fi": "Missä käyt sisäisen valtataistelusi tai punnitset eri vaihtoehtoja?"
                },
                "type": "use_of_power",
                "points": 20,
                "coins": 10,
                "amount": 1,
                "amountLeft": 1,
                "progress": {},
                "timeLimitMinutes": 60,
                "box_id": "6ac603841c1d5e0f2cd97960"
            },
            {
                "_id": "6ac604bd1c1d5e0f2cd97b1f",
                "clan_id": "6ac604bd1c1d5e0f2cd97aa5",
                "player_id": null,
                "title": {
                    "fi": "Mitä olet oppinut joltain toiselta? Etsi teitä yhdistävä asia."
                },
                "type": "common_factor",
                "points": 20,
                "coins": 10,
                "amount": 1,
                "amountLeft": 1,
                "progress": {},
                "timeLimitMinutes": 60,
                "box_id": "6ac603841c1d5e0f2cd97960"
            },
            {
                "_id": "6ac604bd1c1d5e0f2cd97b21",
                "clan_id": "6ac604bd1c1d5e0f2cd97aa5",
                "player_id": null,
                "title": {
                    "fi": "Etsi pelistä henkisen valuutan symboli."
                },
                "type": "spiritual_currency",
                "points": 20,
                "coins": 10,
                "amount": 1,
                "amountLeft": 1,
                "progress": {},
                "timeLimitMinutes": 60,
                "box_id": "6ac603841c1d5e0f2cd97960"
            },
            {
                "_id": "6ac604bd1c1d5e0f2cd97b23",
                "clan_id": "6ac604bd1c1d5e0f2cd97aa5",
                "player_id": null,
                "title": {
                    "fi": "Tunnista, missä syntyy dopamiinia ja onnistumisen tunnetta."
                },
                "type": "reward_traps",
                "points": 20,
                "coins": 10,
                "amount": 1,
                "amountLeft": 1,
                "progress": {},
                "timeLimitMinutes": 60,
                "box_id": "6ac603841c1d5e0f2cd97960"
            },
            {
                "_id": "6ac604bd1c1d5e0f2cd97b25",
                "clan_id": "6ac604bd1c1d5e0f2cd97aa5",
                "player_id": null,
                "title": {
                    "fi": "Etsi kohta, jossa jouduit pohtimaan oikean ja väärän merkitystä."
                },
                "type": "moral_dilemmas",
                "points": 20,
                "coins": 10,
                "amount": 1,
                "amountLeft": 1,
                "progress": {},
                "timeLimitMinutes": 60,
                "box_id": "6ac603841c1d5e0f2cd97960"
            },
            {
                "_id": "6ac604bd1c1d5e0f2cd97b27",
                "clan_id": "6ac604bd1c1d5e0f2cd97aa5",
                "player_id": null,
                "title": {
                    "fi": "Huomaa, miten toimintasi jättää jäljen tähän maailmaan."
                },
                "type": "eco_friendly",
                "points": 20,
                "coins": 10,
                "amount": 1,
                "amountLeft": 1,
                "progress": {},
                "timeLimitMinutes": 60,
                "box_id": "6ac603841c1d5e0f2cd97960"
            },
            {
                "_id": "6ac604bd1c1d5e0f2cd97b29",
                "clan_id": "6ac604bd1c1d5e0f2cd97aa5",
                "player_id": null,
                "title": {
                    "fi": "Miten ohjenuorasi rakentuu? Minkälaisia arvoja edustat?"
                },
                "type": "hunting for values",
                "points": 20,
                "coins": 10,
                "amount": 1,
                "amountLeft": 1,
                "progress": {},
                "timeLimitMinutes": 60,
                "box_id": "6ac603841c1d5e0f2cd97960"
            },
            {
                "_id": "6ac604bd1c1d5e0f2cd97b2b",
                "clan_id": "6ac604bd1c1d5e0f2cd97aa5",
                "player_id": null,
                "title": {
                    "fi": "Kumpi soturisi kulkee parempaa polkua?"
                },
                "type": "ethics_metrics",
                "points": 20,
                "coins": 10,
                "amount": 1,
                "amountLeft": 1,
                "progress": {},
                "timeLimitMinutes": 60,
                "box_id": "6ac603841c1d5e0f2cd97960"
            }
        ]
    },
    "metaData": {
        "dataKey": "DailyTask",
        "modelName": "DailyTask",
        "dataType": "Array",
        "dataCount": 29
    }
}

Other info

I have also a script to do the migration on the physical server once this PR is merged.

@codecov-alt

codecov-alt Bot commented Oct 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.06173% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/box/sessionStarter/sessionStarter.service.ts 84.21% 3 Missing ⚠️
src/box/util/createBoxClanPlans.ts 92.30% 1 Missing ⚠️
Files with missing lines Coverage Δ
src/box/accountClaimer/testerAccount.service.ts 95.89% <100.00%> (+0.11%) ⬆️
src/box/box.service.ts 93.47% <100.00%> (+0.56%) ⬆️
src/box/consts/boxSessionConstants.ts 100.00% <100.00%> (ø)
src/clan/clan.service.ts 86.63% <ø> (ø)
...n/guard/blockClanMutationInTestingSession.guard.ts 100.00% <100.00%> (ø)
src/common/controller/APIError.ts 100.00% <100.00%> (ø)
src/common/controller/APIErrorReason.ts 100.00% <100.00%> (ø)
src/dailyTasks/dailyTasksScheduler.service.ts 97.77% <100.00%> (+48.84%) ⬆️
src/dailyTasks/taskGenerator.service.ts 95.77% <100.00%> (+0.32%) ⬆️
src/dailyTasks/uiDailyTasks/uiDailyTasks.ts 100.00% <ø> (ø)
... and 2 more

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@CapoMK25 CapoMK25 self-assigned this Oct 7, 2026

@CapoMK25 CapoMK25 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Clean work, approved and merging!

@CapoMK25
CapoMK25 merged commit 5535de9 into dev Oct 7, 2026
5 checks passed
@CapoMK25
CapoMK25 deleted the 904-the-goal-of-box-session-gameplay branch October 7, 2026 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants