You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: user_serializer.rb
    path of file: ./repos/vets-api/modules/mobile/app/serializers/mobile/v1
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

require 'jsonapi/serializer'

module Mobile
  module V1
    class UserSerializer < Mobile::V0::UserSerializer
      include JSONAPI::Serializer

      private

      def profile
        {
          first_name: user.first_name,
          preferred_name: user_demographics.demographics&.preferred_name&.text,
          middle_name: user.middle_name,
          last_name: user.last_name,
          contact_email: filter_keys(contact_info&.email, EMAIL_KEYS),
          signin_email: user.email,
          birth_date: user.birth_date.nil? ? nil : Date.parse(user.birth_date).iso8601,
          gender_identity: user_demographics.demographics&.gender_ide
    
      def profile
        {
          first_name: user.first_name,
          preferred_name: user_demographics.demographics&.preferred_name&.text,
          middle_name: user.middle_name,
          last_name: user.last_name,
          contact_email: filter_keys(contact_info&.email, EMAIL_KEYS),
          signin_email: user.email,
          birth_date: user.birth_date.nil? ? nil : Date.parse(user.birth_date).iso8601,
          gender_identity: user_demographics.demographics&.gender_identity&.code,
          residential_address: filter_keys(contact_info&.residential_address, ADDRESS_KEYS),
          mailing_address: filter_keys(contact_info&.mailing_address, ADDRESS_KEYS),
          home_phone_number: filter_keys(contact_info&.home_phone, PHONE_KEYS),
          mobile_phone_number: filter_keys(contact_info&.mobile_phone, PHONE_KEYS),
          work_phone_number: filter_keys(contact_info&.work_phone, PHONE_KEYS),
          signin_service: user.identity.sign_in[:service_name].remove('oauth_')
        }
      end