@@ -447,3 +447,30 @@ export const buttonsMessageSchema: JSONSchema7 = {
447447 } ,
448448 required : [ 'number' ] ,
449449} ;
450+
451+ export const productMessageSchema : JSONSchema7 = {
452+ $id : v4 ( ) ,
453+ type : 'object' ,
454+ properties : {
455+ number : { ...numberDefinition } ,
456+ productId : { type : 'string' , minLength : 1 } ,
457+ businessOwnerJid : {
458+ type : 'string' ,
459+ pattern : '^[0-9]+@s[.]whatsapp[.]net$' ,
460+ description : '"businessOwnerJid" must look like "<phone>@s.whatsapp.net"' ,
461+ } ,
462+ productImage : { type : 'string' , minLength : 1 } ,
463+ retailerId : { type : 'string' } ,
464+ title : { type : 'string' } ,
465+ description : { type : 'string' } ,
466+ currencyCode : { type : 'string' , minLength : 3 , maxLength : 3 } ,
467+ priceAmount1000 : { type : 'integer' , minimum : 0 } ,
468+ url : { type : 'string' } ,
469+ productImageCount : { type : 'integer' , minimum : 1 } ,
470+ caption : { type : 'string' } ,
471+ delay : { type : 'integer' , description : 'Enter a value in milliseconds' } ,
472+ quoted : { ...quotedOptionsSchema } ,
473+ } ,
474+ required : [ 'number' , 'productId' , 'businessOwnerJid' , 'productImage' ] ,
475+ ...isNotEmpty ( 'number' , 'productId' , 'businessOwnerJid' , 'productImage' ) ,
476+ } ;
0 commit comments