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

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

const collection = "social-network-connects";

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

customsSchema(Schema);

const getItem = SocialNetworkConnectsSchema.swagger({
  _id: "String",
  ...SocialNetworkConnectsSchema.schemas.parentSchema,
}).definitions;
const deleteItem = DeleteSchema.swagger(
  DeleteSchema.schemas.parentSchema
).definitions;

export const SocialNetworkConnectsModel = mongoose.model(collection, Schema);
export const SocialNetworkConnectsModelSwagger = {
  SocialNetworkConnectsGetItem: {
    type: "object",
    properties: getItem,
  },
  SocialNetworkConnectsGetItems: {
    type: "object",
    properties: getItem,
  },
  SocialNetworkConnectsCreateItem: {
    type: "object",
    properties: getItem,
  },
  SocialNetworkConnectsUpdateItem: {
    type: "object",
    properties: getItem,
  },
  SocialNetworkConnectsDeleteItem: {
    type: "object",
    properties: deleteItem,
  },
};
