import { Module } from '@nestjs/common';
import { ModelsService } from './models.service';
import { MongooseModule } from '@nestjs/mongoose';
import * as Model from './index';


@Module({
    imports: [MongooseModule.forFeature([
        //user auth
        { name: "users", schema: Model.Users.UserSchema },
        { name: "sessions", schema: Model.Sessions.SessionSchema },
        { name: "otps", schema: Model.OTP.OTPSchema },

        //chat
        { name: "connections", schema: Model.Connections.ConnectionSchema },
        { name: "messages", schema: Model.Messages.MessageSchema },
        { name: "chat-medias", schema: Model.MessageMedias.MessageMediaSchema },
        { name: "group-members", schema: Model.GroupMembers.GroupMembersSchema },
        { name: "message-reactions", schema: Model.MessageReactions.ReactionEmojiSchema },
        { name: "block-users", schema: Model.BlockUser.BlockUserSchema },


        //call
        { name: "calls", schema: Model.Calling.CallingSchema },
        { name: "call-members", schema: Model.CallJoinedMember.CallJoinedMemberSchema },
        { name: "notifications", schema: Model.Notifications.NotificationSchema },
        
        { name : "pages", schema: Model.Pages.PagesSchema },
    

        { name : "settings", schema: Model.Settings.SettingsSchema },
        { name : "broadcasts", schema: Model.Broadcast.BroadcastSchema },

        // email templates
        { name : "email-templates", schema: Model.EmailTemplates.EmailTemplatesModel },

        // languages
        { name : "languages", schema: Model.Language.LanguageSchema },
        { name : "translation-keys", schema: Model.TranslationKey.TranslationKeySchema },
        { name : "translations", schema: Model.Translation.TranslationSchema },

    

        // catalog
        { name: "categories", schema: Model.Category.CategorySchema },
        { name: "insurers", schema: Model.Insurer.InsurerSchema },
        { name: "regions", schema: Model.Region.RegionSchema },

        // audit trail
        { name: "activity-logs", schema: Model.ActivityLog.ActivityLogSchema },

        // customers and leads
        { name: "customers", schema: Model.Customer.CustomerSchema },
        { name: "leads", schema: Model.Lead.LeadSchema },

        // products
        { name: "products", schema: Model.Product.ProductSchema },

        // policies
        { name: "policies", schema: Model.Policy.PolicySchema },
    ])],
    providers: [ModelsService],
    exports: [ModelsService]
})
export class ModelsModule { }
