# Touranment ts definition question

**URL:** <https://forum.heroiclabs.com/t/touranment-ts-definition-question/5417>\
**Category:** Runtime Framework\
**Tags:** server-framework\
**Created:** [July 4, 2024, 9:15am UTC](https://forum.heroiclabs.com/t/touranment-ts-definition-question/5417 "2024-07-04T09:15:24Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mengxin](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/mengxin/32/1879_2.png) [@mengxin](https://forum.heroiclabs.com/u/mengxin)\
**Post date:** [July 4, 2024, 9:15am UTC](https://forum.heroiclabs.com/t/touranment-ts-definition-question/5417/1 "2024-07-04T09:15:24Z")

</div>

```typescript
export interface Tournament {
        id: string;
        title: string;
        description: string;
        category: number;
        sortOrder: number;
        size: number;
        maxSize: number;
        maxNumScore: number;
        duration: number;
        startActive: number;
        endActive: number;
        canEnter: boolean;
        nextReset: string;
        metadata: {[key: string]: any};
        createTime: number;
        startTime: number;
        endTime: number;
    }

```

**“prevReset”: 1719921600, missing in definition**  
**“nextReset”: 1720008000, should be number**

but this is the data we got when we tested tournamentGetIds API, seem like the definition is not matched with data we got, any idea?

**btw, may i confirm whether the prevReset should same with startActive after 1 round?**

```auto
 {
        "id": "TournamentMain_1",
        "category": 1,
        "sortOrder": 1,
        "size": 0,
        "endActive": 1719925200,
        "prevReset": 1719921600,
        "startActive": 1719921600,
        "canEnter": false,
        "createTime": 1719854290,
        "endTime": null,
        "title": "Daily Dash",
        "description": "Dash past your opponents for high scores and big rewards!",
        "duration": 3600,
        "nextReset": 1720008000,
        "metadata": {
          "weatherConditions": "rain"
        },
        "startTime": 1719854290,
        "maxSize": 10000,
        "maxNumScore": 3,
        "operator": "best"
      }

```

---

<div class="post-metadata">

**Author:** ![mengxin](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/mengxin/32/1879_2.png) [@mengxin](https://forum.heroiclabs.com/u/mengxin)\
**Post date:** [July 4, 2024, 1:04pm UTC](https://forum.heroiclabs.com/t/touranment-ts-definition-question/5417/2 "2024-07-04T13:04:16Z")

</div>

Based on my testing, seems like this should be a bug for ts definition. will submit a pr

---

<div class="post-metadata">

**Author:** ![sesposito](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/sesposito/32/2594_2.png) [@sesposito](https://forum.heroiclabs.com/u/sesposito)\
**Post date:** [July 4, 2024, 1:04pm UTC](https://forum.heroiclabs.com/t/touranment-ts-definition-question/5417/3 "2024-07-04T13:04:37Z")

</div>

Hello @mengxin,

We’ll fix the type mismatches, thank you for reporting. Going forward if you find any more mismatches please consider opening an issue on [GitHub - heroiclabs/nakama-common: The runtime framework for Nakama server.](https://github.com/heroiclabs/nakama-common) directly.

Can you explain what’s the scheduling that you’re trying to achieve?

Best.

---

<div class="post-metadata">

**Author:** ![mengxin](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/mengxin/32/1879_2.png) [@mengxin](https://forum.heroiclabs.com/u/mengxin)\
**Post date:** [July 4, 2024, 1:05pm UTC](https://forum.heroiclabs.com/t/touranment-ts-definition-question/5417/4 "2024-07-04T13:05:25Z")

</div>

> <https://github.com/heroiclabs/nakama-common/pull/152>

---

<div class="post-metadata">

**Author:** ![mengxin](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/mengxin/32/1879_2.png) [@mengxin](https://forum.heroiclabs.com/u/mengxin)\
**Post date:** [July 4, 2024, 1:41pm UTC](https://forum.heroiclabs.com/t/touranment-ts-definition-question/5417/5 "2024-07-04T13:41:47Z")

</div>

basically, we want to get the start time of the current round (after reset) from tournament object.

for example:

**Tournament start from Today: July 5th Friday 23:59:59, duration 5 days, reset each Thursday 23:59:59**

1st round is July 5th 23:59:59 + 5days to July 10th Wed 23:59:59 and reset at July 11th (1 days for display buffer)  
2nd round is July 11th 23.59.59 + 5days to July 16th Tuesday 23:59:59 (2 days for display buffer)

we want to get the time like:  
July 5th 23:59:59  
July 11th 23.59.59  
which each round tournament is active to accept score.

i think the **prevReset** and **startActive** can be used for this value right?

---

<div class="post-metadata">

**Author:** ![sesposito](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/sesposito/32/2594_2.png) [@sesposito](https://forum.heroiclabs.com/u/sesposito)\
**Post date:** [July 4, 2024, 2:58pm UTC](https://forum.heroiclabs.com/t/touranment-ts-definition-question/5417/6 "2024-07-04T14:58:16Z")

</div>

Yes those values should be updated according to the current tournament cycle.
