@@ -1,6 +1,4 @@
|
||||
import {
|
||||
IsNotEmpty,
|
||||
IsOptional,
|
||||
IsPostalCode,
|
||||
IsString
|
||||
} from "class-validator";
|
||||
@@ -18,10 +16,9 @@ export class Address {
|
||||
* The address's first line.
|
||||
* Containing the street and house number.
|
||||
*/
|
||||
@Column()
|
||||
@Column({ nullable: true })
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
address1: string;
|
||||
address1?: string;
|
||||
|
||||
/**
|
||||
* The address's second line.
|
||||
@@ -29,33 +26,29 @@ export class Address {
|
||||
*/
|
||||
@Column({ nullable: true })
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
address2?: string;
|
||||
|
||||
/**
|
||||
* The address's postal code.
|
||||
* This will get checked against the postal code syntax for the configured country.
|
||||
*/
|
||||
@Column()
|
||||
@Column({ nullable: true })
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
@IsPostalCode(config.postalcode_validation_countrycode)
|
||||
postalcode: string;
|
||||
|
||||
/**
|
||||
* The address's city.
|
||||
*/
|
||||
@Column()
|
||||
@Column({ nullable: true })
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
city: string;
|
||||
|
||||
/**
|
||||
* The address's country.
|
||||
*/
|
||||
@Column()
|
||||
@Column({ nullable: true })
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
country: string;
|
||||
|
||||
public reset() {
|
||||
|
Reference in New Issue
Block a user