feat: creating chats for cards and clients, sending and deleting text messages

This commit is contained in:
2025-03-27 15:15:06 +04:00
parent 3bbdacdd68
commit f6c55012bd
37 changed files with 967 additions and 21 deletions

View File

@@ -0,0 +1,9 @@
/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type BaseMessageSchema = {
text: string;
chatId: number;
};

View File

@@ -12,6 +12,7 @@ import type { CardProductSchema } from './CardProductSchema';
import type { CardServiceSchema } from './CardServiceSchema';
import type { CardStatusHistorySchema } from './CardStatusHistorySchema';
import type { CardTagSchema } from './CardTagSchema';
import type { ChatSchema } from './ChatSchema';
import type { ClientSchema } from './ClientSchema';
import type { PalletSchema } from './PalletSchema';
import type { ShippingWarehouseSchema } from './ShippingWarehouseSchema';
@@ -42,5 +43,6 @@ export type CardSchema = {
employees?: Array<CardEmployeesSchema>;
tags?: Array<CardTagSchema>;
attributes: Array<CardAttributeSchema>;
chat: (ChatSchema | null);
};

View File

@@ -0,0 +1,12 @@
/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { TgGroupSchema } from './TgGroupSchema';
export type ChatSchema = {
id: number;
clientId: (number | null);
cardId: (number | null);
tgGroup: (TgGroupSchema | null);
};

View File

@@ -3,6 +3,7 @@
/* tslint:disable */
/* eslint-disable */
import type { BarcodeTemplateSchema } from './BarcodeTemplateSchema';
import type { ChatSchema } from './ChatSchema';
import type { ClientDetailsSchema } from './ClientDetailsSchema';
import type { ResidualBoxSchema } from './ResidualBoxSchema';
import type { ResidualPalletSchema } from './ResidualPalletSchema';
@@ -13,6 +14,7 @@ export type ClientDetailedSchema = {
barcodeTemplate?: (BarcodeTemplateSchema | null);
comment?: (string | null);
details?: (ClientDetailsSchema | null);
chat?: (ChatSchema | null);
pallets?: Array<ResidualPalletSchema>;
boxes?: Array<ResidualBoxSchema>;
};

View File

@@ -3,6 +3,7 @@
/* tslint:disable */
/* eslint-disable */
import type { BarcodeTemplateSchema } from './BarcodeTemplateSchema';
import type { ChatSchema } from './ChatSchema';
import type { ClientDetailsSchema } from './ClientDetailsSchema';
export type ClientSchema = {
id: number;
@@ -11,5 +12,6 @@ export type ClientSchema = {
barcodeTemplate?: (BarcodeTemplateSchema | null);
comment?: (string | null);
details?: (ClientDetailsSchema | null);
chat?: (ChatSchema | null);
};

View File

@@ -0,0 +1,9 @@
/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type CreateChatRequest = {
clientId: number;
cardId: (number | null);
};

View File

@@ -0,0 +1,9 @@
/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type CreateChatResponse = {
ok: boolean;
message: string;
};

View File

@@ -0,0 +1,9 @@
/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type DeleteMessageResponse = {
ok: boolean;
message: string;
};

View File

@@ -0,0 +1,9 @@
/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type GetChatRequest = {
clientId: number;
cardId: (number | null);
};

View File

@@ -0,0 +1,9 @@
/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { ChatSchema } from './ChatSchema';
export type GetChatResponse = {
chat: (ChatSchema | null);
};

View File

@@ -0,0 +1,10 @@
/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type GetMessagesRequest = {
chatId: number;
offset: number;
limit: number;
};

View File

@@ -0,0 +1,9 @@
/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { MessageSchema } from './MessageSchema';
export type GetMessagesResponse = {
messages: Array<MessageSchema>;
};

View File

@@ -0,0 +1,14 @@
/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { TgUserSchema } from './TgUserSchema';
export type MessageSchema = {
text: string;
chatId: number;
id: number;
createdAt: string;
tgSender: (TgUserSchema | null);
status: string;
};

View File

@@ -0,0 +1,9 @@
/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { BaseMessageSchema } from './BaseMessageSchema';
export type SendMessageRequest = {
message: BaseMessageSchema;
};

View File

@@ -0,0 +1,9 @@
/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type SendMessageResponse = {
ok: boolean;
message: string;
};

View File

@@ -0,0 +1,9 @@
/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type TgGroupSchema = {
tgGroupId: number;
tgInviteLink: string;
};

View File

@@ -0,0 +1,11 @@
/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type TgUserSchema = {
id: number;
firstName: string;
lastName: string;
username: string;
};