Skip to content

Commit

Permalink
feat: update
Browse files Browse the repository at this point in the history
  • Loading branch information
Adson Gomes Oliveira committed Jan 22, 2025
1 parent 711d4c6 commit 6b49a48
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tablerise/database-management",
"version": "5.3.1",
"version": "5.3.25e",
"description": "A library to manage the project database",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
4 changes: 2 additions & 2 deletions src/interfaces/CharactersDnd.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ImageObject } from "./Common";
import { ImageObject, Logs } from "./Common";

export interface CharactersDnd {
characterId: string;
Expand All @@ -8,7 +8,7 @@ export interface CharactersDnd {
data: Data;
npc: boolean;
picture: string;
logs: string[];
logs: Logs[];
createdAt: string;
updatedAt: string;
}
Expand Down
5 changes: 5 additions & 0 deletions src/interfaces/Common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,8 @@ export interface ImageObject {
deleteUrl: string;
request: ImageObjectRequest;
}

export interface Logs {
message: string;
loggedAt: string;
}
8 changes: 7 additions & 1 deletion src/models/character/CharactersDndModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import newUUID from '../../helpers/newUUID';
import MongoModel from '../MongoModel';
import { AbilityScore, AlliesAndOrgs, Appearance, Attack, Author, Characteristics, CharactersDnd, Damage, Data, DeathSaves, HitPoints, Money, Other, Profile, SpellCasting, SpellLevel, Spells, Stats } from '../../interfaces/CharactersDnd';
import CommonModelSchemas from '../common/CommonModelSchemas';
import { Logs } from '../../interfaces/Common';

const authorMongooseSchema = new Schema<Author>(
{
Expand Down Expand Up @@ -197,6 +198,11 @@ const dataMongooseSchema = new Schema<Data>(
{ _id: false }
);

const characterLogsDndMongooseSchema = new Schema<Logs>({
message: { type: String, required: true },
loggedAt: { type: String, required: true }
}, { _id: false });


const charactersDndMongooseSchema = new Schema<CharactersDnd>(
{
Expand All @@ -207,7 +213,7 @@ const charactersDndMongooseSchema = new Schema<CharactersDnd>(
data: { type: dataMongooseSchema },
npc: {type: Boolean },
picture: CommonModelSchemas.pictureMongooseSchema,
logs: { type: [String] },
logs: { type: [characterLogsDndMongooseSchema] },
createdAt: { type: String, required: true },
updatedAt: { type: String, required: true },
},
Expand Down

0 comments on commit 6b49a48

Please sign in to comment.