# Class: Team

## Team()

Team Model ------------------------------------------------------------- A model representing a single team in the game.

## Constructor

#### new Team()

Source:
  - app/models/Team.model.js, line 10

### Extends

- Model

### Members

#### (static) schema

Define the flitter-orm schema of the model.

Source:
  - app/models/Team.model.js, line 18

### Methods

#### (async, static) getForUser(user) → {Promise.<Team>}

Look up or create a team for the given user.

##### Parameters:

Name | Type | Description
--- | --- | ---
`user` | User |

Source:
  - app/models/Team.model.js, line 32

##### Returns:

Type
  Promise.<Team>

#### (async) cumulative_data()

Get the cumulative data for the team (total wins, losses, points scored & allowed)

Source:
  - app/models/Team.model.js, line 82

##### Returns:

object

#### (async) lineup()

returns the lineup

Source:
  - app/models/Team.model.js, line 60

##### Returns:

Promise<Lineup>

#### (async) players()

Returns the players associated with the team.

Source:
  - app/models/Team.model.js, line 69

##### Returns:

Promise<Array<Player>>

#### (async) to_api()

Cast the team to the format expected for the API.

Source:
  - app/models/Team.model.js, line 127

##### Returns:

Promise