diff --git a/package.json b/package.json index 899fe1e..823d0ec 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,12 @@ { "name": "@mtlsz/common", - "version": "2.0.2", + "version": "3.0.0", "description": "MTLSZ frontend packages", "main": "dist/index.ts", "types": "dist/index.d.ts", "scripts": { "build": "tsc", - "test": "echo \"Error: no test specified\" && exit 1", - "publish": "npm publish --registry http://registry.trweb.hu" + "test": "echo \"Error: no test specified\" && exit 1" }, "repository": { "type": "git", diff --git a/src/interfaces/generic-user.ts b/src/interfaces/generic-user.ts new file mode 100644 index 0000000..83d9727 --- /dev/null +++ b/src/interfaces/generic-user.ts @@ -0,0 +1,7 @@ +export interface GenericUser { + firstName: string | null; + lastName: string | null; + emai: string | null; + phone: string | null; + keycloakUserId: string | null; +} diff --git a/src/interfaces/official.ts b/src/interfaces/official.ts index 61125ed..4cfe857 100644 --- a/src/interfaces/official.ts +++ b/src/interfaces/official.ts @@ -1,8 +1,9 @@ -export interface Official { +import { GenericUser } from "./generic-user"; + +export interface Official extends GenericUser { id?: number; + /** @deprecated since 3.0.0. Use lastName and firstName instead */ name: string; - email: string; - phone?: string; /** @deprecated Use referee and umpire booleans instead */ type?: number; referee: boolean; diff --git a/src/interfaces/player.ts b/src/interfaces/player.ts index 452a423..34539ae 100644 --- a/src/interfaces/player.ts +++ b/src/interfaces/player.ts @@ -1,21 +1,18 @@ import { Club } from "./club"; +import { GenericUser } from "./generic-user"; import { RankingEntry } from "./ranking-entry"; -export interface Player { - id?: number; - firstName: string; - lastName: string; - gender: string; - birthDate: string; - birthPlace: string | null; - officialId?: number; - club: Club; - email?: string; - keycloakUserId?: string; - active?: boolean; - licenceFrom?: string; - licenceTo?: string; - disabledBecauseRanking?: boolean; - disabledBecauseSimilarEntry?: boolean; - rankingEntries?: RankingEntry[]; +export interface Player extends GenericUser { + id?: number; + gender: string; + birthDate: string; + birthPlace: string | null; + officialId?: number; + club: Club; + active?: boolean; + licenceFrom?: string; + licenceTo?: string; + disabledBecauseRanking?: boolean; + disabledBecauseSimilarEntry?: boolean; + rankingEntries?: RankingEntry[]; } diff --git a/src/interfaces/team-administrator.ts b/src/interfaces/team-administrator.ts index 973e443..a7503bb 100644 --- a/src/interfaces/team-administrator.ts +++ b/src/interfaces/team-administrator.ts @@ -1,11 +1,10 @@ import { Club } from "./club"; +import { GenericUser } from "./generic-user"; -export interface TeamAdministrator { - id?: number; - keycloakId?: string; - lastName: string; - firstName: string; - email: string; - active?: boolean; - club: Club; +export interface TeamAdministrator extends GenericUser { + id?: number; + /** @deprecated since 3.0.0. Use keycloakUserId instead */ + keycloakId?: string; + active?: boolean; + club: Club; }