Skip to content

Commit

Permalink
Merge pull request #184 from TogetherCrew/183-update-token-schema
Browse files Browse the repository at this point in the history
feat: extent the token schema to support Telegram platform
  • Loading branch information
Behzad-rabiei authored Dec 20, 2024
2 parents 7e457e8 + 3a4a64d commit aeedd61
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@togethercrew.dev/db",
"version": "3.0.77",
"version": "3.0.78",
"description": "All interactions with DB",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand Down
1 change: 1 addition & 0 deletions src/config/enums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@ export enum TokenTypeNames {
GOOGLE_ACCESS = 'google_access',
GOOGLE_REFRESH = 'google_refresh',
NOTION_ACCESS = 'notion_access',
TELEGRAM_VERIFICATION = 'telegram_verification',
}
1 change: 1 addition & 0 deletions src/interfaces/Token.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { type TokenTypeNames } from '../config/enums';
export interface IToken {
token: string;
user: Types.ObjectId;
community?: Types.ObjectId;
type: TokenTypeNames;
expires: Date;
blacklisted?: boolean;
Expand Down
4 changes: 4 additions & 0 deletions src/models/schemas/Token.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ const tokenSchema = new Schema<IToken>(
ref: 'User',
required: true,
},
community: {
type: Schema.Types.ObjectId,
ref: 'Community',
},
type: {
type: String,
enum: Object.values(TokenTypeNames),
Expand Down

0 comments on commit aeedd61

Please sign in to comment.