Skip to content

Commit 33c70c0

Browse files
committed
refactor: remove unused DTOs, enums, and helper functions to clean up the codebase
1 parent b74fec7 commit 33c70c0

30 files changed

Lines changed: 11 additions & 519 deletions

backend/src/common/data-injection.tokens.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -153,15 +153,8 @@ export enum UseCaseType {
153153
GET_API_KEY = 'GET_API_KEY',
154154
DELETE_API_KEY = 'DELETE_API_KEY',
155155

156-
REQUEST_INFO_FROM_TABLE_WITH_AI = 'REQUEST_INFO_FROM_TABLE_WITH_AI',
157156
REQUEST_INFO_FROM_TABLE_WITH_AI_V2 = 'REQUEST_INFO_FROM_TABLE_WITH_AI_V2',
158157

159-
CREATE_THREAD_WITH_AI_ASSISTANT = 'CREATE_THREAD_WITH_AI_ASSISTANT',
160-
ADD_MESSAGE_TO_THREAD_WITH_AI_ASSISTANT = 'ADD_MESSAGE_TO_THREAD_WITH_AI_ASSISTANT',
161-
GET_ALL_USER_THREADS_WITH_AI_ASSISTANT = 'GET_ALL_USER_THREADS_WITH_AI_ASSISTANT',
162-
GET_ALL_THREAD_MESSAGES = 'GET_ALL_THREAD_MESSAGES',
163-
DELETE_THREAD_WITH_AI_ASSISTANT = 'DELETE_THREAD_WITH_AI_ASSISTANT',
164-
165158
CREATE_TABLE_FILTERS = 'CREATE_TABLE_FILTERS',
166159
FIND_TABLE_FILTERS = 'FIND_TABLE_FILTERS',
167160
DELETE_TABLE_FILTERS = 'DELETE_TABLE_FILTERS',

backend/src/entities/table-actions/table-action-rules-module/application/dto/create-action-rules-with-actions-and-events-body.dto.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { TableActionEventEnum } from '../../../../../enums/table-action-event-en
1919
import { applyDecorators } from '@nestjs/common';
2020
import { IsURLOptions } from 'validator';
2121

22-
export function IsUrlIfNotTest(validationOptions?: IsURLOptions) {
22+
function IsUrlIfNotTest(validationOptions?: IsURLOptions) {
2323
return function (object: NonNullable<unknown>, propertyName: string) {
2424
const decorators = [IsString()];
2525
if (process.env.NODE_ENV !== 'test') {

backend/src/entities/table/table-datastructures.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -47,20 +47,6 @@ export class ForeignKeyDSStructure {
4747
autocomplete_columns: Array<string>;
4848
}
4949

50-
export class PaginationRO {
51-
@ApiProperty()
52-
total: number;
53-
54-
@ApiProperty()
55-
lastPage: number;
56-
57-
@ApiProperty()
58-
perPage: number;
59-
60-
@ApiProperty()
61-
currentPage: number;
62-
}
63-
6450
export class PrimaryColumnNameDs {
6551
@ApiProperty()
6652
column_name: string;

backend/src/entities/user/application/data-structures/created-user.ds.ts

Lines changed: 0 additions & 6 deletions
This file was deleted.

backend/src/entities/user/application/data-structures/usual-register-user.ds.ts

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { ApiProperty } from '@nestjs/swagger';
22
import { UserRoleEnum } from '../../enums/user-role.enum.js';
33

4-
export class UsualRegisterUserDs {
4+
class UsualRegisterUserDs {
55
@ApiProperty()
66
email: string;
77

@@ -25,17 +25,3 @@ export class SaasUsualUserRegisterDS extends UsualRegisterUserDs {
2525
@ApiProperty({ required: false })
2626
companyName?: string;
2727
}
28-
29-
export class RegisterInvitedUserDS {
30-
@ApiProperty()
31-
email: string;
32-
33-
@ApiProperty()
34-
password: string;
35-
36-
@ApiProperty()
37-
name: string;
38-
39-
@ApiProperty()
40-
companyId: string;
41-
}
Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
import { SubscriptionLevelEnum } from '../../enums/index.js';
22

3-
export interface IUserData {
4-
id: string;
5-
}
6-
73
export interface IUserInfo {
84
id: string;
95
isActive: boolean;
@@ -13,4 +9,3 @@ export interface IUserInfo {
139
subscriptionLevel: SubscriptionLevelEnum;
1410
name: string;
1511
}
16-
Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,6 @@
1-
import { CreatedUserDs } from '../application/data-structures/created-user.ds.js';
21
import { SimpleFoundUserInfoDs } from '../dto/found-user.dto.js';
32
import { UserEntity } from '../user.entity.js';
43

5-
export function buildCreatedUserDs(user: UserEntity): CreatedUserDs {
6-
return {
7-
user: {
8-
id: user.id,
9-
createdAt: user.createdAt,
10-
},
11-
};
12-
}
13-
144
export function buildSimpleUserInfoDs(user: UserEntity): SimpleFoundUserInfoDs {
155
if (!user) {
166
return null;
@@ -26,4 +16,4 @@ export function buildSimpleUserInfoDs(user: UserEntity): SimpleFoundUserInfoDs {
2616
role: user.role,
2717
externalRegistrationProvider: user.externalRegistrationProvider,
2818
};
29-
}
19+
}

backend/src/entities/user/utils/is-jwt-scope-need.util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { CompanyInfoEntity } from '../../company-info/company-info.entity.js';
22
import { JwtScopesEnum } from '../enums/jwt-scopes.enum.js';
33
import { UserEntity } from '../user.entity.js';
44

5-
export function isJwt2faScopeNeed(user: UserEntity, userCompany: CompanyInfoEntity): boolean {
5+
function isJwt2faScopeNeed(user: UserEntity, userCompany: CompanyInfoEntity): boolean {
66
return userCompany?.is2faEnabled && !user.isOTPEnabled;
77
}
88

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
export { UpdateTableWidgetDto } from './update-table-widget.dto.js';
21
export { CreateTableWidgetDto } from './create-table-widget.dto.js';
32
export { CreateOrUpdateTableWidgetsDto } from './create-table-widget.dto.js';

backend/src/entities/widget/dto/update-table-widget.dto.ts

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)