{"size": 2126, "ext": "js", "max_stars_repo_path": "src/api/v1/user/validation.js", "max_stars_repo_name": "igorlourenco/inflow-backend", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/api/v1/user/validation.js", "max_issues_repo_name": "igorlourenco/inflow-backend", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/api/v1/user/validation.js", "max_forks_repo_name": "igorlourenco/inflow-backend", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 22.1458333333, "max_line_length": 89, "alphanum_fraction": 0.5809031044}
/* eslint-disable sort-keys */
const { Joi } = require('express-validation');

const headers = {
  headers: Joi.object({
    authorization: Joi.string()
      .trim()
      .required()
      .label('Auth Token'),
  }).options({ allowUnknown: true }),
};

module.exports = {

  // POST /v1/user/wallet/connect
  connectWallet: {
    ...headers,
    body: Joi.object({ walletId: Joi.string().required() }),
  },

  // POST /v1/user/wallet/disconnect
  disconnectWallet: {
    ...headers,
    body: Joi.object({}),
  },

  // POST /v1/user/get_wallet
  getWalletId: {
    ...headers,
    body: Joi.object({ firebaseUserId: Joi.string().required() }),
  },

  // POST /v1/user/login
  loginUser: {
    // ...headers,
    body: Joi.object({
      phone: Joi.string().required(),
      // refreshToken: Joi.string().required(),
    }),
  },

  // POST /v1/user/register
  registerUser: {
    body: Joi.object({
      firebase_user_id: Joi.string().required(),
      name: Joi.string().optional(),
      phone: Joi.string().optional(),
      email: Joi.string().optional(),
      refresh_token: Joi.string().required(),
    }),
  },

  // POST /v1/user/update_wallet
  updateWalletId: {
    ...headers,
    body: Joi.object({
      firebaseUserId: Joi.string().required(),
      walletId: Joi.string().required(),
    }),
  },

  // GET /v1/user
  users: { ...headers },

  // GET /v1/user/wallet
  wallet: {
    ...headers,
    query: Joi.object({}),
  },

  // GET /v1/user/profile/get
  getProfilePayload: { body: Joi.object({ firebase_user_id: Joi.string().required() }) },

  // PATCH /v1/user/profile/update
  updateProfilePayload: {
    body: Joi.object({
      firebase_user_id: Joi.string().required(),
      address: Joi.string().trim(),
      city: Joi.string().trim(),
      country: Joi.string().trim(),
      currency: Joi.string().trim(),
      first_name: Joi.string().trim(),
      last_name: Joi.string().trim(),
      name: Joi.string().trim(),
      profile_image: Joi.string().trim(),
    }),
  },

  // DELETE /v1/user/profile/delete
  deleteProfilePayload: {
    ...headers,
    body: Joi.object({}),
  },

};
