@things-factory/worklist 10.1.271 → 10.1.272
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-client/bootstrap.d.ts +1 -0
- package/dist-client/bootstrap.js +1 -0
- package/dist-client/bootstrap.js.map +1 -1
- package/dist-client/components/person-question-todo.d.ts +16 -0
- package/dist-client/components/person-question-todo.js +75 -0
- package/dist-client/components/person-question-todo.js.map +1 -0
- package/dist-client/components/source-link.d.ts +1 -1
- package/dist-client/pages/activity-instance/activity-instance-view.d.ts +1 -1
- package/dist-client/pages/activity-thread/activity-thread-page.d.ts +1 -1
- package/dist-client/route.d.ts +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/controllers/activity-instance/complete.js +4 -0
- package/dist-server/controllers/activity-instance/complete.js.map +1 -1
- package/dist-server/controllers/activity-instance/hand-out.d.ts +2 -0
- package/dist-server/controllers/activity-instance/hand-out.js +7 -0
- package/dist-server/controllers/activity-instance/hand-out.js.map +1 -1
- package/dist-server/service/activity/index.d.ts +1 -1
- package/dist-server/service/activity-instance/index.d.ts +1 -1
- package/dist-server/service/activity-template/index.d.ts +1 -1
- package/dist-server/service/activity-thread/index.d.ts +1 -1
- package/dist-server/service/approval-notice/approval-notice-rules.d.ts +9 -0
- package/dist-server/service/approval-notice/approval-notice-rules.js +25 -1
- package/dist-server/service/approval-notice/approval-notice-rules.js.map +1 -1
- package/dist-server/service/approval-notice/approval-notice.d.ts +10 -0
- package/dist-server/service/approval-notice/approval-notice.js +27 -0
- package/dist-server/service/approval-notice/approval-notice.js.map +1 -1
- package/dist-server/service/index.d.ts +5 -3
- package/dist-server/service/index.js +12 -2
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/service/person-question/index.d.ts +4 -0
- package/dist-server/service/person-question/index.js +19 -0
- package/dist-server/service/person-question/index.js.map +1 -0
- package/dist-server/service/person-question/person-question-activity.d.ts +67 -0
- package/dist-server/service/person-question/person-question-activity.js +46 -0
- package/dist-server/service/person-question/person-question-activity.js.map +1 -0
- package/dist-server/service/person-question/person-question-card.d.ts +1 -0
- package/dist-server/service/person-question/person-question-card.js +36 -0
- package/dist-server/service/person-question/person-question-card.js.map +1 -0
- package/dist-server/service/person-question/person-question-resolver.d.ts +10 -0
- package/dist-server/service/person-question/person-question-resolver.js +54 -0
- package/dist-server/service/person-question/person-question-resolver.js.map +1 -0
- package/dist-server/service/person-question/person-question-service.d.ts +17 -0
- package/dist-server/service/person-question/person-question-service.js +86 -0
- package/dist-server/service/person-question/person-question-service.js.map +1 -0
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -4
- package/tests/complete-db.test.ts +2 -1
- package/tests/hand-out-notice-db.test.ts +99 -0
- package/tests/person-question-db.test.ts +158 -0
- package/translations/en.json +21 -1
- package/translations/es.json +21 -1
- package/translations/ja.json +21 -1
- package/translations/ko.json +21 -1
- package/translations/ms.json +21 -1
- package/translations/zh.json +21 -1
|
@@ -4,6 +4,8 @@ exports.complete = complete;
|
|
|
4
4
|
const typeorm_1 = require("typeorm");
|
|
5
5
|
const activity_thread_js_1 = require("../../service/activity-thread/activity-thread.js");
|
|
6
6
|
const activity_instance_js_1 = require("../../service/activity-instance/activity-instance.js");
|
|
7
|
+
const notification_1 = require("@things-factory/notification");
|
|
8
|
+
const approval_notice_rules_js_1 = require("../../service/approval-notice/approval-notice-rules.js");
|
|
7
9
|
const common_js_1 = require("../common.js");
|
|
8
10
|
/**
|
|
9
11
|
* Ends a case whose work is done - every thread still open ends as done, then the case ends. The counterpart of
|
|
@@ -46,6 +48,8 @@ async function complete({ id, reason, output }, context) {
|
|
|
46
48
|
updater: user,
|
|
47
49
|
terminatedAt: now
|
|
48
50
|
});
|
|
51
|
+
/* Its work done, the notice that handed it out is closed (ADR-0200 decision 3). */
|
|
52
|
+
await (0, notification_1.closeNotices)(tx, domain, 'todo', (0, approval_notice_rules_js_1.todoNoticeKey)(thread.id));
|
|
49
53
|
}
|
|
50
54
|
}
|
|
51
55
|
return await repository.save({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"complete.js","sourceRoot":"","sources":["../../../server/controllers/activity-instance/complete.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"complete.js","sourceRoot":"","sources":["../../../server/controllers/activity-instance/complete.ts"],"names":[],"mappings":";;AAqBA,4BAoDC;AAzED,qCAA4B;AAE5B,yFAAuG;AACvG,+FAA+G;AAC/G,+DAA2D;AAE3D,qGAAsF;AACtF,4CAAwD;AAExD;;;;;;;;;;;GAWG;AACI,KAAK,UAAU,QAAQ,CAC5B,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAiE,EACrF,OAAwB;IAExB,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;IAC1C,MAAM,UAAU,GAAG,EAAE,CAAC,aAAa,CAAC,uCAAgB,CAAC,CAAA;IAErD,MAAM,gBAAgB,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC;QAChD,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;QACxC,SAAS,EAAE,CAAC,QAAQ,EAAE,UAAU,EAAE,iBAAiB,EAAE,eAAe,EAAE,iBAAiB,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,CAAC;KACxI,CAAC,CAAA;IAEF,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,mCAAmC,EAAE,EAAE,gBAAgB,EAAE,EAAE,EAAE,CAAC,CAAC,CAAA;IAC3F,CAAC;IAED,IAAI,gBAAgB,CAAC,KAAK,IAAI,6CAAsB,CAAC,OAAO,IAAI,gBAAgB,CAAC,KAAK,IAAI,6CAAsB,CAAC,KAAK,EAAE,CAAC;QACvH,MAAM,IAAI,KAAK,CAAC,OA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,EAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,IAAA,wCAAa,EAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAA;QAClE,CAAC;IACH,CAAC;IAED,OAAO,MAAM,UAAU,CAAC,IAAI,CAAC;QAC3B,GAAG,gBAAgB;QACnB,eAAe,EAAE,SAAS;QAC1B,MAAM;QACN,GAAG,CAAC,MAAM,IAAA,qCAAyB,EAAC,EAAE,EAAE,OAAO,CAAC,CAAC;QACjD,SAAS,EAAE,gBAAgB,CAAC,SAAS,IAAI,GAAG;QAC5C,WAAW,EAAE,KAAK;QAClB,OAAO,EAAE,IAAI;QACb,YAAY,EAAE,GAAG;QACjB,UAAU,EAAE,IAAI;KACV,CAAC,CAAA;AACX,CAAC","sourcesContent":["import { In } from 'typeorm'\n\nimport { ActivityThread, ActivityThreadStatus } from '../../service/activity-thread/activity-thread.js'\nimport { ActivityInstance, ActivityInstanceStatus } from '../../service/activity-instance/activity-instance.js'\nimport { closeNotices } from '@things-factory/notification'\n\nimport { todoNoticeKey } from '../../service/approval-notice/approval-notice-rules.js'\nimport { evalActivityInstanceState } from '../common.js'\n\n/**\n * Ends a case whose work is done - every thread still open ends as done, then the case ends. The counterpart of\n * `abort` for a to-do the records show finished: a case handed to several people, or to whoever holds a role, is\n * done for all of them when its work is done, and its history says ended, not aborted.\n *\n * For the module that issued the case and judges its work (an application's own to-do); a person ends their own\n * thread through the thread's `end`.\n *\n * `output` is what was done, in the activity's declared output fields - the finished case shows it, as it shows what a\n * person wrote when they end their own thread. A module that closed its to-do with only a reason left the finished\n * screen with nothing to show of how it ended (2026-11-11, 문의 할 일).\n */\nexport async function complete(\n { id, reason, output }: { id: string; reason?: string; output?: Record<string, any> },\n context: ResolverContext\n): Promise<ActivityInstance> {\n const { domain, user, tx } = context.state\n const repository = tx.getRepository(ActivityInstance)\n\n const activityInstance = await repository.findOne({\n where: { domain: { id: domain.id }, id },\n relations: ['domain', 'activity', 'activityThreads', 'assigneeRoles', 'supervisoryRole', 'updater', 'creator', 'starter', 'terminator']\n })\n\n if (!activityInstance) {\n throw new Error(context.t('error.activity-instance not found', { activityInstance: id }))\n }\n\n if (activityInstance.state == ActivityInstanceStatus.Aborted || activityInstance.state == ActivityInstanceStatus.Ended) {\n throw new Error(context.t(`error.activity-instance is already terminated`, { id, state: activityInstance.state }))\n }\n\n const TERMINATED = [ActivityThreadStatus.Aborted, ActivityThreadStatus.Ended]\n const open = (activityInstance.activityThreads ?? []).filter(thread => !TERMINATED.includes(thread.state))\n const now = new Date()\n if (open.length) {\n const threads = tx.getRepository(ActivityThread)\n for (const thread of await threads.find({ where: { id: In(open.map(one => one.id)) } })) {\n await threads.save({\n ...thread,\n reason,\n ...(output ? { output: { ...(thread.output ?? {}), ...output } } : {}),\n state: ActivityThreadStatus.Ended,\n transaction: 'end',\n startedAt: thread.startedAt ?? now,\n updater: user,\n terminatedAt: now\n })\n /* Its work done, the notice that handed it out is closed (ADR-0200 decision 3). */\n await closeNotices(tx, domain, 'todo', todoNoticeKey(thread.id))\n }\n }\n\n return await repository.save({\n ...activityInstance,\n activityThreads: undefined,\n reason,\n ...(await evalActivityInstanceState(id, context)),\n startedAt: activityInstance.startedAt ?? now,\n transaction: 'end',\n updater: user,\n terminatedAt: now,\n terminator: user\n } as any)\n}\n"]}
|
|
@@ -19,5 +19,7 @@ export interface HandOut {
|
|
|
19
19
|
*
|
|
20
20
|
* `context.state.user` is who set it off - the manager who assigned the course, or the person whose turn came - and
|
|
21
21
|
* stands as the issuer.
|
|
22
|
+
*
|
|
23
|
+
* The person is told (ADR-0200 decision 3) - the to-do opens from the notice - unless they handed it to themselves.
|
|
22
24
|
*/
|
|
23
25
|
export declare function handOut(todo: HandOut, context: ResolverContext): Promise<ActivityInstance>;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.handOut = handOut;
|
|
4
|
+
const activity_thread_js_1 = require("../../service/activity-thread/activity-thread.js");
|
|
5
|
+
const approval_notice_js_1 = require("../../service/approval-notice/approval-notice.js");
|
|
4
6
|
const assign_js_1 = require("./assign.js");
|
|
5
7
|
const issue_js_1 = require("./issue.js");
|
|
6
8
|
/**
|
|
@@ -11,11 +13,16 @@ const issue_js_1 = require("./issue.js");
|
|
|
11
13
|
*
|
|
12
14
|
* `context.state.user` is who set it off - the manager who assigned the course, or the person whose turn came - and
|
|
13
15
|
* stands as the issuer.
|
|
16
|
+
*
|
|
17
|
+
* The person is told (ADR-0200 decision 3) - the to-do opens from the notice - unless they handed it to themselves.
|
|
14
18
|
*/
|
|
15
19
|
async function handOut(todo, context) {
|
|
16
20
|
const { activityId, name, description, input, assignee, dueAt } = todo;
|
|
17
21
|
const instance = await (0, issue_js_1.issue)({ name, description: description ?? name, activityId, input, assignees: [], threadsMin: 0, dueAt, creator: null }, context);
|
|
18
22
|
await (0, assign_js_1.assign)({ id: instance.id, assignees: [assignee.email], dueAt, reason: name }, context);
|
|
23
|
+
const thread = await context.state.tx.getRepository(activity_thread_js_1.ActivityThread).findOne({ where: { activityInstance: { id: instance.id }, assignee: { id: assignee.id } } });
|
|
24
|
+
if (thread)
|
|
25
|
+
(0, approval_notice_js_1.noticeHandOut)(context, { threadId: thread.id, name, assignee });
|
|
19
26
|
return instance;
|
|
20
27
|
}
|
|
21
28
|
//# sourceMappingURL=hand-out.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hand-out.js","sourceRoot":"","sources":["../../../server/controllers/activity-instance/hand-out.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"hand-out.js","sourceRoot":"","sources":["../../../server/controllers/activity-instance/hand-out.ts"],"names":[],"mappings":";;AA+BA,0BAOC;AAnCD,yFAAiF;AACjF,yFAAgF;AAChF,2CAAoC;AACpC,yCAAkC;AAclC;;;;;;;;;;GAUG;AACI,KAAK,UAAU,OAAO,CAAC,IAAa,EAAE,OAAwB;IACnE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,IAAI,CAAA;IACtE,MAAM,QAAQ,GAAG,MAAM,IAAA,gBAAK,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,IAAI,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAS,EAAE,OAAO,CAAC,CAAA;IAC/J,MAAM,IAAA,kBAAM,EAAC,EAAE,EAAE,EAAE,QAAQ,CAAC,EAAE,EAAE,SAAS,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,OAAO,CAAC,CAAA;IAC5F,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,aAAa,CAAC,mCAAc,CAAC,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,gBAAgB,EAAE,EAAE,EAAE,EAAE,QAAQ,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,EAAE,QAAQ,CAAC,EAAE,EAAE,EAAS,EAAE,CAAC,CAAA;IACvK,IAAI,MAAM;QAAE,IAAA,kCAAa,EAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAA;IAC3E,OAAO,QAAQ,CAAA;AACjB,CAAC","sourcesContent":["import { User } from '@things-factory/auth-base'\n\nimport { ActivityInstance } from '../../service/activity-instance/activity-instance.js'\nimport { ActivityThread } from '../../service/activity-thread/activity-thread.js'\nimport { noticeHandOut } from '../../service/approval-notice/approval-notice.js'\nimport { assign } from './assign.js'\nimport { issue } from './issue.js'\n\nexport interface HandOut {\n /** The activity it is a case of - an application installs it. */\n activityId: string\n /** 「<과정> 수강」, 「성희롱 예방교육 이수 — 2026」 - what the to-do says. */\n name: string\n description?: string\n input?: Record<string, any>\n /** The one it is for. */\n assignee: User\n dueAt?: Date\n}\n\n/**\n * Hands one person a to-do of a module's own - a course to take, a legal training, this week's report - that nobody put\n * up as a request. The case has no creator: it is the person's 할 일 and nobody's 상신함, the one who set it off\n * included when they hand it to themselves (a manager assigning a course to the whole company). Issued as its own\n * assignee, the case went to the person's 상신함 and never to their 할 일 (2026-11-08).\n *\n * `context.state.user` is who set it off - the manager who assigned the course, or the person whose turn came - and\n * stands as the issuer.\n *\n * The person is told (ADR-0200 decision 3) - the to-do opens from the notice - unless they handed it to themselves.\n */\nexport async function handOut(todo: HandOut, context: ResolverContext): Promise<ActivityInstance> {\n const { activityId, name, description, input, assignee, dueAt } = todo\n const instance = await issue({ name, description: description ?? name, activityId, input, assignees: [], threadsMin: 0, dueAt, creator: null } as any, context)\n await assign({ id: instance.id, assignees: [assignee.email], dueAt, reason: name }, context)\n const thread = await context.state.tx.getRepository(ActivityThread).findOne({ where: { activityInstance: { id: instance.id }, assignee: { id: assignee.id } } as any })\n if (thread) noticeHandOut(context, { threadId: thread.id, name, assignee })\n return instance\n}\n"]}
|
|
@@ -5,5 +5,5 @@ import { ActivityQuery } from "./activity-query.js";
|
|
|
5
5
|
import { ActivityHistoryEntitySubscriber } from "./event-subscriber.js";
|
|
6
6
|
import { ActivityDeclarationGuardSubscriber } from "./declaration-guard-subscriber.js";
|
|
7
7
|
export declare const entities: (typeof Activity | typeof ActivityHistory)[];
|
|
8
|
-
export declare const resolvers: (typeof
|
|
8
|
+
export declare const resolvers: (typeof ActivityQuery | typeof ActivityMutation)[];
|
|
9
9
|
export declare const subscribers: (typeof ActivityHistoryEntitySubscriber | typeof ActivityDeclarationGuardSubscriber)[];
|
|
@@ -5,5 +5,5 @@ import { ActivityInstanceQuery } from "./activity-instance-query.js";
|
|
|
5
5
|
import { ActivityInstanceSubscription } from "./activity-instance-subscription.js";
|
|
6
6
|
import { ActivityInstanceHistoryEntitySubscriber, ActivityInstanceSubscriber } from "./event-subscriber.js";
|
|
7
7
|
export declare const entities: (typeof ActivityInstance | typeof ActivityInstanceHistory)[];
|
|
8
|
-
export declare const resolvers: (typeof
|
|
8
|
+
export declare const resolvers: (typeof ActivityInstanceQuery | typeof ActivityInstanceMutation | typeof ActivityInstanceSubscription)[];
|
|
9
9
|
export declare const subscribers: (typeof ActivityInstanceSubscriber | typeof ActivityInstanceHistoryEntitySubscriber)[];
|
|
@@ -4,5 +4,5 @@ import { ActivityTemplateMutation } from "./activity-template-mutation.js";
|
|
|
4
4
|
import { ActivityTemplateQuery } from "./activity-template-query.js";
|
|
5
5
|
import { ActivityTemplateHistoryEntitySubscriber } from "./event-subscriber.js";
|
|
6
6
|
export declare const entities: (typeof ActivityTemplate | typeof ActivityTemplateHistory)[];
|
|
7
|
-
export declare const resolvers: (typeof
|
|
7
|
+
export declare const resolvers: (typeof ActivityTemplateQuery | typeof ActivityTemplateMutation)[];
|
|
8
8
|
export declare const subscribers: (typeof ActivityTemplateHistoryEntitySubscriber)[];
|
|
@@ -6,5 +6,5 @@ import { ActivityThreadHistoryQuery } from "./activity-thread-history-query.js";
|
|
|
6
6
|
import { ActivityThreadSubscription } from "./activity-thread-subscription.js";
|
|
7
7
|
import { ActivityThreadHistoryEntitySubscriber, ActivityThreadSubscriber } from "./event-subscriber.js";
|
|
8
8
|
export declare const entities: (typeof ActivityThread | typeof ActivityThreadHistory)[];
|
|
9
|
-
export declare const resolvers: (typeof
|
|
9
|
+
export declare const resolvers: (typeof ActivityThreadQuery | typeof ActivityThreadHistoryQuery | typeof ActivityThreadMutation | typeof ActivityThreadSubscription)[];
|
|
10
10
|
export declare const subscribers: (typeof ActivityThreadSubscriber | typeof ActivityThreadHistoryEntitySubscriber)[];
|
|
@@ -65,3 +65,12 @@ export type Translate = (key: string, options?: {
|
|
|
65
65
|
* in: no input, no amount, no comment. The page behind the link shows those to whoever may see them.
|
|
66
66
|
*/
|
|
67
67
|
export declare function noticeWords(t: Translate, facts: NoticeFacts): NoticeWords;
|
|
68
|
+
/** What a hand-out notice tells of - the person's thread of the case. */
|
|
69
|
+
export declare const todoNoticeKey: (threadId: string) => string;
|
|
70
|
+
/** Who is told of a to-do handed out - its person, when they can sign in and did not hand it to themselves. */
|
|
71
|
+
export declare function todoNoticeReceivers(assignee: NoticePerson | null | undefined, actorId?: string | null): NoticePerson[];
|
|
72
|
+
/** The sentences (`todo-notice.*`) - the to-do's name and who handed it, nothing of what it carries. */
|
|
73
|
+
export declare function todoNoticeWords(t: Translate, facts: {
|
|
74
|
+
name: string;
|
|
75
|
+
actor?: string | null;
|
|
76
|
+
}): NoticeWords;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.APPROVAL_NOTICE_KINDS = void 0;
|
|
3
|
+
exports.todoNoticeKey = exports.APPROVAL_NOTICE_KINDS = void 0;
|
|
4
4
|
exports.isTurnNotice = isTurnNotice;
|
|
5
5
|
exports.noticeReceivers = noticeReceivers;
|
|
6
6
|
exports.noticeAddress = noticeAddress;
|
|
7
7
|
exports.approvalStep = approvalStep;
|
|
8
8
|
exports.noticeWords = noticeWords;
|
|
9
|
+
exports.todoNoticeReceivers = todoNoticeReceivers;
|
|
10
|
+
exports.todoNoticeWords = todoNoticeWords;
|
|
9
11
|
const approval_line_js_1 = require("../../controllers/activity-approval/approval-line.js");
|
|
10
12
|
exports.APPROVAL_NOTICE_KINDS = ['request', 'delegated', 'reference', 'approved', 'rejected'];
|
|
11
13
|
/** A notice for the person whose turn it is - the other kinds tell the requester of a judgment. */
|
|
@@ -64,4 +66,26 @@ function noticeWords(t, facts) {
|
|
|
64
66
|
note: t(isTurnNotice(facts.kind) ? 'approval-notice.see-approval-box' : 'approval-notice.see-request-box', values)
|
|
65
67
|
};
|
|
66
68
|
}
|
|
69
|
+
/*
|
|
70
|
+
* A to-do handed out (ADR-0200 decision 3) - a module's own work for one person, nobody's request: a question handed to
|
|
71
|
+
* the person a conversation is about, a legal training, a course. It is told to the person, as a turn is, unless they
|
|
72
|
+
* handed it to themselves; it opens the to-do and is closed when the work is done (`complete`).
|
|
73
|
+
*/
|
|
74
|
+
/** What a hand-out notice tells of - the person's thread of the case. */
|
|
75
|
+
const todoNoticeKey = (threadId) => `todo-thread:${threadId}`;
|
|
76
|
+
exports.todoNoticeKey = todoNoticeKey;
|
|
77
|
+
/** Who is told of a to-do handed out - its person, when they can sign in and did not hand it to themselves. */
|
|
78
|
+
function todoNoticeReceivers(assignee, actorId) {
|
|
79
|
+
return assignee?.id && assignee.id !== actorId ? [assignee] : [];
|
|
80
|
+
}
|
|
81
|
+
/** The sentences (`todo-notice.*`) - the to-do's name and who handed it, nothing of what it carries. */
|
|
82
|
+
function todoNoticeWords(t, facts) {
|
|
83
|
+
const values = { name: facts.name, actor: facts.actor || '-' };
|
|
84
|
+
return {
|
|
85
|
+
subject: t('todo-notice.subject', values),
|
|
86
|
+
body: t(facts.actor ? 'todo-notice.body' : 'todo-notice.body-unsaid', values),
|
|
87
|
+
action: t('todo-notice.open', values),
|
|
88
|
+
note: t('approval-notice.see-request-box', values)
|
|
89
|
+
};
|
|
90
|
+
}
|
|
67
91
|
//# sourceMappingURL=approval-notice-rules.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"approval-notice-rules.js","sourceRoot":"","sources":["../../../server/service/approval-notice/approval-notice-rules.ts"],"names":[],"mappings":";;;AAuBA,oCAEC;AAUD,0CAqBC;AAQD,sCAGC;AAGD,oCAIC;AAoBD,kCAeC;
|
|
1
|
+
{"version":3,"file":"approval-notice-rules.js","sourceRoot":"","sources":["../../../server/service/approval-notice/approval-notice-rules.ts"],"names":[],"mappings":";;;AAuBA,oCAEC;AAUD,0CAqBC;AAQD,sCAGC;AAGD,oCAIC;AAoBD,kCAeC;AAYD,kDAEC;AAGD,0CAQC;AA/HD,2FAAqF;AAaxE,QAAA,qBA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AAI,CAAC,CAAC,CAAC,CAAC,kCAAkC,CAAC,CAAC,CAAC,iCAAiC,EAAE,MAAM,CAAC;KACnH,CAAA;AACH,CAAC;AAED;;;;GAIG;AAEH,yEAAyE;AAClE,MAAM,aAAa,GAAG,CAAC,QAAgB,EAAE,EAAE,CAAC,eAAe,QAAQ,EAAE,CAAA;AAA/D,QAAA,aAAa,iBAAkD;AAE5E,+GAA+G;AAC/G,SAAgB,mBAAmB,CAAC,QAAyC,EAAE,OAAuB;IACpG,OAAO,QAAQ,EAAE,EAAE,IAAI,QAAQ,CAAC,EAAE,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;AAClE,CAAC;AAED,wGAAwG;AACxG,SAAgB,eAAe,CAAC,CAAY,EAAE,KAA8C;IAC1F,MAAM,MAAM,GAAG,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,IAAI,GAAG,EAAE,CAAA;IAC9D,OAAO;QACL,OAAO,EAAE,CAAC,CAAC,qBAAqB,EAAE,MAAM,CAAC;QACzC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,yBAAyB,EAAE,MAAM,CAAC;QAC7E,MAAM,EAAE,CAAC,CAAC,kBAAkB,EAAE,MAAM,CAAC;QACrC,IAAI,EAAE,CAAC,CAAC,iCAAiC,EAAE,MAAM,CAAC;KACnD,CAAA;AACH,CAAC","sourcesContent":["/*\n * The rules of the approval notice (ADR-0164) - who is told and what they read. How it is sent is notification's.\n * Plain functions over plain values: no entity, no request, so a test holds every rule without a database.\n */\nimport type { NoticeWords } from '@things-factory/notification'\nimport type { ApprovalLineItem } from '@things-factory/organization'\n\nimport { isApprovalStep } from '../../controllers/activity-approval/approval-line.js'\n\n/**\n * What happened.\n *\n * - `request` a seat's turn came - the first one on submit, the next one after an approval\n * - `delegated` a seat was handed to someone\n * - `reference` someone was seated to read along\n * - `approved` the last approval ended the case\n * - `rejected` an approver sent it back\n */\nexport type ApprovalNoticeKind = 'request' | 'delegated' | 'reference' | 'approved' | 'rejected'\n\nexport const APPROVAL_NOTICE_KINDS: readonly ApprovalNoticeKind[] = ['request', 'delegated', 'reference', 'approved', 'rejected']\n\n/** A notice for the person whose turn it is - the other kinds tell the requester of a judgment. */\nexport function isTurnNotice(kind: ApprovalNoticeKind): boolean {\n return kind === 'request' || kind === 'delegated' || kind === 'reference'\n}\n\nexport type NoticePerson = { id: string; name?: string | null; email?: string | null; locale?: string | null }\n\n/**\n * Who is told.\n *\n * A turn reaches the seat: its person, or - for a seat held by a role - everyone holding the role. A judgment\n * reaches the requester. Whoever did the thing is not told of it, and nobody is told twice.\n */\nexport function noticeReceivers({\n kind,\n approver,\n roleHolders,\n requester,\n actorId\n}: {\n kind: ApprovalNoticeKind\n approver?: NoticePerson | null\n roleHolders?: NoticePerson[] | null\n requester?: NoticePerson | null\n actorId?: string | null\n}): NoticePerson[] {\n const candidates = isTurnNotice(kind) ? (approver ? [approver] : roleHolders || []) : requester ? [requester] : []\n const seen = new Set<string>()\n\n return candidates.filter(person => {\n if (!person?.id || person.id === actorId || seen.has(person.id)) return false\n seen.add(person.id)\n return true\n })\n}\n\n/**\n * The page the notice opens, relative to the domain - the same pages the worklist lists open.\n *\n * A turn opens the approval. An approved case opens the thread's read-only view; a rejected one opens the thread\n * itself, where the requester revises and raises it again.\n */\nexport function noticeAddress(kind: ApprovalNoticeKind, { approvalId, threadId }: { approvalId: string; threadId: string }): string {\n if (isTurnNotice(kind)) return `activity-approval/${approvalId}`\n return kind === 'approved' ? `activity-thread-view/${threadId}` : `activity-thread/${threadId}`\n}\n\n/** Which approval of the line this seat is - references take a place in the line but are not counted. */\nexport function approvalStep(line: ApprovalLineItem[] | null | undefined, order: number): { step: number; steps: number } | undefined {\n const orders = (line || []).map((item, index) => (isApprovalStep(item) ? index + 1 : 0)).filter(Boolean)\n const step = orders.indexOf(order) + 1\n return step ? { step, steps: orders.length } : undefined\n}\n\n\nexport type NoticeFacts = {\n kind: ApprovalNoticeKind\n /** The case as the worklist names it. */\n name: string\n requester?: string | null\n /** Who did the thing - the approver who judged, the person who handed a seat on. */\n actor?: string | null\n step?: number\n steps?: number\n}\n\nexport type Translate = (key: string, options?: { [name: string]: unknown }) => string\n\n/**\n * The sentences, from the worklist translations (`approval-notice.<kind>.*`). Nothing of the request's content goes\n * in: no input, no amount, no comment. The page behind the link shows those to whoever may see them.\n */\nexport function noticeWords(t: Translate, facts: NoticeFacts): NoticeWords {\n const values = {\n name: facts.name,\n requester: facts.requester || '-',\n actor: facts.actor || '-',\n step: facts.step ?? '-',\n steps: facts.steps ?? '-'\n }\n\n return {\n subject: t(`approval-notice.${facts.kind}.subject`, values),\n body: t(`approval-notice.${facts.kind}.body`, values),\n action: t(isTurnNotice(facts.kind) ? 'approval-notice.open-approval' : 'approval-notice.open-request', values),\n note: t(isTurnNotice(facts.kind) ? 'approval-notice.see-approval-box' : 'approval-notice.see-request-box', values)\n }\n}\n\n/*\n * A to-do handed out (ADR-0200 decision 3) - a module's own work for one person, nobody's request: a question handed to\n * the person a conversation is about, a legal training, a course. It is told to the person, as a turn is, unless they\n * handed it to themselves; it opens the to-do and is closed when the work is done (`complete`).\n */\n\n/** What a hand-out notice tells of - the person's thread of the case. */\nexport const todoNoticeKey = (threadId: string) => `todo-thread:${threadId}`\n\n/** Who is told of a to-do handed out - its person, when they can sign in and did not hand it to themselves. */\nexport function todoNoticeReceivers(assignee: NoticePerson | null | undefined, actorId?: string | null): NoticePerson[] {\n return assignee?.id && assignee.id !== actorId ? [assignee] : []\n}\n\n/** The sentences (`todo-notice.*`) - the to-do's name and who handed it, nothing of what it carries. */\nexport function todoNoticeWords(t: Translate, facts: { name: string; actor?: string | null }): NoticeWords {\n const values = { name: facts.name, actor: facts.actor || '-' }\n return {\n subject: t('todo-notice.subject', values),\n body: t(facts.actor ? 'todo-notice.body' : 'todo-notice.body-unsaid', values),\n action: t('todo-notice.open', values),\n note: t('approval-notice.see-request-box', values)\n }\n}\n"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { User } from '@things-factory/auth-base';
|
|
1
2
|
import type { EntityManager } from 'typeorm';
|
|
2
3
|
import { type ApprovalNoticeKind } from './approval-notice-rules.js';
|
|
3
4
|
/**
|
|
@@ -21,3 +22,12 @@ export declare function closeApprovalNotices(tx: EntityManager, rows: readonly {
|
|
|
21
22
|
id: string;
|
|
22
23
|
domainId?: string;
|
|
23
24
|
}[]): Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* Tells a person of a to-do handed to them (ADR-0200 decision 3), once the transaction has committed - unless they
|
|
27
|
+
* handed it to themselves. Nothing here throws: the to-do stands without its notice.
|
|
28
|
+
*/
|
|
29
|
+
export declare function noticeHandOut(context: ResolverContext, { threadId, name, assignee }: {
|
|
30
|
+
threadId: string;
|
|
31
|
+
name: string;
|
|
32
|
+
assignee: User;
|
|
33
|
+
}): void;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.approvalNoticeKey = void 0;
|
|
4
4
|
exports.noticeApproval = noticeApproval;
|
|
5
5
|
exports.closeApprovalNotices = closeApprovalNotices;
|
|
6
|
+
exports.noticeHandOut = noticeHandOut;
|
|
6
7
|
/*
|
|
7
8
|
* The approval notice (ADR-0164) - the one place the worklist tells people of an approval's turn and judgment.
|
|
8
9
|
*
|
|
@@ -83,6 +84,32 @@ async function closeApprovalNotices(tx, rows) {
|
|
|
83
84
|
await (0, notification_1.closeNotices)(tx, { id: row.domainId }, 'approval', (0, exports.approvalNoticeKey)(row.id));
|
|
84
85
|
}
|
|
85
86
|
}
|
|
87
|
+
/**
|
|
88
|
+
* Tells a person of a to-do handed to them (ADR-0200 decision 3), once the transaction has committed - unless they
|
|
89
|
+
* handed it to themselves. Nothing here throws: the to-do stands without its notice.
|
|
90
|
+
*/
|
|
91
|
+
function noticeHandOut(context, { threadId, name, assignee }) {
|
|
92
|
+
try {
|
|
93
|
+
const { user } = context.state;
|
|
94
|
+
const receivers = (0, approval_notice_rules_js_1.todoNoticeReceivers)(active(assignee), user?.id);
|
|
95
|
+
if (!receivers.length)
|
|
96
|
+
return;
|
|
97
|
+
const address = `activity-thread/${threadId}`;
|
|
98
|
+
(0, notification_1.sendNoticeWhenCommitted)(context, {
|
|
99
|
+
type: 'todo',
|
|
100
|
+
level: 'info',
|
|
101
|
+
receivers,
|
|
102
|
+
words: lng => (0, approval_notice_rules_js_1.todoNoticeWords)(translatorOf(lng), { name, actor: user?.name }),
|
|
103
|
+
address,
|
|
104
|
+
link: (0, notification_1.noticeLinkOf)(context, address),
|
|
105
|
+
key: (0, approval_notice_rules_js_1.todoNoticeKey)(threadId),
|
|
106
|
+
label: `to-do notice of ${threadId}`
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
catch (error) {
|
|
110
|
+
env_1.logger.error(`[worklist] to-do notice of ${threadId} could not be made`, error);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
86
113
|
/** Only a person who can sign in is told. */
|
|
87
114
|
function active(person) {
|
|
88
115
|
return person && person.status === auth_base_1.UserStatus.ACTIVATED ? { id: person.id, name: person.name, email: person.email, locale: person.locale } : null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"approval-notice.js","sourceRoot":"","sources":["../../../server/service/approval-notice/approval-notice.ts"],"names":[],"mappings":";;;AAkCA,wCA4CC;AAUD,oDAKC;AA7FD;;;;;;;GAOG;AACH,yDAA4D;AAC5D,6CAA4C;AAC5C,qEAAoE;AACpE,+DAAwI;AAGxI,oFAA4E;AAC5E,4EAAmE;AACnE,yEAUmC;AAEnC;;;;;GAKG;AACI,KAAK,UAAU,cAAc,CAAC,OAAwB,EAAE,EAAE,IAAI,EAAE,UAAU,EAAoD;IACnI,IAAI,CAAC;QACH,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OA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AiB,qBAAmD;AAEjF;;;;GAIG;AACI,KAAK,UAAU,oBAAoB,CAAC,EAAiB,EAAE,IAAkD;IAC9G,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,IAAI,CAAC,GAAG,CAAC,QAAQ;YAAE,SAAQ;QAC3B,MAAM,IAAA,2BAAY,EAAC,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC,QAAQ,EAAE,EAAE,UAAU,EAAE,IAAA,yBAAiB,EAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAA;IACrF,CAAC;AACH,CAAC;AAED,6CAA6C;AAC7C,SAAS,MAAM,CAAC,MAAoB;IAClC,OAAO,MAAM,IAAI,MAAM,CAAC,MAAM,KAAK,sBAAU,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,IAAI,CAAA;AACnJ,CAAC;AAED,wFAAwF;AACxF,SAAS,YAAY,CAAC,GAAW;IAC/B,MAAM,GAAG,GAAG,IAAA,0BAAa,EAAC,GAAG,CAAC,CAAA;IAC9B,MAAM,OAAO,GAAG,IAAA,0BAAa,EAAC,IAAI,CAAC,CAAA;IACnC,OAAO,CAAC,GAAG,EAAE,OAAO,GAAG,EAAE,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,GAAG,OAAO,EAAE,YAAY,EAAE,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,EAAE,CAAC,CAAA;AAC7F,CAAC","sourcesContent":["/*\n * The approval notice (ADR-0164) - the one place the worklist tells people of an approval's turn and judgment.\n *\n * The four places an approval moves call `noticeApproval`: createApproval (a turn or a reference), delegate (a\n * handed seat), approve with no one after (approved) and reject (rejected). Applications call nothing; a case that\n * goes through the approval line is told of. Sending is notification's (`sendNoticeWhenCommitted`); what it sent is kept\n * on the approval row (`notices`).\n */\nimport { User, UserStatus } from '@things-factory/auth-base'\nimport { logger } from '@things-factory/env'\nimport { translatorFor } from '@things-factory/i18n-base/translator'\nimport { closeNotices, keepNoticeDelivery, noticeDeliveryOf, noticeLinkOf, sendNoticeWhenCommitted } from '@things-factory/notification'\nimport type { EntityManager } from 'typeorm'\n\nimport { ActivityApproval } from '../activity-approval/activity-approval.js'\nimport { poolMembers } from '../activity-instance/assignee-pool.js'\nimport {\n approvalStep,\n isTurnNotice,\n noticeAddress,\n noticeReceivers,\n noticeWords,\n type ApprovalNoticeKind,\n type NoticeFacts,\n type NoticePerson,\n type Translate\n} from './approval-notice-rules.js'\n\n/**\n * Tells of what just happened to approval `approvalId`, once the transaction has committed.\n *\n * Who and what are settled here, inside the transaction, from rows it can see. Nothing here throws: a notice that\n * cannot be made is reported and the approval stands.\n */\nexport async function noticeApproval(context: ResolverContext, { kind, approvalId }: { kind: ApprovalNoticeKind; approvalId: string }): Promise<void> {\n try {\n const { user, tx } = context.state\n\n const approval = await tx.getRepository(ActivityApproval).findOne({\n where: { id: approvalId },\n relations: ['approver', 'approverRole', 'approverRole.users', 'activityThread', 'activityThread.assignee', 'activityThread.activityInstance']\n })\n const thread = approval?.activityThread\n const instance = thread?.activityInstance\n if (!approval || !thread || !instance) return\n\n const receivers = noticeReceivers({\n kind,\n approver: active(approval.approver),\n roleHolders: poolMembers(approval.approverRole ? [approval.approverRole] : []).map(active).filter(Boolean),\n requester: active(thread.assignee),\n actorId: user?.id\n })\n if (!receivers.length) return\n\n const facts: NoticeFacts = {\n kind,\n name: instance.name || '',\n requester: thread.assignee?.name,\n actor: user?.name,\n ...(isTurnNotice(kind) ? approvalStep(instance.approvalLine, approval.order) : {})\n }\n const address = noticeAddress(kind, { approvalId: approval.id, threadId: thread.id })\n\n sendNoticeWhenCommitted(context, {\n type: 'approval',\n level: kind === 'rejected' ? 'warn' : 'info',\n receivers,\n words: lng => noticeWords(translatorOf(lng), facts),\n address,\n link: noticeLinkOf(context, address),\n /* a turn is closed once its row is judged (`closeApprovalNotices`); a judgment told is read by its person */\n key: isTurnNotice(kind) ? approvalNoticeKey(approval.id) : `approval-thread:${thread.id}`,\n label: `approval notice ${kind} of ${approval.id}`\n }, result => keepNoticeDelivery(ActivityApproval, approval.id, 'notices', noticeDeliveryOf(kind, result, receivers.length)))\n } catch (error) {\n logger.error(`[worklist] approval notice ${kind} of ${approvalId} could not be made`, error)\n }\n}\n\n/** What a turn notice tells of - the approval row whose turn it is. */\nexport const approvalNoticeKey = (approvalId: string) => `approval:${approvalId}`\n\n/**\n * Closes the turn notices of approval rows that are no longer waiting - judged, handed on, withdrawn or closed with\n * their case (ADR-0164 amendment 1): everyone the turn was told to, a role's holders too, reads it as read and no screen\n * shows it. In the transaction that moved the rows, so a refused move closes nothing.\n */\nexport async function closeApprovalNotices(tx: EntityManager, rows: readonly { id: string; domainId?: string }[]): Promise<void> {\n for (const row of rows) {\n if (!row.domainId) continue\n await closeNotices(tx, { id: row.domainId }, 'approval', approvalNoticeKey(row.id))\n }\n}\n\n/** Only a person who can sign in is told. */\nfunction active(person?: User | null): NoticePerson | null {\n return person && person.status === UserStatus.ACTIVATED ? { id: person.id, name: person.name, email: person.email, locale: person.locale } : null\n}\n\n/** A sentence missing in the person's language is said in English, never as its key. */\nfunction translatorOf(lng: string): Translate {\n const own = translatorFor(lng)\n const english = translatorFor('en')\n return (key, options = {}) => own(key, { ...options, defaultValue: english(key, options) })\n}\n"]}
|
|
1
|
+
{"version":3,"file":"approval-notice.js","sourceRoot":"","sources":["../../../server/service/approval-notice/approval-notice.ts"],"names":[],"mappings":";;;AAqCA,wCA4CC;AAUD,oDAKC;AAMD,sCAmBC;AAzHD;;;;;;;GAOG;AACH,yDAA4D;AAC5D,6CAA4C;AAC5C,qEAAoE;AACpE,+DAAwI;AAGxI,oFAA4E;AAC5E,4EAAmE;AACnE,yEAamC;AAEnC;;;;;GAKG;AACI,KAA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Aa,EAAC,QAAQ,CAAC;YAC5B,KAAK,EAAE,mBAAmB,QAAQ,EAAE;SACrC,CAAC,CAAA;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,YAAM,CAAC,KAAK,CAAC,8BAA8B,QAAQ,oBAAoB,EAAE,KAAK,CAAC,CAAA;IACjF,CAAC;AACH,CAAC;AAED,6CAA6C;AAC7C,SAAS,MAAM,CAAC,MAAoB;IAClC,OAAO,MAAM,IAAI,MAAM,CAAC,MAAM,KAAK,sBAAU,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,IAAI,CAAA;AACnJ,CAAC;AAED,wFAAwF;AACxF,SAAS,YAAY,CAAC,GAAW;IAC/B,MAAM,GAAG,GAAG,IAAA,0BAAa,EAAC,GAAG,CAAC,CAAA;IAC9B,MAAM,OAAO,GAAG,IAAA,0BAAa,EAAC,IAAI,CAAC,CAAA;IACnC,OAAO,CAAC,GAAG,EAAE,OAAO,GAAG,EAAE,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,GAAG,OAAO,EAAE,YAAY,EAAE,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,EAAE,CAAC,CAAA;AAC7F,CAAC","sourcesContent":["/*\n * The approval notice (ADR-0164) - the one place the worklist tells people of an approval's turn and judgment.\n *\n * The four places an approval moves call `noticeApproval`: createApproval (a turn or a reference), delegate (a\n * handed seat), approve with no one after (approved) and reject (rejected). Applications call nothing; a case that\n * goes through the approval line is told of. Sending is notification's (`sendNoticeWhenCommitted`); what it sent is kept\n * on the approval row (`notices`).\n */\nimport { User, UserStatus } from '@things-factory/auth-base'\nimport { logger } from '@things-factory/env'\nimport { translatorFor } from '@things-factory/i18n-base/translator'\nimport { closeNotices, keepNoticeDelivery, noticeDeliveryOf, noticeLinkOf, sendNoticeWhenCommitted } from '@things-factory/notification'\nimport type { EntityManager } from 'typeorm'\n\nimport { ActivityApproval } from '../activity-approval/activity-approval.js'\nimport { poolMembers } from '../activity-instance/assignee-pool.js'\nimport {\n approvalStep,\n isTurnNotice,\n noticeAddress,\n noticeReceivers,\n noticeWords,\n todoNoticeKey,\n todoNoticeReceivers,\n todoNoticeWords,\n type ApprovalNoticeKind,\n type NoticeFacts,\n type NoticePerson,\n type Translate\n} from './approval-notice-rules.js'\n\n/**\n * Tells of what just happened to approval `approvalId`, once the transaction has committed.\n *\n * Who and what are settled here, inside the transaction, from rows it can see. Nothing here throws: a notice that\n * cannot be made is reported and the approval stands.\n */\nexport async function noticeApproval(context: ResolverContext, { kind, approvalId }: { kind: ApprovalNoticeKind; approvalId: string }): Promise<void> {\n try {\n const { user, tx } = context.state\n\n const approval = await tx.getRepository(ActivityApproval).findOne({\n where: { id: approvalId },\n relations: ['approver', 'approverRole', 'approverRole.users', 'activityThread', 'activityThread.assignee', 'activityThread.activityInstance']\n })\n const thread = approval?.activityThread\n const instance = thread?.activityInstance\n if (!approval || !thread || !instance) return\n\n const receivers = noticeReceivers({\n kind,\n approver: active(approval.approver),\n roleHolders: poolMembers(approval.approverRole ? [approval.approverRole] : []).map(active).filter(Boolean),\n requester: active(thread.assignee),\n actorId: user?.id\n })\n if (!receivers.length) return\n\n const facts: NoticeFacts = {\n kind,\n name: instance.name || '',\n requester: thread.assignee?.name,\n actor: user?.name,\n ...(isTurnNotice(kind) ? approvalStep(instance.approvalLine, approval.order) : {})\n }\n const address = noticeAddress(kind, { approvalId: approval.id, threadId: thread.id })\n\n sendNoticeWhenCommitted(context, {\n type: 'approval',\n level: kind === 'rejected' ? 'warn' : 'info',\n receivers,\n words: lng => noticeWords(translatorOf(lng), facts),\n address,\n link: noticeLinkOf(context, address),\n /* a turn is closed once its row is judged (`closeApprovalNotices`); a judgment told is read by its person */\n key: isTurnNotice(kind) ? approvalNoticeKey(approval.id) : `approval-thread:${thread.id}`,\n label: `approval notice ${kind} of ${approval.id}`\n }, result => keepNoticeDelivery(ActivityApproval, approval.id, 'notices', noticeDeliveryOf(kind, result, receivers.length)))\n } catch (error) {\n logger.error(`[worklist] approval notice ${kind} of ${approvalId} could not be made`, error)\n }\n}\n\n/** What a turn notice tells of - the approval row whose turn it is. */\nexport const approvalNoticeKey = (approvalId: string) => `approval:${approvalId}`\n\n/**\n * Closes the turn notices of approval rows that are no longer waiting - judged, handed on, withdrawn or closed with\n * their case (ADR-0164 amendment 1): everyone the turn was told to, a role's holders too, reads it as read and no screen\n * shows it. In the transaction that moved the rows, so a refused move closes nothing.\n */\nexport async function closeApprovalNotices(tx: EntityManager, rows: readonly { id: string; domainId?: string }[]): Promise<void> {\n for (const row of rows) {\n if (!row.domainId) continue\n await closeNotices(tx, { id: row.domainId }, 'approval', approvalNoticeKey(row.id))\n }\n}\n\n/**\n * Tells a person of a to-do handed to them (ADR-0200 decision 3), once the transaction has committed - unless they\n * handed it to themselves. Nothing here throws: the to-do stands without its notice.\n */\nexport function noticeHandOut(context: ResolverContext, { threadId, name, assignee }: { threadId: string; name: string; assignee: User }): void {\n try {\n const { user } = context.state\n const receivers = todoNoticeReceivers(active(assignee), user?.id)\n if (!receivers.length) return\n const address = `activity-thread/${threadId}`\n sendNoticeWhenCommitted(context, {\n type: 'todo',\n level: 'info',\n receivers,\n words: lng => todoNoticeWords(translatorOf(lng), { name, actor: user?.name }),\n address,\n link: noticeLinkOf(context, address),\n key: todoNoticeKey(threadId),\n label: `to-do notice of ${threadId}`\n })\n } catch (error) {\n logger.error(`[worklist] to-do notice of ${threadId} could not be made`, error)\n }\n}\n\n/** Only a person who can sign in is told. */\nfunction active(person?: User | null): NoticePerson | null {\n return person && person.status === UserStatus.ACTIVATED ? { id: person.id, name: person.name, email: person.email, locale: person.locale } : null\n}\n\n/** A sentence missing in the person's language is said in English, never as its key. */\nfunction translatorOf(lng: string): Translate {\n const own = translatorFor(lng)\n const english = translatorFor('en')\n return (key, options = {}) => own(key, { ...options, defaultValue: english(key, options) })\n}\n"]}
|
|
@@ -17,8 +17,10 @@ export * from './work-door/work-door-journal.js';
|
|
|
17
17
|
export * from './work-door/work-door-journal-service.js';
|
|
18
18
|
export * from './work-door/work-door-service.js';
|
|
19
19
|
export { waitingOn } from './approval-progress/waiting-on.js';
|
|
20
|
-
export
|
|
21
|
-
export
|
|
20
|
+
export { activityTKey } from './activity/decision-key-declaration.js';
|
|
21
|
+
export { PERSON_QUESTION_ACTIVITY, PERSON_QUESTION_ACTIVITIES, askPerson, closePersonQuestions } from './person-question/index.js';
|
|
22
|
+
export declare const entities: (typeof import("./activity-approval/activity-approval.js").ActivityApproval | typeof import("./activity/activity.js").Activity | typeof import("./activity/activity-history.js").ActivityHistory | typeof import("./activity-instance/activity-instance.js").ActivityInstance | typeof import("./activity-instance/activity-instance-history.js").ActivityInstanceHistory | typeof import("./activity-template/activity-template.js").ActivityTemplate | typeof import("./activity-template/activity-template-history.js").ActivityTemplateHistory | typeof import("./activity-thread/activity-thread.js").ActivityThread | typeof import("./activity-thread/activity-thread-history.js").ActivityThreadHistory | typeof import("./installable-activity/installable-activity.js").InstallableActivity | typeof import("./activity-summary/activity-summary.js").ActivitySummary | typeof import("./work-door/work-door-not-used.js").WorkDoorNotUsed | typeof import("./work-door/work-door-journal.js").WorkDoorJournal)[];
|
|
23
|
+
export declare const subscribers: (typeof import("./activity-approval/event-subscriber.js").ActivityApprovalSubscriber | typeof import("./activity-instance/event-subscriber.js").ActivityInstanceSubscriber | typeof import("./activity-instance/event-subscriber.js").ActivityInstanceHistoryEntitySubscriber | typeof import("./activity/event-subscriber.js").ActivityHistoryEntitySubscriber | typeof import("./activity/declaration-guard-subscriber.js").ActivityDeclarationGuardSubscriber | typeof import("./activity-thread/event-subscriber.js").ActivityThreadSubscriber | typeof import("./activity-thread/event-subscriber.js").ActivityThreadHistoryEntitySubscriber)[];
|
|
22
24
|
export declare const schema: {
|
|
23
|
-
resolverClasses: (typeof import("./activity-stats/activity-stats-query.js").ActivityStatsQuery | typeof import("./activity-approval/activity-approval-query.js").ActivityApprovalQuery | typeof import("./activity-approval/activity-approval-mutation.js").ActivityApprovalMutation | typeof import("./activity-approval/activity-approval-subscription.js").ActivityApprovalSubscription | typeof import("./activity/activity-
|
|
25
|
+
resolverClasses: (typeof import("./person-question/person-question-resolver.js").PersonQuestionMutation | typeof import("./activity-stats/activity-stats-query.js").ActivityStatsQuery | typeof import("./activity-approval/activity-approval-query.js").ActivityApprovalQuery | typeof import("./activity-approval/activity-approval-mutation.js").ActivityApprovalMutation | typeof import("./activity-approval/activity-approval-subscription.js").ActivityApprovalSubscription | typeof import("./activity/activity-query.js").ActivityQuery | typeof import("./activity/activity-mutation.js").ActivityMutation | typeof import("./activity-instance/activity-instance-query.js").ActivityInstanceQuery | typeof import("./activity-instance/activity-instance-mutation.js").ActivityInstanceMutation | typeof import("./activity-instance/activity-instance-subscription.js").ActivityInstanceSubscription | typeof import("./activity-template/activity-template-query.js").ActivityTemplateQuery | typeof import("./activity-template/activity-template-mutation.js").ActivityTemplateMutation | typeof import("./activity-thread/activity-thread-query.js").ActivityThreadQuery | typeof import("./activity-thread/activity-thread-history-query.js").ActivityThreadHistoryQuery | typeof import("./activity-thread/activity-thread-mutation.js").ActivityThreadMutation | typeof import("./activity-thread/activity-thread-subscription.js").ActivityThreadSubscription | typeof import("./installable-activity/installable-activity-query.js").InstallableActivityQuery | typeof import("./installable-activity/installable-activity-mutation.js").InstallableActivityMutation | typeof import("./activity-summary/activity-summary-query.js").ActivitySummaryQuery | typeof import("./activity-summary/person-open-work.js").PersonOpenWorkQuery | typeof import("./work-door/work-door-resolver.js").WorkDoorResolver | typeof import("./approval-progress/approval-progress-query.js").ApprovalProgressQuery)[];
|
|
24
26
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.schema = exports.subscribers = exports.entities = exports.waitingOn = void 0;
|
|
3
|
+
exports.schema = exports.subscribers = exports.entities = exports.closePersonQuestions = exports.askPerson = exports.PERSON_QUESTION_ACTIVITIES = exports.PERSON_QUESTION_ACTIVITY = exports.activityTKey = exports.waitingOn = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
/* EXPORT ENTITY TYPES */
|
|
6
6
|
tslib_1.__exportStar(require("./activity-approval/activity-approval.js"), exports);
|
|
@@ -21,6 +21,7 @@ const index_js_7 = require("./installable-activity/index.js");
|
|
|
21
21
|
const index_js_8 = require("./activity-summary/index.js");
|
|
22
22
|
const index_js_9 = require("./work-door/index.js");
|
|
23
23
|
const index_js_10 = require("./approval-progress/index.js");
|
|
24
|
+
const index_js_11 = require("./person-question/index.js");
|
|
24
25
|
/*
|
|
25
26
|
* 업무 문의 판정과 선언은 **앱이 부른다** — 등록(`registerWorkDoors`) · 갈래(`passWorkDoor`) · 결재선
|
|
26
27
|
* 판정이 여기로 나가야 앱이 그것을 쓸 수 있다. 엔티티와 리졸버만 등록하고 이 줄을 빠뜨리면 모듈은
|
|
@@ -44,6 +45,14 @@ tslib_1.__exportStar(require("./work-door/work-door-service.js"), exports);
|
|
|
44
45
|
/* Whom a case waits on now - Office's approval doors name them beside a waiting request (ADR-0183). */
|
|
45
46
|
var waiting_on_js_1 = require("./approval-progress/waiting-on.js");
|
|
46
47
|
Object.defineProperty(exports, "waitingOn", { enumerable: true, get: function () { return waiting_on_js_1.waitingOn; } });
|
|
48
|
+
/* The key a kind of work is named by on a screen - a report that lists activities says them as the worklist does. */
|
|
49
|
+
var decision_key_declaration_js_1 = require("./activity/decision-key-declaration.js");
|
|
50
|
+
Object.defineProperty(exports, "activityTKey", { enumerable: true, get: function () { return decision_key_declaration_js_1.activityTKey; } });
|
|
51
|
+
var index_js_12 = require("./person-question/index.js");
|
|
52
|
+
Object.defineProperty(exports, "PERSON_QUESTION_ACTIVITY", { enumerable: true, get: function () { return index_js_12.PERSON_QUESTION_ACTIVITY; } });
|
|
53
|
+
Object.defineProperty(exports, "PERSON_QUESTION_ACTIVITIES", { enumerable: true, get: function () { return index_js_12.PERSON_QUESTION_ACTIVITIES; } });
|
|
54
|
+
Object.defineProperty(exports, "askPerson", { enumerable: true, get: function () { return index_js_12.askPerson; } });
|
|
55
|
+
Object.defineProperty(exports, "closePersonQuestions", { enumerable: true, get: function () { return index_js_12.closePersonQuestions; } });
|
|
47
56
|
exports.entities = [
|
|
48
57
|
/* ENTITIES */
|
|
49
58
|
...index_js_2.entities,
|
|
@@ -74,7 +83,8 @@ exports.schema = {
|
|
|
74
83
|
...index_js_7.resolvers,
|
|
75
84
|
...index_js_8.resolvers,
|
|
76
85
|
...index_js_9.resolvers,
|
|
77
|
-
...index_js_10.resolvers
|
|
86
|
+
...index_js_10.resolvers,
|
|
87
|
+
...index_js_11.resolvers
|
|
78
88
|
]
|
|
79
89
|
};
|
|
80
90
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/service/index.ts"],"names":[],"mappings":";;;;AAAA,yBAAyB;AACzB,mFAAwD;AACxD,+EAAoD;AACpD,mFAAwD;AACxD,mFAAwD;AACxD,iEAAsC;AACtC,yFAA8D;AAC9D,iFAAsD;AAEtD,mCAAmC;AACnC,wDAA+E;AAC/E,2DAIqC;AACrC,kDAI4B;AAC5B,2DAIqC;AACrC,2DAGqC;AACrC,yDAImC;AACnC,8DAGwC;AACxC,0DAAwH;AACxH,mDAAmG;AACnG,4DAAqF;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/service/index.ts"],"names":[],"mappings":";;;;AAAA,yBAAyB;AACzB,mFAAwD;AACxD,+EAAoD;AACpD,mFAAwD;AACxD,mFAAwD;AACxD,iEAAsC;AACtC,yFAA8D;AAC9D,iFAAsD;AAEtD,mCAAmC;AACnC,wDAA+E;AAC/E,2DA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ENTITY TYPES */\nexport * from './activity-approval/activity-approval.js'\nexport * from './activity-thread/activity-thread.js'\nexport * from './activity-template/activity-template.js'\nexport * from './activity-instance/activity-instance.js'\nexport * from './activity/activity.js'\nexport * from './installable-activity/installable-activity.js'\nexport * from './activity-summary/activity-summary.js'\n\n/* IMPORT ENTITIES AND RESOLVERS */\nimport { resolvers as ActivityStatsResolvers } from './activity-stats/index.js'\nimport {\n entities as ActivityApprovalEntities,\n resolvers as ActivityApprovalResolvers,\n subscribers as ActivityApprovalSubscribers\n} from './activity-approval/index.js'\nimport {\n entities as ActivityEntities,\n resolvers as ActivityResolvers,\n subscribers as ActivitySubscribers\n} from './activity/index.js'\nimport {\n entities as ActivityInstanceEntities,\n resolvers as ActivityInstanceResolvers,\n subscribers as ActivityInstanceSubscribers\n} from './activity-instance/index.js'\nimport {\n entities as ActivityTemplateEntities,\n resolvers as ActivityTemplateResolvers\n} from './activity-template/index.js'\nimport {\n entities as ActivityThreadEntities,\n resolvers as ActivityThreadResolvers,\n subscribers as ActivityThreadSubscribers\n} from './activity-thread/index.js'\nimport {\n entities as InstallableActivityEntities,\n resolvers as InstallableActivityResolvers\n} from './installable-activity/index.js'\nimport { entities as ActivitySummaryEntities, resolvers as ActivitySummaryResolvers } from './activity-summary/index.js'\nimport { entities as WorkDoorEntities, resolvers as WorkDoorResolvers } from './work-door/index.js'\nimport { resolvers as ApprovalProgressResolvers } from './approval-progress/index.js'\nimport { resolvers as PersonQuestionResolvers } from './person-question/index.js'\n\n/*\n * 업무 문의 판정과 선언은 **앱이 부른다** — 등록(`registerWorkDoors`) · 갈래(`passWorkDoor`) · 결재선\n * 판정이 여기로 나가야 앱이 그것을 쓸 수 있다. 엔티티와 리졸버만 등록하고 이 줄을 빠뜨리면 모듈은\n * 멀쩡히 서고 앱만 「그런 export 가 없다」로 멈춘다.\n *\n * **묶음의 `index` 를 통째로 내보내지 않는다.** 그 파일은 `entities` · `resolvers` 라는 이름을 갖고\n * 있고, 이 파일도 같은 이름을 갖는다. `export *` 로 섞으면 그 이름들이 조용히 가려지거나 빠진다 —\n * 오류는 안 나고 서버가 반쯤 선다. 그래서 낼 것을 파일마다 적는다.\n */\nexport * from './work-door/work-door-declaration.js'\nexport * from './work-door/work-door-event.js'\nexport * from './work-door/pass-work-door.js'\nexport * from './work-door/approval-line-standing.js'\nexport * from './work-door/activity-lookup.js'\nexport * from './work-door/work-door.js'\nexport * from './work-door/work-door-type.js'\nexport * from './work-door/work-door-not-used.js'\nexport * from './work-door/work-door-journal.js'\nexport * from './work-door/work-door-journal-service.js'\nexport * from './work-door/work-door-service.js'\n/* Whom a case waits on now - Office's approval doors name them beside a waiting request (ADR-0183). */\nexport { waitingOn } from './approval-progress/waiting-on.js'\n/* The key a kind of work is named by on a screen - a report that lists activities says them as the worklist does. */\nexport { activityTKey } from './activity/decision-key-declaration.js'\nexport { PERSON_QUESTION_ACTIVITY, PERSON_QUESTION_ACTIVITIES, askPerson, closePersonQuestions } from './person-question/index.js'\n\nexport const entities = [\n /* ENTITIES */\n ...ActivityApprovalEntities,\n ...ActivityEntities,\n ...ActivityInstanceEntities,\n ...ActivityTemplateEntities,\n ...ActivityThreadEntities,\n ...InstallableActivityEntities,\n ...ActivitySummaryEntities,\n ...WorkDoorEntities\n]\n\nexport const subscribers = [\n /* SUBSCRIBERS */\n ...ActivityApprovalSubscribers,\n ...ActivityInstanceSubscribers,\n ...ActivitySubscribers,\n ...ActivityThreadSubscribers\n]\n\nexport const schema = {\n resolverClasses: [\n /* RESOLVER CLASSES */\n ...ActivityStatsResolvers,\n ...ActivityApprovalResolvers,\n ...ActivityResolvers,\n ...ActivityInstanceResolvers,\n ...ActivityTemplateResolvers,\n ...ActivityThreadResolvers,\n ...InstallableActivityResolvers,\n ...ActivitySummaryResolvers,\n ...WorkDoorResolvers,\n ...ApprovalProgressResolvers,\n ...PersonQuestionResolvers\n ]\n}\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { PersonQuestionMutation } from './person-question-resolver.js';
|
|
2
|
+
export { PERSON_QUESTION_ACTIVITY, PERSON_QUESTION_ACTIVITIES } from './person-question-activity.js';
|
|
3
|
+
export { askPerson, closePersonQuestions, PERSON_QUESTION_LIMIT, type PersonQuestion } from './person-question-service.js';
|
|
4
|
+
export declare const resolvers: (typeof PersonQuestionMutation)[];
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolvers = exports.PERSON_QUESTION_LIMIT = exports.closePersonQuestions = exports.askPerson = exports.PERSON_QUESTION_ACTIVITIES = exports.PERSON_QUESTION_ACTIVITY = void 0;
|
|
4
|
+
const activity_installation_controller_js_1 = require("../../controllers/activity-installation/activity-installation-controller.js");
|
|
5
|
+
const person_question_activity_js_1 = require("./person-question-activity.js");
|
|
6
|
+
const person_question_resolver_js_1 = require("./person-question-resolver.js");
|
|
7
|
+
const person_question_card_js_1 = require("./person-question-card.js");
|
|
8
|
+
var person_question_activity_js_2 = require("./person-question-activity.js");
|
|
9
|
+
Object.defineProperty(exports, "PERSON_QUESTION_ACTIVITY", { enumerable: true, get: function () { return person_question_activity_js_2.PERSON_QUESTION_ACTIVITY; } });
|
|
10
|
+
Object.defineProperty(exports, "PERSON_QUESTION_ACTIVITIES", { enumerable: true, get: function () { return person_question_activity_js_2.PERSON_QUESTION_ACTIVITIES; } });
|
|
11
|
+
var person_question_service_js_1 = require("./person-question-service.js");
|
|
12
|
+
Object.defineProperty(exports, "askPerson", { enumerable: true, get: function () { return person_question_service_js_1.askPerson; } });
|
|
13
|
+
Object.defineProperty(exports, "closePersonQuestions", { enumerable: true, get: function () { return person_question_service_js_1.closePersonQuestions; } });
|
|
14
|
+
Object.defineProperty(exports, "PERSON_QUESTION_LIMIT", { enumerable: true, get: function () { return person_question_service_js_1.PERSON_QUESTION_LIMIT; } });
|
|
15
|
+
(0, person_question_card_js_1.registerPersonQuestionCard)();
|
|
16
|
+
/* Installable by name - an app lists it in what it installs into its domains (Office REQUIRED_ACTIVITIES). */
|
|
17
|
+
person_question_activity_js_1.PERSON_QUESTION_ACTIVITIES.forEach(template => activity_installation_controller_js_1.ActivityInstallations.installActivityTemplate(template));
|
|
18
|
+
exports.resolvers = [person_question_resolver_js_1.PersonQuestionMutation];
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/person-question/index.ts"],"names":[],"mappings":";;;AAAA,qIAAmH;AACnH,+EAA0E;AAC1E,+EAAsE;AACtE,uEAAsE;AAEtE,6EAAoG;AAA3F,uIAAA,wBAAwB,OAAA;AAAE,yIAAA,0BAA0B,OAAA;AAC7D,2EAA0H;AAAjH,uHAAA,SAAS,OAAA;AAAE,kIAAA,oBAAoB,OAAA;AAAE,mIAAA,qBAAqB,OAAA;AAE/D,IAAA,oDAA0B,GAAE,CAAA;AAC5B,8GAA8G;AAC9G,wDAA0B,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC,2DAAqB,CAAC,uBAAuB,CAAC,QAAe,CAAC,CAAC,CAAA;AAEjG,QAAA,SAAS,GAAG,CAAC,oDAAsB,CAAC,CAAA","sourcesContent":["import { ActivityInstallations } from '../../controllers/activity-installation/activity-installation-controller.js'\nimport { PERSON_QUESTION_ACTIVITIES } from './person-question-activity.js'\nimport { PersonQuestionMutation } from './person-question-resolver.js'\nimport { registerPersonQuestionCard } from './person-question-card.js'\n\nexport { PERSON_QUESTION_ACTIVITY, PERSON_QUESTION_ACTIVITIES } from './person-question-activity.js'\nexport { askPerson, closePersonQuestions, PERSON_QUESTION_LIMIT, type PersonQuestion } from './person-question-service.js'\n\nregisterPersonQuestionCard()\n/* Installable by name - an app lists it in what it installs into its domains (Office REQUIRED_ACTIVITIES). */\nPERSON_QUESTION_ACTIVITIES.forEach(template => ActivityInstallations.installActivityTemplate(template as any))\n\nexport const resolvers = [PersonQuestionMutation]\n"]}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
export declare const PERSON_QUESTION_ACTIVITY = "Person Question";
|
|
2
|
+
export declare const PERSON_QUESTION_ACTIVITIES: {
|
|
3
|
+
name: string;
|
|
4
|
+
label: string;
|
|
5
|
+
description: string;
|
|
6
|
+
guide: string[];
|
|
7
|
+
release: string;
|
|
8
|
+
provider: string;
|
|
9
|
+
category: string;
|
|
10
|
+
activityType: string;
|
|
11
|
+
priority: number;
|
|
12
|
+
startingType: string;
|
|
13
|
+
multiple: string;
|
|
14
|
+
uiType: string;
|
|
15
|
+
uiSource: string;
|
|
16
|
+
searchKeys: {
|
|
17
|
+
name: string;
|
|
18
|
+
description: string;
|
|
19
|
+
inputKey: string;
|
|
20
|
+
tKey: string;
|
|
21
|
+
}[];
|
|
22
|
+
decisionKeys: {
|
|
23
|
+
role: string;
|
|
24
|
+
inputPath: string;
|
|
25
|
+
name: string;
|
|
26
|
+
}[];
|
|
27
|
+
viewType: string;
|
|
28
|
+
viewSource: string;
|
|
29
|
+
model: ({
|
|
30
|
+
name: string;
|
|
31
|
+
description: string;
|
|
32
|
+
tag: string;
|
|
33
|
+
hidden: boolean;
|
|
34
|
+
mandatory: boolean;
|
|
35
|
+
inout: string;
|
|
36
|
+
type: string;
|
|
37
|
+
options: {};
|
|
38
|
+
unit: any;
|
|
39
|
+
quantifier: number[];
|
|
40
|
+
spec: {};
|
|
41
|
+
} | {
|
|
42
|
+
name: string;
|
|
43
|
+
description: string;
|
|
44
|
+
tag: string;
|
|
45
|
+
hidden: boolean;
|
|
46
|
+
inout: string;
|
|
47
|
+
type: string;
|
|
48
|
+
options: {};
|
|
49
|
+
unit: any;
|
|
50
|
+
quantifier: number[];
|
|
51
|
+
spec: {};
|
|
52
|
+
mandatory?: undefined;
|
|
53
|
+
} | {
|
|
54
|
+
name: string;
|
|
55
|
+
description: string;
|
|
56
|
+
tag: string;
|
|
57
|
+
inout: string;
|
|
58
|
+
type: string;
|
|
59
|
+
options: {};
|
|
60
|
+
unit: any;
|
|
61
|
+
quantifier: number[];
|
|
62
|
+
spec: {};
|
|
63
|
+
hidden?: undefined;
|
|
64
|
+
mandatory?: undefined;
|
|
65
|
+
})[];
|
|
66
|
+
standardTime: number;
|
|
67
|
+
}[];
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PERSON_QUESTION_ACTIVITIES = exports.PERSON_QUESTION_ACTIVITY = void 0;
|
|
4
|
+
/*
|
|
5
|
+
* 본인 확인 요청 (ADR-0200 decision 3) - a question asked about someone in a conversation that their records could not
|
|
6
|
+
* answer: whether something can be done, by when, whether they agree. It goes to them as a to-do; the to-do shows the
|
|
7
|
+
* question, what the records already answered, what is theirs to decide and a draft drawn from their records, and opens
|
|
8
|
+
* the conversation. Their answer there ends it.
|
|
9
|
+
*/
|
|
10
|
+
exports.PERSON_QUESTION_ACTIVITY = 'Person Question';
|
|
11
|
+
exports.PERSON_QUESTION_ACTIVITIES = [
|
|
12
|
+
{
|
|
13
|
+
name: exports.PERSON_QUESTION_ACTIVITY,
|
|
14
|
+
label: 'confirmation request',
|
|
15
|
+
description: 'A question about a person that only they can answer, handed to them from a conversation',
|
|
16
|
+
guide: [
|
|
17
|
+
'the assistant offers it in a conversation about a person, and the one asking presses it.',
|
|
18
|
+
'it shows the question, what the records already answered, what is the person\'s to decide and a draft answer.',
|
|
19
|
+
'answering in the conversation ends it.'
|
|
20
|
+
],
|
|
21
|
+
release: '1.0.0',
|
|
22
|
+
provider: 'hatiolab.com',
|
|
23
|
+
category: 'collaboration',
|
|
24
|
+
activityType: 'user',
|
|
25
|
+
priority: 1,
|
|
26
|
+
startingType: 'issue',
|
|
27
|
+
multiple: 'single',
|
|
28
|
+
uiType: 'custom-element',
|
|
29
|
+
uiSource: 'person-question-todo',
|
|
30
|
+
searchKeys: [{ name: 'question', description: 'The question', inputKey: 'question', tKey: 'field.subject' }],
|
|
31
|
+
decisionKeys: [{ role: 'headline', inputPath: 'question', name: 'the question asked' }],
|
|
32
|
+
viewType: '',
|
|
33
|
+
viewSource: '',
|
|
34
|
+
model: [
|
|
35
|
+
{ name: 'sessionId', description: 'The conversation the question came from', tag: 'sessionId', hidden: true, mandatory: true, inout: 'in', type: 'string', options: {}, unit: null, quantifier: [1], spec: {} },
|
|
36
|
+
{ name: 'asker', description: 'Who asked', tag: 'asker', hidden: true, mandatory: true, inout: 'in', type: 'string', options: {}, unit: null, quantifier: [1], spec: {} },
|
|
37
|
+
{ name: 'question', description: 'The question', tag: 'question', hidden: true, mandatory: true, inout: 'in', type: 'string', options: {}, unit: null, quantifier: [1], spec: {} },
|
|
38
|
+
{ name: 'answered', description: 'What the records already answered', tag: 'answered', hidden: true, inout: 'in', type: 'string', options: {}, unit: null, quantifier: [1], spec: {} },
|
|
39
|
+
{ name: 'decide', description: 'What is the person\'s to decide', tag: 'decide', hidden: true, mandatory: true, inout: 'in', type: 'string', options: {}, unit: null, quantifier: [1], spec: {} },
|
|
40
|
+
{ name: 'draft', description: 'A draft answer drawn from their records', tag: 'draft', hidden: true, inout: 'in', type: 'string', options: {}, unit: null, quantifier: [1], spec: {} },
|
|
41
|
+
{ name: 'answer', description: 'What the person answered in the conversation', tag: 'answer', inout: 'out', type: 'string', options: {}, unit: null, quantifier: [1], spec: {} }
|
|
42
|
+
],
|
|
43
|
+
standardTime: 2 * 24 * 60 * 60
|
|
44
|
+
}
|
|
45
|
+
];
|
|
46
|
+
//# sourceMappingURL=person-question-activity.js.map
|