2025-01-31 14:15:36 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								import  {  IMessageDatabase ,  Inbox  }  from  "@/src/models/inboxModel" ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								import  {  getAccountForRequest  }  from  "@/src/services/loginService" ; 
							 
						 
					
						
							
								
									
										
										
										
											2025-03-31 09:18:00 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								import  {  HydratedDocument ,  Types  }  from  "mongoose" ; 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-31 14:15:36 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								import  {  Request  }  from  "express" ; 
							 
						 
					
						
							
								
									
										
										
										
											2025-07-04 17:40:06 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								import  {  unixTimesInMs  }  from  "@/src/constants/timeConstants" ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								import  {  config  }  from  "@/src/services/configService" ; 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-31 14:15:36 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								export  const  getAllMessagesSorted  =  async  ( accountId : string ) :  Promise < HydratedDocument < IMessageDatabase > [ ] >  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    const  inbox  =  await  Inbox . find ( {  ownerId : accountId  } ) . sort ( {  date :  - 1  } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    return  inbox ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								export  const  getMessage  =  async  ( messageId : string ) :  Promise < HydratedDocument < IMessageDatabase > >  = >  { 
							 
						 
					
						
							
								
									
										
										
										
											2025-03-24 11:32:08 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    const  message  =  await  Inbox . findById ( messageId ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-31 14:15:36 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    if  ( ! message )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        throw  new  Error ( ` Message not found  ${ messageId } ` ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    return  message ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								export  const  deleteMessageRead  =  async  ( messageId : string ) :  Promise < void >  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    await  Inbox . findOneAndDelete ( {  _id : messageId ,  r : true  } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								export  const  deleteAllMessagesRead  =  async  ( accountId : string ) :  Promise < void >  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    await  Inbox . deleteMany ( {  ownerId : accountId ,  r : true  } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2025-02-24 20:56:34 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								export  const  createNewEventMessages  =  async  ( req : Request ) :  Promise < void >  = >  { 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-31 14:15:36 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    const  account  =  await  getAccountForRequest ( req ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2025-06-24 11:19:32 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    const  newEventMessages : IMessageCreationTemplate [ ]  =  [ ] ; 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-31 14:15:36 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2025-06-24 11:19:32 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    // Baro
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    const  baroIndex  =  Math . trunc ( ( Date . now ( )  -  910800000 )  /  ( unixTimesInMs . day  *  14 ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    const  baroStart  =  baroIndex  *  ( unixTimesInMs . day  *  14 )  +  910800000 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    const  baroActualStart  =  baroStart  +  unixTimesInMs . day  *  ( config . baroAlwaysAvailable  ?  0  : 12 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    if  ( account . LatestEventMessageDate . getTime ( )  <  baroActualStart )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        newEventMessages . push ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								            sndr :  "/Lotus/Language/G1Quests/VoidTraderName" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								            sub :  "/Lotus/Language/CommunityMessages/VoidTraderAppearanceTitle" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								            msg :  "/Lotus/Language/CommunityMessages/VoidTraderAppearanceMessage" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								            icon :  "/Lotus/Interface/Icons/Npcs/BaroKiTeerPortrait.png" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								            startDate : new  Date ( baroActualStart ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								            endDate : new  Date ( baroStart  +  unixTimesInMs . day  *  14 ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								            CrossPlatform : true , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								            arg :  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                    Key :  "NODE_NAME" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                    Tag :  [ "EarthHUB" ,  "MercuryHUB" ,  "SaturnHUB" ,  "PlutoHUB" ] [ baroIndex  %  4 ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								            ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								            date : new  Date ( baroActualStart ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-31 14:15:36 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2025-06-25 08:04:03 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    // BUG: Deleting the inbox message manually means it'll just be automatically re-created. This is because we don't use startDate/endDate for these config-toggled events.
 
							 
						 
					
						
							
								
									
										
										
										
											2025-07-14 20:24:17 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    const  promises  =  [ ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    if  ( config . worldState ? . creditBoost )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        promises . push ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								            ( async  ( ) :  Promise < void >  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                if  ( ! ( await  Inbox . exists ( {  ownerId : account._id ,  globaUpgradeId :  "5b23106f283a555109666672"  } ) ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                    newEventMessages . push ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                        globaUpgradeId : new  Types . ObjectId ( "5b23106f283a555109666672" ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                        sndr :  "/Lotus/Language/Menu/Mailbox_WarframeSender" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                        sub :  "/Lotus/Language/Items/EventDoubleCreditsName" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                        msg :  "/Lotus/Language/Items/EventDoubleCreditsDesc" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                        icon :  "/Lotus/Interface/Icons/Npcs/Lotus_d.png" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                        startDate : new  Date ( ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                        CrossPlatform : true 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                    } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								            } ) ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    if  ( config . worldState ? . affinityBoost )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        promises . push ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								            ( async  ( ) :  Promise < void >  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                if  ( ! ( await  Inbox . exists ( {  ownerId : account._id ,  globaUpgradeId :  "5b23106f283a555109666673"  } ) ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                    newEventMessages . push ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                        globaUpgradeId : new  Types . ObjectId ( "5b23106f283a555109666673" ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                        sndr :  "/Lotus/Language/Menu/Mailbox_WarframeSender" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                        sub :  "/Lotus/Language/Items/EventDoubleAffinityName" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                        msg :  "/Lotus/Language/Items/EventDoubleAffinityDesc" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                        icon :  "/Lotus/Interface/Icons/Npcs/Lotus_d.png" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                        startDate : new  Date ( ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                        CrossPlatform : true 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                    } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								            } ) ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    if  ( config . worldState ? . resourceBoost )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        promises . push ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								            ( async  ( ) :  Promise < void >  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                if  ( ! ( await  Inbox . exists ( {  ownerId : account._id ,  globaUpgradeId :  "5b23106f283a555109666674"  } ) ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                    newEventMessages . push ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                        globaUpgradeId : new  Types . ObjectId ( "5b23106f283a555109666674" ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                        sndr :  "/Lotus/Language/Menu/Mailbox_WarframeSender" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                        sub :  "/Lotus/Language/Items/EventDoubleResourceName" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                        msg :  "/Lotus/Language/Items/EventDoubleResourceDesc" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                        icon :  "/Lotus/Interface/Icons/Npcs/Lotus_d.png" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                        startDate : new  Date ( ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                        CrossPlatform : true 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                    } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								            } ) ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2025-06-25 08:04:03 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    if  ( config . worldState ? . galleonOfGhouls )  { 
							 
						 
					
						
							
								
									
										
										
										
											2025-07-14 20:24:17 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        promises . push ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								            ( async  ( ) :  Promise < void >  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                if  ( ! ( await  Inbox . exists ( {  ownerId : account._id ,  goalTag :  "GalleonRobbery"  } ) ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                    newEventMessages . push ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                        sndr :  "/Lotus/Language/Bosses/BossCouncilorVayHek" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                        sub :  "/Lotus/Language/Events/GalleonRobberyIntroMsgTitle" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                        msg :  "/Lotus/Language/Events/GalleonRobberyIntroMsgDesc" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                        icon :  "/Lotus/Interface/Icons/Npcs/VayHekPortrait.png" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                        transmission :  "/Lotus/Sounds/Dialog/GalleonOfGhouls/DGhoulsWeekOneInbox0010VayHek" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                        att :  [ "/Lotus/Upgrades/Skins/Events/OgrisOldSchool" ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                        startDate : new  Date ( ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                        goalTag :  "GalleonRobbery" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                    } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								            } ) ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2025-06-25 08:04:03 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2025-07-14 20:24:17 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    await  Promise . all ( promises ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2025-06-25 08:04:03 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2025-01-31 14:15:36 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    if  ( newEventMessages . length  ===  0 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2025-06-24 11:19:32 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    await  createMessage ( account . _id ,  newEventMessages ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-31 14:15:36 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    const  latestEventMessage  =  newEventMessages . reduce ( ( prev ,  current )  = > 
							 
						 
					
						
							
								
									
										
										
										
											2025-06-24 11:19:32 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        prev . startDate !  >  current . startDate !  ?  prev  : current 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-31 14:15:36 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2025-06-24 11:19:32 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    account . LatestEventMessageDate  =  new  Date ( latestEventMessage . startDate ! ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-31 14:15:36 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    await  account . save ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2025-06-18 05:50:43 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								export  const  createMessage  =  async  ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    accountId : string  |  Types . ObjectId , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    messages : IMessageCreationTemplate [ ] 
							 
						 
					
						
							
								
									
										
										
										
											2025-06-24 11:19:32 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								) :  Promise < void >  = >  { 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-31 14:15:36 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    const  ownerIdMessages  =  messages . map ( m  = >  ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        . . . m , 
							 
						 
					
						
							
								
									
										
										
										
											2025-06-24 11:19:32 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        date : m.date  ? ?  new  Date ( ) , 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-31 14:15:36 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								        ownerId : accountId 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    } ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2025-06-24 11:19:32 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    await  Inbox . insertMany ( ownerIdMessages ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-31 14:15:36 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								export  interface  IMessageCreationTemplate  extends  Omit < IMessageDatabase ,  "_id"  |  "date"  |  "ownerId" >  { 
							 
						 
					
						
							
								
									
										
										
										
											2025-06-24 11:19:32 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    date? : Date ; 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-31 14:15:36 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								}