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