diff --git a/__tests__/unit/models/channel.model.test.ts b/__tests__/unit/models/channel.model.test.ts index 33aa453..6235c9a 100644 --- a/__tests__/unit/models/channel.model.test.ts +++ b/__tests__/unit/models/channel.model.test.ts @@ -6,9 +6,9 @@ describe('Channel model', () => { let channel: IChannel; beforeEach(() => { channel = { - id: '123', + channelId: '123', name: 'channel1', - parent_id: 'admin', + parentId: 'admin', }; }); test('should correctly validate a valid Channel data', async () => { diff --git a/__tests__/unit/models/role.model.test.ts b/__tests__/unit/models/role.model.test.ts index df913d7..16cb530 100644 --- a/__tests__/unit/models/role.model.test.ts +++ b/__tests__/unit/models/role.model.test.ts @@ -6,7 +6,7 @@ describe('Role model', () => { let role: IRole; beforeEach(() => { role = { - id: '123', + roleId: '123', name: 'role1', color: 1234, }; diff --git a/package.json b/package.json index eb91e6f..f20e82a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@togethercrew.dev/db", - "version": "2.4.4", + "version": "2.4.5", "description": "All interactions with DB", "main": "./dist/index.js", "types": "./dist/index.d.ts", diff --git a/src/interfaces/Channel.interface.ts b/src/interfaces/Channel.interface.ts index c2bb953..9bbfb88 100644 --- a/src/interfaces/Channel.interface.ts +++ b/src/interfaces/Channel.interface.ts @@ -2,14 +2,14 @@ import { type Snowflake } from 'discord.js'; import { type Model } from 'mongoose'; export interface IChannel { - id: Snowflake; + channelId: Snowflake; name?: string | null; - parent_id?: string | null; + parentId?: string | null; } export interface IChannelUpdateBody { name?: string | null; - parent_id?: string | null; + parentId?: string | null; } export interface ChannelModel extends Model { diff --git a/src/interfaces/Role.interface.ts b/src/interfaces/Role.interface.ts index 7e5bc27..4141f07 100644 --- a/src/interfaces/Role.interface.ts +++ b/src/interfaces/Role.interface.ts @@ -2,7 +2,7 @@ import { type Snowflake } from 'discord.js'; import { type Model } from 'mongoose'; export interface IRole { - id: Snowflake; + roleId: Snowflake; name: string; color: number; } diff --git a/src/models/schemas/Channel.schema.ts b/src/models/schemas/Channel.schema.ts index 6db821d..7c15e38 100644 --- a/src/models/schemas/Channel.schema.ts +++ b/src/models/schemas/Channel.schema.ts @@ -3,14 +3,14 @@ import { toJSON } from './plugins'; import { IChannel, ChannelModel } from '../../interfaces'; const channelSchema = new Schema({ - id: { + channelId: { type: String, unique: true, }, name: { type: String, }, - parent_id: { + parentId: { type: String, }, }); diff --git a/src/models/schemas/Role.schema.ts b/src/models/schemas/Role.schema.ts index b85ded5..a38fe4b 100644 --- a/src/models/schemas/Role.schema.ts +++ b/src/models/schemas/Role.schema.ts @@ -3,7 +3,7 @@ import { toJSON } from './plugins'; import { IRole, RoleModel } from '../../interfaces'; const roleSchema = new Schema({ - id: { + roleId: { type: String, unique: true, },