export function getTextMessageInput(recipient, text) {
  return JSON.stringify({
    messaging_product: 'whatsapp',
    preview_url: false,
    recipient_type: 'individual',
    to: recipient,
    type: 'text',
    text: {
      body: text,
    },
  });
}

export function getTemplatedMessageInput(recipient, movie, seats) {
  return JSON.stringify({
    messaging_product: 'whatsapp',
    to: recipient,
    type: 'template',
    template: {
      name: 'sample_movie_ticket_confirmation',
      language: {
        code: 'en_US',
      },
      components: [
        {
          type: 'header',
          parameters: [
            {
              type: 'image',
              image: {
                link: movie.thumbnail,
              },
            },
          ],
        },
        {
          type: 'body',
          parameters: [
            {
              type: 'text',
              text: movie.title,
            },
            {
              type: 'date_time',
              date_time: {
                fallback_value: movie.time,
              },
            },
            {
              type: 'text',
              text: movie.venue,
            },
            {
              type: 'text',
              text: seats,
            },
          ],
        },
      ],
    },
  });
}
