Optional Contact
This commit is contained in:
parent
cabb4c6c05
commit
e05824e025
@ -1,6 +1,7 @@
|
|||||||
import {
|
import {
|
||||||
IsDate,
|
IsDate,
|
||||||
IsNotEmpty,
|
IsNotEmpty,
|
||||||
|
IsOptional,
|
||||||
ValidateNested,
|
ValidateNested,
|
||||||
} from "class-validator";
|
} from "class-validator";
|
||||||
import { Contact, Document } from ".";
|
import { Contact, Document } from ".";
|
||||||
@ -14,10 +15,12 @@ export default class Customer extends Resource {
|
|||||||
public uid?: string;
|
public uid?: string;
|
||||||
|
|
||||||
@Expose()
|
@Expose()
|
||||||
|
@IsOptional({ groups : ["updateCustomer"]})
|
||||||
@IsNotEmpty({ groups: ["updateCustomer"], message: "Status is required" })
|
@IsNotEmpty({ groups: ["updateCustomer"], message: "Status is required" })
|
||||||
public status!: ECustomerStatus | string;
|
public status!: ECustomerStatus | string;
|
||||||
|
|
||||||
@Expose()
|
@Expose()
|
||||||
|
@IsOptional({ groups : ["updateCustomer"]})
|
||||||
@IsNotEmpty({ groups: ["createCustomer", "updateCustomer"], message: "Contact is required" })
|
@IsNotEmpty({ groups: ["createCustomer", "updateCustomer"], message: "Contact is required" })
|
||||||
@ValidateNested({ groups: ["createCustomer", "updateCustomer"] })
|
@ValidateNested({ groups: ["createCustomer", "updateCustomer"] })
|
||||||
@Type(() => Contact)
|
@Type(() => Contact)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user