echadospalante-core 14.5.0 → 14.7.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/domain/publications/category.d.ts +10 -0
- package/dist/app/modules/domain/publications/category.js +2 -0
- package/dist/app/modules/domain/publications/index.d.ts +1 -0
- package/dist/app/modules/domain/publications/publication.d.ts +2 -0
- package/dist/app/modules/infrastructure/database/entities/publication-category.data.d.ts +10 -0
- package/dist/app/modules/infrastructure/database/entities/publication-category.data.js +62 -0
- package/dist/app/modules/infrastructure/database/entities/venture-publication.data.d.ts +2 -0
- package/dist/app/modules/infrastructure/database/entities/venture-publication.data.js +9 -3
- package/package.json +1 -1
- package/src/app/modules/domain/publications/category.ts +11 -0
- package/src/app/modules/domain/publications/index.ts +1 -0
- package/src/app/modules/domain/publications/publication.ts +2 -0
- package/src/app/modules/infrastructure/database/entities/publication-category.data.ts +43 -0
- package/src/app/modules/infrastructure/database/entities/venture-publication.data.ts +16 -3
@@ -1,5 +1,6 @@
|
|
1
1
|
import { ContentType } from "../common";
|
2
2
|
import { Venture } from "../ventures/venture";
|
3
|
+
import { PublicationCategory } from "./category";
|
3
4
|
import { PublicationClap } from "./clap";
|
4
5
|
import { PublicationComment } from "./comment";
|
5
6
|
export interface VenturePublication {
|
@@ -12,6 +13,7 @@ export interface VenturePublication {
|
|
12
13
|
claps: PublicationClap[];
|
13
14
|
comments: PublicationComment[];
|
14
15
|
contents: PublicationContent[];
|
16
|
+
categories: PublicationCategory[];
|
15
17
|
createdAt: Date;
|
16
18
|
}
|
17
19
|
export declare enum PublicationType {
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { VenturePublicationData } from "./venture-publication.data";
|
2
|
+
export declare class PublicationCategoryData {
|
3
|
+
id: string;
|
4
|
+
name: string;
|
5
|
+
slug: string;
|
6
|
+
description: string;
|
7
|
+
createdAt: Date;
|
8
|
+
updatedAt: Date;
|
9
|
+
publications: VenturePublicationData[];
|
10
|
+
}
|
@@ -0,0 +1,62 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
7
|
+
};
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
10
|
+
};
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
exports.PublicationCategoryData = void 0;
|
13
|
+
const typeorm_1 = require("typeorm");
|
14
|
+
const venture_event_data_1 = require("./venture-event.data");
|
15
|
+
let PublicationCategoryData = class PublicationCategoryData {
|
16
|
+
id;
|
17
|
+
name;
|
18
|
+
slug;
|
19
|
+
description;
|
20
|
+
createdAt;
|
21
|
+
updatedAt;
|
22
|
+
publications;
|
23
|
+
};
|
24
|
+
exports.PublicationCategoryData = PublicationCategoryData;
|
25
|
+
__decorate([
|
26
|
+
(0, typeorm_1.PrimaryGeneratedColumn)("uuid"),
|
27
|
+
__metadata("design:type", String)
|
28
|
+
], PublicationCategoryData.prototype, "id", void 0);
|
29
|
+
__decorate([
|
30
|
+
(0, typeorm_1.Column)({ unique: true }),
|
31
|
+
__metadata("design:type", String)
|
32
|
+
], PublicationCategoryData.prototype, "name", void 0);
|
33
|
+
__decorate([
|
34
|
+
(0, typeorm_1.Column)({ unique: true }),
|
35
|
+
__metadata("design:type", String)
|
36
|
+
], PublicationCategoryData.prototype, "slug", void 0);
|
37
|
+
__decorate([
|
38
|
+
(0, typeorm_1.Column)(),
|
39
|
+
__metadata("design:type", String)
|
40
|
+
], PublicationCategoryData.prototype, "description", void 0);
|
41
|
+
__decorate([
|
42
|
+
(0, typeorm_1.CreateDateColumn)(),
|
43
|
+
__metadata("design:type", Date)
|
44
|
+
], PublicationCategoryData.prototype, "createdAt", void 0);
|
45
|
+
__decorate([
|
46
|
+
(0, typeorm_1.UpdateDateColumn)(),
|
47
|
+
__metadata("design:type", Date)
|
48
|
+
], PublicationCategoryData.prototype, "updatedAt", void 0);
|
49
|
+
__decorate([
|
50
|
+
(0, typeorm_1.ManyToMany)(() => venture_event_data_1.VentureEventData, (ventureEvent) => ventureEvent.categories),
|
51
|
+
(0, typeorm_1.JoinTable)({
|
52
|
+
name: "x_publication_publication_category",
|
53
|
+
joinColumn: { name: "categoryId", referencedColumnName: "id" },
|
54
|
+
inverseJoinColumn: { name: "publicationId", referencedColumnName: "id" },
|
55
|
+
}),
|
56
|
+
__metadata("design:type", Array)
|
57
|
+
], PublicationCategoryData.prototype, "publications", void 0);
|
58
|
+
exports.PublicationCategoryData = PublicationCategoryData = __decorate([
|
59
|
+
(0, typeorm_1.Entity)({
|
60
|
+
name: "event_category",
|
61
|
+
})
|
62
|
+
], PublicationCategoryData);
|
@@ -3,6 +3,7 @@ import { PublicationCommentData } from "./publication-comment.data";
|
|
3
3
|
import { PublicationContentData } from "./publication-content.data";
|
4
4
|
import { PublicationType } from "../../../domain/publications";
|
5
5
|
import { VentureData } from "./venture.data";
|
6
|
+
import { PublicationCategoryData } from "./publication-category.data";
|
6
7
|
export declare class VenturePublicationData {
|
7
8
|
id: string;
|
8
9
|
description: string;
|
@@ -13,5 +14,6 @@ export declare class VenturePublicationData {
|
|
13
14
|
claps: PublicationClapData[];
|
14
15
|
comments: PublicationCommentData[];
|
15
16
|
contents: PublicationContentData[];
|
17
|
+
categories: PublicationCategoryData[];
|
16
18
|
createdAt: Date;
|
17
19
|
}
|
@@ -16,6 +16,7 @@ const publication_comment_data_1 = require("./publication-comment.data");
|
|
16
16
|
const publication_content_data_1 = require("./publication-content.data");
|
17
17
|
const publications_1 = require("../../../domain/publications");
|
18
18
|
const venture_data_1 = require("./venture.data");
|
19
|
+
const publication_category_data_1 = require("./publication-category.data");
|
19
20
|
let VenturePublicationData = class VenturePublicationData {
|
20
21
|
id;
|
21
22
|
description;
|
@@ -26,6 +27,7 @@ let VenturePublicationData = class VenturePublicationData {
|
|
26
27
|
claps;
|
27
28
|
comments;
|
28
29
|
contents;
|
30
|
+
categories;
|
29
31
|
createdAt;
|
30
32
|
};
|
31
33
|
exports.VenturePublicationData = VenturePublicationData;
|
@@ -55,17 +57,21 @@ __decorate([
|
|
55
57
|
__metadata("design:type", String)
|
56
58
|
], VenturePublicationData.prototype, "type", void 0);
|
57
59
|
__decorate([
|
58
|
-
(0, typeorm_1.OneToMany)(() => publication_clap_data_1.PublicationClapData, (publicationClap) => publicationClap.publication),
|
60
|
+
(0, typeorm_1.OneToMany)(() => publication_clap_data_1.PublicationClapData, (publicationClap) => publicationClap.publication, { eager: true, cascade: true }),
|
59
61
|
__metadata("design:type", Array)
|
60
62
|
], VenturePublicationData.prototype, "claps", void 0);
|
61
63
|
__decorate([
|
62
|
-
(0, typeorm_1.OneToMany)(() => publication_comment_data_1.PublicationCommentData, (publicationComment) => publicationComment.publication),
|
64
|
+
(0, typeorm_1.OneToMany)(() => publication_comment_data_1.PublicationCommentData, (publicationComment) => publicationComment.publication, { eager: true, cascade: true }),
|
63
65
|
__metadata("design:type", Array)
|
64
66
|
], VenturePublicationData.prototype, "comments", void 0);
|
65
67
|
__decorate([
|
66
|
-
(0, typeorm_1.OneToMany)(() => publication_content_data_1.PublicationContentData, (publicationContent) => publicationContent.publication),
|
68
|
+
(0, typeorm_1.OneToMany)(() => publication_content_data_1.PublicationContentData, (publicationContent) => publicationContent.publication, { eager: true, cascade: true }),
|
67
69
|
__metadata("design:type", Array)
|
68
70
|
], VenturePublicationData.prototype, "contents", void 0);
|
71
|
+
__decorate([
|
72
|
+
(0, typeorm_1.ManyToMany)(() => publication_category_data_1.PublicationCategoryData, (publicationCategory) => publicationCategory.publications, { eager: true }),
|
73
|
+
__metadata("design:type", Array)
|
74
|
+
], VenturePublicationData.prototype, "categories", void 0);
|
69
75
|
__decorate([
|
70
76
|
(0, typeorm_1.CreateDateColumn)(),
|
71
77
|
__metadata("design:type", Date)
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "echadospalante-core",
|
3
|
-
"version": "14.
|
3
|
+
"version": "14.7.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",
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { ContentType } from "../common";
|
2
2
|
import { Venture } from "../ventures/venture";
|
3
|
+
import { PublicationCategory } from "./category";
|
3
4
|
import { PublicationClap } from "./clap";
|
4
5
|
import { PublicationComment } from "./comment";
|
5
6
|
|
@@ -13,6 +14,7 @@ export interface VenturePublication {
|
|
13
14
|
claps: PublicationClap[];
|
14
15
|
comments: PublicationComment[];
|
15
16
|
contents: PublicationContent[];
|
17
|
+
categories: PublicationCategory[];
|
16
18
|
createdAt: Date;
|
17
19
|
}
|
18
20
|
|
@@ -0,0 +1,43 @@
|
|
1
|
+
// event-category.entity.ts
|
2
|
+
import {
|
3
|
+
Entity,
|
4
|
+
PrimaryGeneratedColumn,
|
5
|
+
Column,
|
6
|
+
CreateDateColumn,
|
7
|
+
UpdateDateColumn,
|
8
|
+
ManyToMany,
|
9
|
+
JoinTable,
|
10
|
+
} from "typeorm";
|
11
|
+
import { VentureEventData } from "./venture-event.data";
|
12
|
+
import { VenturePublicationData } from "./venture-publication.data";
|
13
|
+
|
14
|
+
@Entity({
|
15
|
+
name: "event_category",
|
16
|
+
})
|
17
|
+
export class PublicationCategoryData {
|
18
|
+
@PrimaryGeneratedColumn("uuid")
|
19
|
+
id: string;
|
20
|
+
|
21
|
+
@Column({ unique: true })
|
22
|
+
name: string;
|
23
|
+
|
24
|
+
@Column({ unique: true })
|
25
|
+
slug: string;
|
26
|
+
|
27
|
+
@Column()
|
28
|
+
description: string;
|
29
|
+
|
30
|
+
@CreateDateColumn()
|
31
|
+
createdAt: Date;
|
32
|
+
|
33
|
+
@UpdateDateColumn()
|
34
|
+
updatedAt: Date;
|
35
|
+
|
36
|
+
@ManyToMany(() => VentureEventData, (ventureEvent) => ventureEvent.categories)
|
37
|
+
@JoinTable({
|
38
|
+
name: "x_publication_publication_category",
|
39
|
+
joinColumn: { name: "categoryId", referencedColumnName: "id" },
|
40
|
+
inverseJoinColumn: { name: "publicationId", referencedColumnName: "id" },
|
41
|
+
})
|
42
|
+
publications: VenturePublicationData[];
|
43
|
+
}
|
@@ -4,6 +4,7 @@ import {
|
|
4
4
|
CreateDateColumn,
|
5
5
|
Entity,
|
6
6
|
JoinColumn,
|
7
|
+
ManyToMany,
|
7
8
|
ManyToOne,
|
8
9
|
OneToMany,
|
9
10
|
PrimaryGeneratedColumn,
|
@@ -14,6 +15,8 @@ import { PublicationCommentData } from "./publication-comment.data";
|
|
14
15
|
import { PublicationContentData } from "./publication-content.data";
|
15
16
|
import { PublicationType } from "../../../domain/publications";
|
16
17
|
import { VentureData } from "./venture.data";
|
18
|
+
import { PublicationCategoryData } from "./publication-category.data";
|
19
|
+
import { EventCategoryData } from "./event-category.data";
|
17
20
|
|
18
21
|
@Entity({ name: "venture_publication" })
|
19
22
|
export class VenturePublicationData {
|
@@ -38,22 +41,32 @@ export class VenturePublicationData {
|
|
38
41
|
|
39
42
|
@OneToMany(
|
40
43
|
() => PublicationClapData,
|
41
|
-
(publicationClap) => publicationClap.publication
|
44
|
+
(publicationClap) => publicationClap.publication,
|
45
|
+
{ eager: true, cascade: true }
|
42
46
|
)
|
43
47
|
claps: PublicationClapData[];
|
44
48
|
|
45
49
|
@OneToMany(
|
46
50
|
() => PublicationCommentData,
|
47
|
-
(publicationComment) => publicationComment.publication
|
51
|
+
(publicationComment) => publicationComment.publication,
|
52
|
+
{ eager: true, cascade: true }
|
48
53
|
)
|
49
54
|
comments: PublicationCommentData[];
|
50
55
|
|
51
56
|
@OneToMany(
|
52
57
|
() => PublicationContentData,
|
53
|
-
(publicationContent) => publicationContent.publication
|
58
|
+
(publicationContent) => publicationContent.publication,
|
59
|
+
{ eager: true, cascade: true }
|
54
60
|
)
|
55
61
|
contents: PublicationContentData[];
|
56
62
|
|
63
|
+
@ManyToMany(
|
64
|
+
() => PublicationCategoryData,
|
65
|
+
(publicationCategory) => publicationCategory.publications,
|
66
|
+
{ eager: true }
|
67
|
+
)
|
68
|
+
categories: PublicationCategoryData[];
|
69
|
+
|
57
70
|
@CreateDateColumn()
|
58
71
|
createdAt: Date;
|
59
72
|
}
|