Skip to content

Commit 3d7c9e2

Browse files
committed
Refactor test program.
1 parent 3699189 commit 3d7c9e2

12 files changed

Lines changed: 253 additions & 228 deletions

File tree

docs/ERD.md

Lines changed: 87 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
# PROJECT
2+
23
> Generated by [`prisma-markdown`](https://github.com/samchon/prisma-markdown)
34
45
- [Articles](#articles)
56

67
## Articles
8+
79
```mermaid
810
erDiagram
911
"attachment_files" {
@@ -63,27 +65,30 @@ erDiagram
6365
```
6466

6567
### `attachment_files`
68+
6669
Attachment File.
6770

6871
Every attachment files that are managed in current system.
6972

7073
For reference, it is possible to omit one of file name or extension like
7174
`.gitignore` or `README` case, but not possible to omit both of them.
7275

73-
**Properties**
74-
- `id`:
75-
- `name`
76-
> File name, except extension.
77-
>
78-
> If there's file `.gitignore`, then its name is an empty string.
79-
- `extension`
80-
> Extension.
81-
>
82-
> Possible to omit like `README` case.
83-
- `url`: URL path of the real file.
84-
- `created_at`: Creation time of file.
76+
Properties as follows:
77+
78+
- `id`:
79+
- `name`
80+
> File name, except extension.
81+
>
82+
> If there's file `.gitignore`, then its name is an empty string.
83+
- `extension`
84+
> Extension.
85+
>
86+
> Possible to omit like `README` case.
87+
- `url`: URL path of the real file.
88+
- `created_at`: Creation time of file.
8589

8690
### `bbs_articles`
91+
8792
Article entity.
8893

8994
`bbs_articles` is a super-type entity of all kinds of articles in the
@@ -105,38 +110,42 @@ the article is designed in this structure.
105110

106111
In other words, to keep evidence, and prevent fraud.
107112

108-
**Properties**
109-
- `id`:
110-
- `created_at`: Creation time of article.
111-
- `deleted_at`
112-
> Deletion time of article.
113-
>
114-
> To keep evidence, do not delete the article, but just mark it as
115-
> deleted.
113+
Properties as follows:
114+
115+
- `id`:
116+
- `created_at`: Creation time of article.
117+
- `deleted_at`
118+
> Deletion time of article.
119+
>
120+
> To keep evidence, do not delete the article, but just mark it as
121+
> deleted.
116122
117123
### `bbs_article_snapshots`
124+
118125
Snapshot of article.
119126

120127
`bbs_article_snapshots` is a snapshot entity that contains the contents of
121128
the article, as mentioned in [bbs_articles](#bbs_articles), the contents of the
122129
article are separated from the article record to keep evidence and prevent
123130
fraud.
124131

125-
**Properties**
126-
- `id`:
127-
- `bbs_article_id`: Belong article's [bbs_articles.id](#bbs_articles)
128-
- `format`
129-
> Format of body.
130-
>
131-
> Same meaning with extension like `html`, `md`, `txt`.
132-
- `title`: Title of article.
133-
- `body`: Content body of article.
134-
- `created_at`
135-
> Creation time of record.
136-
>
137-
> It means creation time or update time or article.
132+
Properties as follows:
133+
134+
- `id`:
135+
- `bbs_article_id`: Belong article's [bbs_articles.id](#bbs_articles)
136+
- `format`
137+
> Format of body.
138+
>
139+
> Same meaning with extension like `html`, `md`, `txt`.
140+
- `title`: Title of article.
141+
- `body`: Content body of article.
142+
- `created_at`
143+
> Creation time of record.
144+
>
145+
> It means creation time or update time or article.
138146
139147
### `bbs_article_snapshot_files`
148+
140149
Attachment file of article snapshot.
141150

142151
`bbs_article_snapshot_files` is an entity that shapes the attached files of
@@ -148,13 +157,15 @@ resolve the M: N relationship between [bbs_article_snapshots](#bbs_article_snaps
148157
files, it has an additional `sequence` attribute, which we will continue to
149158
see in this documents.
150159

151-
**Properties**
152-
- `id`:
153-
- `bbs_article_snapshot_id`: Belonged snapshot's [bbs_article_snapshots.id](#bbs_article_snapshots)
154-
- `attachment_file_id`: Belonged file's [attachment_files.id](#attachment_files)
155-
- `sequence`: Sequence of attachment file in the snapshot.
160+
Properties as follows:
161+
162+
- `id`:
163+
- `bbs_article_snapshot_id`: Belonged snapshot's [bbs_article_snapshots.id](#bbs_article_snapshots)
164+
- `attachment_file_id`: Belonged file's [attachment_files.id](#attachment_files)
165+
- `sequence`: Sequence of attachment file in the snapshot.
156166

157167
### `bbs_article_comments`
168+
158169
Comment written on an article.
159170

160171
`bbs_article_comments` is an entity that shapes the comments written on an
@@ -169,21 +180,23 @@ the comment is modified.
169180
Also, `bbs_article_comments` is expressing the relationship of the
170181
hierarchical reply structure through the `parent_id` attribute.
171182

172-
**Properties**
173-
- `id`:
174-
- `bbs_article_id`: Belonged article's [bbs_articles.id](#bbs_articles)
175-
- `parent_id`
176-
> Parent comment's [bbs_article_comments.id](#bbs_article_comments)
177-
>
178-
> Used to express the hierarchical reply structure.
179-
- `created_at`: Creation time of comment.
180-
- `deleted_at`
181-
> Deletion time of comment.
182-
>
183-
> Do not allow to delete the comment, but just mark it as deleted,
184-
> to keep evidence.
183+
Properties as follows:
184+
185+
- `id`:
186+
- `bbs_article_id`: Belonged article's [bbs_articles.id](#bbs_articles)
187+
- `parent_id`
188+
> Parent comment's [bbs_article_comments.id](#bbs_article_comments)
189+
>
190+
> Used to express the hierarchical reply structure.
191+
- `created_at`: Creation time of comment.
192+
- `deleted_at`
193+
> Deletion time of comment.
194+
>
195+
> Do not allow to delete the comment, but just mark it as deleted,
196+
> to keep evidence.
185197
186198
### `bbs_article_comment_snapshots`
199+
187200
Snapshot of comment.
188201

189202
`bbs_article_comment_snapshots` is a snapshot entity that contains the
@@ -192,31 +205,34 @@ contents of the comment.
192205
As mentioned in [bbs_article_comments](#bbs_article_comments), designed to keep evidence
193206
and prevent fraud.
194207

195-
**Properties**
196-
- `id`:
197-
- `bbs_article_comment_id`: Belonged article's [bbs_article_comments.id](#bbs_article_comments)
198-
- `format`
199-
> Format of content body.
200-
>
201-
> Same meaning with extension like `html`, `md`, `txt`.
202-
- `body`: Content body of comment.
203-
- `created_at`
204-
> Creation time of record.
205-
>
206-
> It means creation time or update time or comment.
208+
Properties as follows:
209+
210+
- `id`:
211+
- `bbs_article_comment_id`: Belonged article's [bbs_article_comments.id](#bbs_article_comments)
212+
- `format`
213+
> Format of content body.
214+
>
215+
> Same meaning with extension like `html`, `md`, `txt`.
216+
- `body`: Content body of comment.
217+
- `created_at`
218+
> Creation time of record.
219+
>
220+
> It means creation time or update time or comment.
207221
208222
### `bbs_article_comment_snapshot_files`
223+
209224
Attachment file of comment snapshot.
210225

211226
`bbs_article_comment_snapshot_files` is an entity resolving the M:N
212227
relationship between [bbs_article_comment_snapshots](#bbs_article_comment_snapshots) and
213228
[attachment_files](#attachment_files) tables.
214229

215-
**Properties**
216-
- `id`:
217-
- `bbs_article_comment_snapshot_id`: Belonged snapshot's [bbs_article_comment_snapshots.id](#bbs_article_comment_snapshots)
218-
- `attachment_file_id`: Belonged file's [attachment_files.id](#attachment_files)
219-
- `sequence`
220-
> Sequence order.
221-
>
222-
> Sequence order of the attached file in the belonged snapshot.
230+
Properties as follows:
231+
232+
- `id`:
233+
- `bbs_article_comment_snapshot_id`: Belonged snapshot's [bbs_article_comment_snapshots.id](#bbs_article_comment_snapshots)
234+
- `attachment_file_id`: Belonged file's [attachment_files.id](#attachment_files)
235+
- `sequence`
236+
> Sequence order.
237+
>
238+
> Sequence order of the attached file in the belonged snapshot.

src/api/functional/monitors/health/index.ts

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import typia from "typia";
1919
* @nestia Generated by Nestia - https://github.com/samchon/nestia
2020
*/
2121
export async function get(connection: IConnection): Promise<void> {
22-
return !!connection.simulate
22+
return true === connection.simulate
2323
? get.simulate(connection)
2424
: PlainFetcher.fetch(connection, {
2525
...get.METADATA,
@@ -40,13 +40,8 @@ export namespace get {
4040
} as const;
4141

4242
export const path = () => "/monitors/health";
43-
export const random = (g?: Partial<typia.IRandomGenerator>): void =>
44-
typia.random<void>(g);
45-
export const simulate = (connection: IConnection): void => {
46-
return random(
47-
"object" === typeof connection.simulate && null !== connection.simulate
48-
? connection.simulate
49-
: undefined,
50-
);
43+
export const random = (): void => typia.random<void>();
44+
export const simulate = (_connection: IConnection): void => {
45+
return random();
5146
};
5247
}

src/api/functional/monitors/performance/index.ts

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import type { IPerformance } from "../../../structures/monitors/IPerformance";
2424
* @nestia Generated by Nestia - https://github.com/samchon/nestia
2525
*/
2626
export async function get(connection: IConnection): Promise<get.Output> {
27-
return !!connection.simulate
27+
return true === connection.simulate
2828
? get.simulate(connection)
2929
: PlainFetcher.fetch(connection, {
3030
...get.METADATA,
@@ -47,13 +47,8 @@ export namespace get {
4747
} as const;
4848

4949
export const path = () => "/monitors/performance";
50-
export const random = (g?: Partial<typia.IRandomGenerator>): IPerformance =>
51-
typia.random<IPerformance>(g);
52-
export const simulate = (connection: IConnection): Output => {
53-
return random(
54-
"object" === typeof connection.simulate && null !== connection.simulate
55-
? connection.simulate
56-
: undefined,
57-
);
50+
export const random = (): IPerformance => typia.random<IPerformance>();
51+
export const simulate = (_connection: IConnection): Output => {
52+
return random();
5853
};
5954
}

src/api/functional/monitors/system/index.ts

Lines changed: 12 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import type { ISystem } from "../../../structures/monitors/ISystem";
2424
* @nestia Generated by Nestia - https://github.com/samchon/nestia
2525
*/
2626
export async function get(connection: IConnection): Promise<get.Output> {
27-
return !!connection.simulate
27+
return true === connection.simulate
2828
? get.simulate(connection)
2929
: PlainFetcher.fetch(connection, {
3030
...get.METADATA,
@@ -47,14 +47,9 @@ export namespace get {
4747
} as const;
4848

4949
export const path = () => "/monitors/system";
50-
export const random = (g?: Partial<typia.IRandomGenerator>): ISystem =>
51-
typia.random<ISystem>(g);
52-
export const simulate = (connection: IConnection): Output => {
53-
return random(
54-
"object" === typeof connection.simulate && null !== connection.simulate
55-
? connection.simulate
56-
: undefined,
57-
);
50+
export const random = (): ISystem => typia.random<ISystem>();
51+
export const simulate = (_connection: IConnection): Output => {
52+
return random();
5853
};
5954
}
6055

@@ -67,7 +62,7 @@ export namespace get {
6762
export async function internal_server_error(
6863
connection: IConnection,
6964
): Promise<void> {
70-
return !!connection.simulate
65+
return true === connection.simulate
7166
? internal_server_error.simulate(connection)
7267
: PlainFetcher.fetch(connection, {
7368
...internal_server_error.METADATA,
@@ -88,14 +83,9 @@ export namespace internal_server_error {
8883
} as const;
8984

9085
export const path = () => "/monitors/system/internal_server_error";
91-
export const random = (g?: Partial<typia.IRandomGenerator>): void =>
92-
typia.random<void>(g);
93-
export const simulate = (connection: IConnection): void => {
94-
return random(
95-
"object" === typeof connection.simulate && null !== connection.simulate
96-
? connection.simulate
97-
: undefined,
98-
);
86+
export const random = (): void => typia.random<void>();
87+
export const simulate = (_connection: IConnection): void => {
88+
return random();
9989
};
10090
}
10191

@@ -108,7 +98,7 @@ export namespace internal_server_error {
10898
export async function uncaught_exception(
10999
connection: IConnection,
110100
): Promise<void> {
111-
return !!connection.simulate
101+
return true === connection.simulate
112102
? uncaught_exception.simulate(connection)
113103
: PlainFetcher.fetch(connection, {
114104
...uncaught_exception.METADATA,
@@ -129,13 +119,8 @@ export namespace uncaught_exception {
129119
} as const;
130120

131121
export const path = () => "/monitors/system/uncaught_exception";
132-
export const random = (g?: Partial<typia.IRandomGenerator>): void =>
133-
typia.random<void>(g);
134-
export const simulate = (connection: IConnection): void => {
135-
return random(
136-
"object" === typeof connection.simulate && null !== connection.simulate
137-
? connection.simulate
138-
: undefined,
139-
);
122+
export const random = (): void => typia.random<void>();
123+
export const simulate = (_connection: IConnection): void => {
124+
return random();
140125
};
141126
}

0 commit comments

Comments
 (0)