echadospalante-core 14.14.0 → 14.16.0
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/dist/app/modules/infrastructure/database/entities/publication-clap.data.d.ts +2 -0
- package/dist/app/modules/infrastructure/database/entities/publication-clap.data.js +12 -1
- package/dist/app/modules/infrastructure/database/entities/venture-publication.data.js +2 -2
- package/package.json +1 -1
- package/src/app/modules/infrastructure/database/entities/publication-clap.data.ts +8 -0
- package/src/app/modules/infrastructure/database/entities/venture-publication.data.ts +2 -2
@@ -2,6 +2,8 @@ import { VenturePublicationData } from "./venture-publication.data";
|
|
2
2
|
import { UserData } from "./user.data";
|
3
3
|
export declare class PublicationClapData {
|
4
4
|
id: string;
|
5
|
+
publicationId: string;
|
6
|
+
userId: string;
|
5
7
|
publication: VenturePublicationData;
|
6
8
|
user: UserData;
|
7
9
|
createdAt: Date;
|
@@ -15,6 +15,8 @@ const venture_publication_data_1 = require("./venture-publication.data");
|
|
15
15
|
const user_data_1 = require("./user.data");
|
16
16
|
let PublicationClapData = class PublicationClapData {
|
17
17
|
id;
|
18
|
+
publicationId;
|
19
|
+
userId;
|
18
20
|
publication;
|
19
21
|
user;
|
20
22
|
createdAt;
|
@@ -24,6 +26,14 @@ __decorate([
|
|
24
26
|
(0, typeorm_1.PrimaryGeneratedColumn)("uuid"),
|
25
27
|
__metadata("design:type", String)
|
26
28
|
], PublicationClapData.prototype, "id", void 0);
|
29
|
+
__decorate([
|
30
|
+
(0, typeorm_1.Column)(),
|
31
|
+
__metadata("design:type", String)
|
32
|
+
], PublicationClapData.prototype, "publicationId", void 0);
|
33
|
+
__decorate([
|
34
|
+
(0, typeorm_1.Column)(),
|
35
|
+
__metadata("design:type", String)
|
36
|
+
], PublicationClapData.prototype, "userId", void 0);
|
27
37
|
__decorate([
|
28
38
|
(0, typeorm_1.ManyToOne)(() => venture_publication_data_1.VenturePublicationData, (venturePublication) => venturePublication.claps),
|
29
39
|
(0, typeorm_1.JoinColumn)({ name: "publicationId" }),
|
@@ -39,5 +49,6 @@ __decorate([
|
|
39
49
|
__metadata("design:type", Date)
|
40
50
|
], PublicationClapData.prototype, "createdAt", void 0);
|
41
51
|
exports.PublicationClapData = PublicationClapData = __decorate([
|
42
|
-
(0, typeorm_1.Entity)({ name: "publication_clap" })
|
52
|
+
(0, typeorm_1.Entity)({ name: "publication_clap" }),
|
53
|
+
(0, typeorm_1.Unique)(["publicationId", "userId"])
|
43
54
|
], PublicationClapData);
|
@@ -48,11 +48,11 @@ __decorate([
|
|
48
48
|
__metadata("design:type", venture_data_1.VentureData)
|
49
49
|
], VenturePublicationData.prototype, "venture", void 0);
|
50
50
|
__decorate([
|
51
|
-
(0, typeorm_1.Column)(),
|
51
|
+
(0, typeorm_1.Column)({ default: 0 }),
|
52
52
|
__metadata("design:type", Number)
|
53
53
|
], VenturePublicationData.prototype, "clapsCount", void 0);
|
54
54
|
__decorate([
|
55
|
-
(0, typeorm_1.Column)(),
|
55
|
+
(0, typeorm_1.Column)({ default: 0 }),
|
56
56
|
__metadata("design:type", Number)
|
57
57
|
], VenturePublicationData.prototype, "commentsCount", void 0);
|
58
58
|
__decorate([
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "echadospalante-core",
|
3
|
-
"version": "14.
|
3
|
+
"version": "14.16.0",
|
4
4
|
"description": "This package contains the core of the echadospalante project, it contains the domain entities, helpers, and other utilities that are shared between the different services.",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"types": "dist/index.d.ts",
|
@@ -6,16 +6,24 @@ import {
|
|
6
6
|
CreateDateColumn,
|
7
7
|
ManyToOne,
|
8
8
|
JoinColumn,
|
9
|
+
Unique,
|
9
10
|
} from "typeorm";
|
10
11
|
|
11
12
|
import { VenturePublicationData } from "./venture-publication.data";
|
12
13
|
import { UserData } from "./user.data";
|
13
14
|
|
14
15
|
@Entity({ name: "publication_clap" })
|
16
|
+
@Unique(["publicationId", "userId"])
|
15
17
|
export class PublicationClapData {
|
16
18
|
@PrimaryGeneratedColumn("uuid")
|
17
19
|
id: string;
|
18
20
|
|
21
|
+
@Column()
|
22
|
+
publicationId: string;
|
23
|
+
|
24
|
+
@Column()
|
25
|
+
userId: string;
|
26
|
+
|
19
27
|
@ManyToOne(
|
20
28
|
() => VenturePublicationData,
|
21
29
|
(venturePublication) => venturePublication.claps
|
@@ -30,10 +30,10 @@ export class VenturePublicationData {
|
|
30
30
|
@JoinColumn({ name: "ventureId" })
|
31
31
|
venture?: VentureData;
|
32
32
|
|
33
|
-
@Column()
|
33
|
+
@Column({ default: 0 })
|
34
34
|
clapsCount: number;
|
35
35
|
|
36
|
-
@Column()
|
36
|
+
@Column({ default: 0 })
|
37
37
|
commentsCount: number;
|
38
38
|
|
39
39
|
@OneToMany(
|