dl-commons 0.0.2-testing.17 → 0.0.2-testing.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dl-commons",
3
3
  "type": "commonjs",
4
- "version": "0.0.2-testing.17",
4
+ "version": "0.0.2-testing.19",
5
5
  "description": "distance learning commons",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
package/src/index.ts CHANGED
@@ -110,6 +110,7 @@ import { Picture, PictureSchema, PictureDocument } from './models/schemas/embedd
110
110
  import { IPicture } from './models/interfaces/picture.interface';
111
111
  import { IAuthor } from './models/interfaces/author.interface';
112
112
  import { Author, AuthorDocument, AuthorSchema } from './models/schemas/embedded/author.schema';
113
+ import { CropAreaDTO } from './models/dtos/commons/crop-area.dto';
113
114
 
114
115
  export {
115
116
  /**
@@ -168,6 +169,7 @@ export {
168
169
  * DTOs
169
170
  */
170
171
  I18nDTO,
172
+ CropAreaDTO,
171
173
 
172
174
  /**
173
175
  * Interfaces
@@ -0,0 +1,19 @@
1
+ import { IsInt, IsNotEmpty } from 'class-validator';
2
+
3
+ export class CropAreaDTO {
4
+ @IsNotEmpty()
5
+ @IsInt()
6
+ x1: number;
7
+
8
+ @IsNotEmpty()
9
+ @IsInt()
10
+ x2: number;
11
+
12
+ @IsNotEmpty()
13
+ @IsInt()
14
+ y1: number;
15
+
16
+ @IsNotEmpty()
17
+ @IsInt()
18
+ y2: number;
19
+ }
@@ -1,6 +1,8 @@
1
- import { Types } from "mongoose";
1
+ import { Types } from 'mongoose';
2
2
 
3
3
  export interface IAuthor {
4
4
  userId?: Types.ObjectId | string | null | undefined;
5
- fullName: string;
5
+ firstName?: string | null | undefined;
6
+ lastName?: string | null | undefined;
7
+ pid?: string | null | undefined;
6
8
  }
@@ -7,8 +7,14 @@ export class Author implements IAuthor {
7
7
  @Prop({ type: MongooseSchema.Types.ObjectId, default: null })
8
8
  userId: Types.ObjectId | string | null | undefined;
9
9
 
10
- @Prop({ type: String, required: true, default: null })
11
- fullName: string;
10
+ @Prop({ type: String, required: false, default: null })
11
+ pid: string | null | undefined;
12
+
13
+ @Prop({ type: String, required: false, default: null })
14
+ firstName: string | null | undefined;
15
+
16
+ @Prop({ type: String, required: false, default: null })
17
+ lastName: string | null | undefined;
12
18
  }
13
19
 
14
20
  export const AuthorSchema = SchemaFactory.createForClass(Author);
@@ -12,10 +12,10 @@ export class Picture implements IPicture {
12
12
  original: IFileEmbedded;
13
13
 
14
14
  @Prop({ type: FileEmbeddedSchema, required: false, default: null })
15
- cropped: IFileEmbedded;
15
+ cropped: IFileEmbedded | null | undefined;
16
16
 
17
17
  @Prop({ type: CropAreaSchema, required: false, default: null })
18
- cropArea: ICropArea;
18
+ cropArea: ICropArea | null | undefined;
19
19
  }
20
20
 
21
21
  export const PictureSchema = SchemaFactory.createForClass(Picture);