Updated a bunch of optional collumns to be nullable

ref #11 #13
This commit is contained in:
2020-12-02 19:14:45 +01:00
parent a78bbb1de5
commit aa565c6b34
8 changed files with 23 additions and 22 deletions

View File

@@ -5,6 +5,7 @@ import {
IsNotEmpty,
IsOptional,
IsPhoneNumber,
IsPositive,
IsString,
} from "class-validator";
import { Address } from "./Address";
@@ -36,7 +37,7 @@ export class GroupContact {
* The contact's middle name.
* Optional
*/
@Column()
@Column({nullable: true})
@IsOptional()
@IsString()
middlename?: string;
@@ -45,7 +46,7 @@ export class GroupContact {
* The contact's last name.
*/
@Column()
@IsOptional()
@IsNotEmpty()
@IsString()
lastname: string;
@@ -61,7 +62,7 @@ export class GroupContact {
* The contact's phone number.
* Optional
*/
@Column()
@Column({nullable: true})
@IsOptional()
@IsPhoneNumber("DE")
phone?: string;
@@ -70,7 +71,7 @@ export class GroupContact {
* The contact's email address.
* Optional
*/
@Column()
@Column({nullable: true})
@IsOptional()
@IsEmail()
email?: string;