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

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

const collection = "social-network-instagrams";

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

customsSchema(Schema);

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

const responseSchema = SocialNetworkInstagramsSchema.swagger({
  _id: "String",
  ...SocialNetworkInstagramsSchema.schemas.responseSchema,
}).definitions;
const connectSchema = SocialNetworkInstagramsSchema.swagger({
  _id: "String",
  ...SocialNetworkInstagramsSchema.schemas.connectSchema,
}).definitions;
const disconnectSchema = SocialNetworkInstagramsSchema.swagger({
  _id: "String",
  ...SocialNetworkInstagramsSchema.schemas.disconnectSchema,
}).definitions;
const sessionSchema = SocialNetworkInstagramsSchema.swagger({
  _id: "String",
  ...SocialNetworkInstagramsSchema.schemas.sessionSchema,
}).definitions;
const sendMessageSchema = SocialNetworkInstagramsSchema.swagger({
  _id: "String",
  ...SocialNetworkInstagramsSchema.schemas.sendMessageSchema,
}).definitions;
const sendPhotosSchema = SocialNetworkInstagramsSchema.swagger({
  _id: "String",
  ...SocialNetworkInstagramsSchema.schemas.sendPhotosSchema,
}).definitions;
const sendStoriesSchema = SocialNetworkInstagramsSchema.swagger({
  _id: "String",
  ...SocialNetworkInstagramsSchema.schemas.sendStoriesSchema,
}).definitions;
const sendVideosSchema = SocialNetworkInstagramsSchema.swagger({
  _id: "String",
  ...SocialNetworkInstagramsSchema.schemas.sendVideosSchema,
}).definitions;
const sendAudiosSchema = SocialNetworkInstagramsSchema.swagger({
  _id: "String",
  ...SocialNetworkInstagramsSchema.schemas.sendAudiosSchema,
}).definitions;
const publishMultimediaSchema = SocialNetworkInstagramsSchema.swagger({
  _id: "String",
  ...SocialNetworkInstagramsSchema.schemas.publishMultimediaSchema,
}).definitions;
const publishStorySchema = SocialNetworkInstagramsSchema.swagger({
  _id: "String",
  ...SocialNetworkInstagramsSchema.schemas.publishStorySchema,
}).definitions;
const deleteItem = DeleteSchema.swagger(
  DeleteSchema.schemas.parentSchema
).definitions;

export const SocialNetworkInstagramsModel = mongoose.model(collection, Schema);
export const SocialNetworkInstagramsModelSwagger = {
  SocialNetworkInstagramsGetItem: {
    type: "object",
    properties: getItem,
  },
  SocialNetworkInstagramsGetItems: {
    type: "object",
    properties: getItem,
  },
  SocialNetworkInstagramsCreateItem: {
    type: "object",
    properties: getItem,
  },
  SocialNetworkInstagramsUpdateItem: {
    type: "object",
    properties: getItem,
  },
  SocialNetworkInstagramsDeleteItem: {
    type: "object",
    properties: deleteItem,
  },
  SocialNetworkInstagramsSessionItem: {
    type: "object",
    properties: sessionSchema,
  },
  SocialNetworkInstagramsConnectItem: {
    type: "object",
    properties: connectSchema,
  },
  SocialNetworkInstagramsDisconnectItem: {
    type: "object",
    properties: disconnectSchema,
  },
  SocialNetworkInstagramsSendMessageItem: {
    type: "object",
    properties: sendMessageSchema,
  },
  SocialNetworkInstagramsSendStoriesItem: {
    type: "object",
    properties: sendStoriesSchema,
  },
  SocialNetworkInstagramsSendPhotosItem: {
    type: "object",
    properties: sendPhotosSchema,
  },
  SocialNetworkInstagramsSendVideosItem: {
    type: "object",
    properties: sendVideosSchema,
  },
  SocialNetworkInstagramsSendAudiosItem: {
    type: "object",
    properties: sendAudiosSchema,
  },
  SocialNetworkInstagramsPublishMultimediaItem: {
    type: "object",
    properties: publishMultimediaSchema,
  },
  SocialNetworkInstagramsPublishStoryItem: {
    type: "object",
    properties: publishStorySchema,
  },
  SocialNetworkInstagramsResponse: {
    type: "object",
    properties: responseSchema,
  },
};
