import { schema as SocialNetworkSmssSchema } from "../../schemas/social-network/social-network-sms.schema";
import { schema as DeleteSchema } from "../../schemas/delete.schema";

import mongoose from "mongoose";
import { customsSchema } from "../abstract.model";

const collection = "social-network-smss";

const schemaModelsMongoose = SocialNetworkSmssSchema.mongoose(
  SocialNetworkSmssSchema.schemas.parentSchema
);
const AbstractSchemaOptions = {
  timestamps: true,
  versionKey: false,
};
const Schema = new mongoose.Schema(schemaModelsMongoose, AbstractSchemaOptions);

customsSchema(Schema);

const getItem = SocialNetworkSmssSchema.swagger({
  _id: "String",
  ...SocialNetworkSmssSchema.schemas.parentSchema,
}).definitions;
const sendMessageItem = SocialNetworkSmssSchema.swagger({
  _id: "String",
  ...SocialNetworkSmssSchema.schemas.sendMessageSchema,
}).definitions;
const verifyItem = SocialNetworkSmssSchema.swagger({
  _id: "String",
  ...SocialNetworkSmssSchema.schemas.verifySchema,
}).definitions;
const sendVerificationItem = SocialNetworkSmssSchema.swagger({
  _id: "String",
  ...SocialNetworkSmssSchema.schemas.sendVerificationSchema,
}).definitions;
const deleteItem = DeleteSchema.swagger(
  DeleteSchema.schemas.parentSchema
).definitions;

export const SocialNetworkSmssModel = mongoose.model(collection, Schema);
export const SocialNetworkSmssModelSwagger = {
  SocialNetworkSmssGetItem: {
    type: "object",
    properties: getItem,
  },
  SocialNetworkSmsVerifyItem: {
    type: "object",
    properties: verifyItem,
  },
  SocialNetworkSmsSendMessageItem: {
    type: "object",
    properties: sendMessageItem,
  },
  SocialNetworkSmsSendVerificationItem: {
    type: "object",
    properties: sendVerificationItem,
  },
  SocialNetworkSmssGetItems: {
    type: "object",
    properties: getItem,
  },
  SocialNetworkSmssCreateItem: {
    type: "object",
    properties: getItem,
  },
  SocialNetworkSmssUpdateItem: {
    type: "object",
    properties: getItem,
  },
  SocialNetworkSmssDeleteItem: {
    type: "object",
    properties: deleteItem,
  },
};
