volleyballsimtypes 0.0.192 → 0.0.194

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/dist/cjs/src/data/init-models.js +4 -6
  2. package/dist/cjs/src/data/models/country.d.ts +1 -12
  3. package/dist/cjs/src/data/models/division.d.ts +2 -0
  4. package/dist/cjs/src/data/models/division.js +4 -0
  5. package/dist/cjs/src/data/models/index.d.ts +1 -1
  6. package/dist/cjs/src/data/models/index.js +1 -1
  7. package/dist/cjs/src/data/models/tactics.d.ts +30 -0
  8. package/dist/cjs/src/data/models/{coach.js → tactics.js} +9 -24
  9. package/dist/cjs/src/data/models/team.d.ts +8 -8
  10. package/dist/cjs/src/data/models/team.js +2 -2
  11. package/dist/cjs/src/data/transformers/division.d.ts +1 -1
  12. package/dist/cjs/src/data/transformers/division.js +13 -3
  13. package/dist/cjs/src/data/transformers/index.d.ts +1 -1
  14. package/dist/cjs/src/data/transformers/index.js +1 -1
  15. package/dist/cjs/src/data/transformers/league.js +1 -1
  16. package/dist/cjs/src/data/transformers/tactics.d.ts +5 -0
  17. package/dist/cjs/src/data/transformers/tactics.js +21 -0
  18. package/dist/cjs/src/data/transformers/team.js +3 -3
  19. package/dist/cjs/src/service/coach/index.d.ts +1 -1
  20. package/dist/cjs/src/service/coach/index.js +1 -1
  21. package/dist/cjs/src/service/coach/tactics.d.ts +13 -0
  22. package/dist/cjs/src/service/coach/{coach.js → tactics.js} +4 -6
  23. package/dist/cjs/src/service/competition/division.d.ts +5 -1
  24. package/dist/cjs/src/service/competition/division.js +3 -1
  25. package/dist/cjs/src/service/team/team.d.ts +4 -4
  26. package/dist/cjs/src/service/team/team.js +2 -2
  27. package/dist/esm/src/data/init-models.js +5 -7
  28. package/dist/esm/src/data/models/country.d.ts +1 -12
  29. package/dist/esm/src/data/models/division.d.ts +2 -0
  30. package/dist/esm/src/data/models/division.js +4 -0
  31. package/dist/esm/src/data/models/index.d.ts +1 -1
  32. package/dist/esm/src/data/models/index.js +1 -1
  33. package/dist/esm/src/data/models/tactics.d.ts +30 -0
  34. package/dist/esm/src/data/models/{coach.js → tactics.js} +7 -22
  35. package/dist/esm/src/data/models/team.d.ts +8 -8
  36. package/dist/esm/src/data/models/team.js +2 -2
  37. package/dist/esm/src/data/transformers/division.d.ts +1 -1
  38. package/dist/esm/src/data/transformers/division.js +14 -4
  39. package/dist/esm/src/data/transformers/index.d.ts +1 -1
  40. package/dist/esm/src/data/transformers/index.js +1 -1
  41. package/dist/esm/src/data/transformers/league.js +1 -1
  42. package/dist/esm/src/data/transformers/tactics.d.ts +5 -0
  43. package/dist/esm/src/data/transformers/tactics.js +17 -0
  44. package/dist/esm/src/data/transformers/team.js +4 -4
  45. package/dist/esm/src/service/coach/index.d.ts +1 -1
  46. package/dist/esm/src/service/coach/index.js +1 -1
  47. package/dist/esm/src/service/coach/tactics.d.ts +13 -0
  48. package/dist/esm/src/service/coach/{coach.js → tactics.js} +2 -4
  49. package/dist/esm/src/service/competition/division.d.ts +5 -1
  50. package/dist/esm/src/service/competition/division.js +3 -1
  51. package/dist/esm/src/service/team/team.d.ts +4 -4
  52. package/dist/esm/src/service/team/team.js +2 -2
  53. package/package.json +2 -2
  54. package/dist/cjs/src/data/models/coach.d.ts +0 -40
  55. package/dist/cjs/src/data/transformers/coach.d.ts +0 -5
  56. package/dist/cjs/src/data/transformers/coach.js +0 -29
  57. package/dist/cjs/src/service/coach/coach.d.ts +0 -19
  58. package/dist/esm/src/data/models/coach.d.ts +0 -40
  59. package/dist/esm/src/data/transformers/coach.d.ts +0 -5
  60. package/dist/esm/src/data/transformers/coach.js +0 -25
  61. package/dist/esm/src/service/coach/coach.d.ts +0 -19
@@ -1,5 +1,4 @@
1
1
  export * from './box-score';
2
- export * from './coach';
3
2
  export * from './competition';
4
3
  export * from './competition-champion';
5
4
  export * from './competition-match';
@@ -22,3 +21,4 @@ export * from './rally';
22
21
  export * from './set-position';
23
22
  export * from './team';
24
23
  export * from './user';
24
+ export * from './tactics';
@@ -1,5 +1,4 @@
1
1
  export * from './box-score';
2
- export * from './coach';
3
2
  export * from './competition';
4
3
  export * from './competition-champion';
5
4
  export * from './competition-match';
@@ -22,3 +21,4 @@ export * from './rally';
22
21
  export * from './set-position';
23
22
  export * from './team';
24
23
  export * from './user';
24
+ export * from './tactics';
@@ -0,0 +1,30 @@
1
+ import * as Sequelize from 'sequelize';
2
+ import { Model, Optional } from 'sequelize';
3
+ import { TeamId, TeamModel } from '.';
4
+ export interface TacticsAttributes {
5
+ tactics_id: string;
6
+ formation: FormationType;
7
+ substitution_tolerance: number;
8
+ }
9
+ export type FormationType = '4-2' | '5-1' | '6-2';
10
+ export type TacticsPk = 'tactics_id';
11
+ export type TacticsId = TacticsModel[TacticsPk];
12
+ export type TacticsOptionalAttributes = 'substitution_tolerance';
13
+ export type TacticsCreationAttributes = Optional<TacticsAttributes, TacticsOptionalAttributes>;
14
+ export declare class TacticsModel extends Model<TacticsAttributes, TacticsCreationAttributes> implements TacticsAttributes {
15
+ tactics_id: string;
16
+ formation: FormationType;
17
+ substitution_tolerance: number;
18
+ Teams: TeamModel[];
19
+ getTeams: Sequelize.HasManyGetAssociationsMixin<TeamModel>;
20
+ setTeams: Sequelize.HasManySetAssociationsMixin<TeamModel, TeamId>;
21
+ addTeam: Sequelize.HasManyAddAssociationMixin<TeamModel, TeamId>;
22
+ addTeams: Sequelize.HasManyAddAssociationsMixin<TeamModel, TeamId>;
23
+ createTeam: Sequelize.HasManyCreateAssociationMixin<TeamModel>;
24
+ removeTeam: Sequelize.HasManyRemoveAssociationMixin<TeamModel, TeamId>;
25
+ removeTeams: Sequelize.HasManyRemoveAssociationsMixin<TeamModel, TeamId>;
26
+ hasTeam: Sequelize.HasManyHasAssociationMixin<TeamModel, TeamId>;
27
+ hasTeams: Sequelize.HasManyHasAssociationsMixin<TeamModel, TeamId>;
28
+ countTeams: Sequelize.HasManyCountAssociationsMixin;
29
+ static initModel(sequelize: Sequelize.Sequelize): typeof TacticsModel;
30
+ }
@@ -1,11 +1,12 @@
1
1
  import { DataTypes, Model } from 'sequelize';
2
- export class CoachModel extends Model {
2
+ export class TacticsModel extends Model {
3
3
  static initModel(sequelize) {
4
- return CoachModel.init({
5
- coach_id: {
4
+ return TacticsModel.init({
5
+ tactics_id: {
6
6
  type: DataTypes.UUID,
7
7
  allowNull: false,
8
- primaryKey: true
8
+ primaryKey: true,
9
+ field: 'coach_id'
9
10
  },
10
11
  formation: {
11
12
  type: DataTypes.ENUM('4-2', '5-1', '6-2'),
@@ -15,31 +16,15 @@ export class CoachModel extends Model {
15
16
  type: DataTypes.REAL,
16
17
  allowNull: false,
17
18
  defaultValue: 0
18
- },
19
- first_name: {
20
- type: DataTypes.STRING,
21
- allowNull: false
22
- },
23
- last_name: {
24
- type: DataTypes.STRING,
25
- allowNull: false
26
- },
27
- country_id: {
28
- type: DataTypes.UUID,
29
- allowNull: false,
30
- references: {
31
- model: 'Country',
32
- key: 'country_id'
33
- }
34
19
  }
35
20
  }, {
36
21
  sequelize,
37
- tableName: 'Coach',
22
+ tableName: 'Tactics',
38
23
  schema: 'public',
39
24
  timestamps: false,
40
25
  indexes: [
41
26
  {
42
- name: 'Coach_pk',
27
+ name: 'Tactics_pk',
43
28
  unique: true,
44
29
  fields: [
45
30
  { name: 'coach_id' }
@@ -1,15 +1,15 @@
1
1
  import * as Sequelize from 'sequelize';
2
2
  import { Model, Optional } from 'sequelize';
3
- import { CoachAttributes, CoachId, CoachModel, CompetitionChampionId, CompetitionChampionModel, CompetitionId, CompetitionModel, CompetitionTeamsId, CompetitionTeamsModel, CountryId, CountryModel, DraftPickId, DraftPickModel, DivisionAttributes, DivisionId, DivisionModel, MatchId, MatchModel, MatchRatingId, MatchRatingModel, PlayerAttributes, PlayerId, PlayerModel, PlayerTeamId, PlayerTeamModel, RallyId, RallyModel } from '.';
3
+ import { TacticsAttributes, TacticsId, TacticsModel, CompetitionChampionId, CompetitionChampionModel, CompetitionId, CompetitionModel, CompetitionTeamsId, CompetitionTeamsModel, CountryId, CountryModel, DraftPickId, DraftPickModel, DivisionAttributes, DivisionId, DivisionModel, MatchId, MatchModel, MatchRatingId, MatchRatingModel, PlayerAttributes, PlayerId, PlayerModel, PlayerTeamId, PlayerTeamModel, RallyId, RallyModel } from '.';
4
4
  export interface TeamAttributes {
5
5
  team_id: string;
6
6
  name: string;
7
7
  short_name: string;
8
8
  rating: number;
9
- coach_id?: string;
9
+ tactics_id?: string;
10
10
  country_id?: string;
11
11
  division_id: string;
12
- coach?: CoachAttributes;
12
+ tactics?: TacticsAttributes;
13
13
  Players?: PlayerAttributes[];
14
14
  Division?: DivisionAttributes;
15
15
  }
@@ -19,16 +19,16 @@ export type TeamOptionalAttributes = 'rating';
19
19
  export type TeamCreationAttributes = Optional<TeamAttributes, TeamOptionalAttributes>;
20
20
  export declare class TeamModel extends Model<TeamAttributes, TeamCreationAttributes> implements TeamAttributes {
21
21
  team_id: string;
22
- coach_id: string;
22
+ tactics_id: string;
23
23
  name: string;
24
24
  short_name: string;
25
25
  country_id: string;
26
26
  rating: number;
27
27
  division_id: string;
28
- coach: CoachModel;
29
- getCoach: Sequelize.BelongsToGetAssociationMixin<CoachModel>;
30
- setCoach: Sequelize.BelongsToSetAssociationMixin<CoachModel, CoachId>;
31
- createCoach: Sequelize.BelongsToCreateAssociationMixin<CoachModel>;
28
+ tactics: TacticsModel;
29
+ getTactics: Sequelize.BelongsToGetAssociationMixin<TacticsModel>;
30
+ setTactics: Sequelize.BelongsToSetAssociationMixin<TacticsModel, TacticsId>;
31
+ createTactics: Sequelize.BelongsToCreateAssociationMixin<TacticsModel>;
32
32
  country: CountryModel;
33
33
  getCountry: Sequelize.BelongsToGetAssociationMixin<CountryModel>;
34
34
  setCountry: Sequelize.BelongsToSetAssociationMixin<CountryModel, CountryId>;
@@ -7,11 +7,11 @@ export class TeamModel extends Model {
7
7
  allowNull: false,
8
8
  primaryKey: true
9
9
  },
10
- coach_id: {
10
+ tactics_id: {
11
11
  type: DataTypes.UUID,
12
12
  allowNull: false,
13
13
  references: {
14
- model: 'Coach',
14
+ model: 'Tactics',
15
15
  key: 'coach_id'
16
16
  }
17
17
  },
@@ -1,5 +1,5 @@
1
1
  import { DivisionAttributes, DivisionModel } from '../models';
2
2
  import { Division } from '../../service';
3
- declare function transformToAttributes(division: Division, leagueId: string): DivisionAttributes;
3
+ declare function transformToAttributes(division: Division): DivisionAttributes;
4
4
  declare function transformToObject(model: DivisionModel): Division;
5
5
  export { transformToObject as transformToDivision, transformToAttributes as transformFromDivision };
@@ -1,12 +1,20 @@
1
1
  import { Division } from '../../service';
2
2
  import { transformToSeason } from './season';
3
- import { transformToTeam } from './team';
4
- function transformToAttributes(division, leagueId) {
3
+ import { transformFromTeam, transformToTeam } from './team';
4
+ function transformToAttributes(division) {
5
+ const Teams = (division.teams ?? []).map(transformFromTeam);
6
+ const DivisionSeasons = division.seasons.map(season => ({
7
+ division_id: division.id,
8
+ competition_id: season.id
9
+ }));
5
10
  return {
6
11
  division_id: division.id,
7
- league_id: leagueId,
12
+ league_id: division.leagueId,
8
13
  tier: division.tier,
9
- name: division.name
14
+ subdivision: division.subdivision,
15
+ name: division.name,
16
+ DivisionSeasons,
17
+ Teams
10
18
  };
11
19
  }
12
20
  function transformToObject(model) {
@@ -14,6 +22,8 @@ function transformToObject(model) {
14
22
  id: model.division_id,
15
23
  name: model.name,
16
24
  tier: model.tier,
25
+ subdivision: model.subdivision,
26
+ leagueId: model.league_id,
17
27
  seasons: (model.DivisionSeasons ?? []).map((ds) => transformToSeason(ds.competition)),
18
28
  teams: model.Teams != null ? model.Teams.map(transformToTeam) : undefined
19
29
  });
@@ -1,4 +1,3 @@
1
- export * from './coach';
2
1
  export * from './country';
3
2
  export * from './court-position';
4
3
  export * from './formation';
@@ -22,3 +21,4 @@ export * from './season-match';
22
21
  export * from './player-team';
23
22
  export * from './match-rating';
24
23
  export * from './team';
24
+ export * from './tactics';
@@ -1,4 +1,3 @@
1
- export * from './coach';
2
1
  export * from './country';
3
2
  export * from './court-position';
4
3
  export * from './formation';
@@ -22,3 +21,4 @@ export * from './season-match';
22
21
  export * from './player-team';
23
22
  export * from './match-rating';
24
23
  export * from './team';
24
+ export * from './tactics';
@@ -1,7 +1,7 @@
1
1
  import { League } from '../../service';
2
2
  import { transformFromDivision, transformToCountry, transformToDivision } from '.';
3
3
  function transformToAttributes(league) {
4
- const Divisions = league.divisions?.map(div => transformFromDivision(div, league.id));
4
+ const Divisions = league.divisions?.map((division) => transformFromDivision(division));
5
5
  return {
6
6
  league_id: league.id,
7
7
  country_id: league.country.id,
@@ -0,0 +1,5 @@
1
+ import { TacticsAttributes, TacticsModel } from '../models';
2
+ import { Tactics } from '../../service';
3
+ declare function transformToAttributes(tactics: Tactics): TacticsAttributes;
4
+ declare function transformToObject(model: TacticsModel): Tactics;
5
+ export { transformToObject as transformToTactics, transformToAttributes as transformFromTactics };
@@ -0,0 +1,17 @@
1
+ import { transformFromFormation, transformToFormation } from '.';
2
+ import { Tactics } from '../../service';
3
+ function transformToAttributes(tactics) {
4
+ return {
5
+ tactics_id: tactics.id,
6
+ substitution_tolerance: tactics.substitutionTolerance ?? 0,
7
+ formation: transformFromFormation(tactics.formation)
8
+ };
9
+ }
10
+ function transformToObject(model) {
11
+ return new Tactics({
12
+ id: model.tactics_id,
13
+ substitutionTolerance: model.substitution_tolerance,
14
+ formation: transformToFormation(model.formation)
15
+ });
16
+ }
17
+ export { transformToObject as transformToTactics, transformToAttributes as transformFromTactics };
@@ -1,13 +1,13 @@
1
1
  import { Team } from '../../service';
2
- import { transformFromCoach, transformToCoach, transformToCountry, transformToPlayer } from '.';
2
+ import { transformFromTactics, transformToCountry, transformToPlayer, transformToTactics } from '.';
3
3
  function transformToAttributes(team) {
4
4
  return {
5
5
  team_id: team.id,
6
6
  name: team.name,
7
7
  short_name: team.shortName,
8
- coach_id: team.coach?.id,
8
+ tactics_id: team.tactics?.id,
9
9
  country_id: team.country?.id,
10
- coach: team.coach != null ? transformFromCoach(team.coach) : undefined,
10
+ tactics: team.tactics != null ? transformFromTactics(team.tactics) : undefined,
11
11
  rating: team.rating,
12
12
  division_id: team.divisionId
13
13
  };
@@ -18,7 +18,7 @@ function transformToObject(model) {
18
18
  name: model.name,
19
19
  shortName: model.short_name,
20
20
  country: model.country != null ? transformToCountry(model.country) : undefined,
21
- coach: model.coach != null ? transformToCoach(model.coach) : undefined,
21
+ tactics: model.tactics != null ? transformToTactics(model.tactics) : undefined,
22
22
  roster: (model.PlayerTeams ?? []).map((pt) => transformToPlayer(pt.player)),
23
23
  rating: model.rating,
24
24
  divisionId: model.division_id
@@ -1,2 +1,2 @@
1
- export * from './coach';
1
+ export * from './tactics';
2
2
  export * from './formation';
@@ -1,2 +1,2 @@
1
- export * from './coach';
1
+ export * from './tactics';
2
2
  export * from './formation';
@@ -0,0 +1,13 @@
1
+ import { Formation } from './formation';
2
+ interface TacticsOpts {
3
+ readonly id: string;
4
+ readonly formation: Formation;
5
+ readonly substitutionTolerance?: number;
6
+ }
7
+ export declare class Tactics {
8
+ readonly id: string;
9
+ readonly formation: Formation;
10
+ readonly substitutionTolerance: number;
11
+ constructor({ id, formation, substitutionTolerance }: TacticsOpts);
12
+ }
13
+ export {};
@@ -1,10 +1,8 @@
1
1
  import { validateUUID } from '../utils';
2
- export class Coach {
3
- constructor({ id, name, country, formation, substitutionTolerance }) {
2
+ export class Tactics {
3
+ constructor({ id, formation, substitutionTolerance = 0 }) {
4
4
  validateUUID(id);
5
5
  this.id = id;
6
- this.name = name;
7
- this.country = country;
8
6
  this.formation = formation;
9
7
  this.substitutionTolerance = substitutionTolerance;
10
8
  }
@@ -4,6 +4,8 @@ interface DivisionOpts {
4
4
  readonly id: string;
5
5
  readonly name: string;
6
6
  readonly tier: number;
7
+ readonly subdivision: number;
8
+ readonly leagueId: string;
7
9
  readonly seasons: Season[];
8
10
  readonly teams?: Team[];
9
11
  }
@@ -11,8 +13,10 @@ export declare class Division {
11
13
  readonly id: string;
12
14
  readonly name: string;
13
15
  readonly tier: number;
16
+ readonly subdivision: number;
17
+ readonly leagueId: string;
14
18
  readonly seasons: Season[];
15
19
  readonly teams?: Team[];
16
- constructor({ id, name, tier, seasons, teams }: DivisionOpts);
20
+ constructor({ id, name, tier, subdivision, seasons, teams, leagueId }: DivisionOpts);
17
21
  }
18
22
  export {};
@@ -1,8 +1,10 @@
1
1
  export class Division {
2
- constructor({ id, name, tier, seasons, teams }) {
2
+ constructor({ id, name, tier, subdivision, seasons, teams, leagueId }) {
3
3
  this.id = id;
4
4
  this.name = name;
5
5
  this.tier = tier;
6
+ this.subdivision = subdivision;
7
+ this.leagueId = leagueId;
6
8
  this.seasons = seasons;
7
9
  this.teams = teams;
8
10
  }
@@ -1,6 +1,6 @@
1
- import { Coach } from '../coach';
2
1
  import { Player } from '../player';
3
2
  import { Country } from '../country';
3
+ import { Tactics } from '../coach';
4
4
  interface TeamParams {
5
5
  readonly id: string;
6
6
  readonly rating: number;
@@ -9,7 +9,7 @@ interface TeamParams {
9
9
  readonly divisionId: string;
10
10
  readonly roster: Player[];
11
11
  readonly country?: Country;
12
- readonly coach?: Coach;
12
+ readonly tactics?: Tactics;
13
13
  }
14
14
  export declare class Team {
15
15
  readonly id: string;
@@ -17,10 +17,10 @@ export declare class Team {
17
17
  readonly name: string;
18
18
  readonly shortName: string;
19
19
  readonly divisionId: string;
20
- readonly coach?: Coach;
20
+ readonly tactics?: Tactics;
21
21
  readonly country?: Country;
22
22
  private _rating;
23
- constructor({ id, rating, name, shortName, divisionId, country, roster, coach }: TeamParams);
23
+ constructor({ id, rating, name, shortName, divisionId, country, roster, tactics }: TeamParams);
24
24
  get rating(): number;
25
25
  set rating(value: number);
26
26
  isPlayerInRoster(player: Player): boolean;
@@ -1,11 +1,11 @@
1
1
  import { validateUUID } from '../utils';
2
2
  export class Team {
3
- constructor({ id, rating, name, shortName, divisionId, country, roster, coach }) {
3
+ constructor({ id, rating, name, shortName, divisionId, country, roster, tactics }) {
4
4
  validateUUID(id);
5
5
  this.id = id;
6
6
  this._rating = rating;
7
7
  this.roster = roster;
8
- this.coach = coach;
8
+ this.tactics = tactics;
9
9
  this.name = name;
10
10
  this.shortName = shortName;
11
11
  this.divisionId = divisionId;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "volleyballsimtypes",
3
- "version": "0.0.192",
3
+ "version": "0.0.194",
4
4
  "description": "vbsim types",
5
5
  "main": "./dist/cjs/src/index.js",
6
6
  "module": "./dist/esm/src/index.js",
@@ -14,7 +14,7 @@
14
14
  "validate": "npm run standard && npm run madge",
15
15
  "build": "tsc -p tsconfig.json && tsc -p tsconfig-cjs.json",
16
16
  "preversion": "npm run clean && npm run validate && npm run build && git commit -a --amend --no-edit",
17
- "postversion": "git push --follow-tags && npm publish"
17
+ "postversion": "git push --follow-tags && npm login && npm publish"
18
18
  },
19
19
  "author": "Francisco Farias <fariasfranciscoe@gmail.com>",
20
20
  "license": "ISC",
@@ -1,40 +0,0 @@
1
- import * as Sequelize from 'sequelize';
2
- import { Model, Optional } from 'sequelize';
3
- import { CountryId, CountryModel, TeamId, TeamModel } from '.';
4
- export interface CoachAttributes {
5
- coach_id: string;
6
- formation: FormationType;
7
- substitution_tolerance: number;
8
- first_name: string;
9
- last_name: string;
10
- country_id: string;
11
- }
12
- export type FormationType = '4-2' | '5-1' | '6-2';
13
- export type CoachPk = 'coach_id';
14
- export type CoachId = CoachModel[CoachPk];
15
- export type CoachOptionalAttributes = 'substitution_tolerance';
16
- export type CoachCreationAttributes = Optional<CoachAttributes, CoachOptionalAttributes>;
17
- export declare class CoachModel extends Model<CoachAttributes, CoachCreationAttributes> implements CoachAttributes {
18
- coach_id: string;
19
- formation: FormationType;
20
- substitution_tolerance: number;
21
- first_name: string;
22
- last_name: string;
23
- country_id: string;
24
- Teams: TeamModel[];
25
- getTeams: Sequelize.HasManyGetAssociationsMixin<TeamModel>;
26
- setTeams: Sequelize.HasManySetAssociationsMixin<TeamModel, TeamId>;
27
- addTeam: Sequelize.HasManyAddAssociationMixin<TeamModel, TeamId>;
28
- addTeams: Sequelize.HasManyAddAssociationsMixin<TeamModel, TeamId>;
29
- createTeam: Sequelize.HasManyCreateAssociationMixin<TeamModel>;
30
- removeTeam: Sequelize.HasManyRemoveAssociationMixin<TeamModel, TeamId>;
31
- removeTeams: Sequelize.HasManyRemoveAssociationsMixin<TeamModel, TeamId>;
32
- hasTeam: Sequelize.HasManyHasAssociationMixin<TeamModel, TeamId>;
33
- hasTeams: Sequelize.HasManyHasAssociationsMixin<TeamModel, TeamId>;
34
- countTeams: Sequelize.HasManyCountAssociationsMixin;
35
- country: CountryModel;
36
- getCountry: Sequelize.BelongsToGetAssociationMixin<CountryModel>;
37
- setCountry: Sequelize.BelongsToSetAssociationMixin<CountryModel, CountryId>;
38
- createCountry: Sequelize.BelongsToCreateAssociationMixin<CountryModel>;
39
- static initModel(sequelize: Sequelize.Sequelize): typeof CoachModel;
40
- }
@@ -1,5 +0,0 @@
1
- import { CoachAttributes, CoachModel } from '../models';
2
- import { Coach } from '../../service';
3
- declare function transformToAttributes(coach: Coach): CoachAttributes;
4
- declare function transformToObject(model: CoachModel): Coach;
5
- export { transformToObject as transformToCoach, transformToAttributes as transformFromCoach };
@@ -1,29 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.transformFromCoach = exports.transformToCoach = void 0;
4
- const _1 = require(".");
5
- const service_1 = require("../../service");
6
- function transformToAttributes(coach) {
7
- return {
8
- coach_id: coach.id,
9
- country_id: coach.country.id,
10
- first_name: coach.name.first,
11
- last_name: coach.name.last,
12
- substitution_tolerance: coach.substitutionTolerance ?? 0,
13
- formation: (0, _1.transformFromFormation)(coach.formation)
14
- };
15
- }
16
- exports.transformFromCoach = transformToAttributes;
17
- function transformToObject(model) {
18
- return new service_1.Coach({
19
- id: model.coach_id,
20
- name: {
21
- first: model.first_name,
22
- last: model.last_name
23
- },
24
- country: (0, _1.transformToCountry)(model.country),
25
- substitutionTolerance: model.substitution_tolerance,
26
- formation: (0, _1.transformToFormation)(model.formation)
27
- });
28
- }
29
- exports.transformToCoach = transformToObject;
@@ -1,19 +0,0 @@
1
- import { Formation } from './formation';
2
- import { Name } from '../player';
3
- import { Country } from '../country';
4
- interface CoachOpts {
5
- readonly id: string;
6
- readonly name: Name;
7
- readonly country: Country;
8
- readonly formation: Formation;
9
- readonly substitutionTolerance: number;
10
- }
11
- export declare class Coach {
12
- readonly id: string;
13
- readonly name: Name;
14
- readonly country: Country;
15
- readonly formation: Formation;
16
- readonly substitutionTolerance: number;
17
- constructor({ id, name, country, formation, substitutionTolerance }: CoachOpts);
18
- }
19
- export {};
@@ -1,40 +0,0 @@
1
- import * as Sequelize from 'sequelize';
2
- import { Model, Optional } from 'sequelize';
3
- import { CountryId, CountryModel, TeamId, TeamModel } from '.';
4
- export interface CoachAttributes {
5
- coach_id: string;
6
- formation: FormationType;
7
- substitution_tolerance: number;
8
- first_name: string;
9
- last_name: string;
10
- country_id: string;
11
- }
12
- export type FormationType = '4-2' | '5-1' | '6-2';
13
- export type CoachPk = 'coach_id';
14
- export type CoachId = CoachModel[CoachPk];
15
- export type CoachOptionalAttributes = 'substitution_tolerance';
16
- export type CoachCreationAttributes = Optional<CoachAttributes, CoachOptionalAttributes>;
17
- export declare class CoachModel extends Model<CoachAttributes, CoachCreationAttributes> implements CoachAttributes {
18
- coach_id: string;
19
- formation: FormationType;
20
- substitution_tolerance: number;
21
- first_name: string;
22
- last_name: string;
23
- country_id: string;
24
- Teams: TeamModel[];
25
- getTeams: Sequelize.HasManyGetAssociationsMixin<TeamModel>;
26
- setTeams: Sequelize.HasManySetAssociationsMixin<TeamModel, TeamId>;
27
- addTeam: Sequelize.HasManyAddAssociationMixin<TeamModel, TeamId>;
28
- addTeams: Sequelize.HasManyAddAssociationsMixin<TeamModel, TeamId>;
29
- createTeam: Sequelize.HasManyCreateAssociationMixin<TeamModel>;
30
- removeTeam: Sequelize.HasManyRemoveAssociationMixin<TeamModel, TeamId>;
31
- removeTeams: Sequelize.HasManyRemoveAssociationsMixin<TeamModel, TeamId>;
32
- hasTeam: Sequelize.HasManyHasAssociationMixin<TeamModel, TeamId>;
33
- hasTeams: Sequelize.HasManyHasAssociationsMixin<TeamModel, TeamId>;
34
- countTeams: Sequelize.HasManyCountAssociationsMixin;
35
- country: CountryModel;
36
- getCountry: Sequelize.BelongsToGetAssociationMixin<CountryModel>;
37
- setCountry: Sequelize.BelongsToSetAssociationMixin<CountryModel, CountryId>;
38
- createCountry: Sequelize.BelongsToCreateAssociationMixin<CountryModel>;
39
- static initModel(sequelize: Sequelize.Sequelize): typeof CoachModel;
40
- }
@@ -1,5 +0,0 @@
1
- import { CoachAttributes, CoachModel } from '../models';
2
- import { Coach } from '../../service';
3
- declare function transformToAttributes(coach: Coach): CoachAttributes;
4
- declare function transformToObject(model: CoachModel): Coach;
5
- export { transformToObject as transformToCoach, transformToAttributes as transformFromCoach };
@@ -1,25 +0,0 @@
1
- import { transformFromFormation, transformToCountry, transformToFormation } from '.';
2
- import { Coach } from '../../service';
3
- function transformToAttributes(coach) {
4
- return {
5
- coach_id: coach.id,
6
- country_id: coach.country.id,
7
- first_name: coach.name.first,
8
- last_name: coach.name.last,
9
- substitution_tolerance: coach.substitutionTolerance ?? 0,
10
- formation: transformFromFormation(coach.formation)
11
- };
12
- }
13
- function transformToObject(model) {
14
- return new Coach({
15
- id: model.coach_id,
16
- name: {
17
- first: model.first_name,
18
- last: model.last_name
19
- },
20
- country: transformToCountry(model.country),
21
- substitutionTolerance: model.substitution_tolerance,
22
- formation: transformToFormation(model.formation)
23
- });
24
- }
25
- export { transformToObject as transformToCoach, transformToAttributes as transformFromCoach };
@@ -1,19 +0,0 @@
1
- import { Formation } from './formation';
2
- import { Name } from '../player';
3
- import { Country } from '../country';
4
- interface CoachOpts {
5
- readonly id: string;
6
- readonly name: Name;
7
- readonly country: Country;
8
- readonly formation: Formation;
9
- readonly substitutionTolerance: number;
10
- }
11
- export declare class Coach {
12
- readonly id: string;
13
- readonly name: Name;
14
- readonly country: Country;
15
- readonly formation: Formation;
16
- readonly substitutionTolerance: number;
17
- constructor({ id, name, country, formation, substitutionTolerance }: CoachOpts);
18
- }
19
- export {};