Merge branch 'dev' into feature/13-runner_controllers

This commit is contained in:
2020-12-09 19:41:31 +01:00
10 changed files with 42 additions and 16 deletions

View File

@@ -1,5 +1,6 @@
import { IsEmail, IsInt, IsNotEmpty, IsOptional, IsPhoneNumber, IsString } from 'class-validator';
import { getConnectionManager } from 'typeorm';
import { config } from '../../config';
import { AddressNotFoundError, AddressWrongTypeError } from '../../errors/AddressErrors';
import { Address } from '../entities/Address';
import { GroupContact } from '../entities/GroupContact';
@@ -40,7 +41,7 @@ export class CreateGroupContact {
* Optional
*/
@IsOptional()
@IsPhoneNumber("DE")
@IsPhoneNumber(config.phone_validation_countrycode)
phone?: string;
/**

View File

@@ -1,5 +1,6 @@
import { IsEmail, IsInt, IsNotEmpty, IsOptional, IsPhoneNumber, IsString } from 'class-validator';
import { getConnectionManager } from 'typeorm';
import { config } from '../../config';
import { AddressNotFoundError, AddressWrongTypeError } from '../../errors/AddressErrors';
import { Address } from '../entities/Address';
@@ -32,7 +33,7 @@ export abstract class CreateParticipant {
*/
@IsString()
@IsOptional()
@IsPhoneNumber("ZZ")
@IsPhoneNumber(config.phone_validation_countrycode)
phone?: string;
/**

View File

@@ -2,6 +2,7 @@ import * as argon2 from "argon2";
import { IsEmail, IsOptional, IsPhoneNumber, IsString } from 'class-validator';
import { getConnectionManager } from 'typeorm';
import * as uuid from 'uuid';
import { config } from '../../config';
import { UsernameOrEmailNeededError } from '../../errors/UserErrors';
import { UserGroupNotFoundError } from '../../errors/UserGroupErrors';
import { User } from '../entities/User';
@@ -49,7 +50,7 @@ export class CreateUser {
* The new user's phone number.
* Optional
*/
@IsPhoneNumber("ZZ")
@IsPhoneNumber(config.phone_validation_countrycode)
@IsOptional()
phone?: string;

View File

@@ -8,6 +8,7 @@ import {
IsString
} from "class-validator";
import { Column, Entity, ManyToOne, OneToMany, PrimaryGeneratedColumn } from "typeorm";
import { config } from '../../config';
import { Address } from "./Address";
import { RunnerGroup } from "./RunnerGroup";
@@ -62,7 +63,7 @@ export class GroupContact {
*/
@Column({ nullable: true })
@IsOptional()
@IsPhoneNumber("DE")
@IsPhoneNumber(config.phone_validation_countrycode)
phone?: string;
/**

View File

@@ -8,6 +8,7 @@ import {
IsString
} from "class-validator";
import { Column, Entity, ManyToOne, OneToMany, PrimaryGeneratedColumn, TableInheritance } from "typeorm";
import { config } from '../../config';
import { Address } from "./Address";
import { Donation } from "./Donation";
@@ -62,7 +63,7 @@ export abstract class Participant {
*/
@Column({ nullable: true })
@IsOptional()
@IsPhoneNumber("DE")
@IsPhoneNumber(config.phone_validation_countrycode)
phone?: string;
/**

View File

@@ -1,5 +1,6 @@
import { IsBoolean, IsEmail, IsInt, IsNotEmpty, IsOptional, IsPhoneNumber, IsString, IsUUID } from "class-validator";
import { Column, Entity, JoinTable, ManyToMany, ManyToOne, OneToMany, PrimaryGeneratedColumn } from "typeorm";
import { config } from '../../config';
import { Permission } from './Permission';
import { UserAction } from './UserAction';
import { UserGroup } from './UserGroup';
@@ -35,7 +36,7 @@ export class User {
*/
@Column({ nullable: true })
@IsOptional()
@IsPhoneNumber("ZZ")
@IsPhoneNumber(config.phone_validation_countrycode)
phone?: string;
/**