style: clean up code formatting and remove trailing whitespace

refactor: reorganize imports and fix type imports
This commit is contained in:
Evandro Fonseca Junior committed 2025-11-11 03:08:36 -03:00
1 parent d3704602fd
commit 47c04de6fe
232 files changed
+7140 -4798

No files matched your search

+5 -6
View File
@@ -2,7 +2,7 @@
* Model Chat - Representa uma conversa entre comprador e vendedor
*/
import mongoose, { Schema, model, models } from "mongoose";
import { model, models, Schema } from "mongoose";
export interface IChat {
chat_id: string; // ID único: `${listing_id}_${buyer_id}_${seller_id}`
@@ -16,7 +16,7 @@ export interface IChat {
buyer_unread_count: number;
seller_unread_count: number;
is_active: boolean; // Chat ativo (anúncio ainda disponível)
// Dados cached do anúncio (para performance)
listing_cache: {
item_name: string;
@@ -27,14 +27,14 @@ export interface IChat {
server_name: string;
listing_status: string;
};
// Dados cached dos usuários
buyer_cache: {
user_id: number;
username: string;
character_name?: string;
};
seller_cache: {
user_id: number;
username: string;
@@ -120,7 +120,7 @@ const ChatSchema = new Schema<IChat>(
{
timestamps: false, // Usamos campos manuais
collection: "chats",
}
},
);
// Índices compostos para queries eficientes
@@ -135,4 +135,3 @@ ChatSchema.pre("save", function (next) {
});
export const Chat = models.Chat || model<IChat>("Chat", ChatSchema);