@ -231,6 +231,7 @@ const fieldPhonesMock = {
|
||||
{
|
||||
primaryPhoneNumber: '',
|
||||
primaryPhoneCountryCode: '',
|
||||
primaryPhoneCallingCode: '',
|
||||
additionalPhones: {},
|
||||
},
|
||||
],
|
||||
|
||||
@ -150,6 +150,7 @@ export const mapFieldMetadataToGraphqlQuery = (
|
||||
{
|
||||
primaryPhoneNumber
|
||||
primaryPhoneCountryCode
|
||||
primaryPhoneCallingCode
|
||||
additionalPhones
|
||||
}
|
||||
`;
|
||||
|
||||
@ -31,6 +31,9 @@ describe('computeSchemaComponents', () => {
|
||||
primaryPhoneCountryCode: {
|
||||
type: 'string',
|
||||
},
|
||||
primaryPhoneCallingCode: {
|
||||
type: 'string',
|
||||
},
|
||||
primaryPhoneNumber: {
|
||||
type: 'string',
|
||||
},
|
||||
@ -216,6 +219,9 @@ describe('computeSchemaComponents', () => {
|
||||
primaryPhoneCountryCode: {
|
||||
type: 'string',
|
||||
},
|
||||
primaryPhoneCallingCode: {
|
||||
type: 'string',
|
||||
},
|
||||
primaryPhoneNumber: {
|
||||
type: 'string',
|
||||
},
|
||||
@ -400,6 +406,9 @@ describe('computeSchemaComponents', () => {
|
||||
primaryPhoneCountryCode: {
|
||||
type: 'string',
|
||||
},
|
||||
primaryPhoneCallingCode: {
|
||||
type: 'string',
|
||||
},
|
||||
primaryPhoneNumber: {
|
||||
type: 'string',
|
||||
},
|
||||
|
||||
@ -259,6 +259,9 @@ const getSchemaComponentsProperties = ({
|
||||
primaryPhoneCountryCode: {
|
||||
type: 'string',
|
||||
},
|
||||
primaryPhoneCallingCode: {
|
||||
type: 'string',
|
||||
},
|
||||
primaryPhoneNumber: {
|
||||
type: 'string',
|
||||
},
|
||||
|
||||
@ -18,6 +18,12 @@ export const phonesCompositeType: CompositeType = {
|
||||
hidden: false,
|
||||
isRequired: false,
|
||||
},
|
||||
{
|
||||
name: 'primaryPhoneCallingCode',
|
||||
type: FieldMetadataType.TEXT,
|
||||
hidden: false,
|
||||
isRequired: false,
|
||||
},
|
||||
{
|
||||
name: 'additionalPhones',
|
||||
type: FieldMetadataType.RAW_JSON,
|
||||
@ -30,5 +36,6 @@ export const phonesCompositeType: CompositeType = {
|
||||
export type PhonesMetadata = {
|
||||
primaryPhoneNumber: string;
|
||||
primaryPhoneCountryCode: string;
|
||||
primaryPhoneCallingCode: string;
|
||||
additionalPhones: object | null;
|
||||
};
|
||||
|
||||
@ -193,6 +193,10 @@ export class FieldMetadataDefaultValuePhones {
|
||||
@IsQuotedString()
|
||||
primaryPhoneCountryCode: string | null;
|
||||
|
||||
@ValidateIf((_object, value) => value !== null)
|
||||
@IsQuotedString()
|
||||
primaryPhoneCallingCode: string | null;
|
||||
|
||||
@ValidateIf((_object, value) => value !== null)
|
||||
@IsObject()
|
||||
additionalPhones: object | null;
|
||||
|
||||
@ -44,6 +44,7 @@ export function generateDefaultValue(
|
||||
return {
|
||||
primaryPhoneNumber: "''",
|
||||
primaryPhoneCountryCode: "''",
|
||||
primaryPhoneCallingCode: "''",
|
||||
additionalPhones: null,
|
||||
};
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user