taxtank-core 0.28.19 → 0.28.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,10 @@
1
+ import { Collection } from './collection';
2
+ import { Chat } from '../models/chat/chat';
3
+ import { Message } from '../models/chat/message';
4
+ export declare class ChatCollection extends Collection<Chat> {
5
+ /**
6
+ * Sort chats by last messages (newest first) + empty chats in the end
7
+ */
8
+ getSortedByNewest(messages: Message[]): this;
9
+ getActive(): this;
10
+ }
@@ -7,6 +7,11 @@ export declare class MessageCollection extends Collection<Message> {
7
7
  * Get List of unread chats
8
8
  */
9
9
  getUnread(): Message[];
10
+ getFromActiveChats(): this;
11
+ /**
12
+ * Get amount of chats that contains unread messages
13
+ */
14
+ getUnreadChatsAmount(isFromEmployee?: boolean): number;
10
15
  /**
11
16
  * Check if chat has unread chats
12
17
  */
@@ -1,9 +1,11 @@
1
1
  import { Message as MessageBase } from '../../db/Models/firm/message';
2
2
  import { User } from '../user/user';
3
3
  import { MessageDocument } from './message-document';
4
+ import { Chat } from './chat';
4
5
  export declare class Message extends MessageBase {
5
6
  createdAt: Date;
6
7
  employee: User;
8
+ chat: Chat;
7
9
  documents: MessageDocument[];
8
10
  /**
9
11
  * Check if message created today or not
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taxtank-core",
3
- "version": "0.28.19",
3
+ "version": "0.28.20",
4
4
  "private": false,
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^12.2.3 || ~13.0.0",
package/public-api.d.ts CHANGED
@@ -11,6 +11,7 @@ export * from './lib/collections/account-setup-item.collection';
11
11
  export * from './lib/collections/bank-account.collection';
12
12
  export * from './lib/collections/bank-transaction.collection';
13
13
  export * from './lib/collections/chart-accounts.collection';
14
+ export * from './lib/collections/chat.collection';
14
15
  export * from './lib/collections/client.collection';
15
16
  export * from './lib/collections/client-movement.collection';
16
17
  export * from './lib/collections/client-portfolio-report.collection';