@shizuoka-its/core 0.3.1 → 0.3.2-alpha.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.
|
@@ -1,9 +1,28 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Prisma } from "@prisma/client";
|
|
2
2
|
import type { IBaseRepository } from "./base.repository.interface";
|
|
3
|
-
|
|
4
|
-
exhibit:
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
type DefaultInclude = {
|
|
4
|
+
exhibit: true;
|
|
5
|
+
};
|
|
6
|
+
export interface ILightningTalkRepository extends IBaseRepository<Prisma.LightningTalkGetPayload<{
|
|
7
|
+
include: DefaultInclude;
|
|
8
|
+
}>, Prisma.LightningTalkCreateInput, Prisma.LightningTalkUpdateInput, Prisma.LightningTalkFindManyArgs> {
|
|
9
|
+
create(data: Prisma.LightningTalkCreateInput): Promise<Prisma.LightningTalkGetPayload<{
|
|
10
|
+
include: DefaultInclude;
|
|
11
|
+
}>>;
|
|
12
|
+
update(id: string, data: Prisma.LightningTalkUpdateInput): Promise<Prisma.LightningTalkGetPayload<{
|
|
13
|
+
include: DefaultInclude;
|
|
14
|
+
}>>;
|
|
15
|
+
delete(id: string): Promise<Prisma.LightningTalkGetPayload<{
|
|
16
|
+
include: DefaultInclude;
|
|
17
|
+
}>>;
|
|
18
|
+
findById<T extends Prisma.LightningTalkInclude>(id: string, include?: T): Promise<Prisma.LightningTalkGetPayload<{
|
|
19
|
+
include: DefaultInclude;
|
|
20
|
+
}> | null>;
|
|
21
|
+
findByEventId<T extends Prisma.LightningTalkInclude>(eventId: string, include?: T): Promise<Prisma.LightningTalkGetPayload<{
|
|
22
|
+
include: DefaultInclude;
|
|
23
|
+
}>[]>;
|
|
24
|
+
findMany(args?: Omit<Prisma.LightningTalkFindManyArgs, "include">): Promise<Prisma.LightningTalkGetPayload<{
|
|
25
|
+
include: DefaultInclude;
|
|
26
|
+
}>[]>;
|
|
9
27
|
}
|
|
28
|
+
export {};
|
|
@@ -1,26 +1,30 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Prisma, PrismaClient } from "@prisma/client";
|
|
2
2
|
import { BaseRepository } from "./base.repository";
|
|
3
3
|
import type { ILightningTalkRepository } from "./interfaces/lightningTalk.repository.interface";
|
|
4
|
-
|
|
5
|
-
exhibit:
|
|
6
|
-
}
|
|
4
|
+
type DefaultInclude = {
|
|
5
|
+
exhibit: true;
|
|
6
|
+
};
|
|
7
|
+
export declare class LightningTalkRepository extends BaseRepository<Prisma.LightningTalkGetPayload<{
|
|
8
|
+
include: DefaultInclude;
|
|
9
|
+
}>, Prisma.LightningTalkCreateInput, Prisma.LightningTalkUpdateInput, Prisma.LightningTalkFindManyArgs> implements ILightningTalkRepository {
|
|
7
10
|
constructor(prisma: PrismaClient);
|
|
8
|
-
create(data: Prisma.LightningTalkCreateInput): Promise<
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
update(id: string, data: Prisma.LightningTalkUpdateInput): Promise<
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
delete(id: string): Promise<
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
findById(id: string): Promise<
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
findByEventId(eventId: string): Promise<
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
findMany(args?: Prisma.LightningTalkFindManyArgs): Promise<
|
|
24
|
-
|
|
25
|
-
}
|
|
11
|
+
create(data: Prisma.LightningTalkCreateInput): Promise<Prisma.LightningTalkGetPayload<{
|
|
12
|
+
include: DefaultInclude;
|
|
13
|
+
}>>;
|
|
14
|
+
update(id: string, data: Prisma.LightningTalkUpdateInput): Promise<Prisma.LightningTalkGetPayload<{
|
|
15
|
+
include: DefaultInclude;
|
|
16
|
+
}>>;
|
|
17
|
+
delete(id: string): Promise<Prisma.LightningTalkGetPayload<{
|
|
18
|
+
include: DefaultInclude;
|
|
19
|
+
}>>;
|
|
20
|
+
findById(id: string, include?: Prisma.LightningTalkInclude): Promise<Prisma.LightningTalkGetPayload<{
|
|
21
|
+
include: DefaultInclude;
|
|
22
|
+
}> | null>;
|
|
23
|
+
findByEventId(eventId: string, include?: Prisma.LightningTalkInclude): Promise<Prisma.LightningTalkGetPayload<{
|
|
24
|
+
include: DefaultInclude;
|
|
25
|
+
}>[]>;
|
|
26
|
+
findMany(args?: Omit<Prisma.LightningTalkFindManyArgs, "include">): Promise<Prisma.LightningTalkGetPayload<{
|
|
27
|
+
include: DefaultInclude;
|
|
28
|
+
}>[]>;
|
|
26
29
|
}
|
|
30
|
+
export {};
|
|
@@ -25,46 +25,26 @@ class LightningTalkRepository extends base_repository_1.BaseRepository {
|
|
|
25
25
|
include: { exhibit: true },
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
|
-
async findById(id) {
|
|
28
|
+
async findById(id, include) {
|
|
29
29
|
return this.prisma.lightningTalk.findUnique({
|
|
30
30
|
where: { exhibitId: id },
|
|
31
|
-
include: {
|
|
32
|
-
exhibit: {
|
|
33
|
-
include: {
|
|
34
|
-
members: {
|
|
35
|
-
include: {
|
|
36
|
-
member: true,
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
},
|
|
31
|
+
include: { ...include, exhibit: true },
|
|
42
32
|
});
|
|
43
33
|
}
|
|
44
|
-
async findByEventId(eventId) {
|
|
34
|
+
async findByEventId(eventId, include) {
|
|
45
35
|
return this.prisma.lightningTalk.findMany({
|
|
46
36
|
where: {
|
|
47
37
|
exhibit: {
|
|
48
38
|
eventId,
|
|
49
39
|
},
|
|
50
40
|
},
|
|
51
|
-
include: {
|
|
52
|
-
exhibit: {
|
|
53
|
-
include: {
|
|
54
|
-
members: {
|
|
55
|
-
include: {
|
|
56
|
-
member: true,
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
},
|
|
41
|
+
include: { ...include, exhibit: true },
|
|
62
42
|
});
|
|
63
43
|
}
|
|
64
44
|
async findMany(args) {
|
|
65
45
|
return this.prisma.lightningTalk.findMany({
|
|
66
46
|
...args,
|
|
67
|
-
include: {
|
|
47
|
+
include: { exhibit: true },
|
|
68
48
|
});
|
|
69
49
|
}
|
|
70
50
|
}
|
|
@@ -8,7 +8,11 @@ class LightningTalkService extends base_service_1.BaseService {
|
|
|
8
8
|
this.exhibitRepository = exhibitRepository;
|
|
9
9
|
}
|
|
10
10
|
async findById(id) {
|
|
11
|
-
return this.repository.findById(id
|
|
11
|
+
return this.repository.findById(id, {
|
|
12
|
+
exhibit: {
|
|
13
|
+
include: { members: true, event: true },
|
|
14
|
+
},
|
|
15
|
+
});
|
|
12
16
|
}
|
|
13
17
|
async create(data) {
|
|
14
18
|
// 展示の存在確認
|
|
@@ -52,7 +56,11 @@ class LightningTalkService extends base_service_1.BaseService {
|
|
|
52
56
|
return this.repository.findMany();
|
|
53
57
|
}
|
|
54
58
|
async findByEventId(eventId) {
|
|
55
|
-
return this.repository.findByEventId(eventId
|
|
59
|
+
return this.repository.findByEventId(eventId, {
|
|
60
|
+
exhibit: {
|
|
61
|
+
include: { members: true, event: true },
|
|
62
|
+
},
|
|
63
|
+
});
|
|
56
64
|
}
|
|
57
65
|
}
|
|
58
66
|
exports.LightningTalkService = LightningTalkService;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shizuoka-its/core",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2-alpha.0",
|
|
4
4
|
"description": "ITS core library",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -11,7 +11,10 @@
|
|
|
11
11
|
"publishConfig": {
|
|
12
12
|
"access": "public"
|
|
13
13
|
},
|
|
14
|
-
"files": [
|
|
14
|
+
"files": [
|
|
15
|
+
"dist",
|
|
16
|
+
"prisma"
|
|
17
|
+
],
|
|
15
18
|
"scripts": {
|
|
16
19
|
"postinstall": "prisma generate",
|
|
17
20
|
"build": "tsc",
|
|
@@ -38,5 +41,6 @@
|
|
|
38
41
|
},
|
|
39
42
|
"dependencies": {
|
|
40
43
|
"@prisma/client": "^5.22.0"
|
|
41
|
-
}
|
|
44
|
+
},
|
|
45
|
+
"packageManager": "yarn@1.22.22+sha1.ac34549e6aa8e7ead463a7407e1c7390f61a6610"
|
|
42
46
|
}
|