@things-factory/compliance 10.1.256 → 10.1.258
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/components/compliance-case-form.d.ts +11 -6
- package/dist-client/components/compliance-case-form.js +67 -88
- package/dist-client/components/compliance-case-form.js.map +1 -1
- package/dist-client/components/compliance-case-sheet.d.ts +14 -12
- package/dist-client/components/compliance-case-sheet.js +92 -133
- package/dist-client/components/compliance-case-sheet.js.map +1 -1
- package/dist-client/components/compliance-my-inventions.d.ts +3 -4
- package/dist-client/components/compliance-my-inventions.js +10 -30
- package/dist-client/components/compliance-my-inventions.js.map +1 -1
- package/dist-client/components/compliance-my-privacy-requests.d.ts +6 -6
- package/dist-client/components/compliance-my-privacy-requests.js +30 -66
- package/dist-client/components/compliance-my-privacy-requests.js.map +1 -1
- package/dist-client/components/compliance-my-reports.d.ts +3 -4
- package/dist-client/components/compliance-my-reports.js +19 -40
- package/dist-client/components/compliance-my-reports.js.map +1 -1
- package/dist-client/components/invention-report-form.d.ts +5 -4
- package/dist-client/components/invention-report-form.js +24 -45
- package/dist-client/components/invention-report-form.js.map +1 -1
- package/dist-client/components/my-trainings.d.ts +3 -5
- package/dist-client/components/my-trainings.js +20 -49
- package/dist-client/components/my-trainings.js.map +1 -1
- package/dist-client/components/seal-use-form.d.ts +9 -6
- package/dist-client/components/seal-use-form.js +60 -81
- package/dist-client/components/seal-use-form.js.map +1 -1
- package/dist-client/components/training-attendance-form.d.ts +6 -4
- package/dist-client/components/training-attendance-form.js +30 -50
- package/dist-client/components/training-attendance-form.js.map +1 -1
- package/dist-client/pages/regulation-detail.d.ts +15 -6
- package/dist-client/pages/regulation-detail.js +169 -142
- package/dist-client/pages/regulation-detail.js.map +1 -1
- package/dist-client/pages/regulations.d.ts +7 -5
- package/dist-client/pages/regulations.js +38 -56
- package/dist-client/pages/regulations.js.map +1 -1
- package/dist-client/regulation/regulation-guide.js +2 -1
- package/dist-client/regulation/regulation-guide.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-client/words.js +2 -2
- package/dist-client/words.js.map +1 -1
- package/dist-server/service/compliance-case/compliance-case-query.js +1 -1
- package/dist-server/service/compliance-case/compliance-case-query.js.map +1 -1
- package/dist-server/service/compliance-case/compliance-case-rules.d.ts +1 -3
- package/dist-server/service/compliance-case/compliance-case-rules.js +2 -4
- package/dist-server/service/compliance-case/compliance-case-rules.js.map +1 -1
- package/dist-server/service/compliance-case/compliance-case-service.d.ts +3 -3
- package/dist-server/service/compliance-case/compliance-case-service.js +4 -6
- package/dist-server/service/compliance-case/compliance-case-service.js.map +1 -1
- package/dist-server/service/compliance-case/compliance-case-type.js +1 -1
- package/dist-server/service/compliance-case/compliance-case-type.js.map +1 -1
- package/dist-server/service/compliance-case/compliance-case.js +1 -1
- package/dist-server/service/compliance-case/compliance-case.js.map +1 -1
- package/dist-server/service/regulation/regulation-rules.d.ts +3 -3
- package/dist-server/service/regulation/regulation-rules.js +17 -17
- package/dist-server/service/regulation/regulation-rules.js.map +1 -1
- package/dist-server/service/regulation/regulation.d.ts +1 -1
- package/dist-server/service/regulation/regulation.js +1 -1
- package/dist-server/service/regulation/regulation.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +20 -20
- package/translations/en.json +27 -14
- package/translations/es.json +27 -14
- package/translations/ja.json +27 -14
- package/translations/ko.json +27 -14
- package/translations/ms.json +27 -14
- package/translations/zh.json +27 -14
package/dist-client/words.js
CHANGED
|
@@ -6,8 +6,8 @@ export const SEAL_KINDS = ['CORPORATE', 'USE', 'OFFICIAL', 'NAMEPLATE', 'CONFIDE
|
|
|
6
6
|
export const REGULATION_KINDS = ['WORK_RULES', 'WORK_RULES_ANNEX', 'PRIVACY_POLICY', 'PRIVACY_PLAN', 'OTHER'];
|
|
7
7
|
export const PROCEDURE_KINDS = ['OPINION', 'CONSENT', 'FILING'];
|
|
8
8
|
export const PROCEDURE_METHODS = {
|
|
9
|
-
OPINION: ['
|
|
10
|
-
CONSENT: ['
|
|
9
|
+
OPINION: ['WORKERS_MEETING', 'SIGNATURES'],
|
|
10
|
+
CONSENT: ['WORKERS_MEETING', 'SIGNATURES'],
|
|
11
11
|
FILING: ['ONLINE', 'VISIT', 'MAIL']
|
|
12
12
|
};
|
|
13
13
|
const kebab = (code) => code.toLowerCase().replace(/_/g, '-');
|
package/dist-client/words.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"words.js","sourceRoot":"","sources":["../client/words.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAEvC,6DAA6D;AAC7D,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,OAAO,EAAE,UAAU,EAAE,aAAa,CAAC,CAAA;AAC7D,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,CAAC,CAAA;AAC1F,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,WAAW,EAAE,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,cAAc,CAAC,CAAA;AACvF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,YAAY,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,cAAc,EAAE,OAAO,CAAC,CAAA;AAC7G,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAA;AAC/D,MAAM,CAAC,MAAM,iBAAiB,GAA6B;IACzD,OAAO,EAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"words.js","sourceRoot":"","sources":["../client/words.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAEvC,6DAA6D;AAC7D,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,OAAO,EAAE,UAAU,EAAE,aAAa,CAAC,CAAA;AAC7D,MAAM,CAAC,M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sD;AACtD,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,KAAU,EAAE,EAAE,CAAC,KAAK,EAAE,aAAa,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,IAAI,KAAK,EAAE,OAAO,IAAI,MAAM,CAAC,KAAK,CAAC,CAAA","sourcesContent":["import { i18next } from '@operato/i18n'\n\n/* What the seal use codes read as, in the reader's words. */\nexport const USE_KINDS = ['STAMP', 'TAKE_OUT', 'CERTIFICATE']\nexport const USE_STATUSES = ['RECORDED', 'SUBMITTED', 'APPROVED', 'REJECTED', 'WITHDRAWN']\nexport const SEAL_KINDS = ['CORPORATE', 'USE', 'OFFICIAL', 'NAMEPLATE', 'CONFIDENTIAL']\nexport const REGULATION_KINDS = ['WORK_RULES', 'WORK_RULES_ANNEX', 'PRIVACY_POLICY', 'PRIVACY_PLAN', 'OTHER']\nexport const PROCEDURE_KINDS = ['OPINION', 'CONSENT', 'FILING']\nexport const PROCEDURE_METHODS: Record<string, string[]> = {\n OPINION: ['WORKERS_MEETING', 'SIGNATURES'],\n CONSENT: ['WORKERS_MEETING', 'SIGNATURES'],\n FILING: ['ONLINE', 'VISIT', 'MAIL']\n}\n\nconst kebab = (code: string) => code.toLowerCase().replace(/_/g, '-')\n/** The word for a code of a set - `text.seal-use-kind-stamp`. */\nexport const wordOf = (set: string, code?: string | null) => (code ? i18next.t(`text.${set}-${kebab(code)}`) : '')\n/** A grid's select options for a set. */\nexport const optionsOf = (set: string, codes: string[]) => codes.map(value => ({ value, display: wordOf(set, value) }))\n\n/** What a failed call says, in the server's words. */\nexport const failureOf = (error: any) => error?.graphQLErrors?.[0]?.message ?? error?.errors?.[0]?.message ?? error?.message ?? String(error)\n"]}
|
|
@@ -96,7 +96,7 @@ tslib_1.__decorate([
|
|
|
96
96
|
tslib_1.__metadata("design:returntype", Promise)
|
|
97
97
|
], ComplianceCaseQuery.prototype, "myComplianceReports", null);
|
|
98
98
|
tslib_1.__decorate([
|
|
99
|
-
(0, type_graphql_1.Query)(returns => Boolean, { description: 'Whether a case handler is left to take a report against these employees - false
|
|
99
|
+
(0, type_graphql_1.Query)(returns => Boolean, { description: 'Whether a case handler is left to take a report against these employees - false: it waits for the handler the company names' }),
|
|
100
100
|
tslib_1.__param(0, (0, type_graphql_1.Arg)('accusedIds', type => [String])),
|
|
101
101
|
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
102
102
|
tslib_1.__metadata("design:type", Function),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compliance-case-query.js","sourceRoot":"","sources":["../../../server/service/compliance-case/compliance-case-query.ts"],"names":[],"mappings":";;;;AAAA,+CAA6G;AAE7G,qEAA4D;AAC5D,yDAAgD;AAChD,+DAAuD;AACvD,iDAA+E;AAE/E,qDAA0E;AAC1E,uDAAuE;AACvE,uEAAgN;AAChN,iEAAuG;AAEvG;;;;GAIG;AAGI,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAGxB,AAAN,KAAK,CAAC,eAAe,CAA0B,MAAiB,EAAS,OAAwB;QAC/F,OAAO,MAAM,IAAA,4CAAkB,EAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAClD,CAAC;IAGK,AAAN,KAAK,CAAC,cAAc,CAAY,EAAU,EAAS,OAAwB;QACzE,OAAO,MAAM,IAAA,2CAAiB,EAAC,EAAE,EAAE,OAAO,CAAC,CAAA;IAC7C,CAAC;IAGK,AAAN,KAAK,CAAC,0BAA0B,CAAQ,OAAwB;QAC9D,OAAO,MAAM,IAAA,0CAAgB,EAAC,OAAO,CAAC,CAAA;IACxC,CAAC;IAGK,AAAN,KAAK,CAAC,mBAAmB,CAAQ,OAAwB;QACvD,OAAO,MAAM,IAAA,6CAAmB,EAAC,OAAO,CAAC,CAAA;IAC3C,CAAC;IAGK,AAAN,KAAK,CAAC,yBAAyB,CAAsC,UAAoB,EAAS,OAAwB;QACxH,OAAO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EAAS,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,KAAK,EAAS,EAAE,CAAC,CAAA;IAC7L,CAAC;IAGK,AAAN,KAAK,CAAC,OAAO,CAAS,GAAwB;QAC5C,OAAO,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,IAAA,qBAAa,EAAC,gBAAI,CAAC,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;IACnG,CAAC;CACF,CAAA;AAVY,4DAAwB;AAE7B;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,4BAAU,CAAC,EAAE,EAAE,WAAW,EAAE,wBAAwB,EAAE,CAAC;IAC5D,mBAAA,IAAA,mBAAI,GAAE,CAAA;IAA4B,mBAAA,IAAA,kBAAG,GAAE,CAAA;;6CAA3B,qCAAmB;;2DAEjD;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACjC,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAM,qCAAmB;;uDAE7C;mCATU,wBAAwB;IADpC,IAAA,uBAAQ,EAAC,qCAAmB,CAAC;GACjB,wBAAwB,CAUpC","sourcesContent":["import { Arg, Args, Ctx, Directive, FieldResolver, Query, Resolver, Root, UseMiddleware } from 'type-graphql'\n\nimport { Attachment } from '@things-factory/attachment-base'\nimport { User } from '@things-factory/auth-base'\nimport { Employee } from '@things-factory/organization'\nimport { getRepository, ListParam, SpeakRefusals } from '@things-factory/shell'\n\nimport { ComplianceCorrection, correctionsOf } from '../common/correction'\nimport { ComplianceCase, ComplianceCaseEntry } from './compliance-case'\nimport { CASE_ENTRY_REF_TYPE, CASE_REF_TYPE, casePeople, complianceCaseFor, complianceCasesFor, insideHandlerLeft, investigatorChoices, myComplianceReports, myInvestigations } from './compliance-case-service'\nimport { ComplianceCaseList, ComplianceCasePerson, ComplianceReportView } from './compliance-case-type'\n\n/*\n * The doors that hand out cases (ADR-0187 decision 21). The `ComplianceCase` type, investigation and all, is answered\n * only by the doors that ask for the whole sight - the handlers' list, one case, an investigator's list; the reporter\n * and the victim read `ComplianceReportView`, which has no field of the investigation.\n */\n@Resolver(ComplianceCase)\n@UseMiddleware(SpeakRefusals)\nexport class ComplianceCaseQuery {\n @Directive('@privilege(category: \"compliance-case\", privilege: \"query\", domainOwnerGranted: true)')\n @Query(returns => ComplianceCaseList, { description: '신고 사건 - the cases the handler reads; never one they are reported against (ADR-0187 decision 21)' })\n async complianceCases(@Args(type => ListParam) params: ListParam, @Ctx() context: ResolverContext): Promise<ComplianceCaseList> {\n return await complianceCasesFor(params, context)\n }\n\n @Query(returns => ComplianceCase, { description: 'One case, whole - for its handlers and its investigators, never one reported against' })\n async complianceCase(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<ComplianceCase> {\n return await complianceCaseFor(id, context)\n }\n\n @Query(returns => [ComplianceCase], { description: 'The cases the request investigates - an investigator who is no case handler reads them here' })\n async myComplianceInvestigations(@Ctx() context: ResolverContext): Promise<ComplianceCase[]> {\n return await myInvestigations(context)\n }\n\n @Query(returns => [ComplianceReportView], { description: 'The cases the request reported or that happened to them - their progress, protection and result' })\n async myComplianceReports(@Ctx() context: ResolverContext): Promise<ComplianceReportView[]> {\n return await myComplianceReports(context)\n }\n\n @Query(returns => Boolean, { description: 'Whether a case handler is left to take a report against these employees - false sends the reporter to the labour ministry' })\n async complianceCaseHandlerLeft(@Arg('accusedIds', type => [String]) accusedIds: string[], @Ctx() context: ResolverContext): Promise<boolean> {\n return await insideHandlerLeft(accusedIds, context)\n }\n\n @Query(returns => [ComplianceCasePerson], { description: 'Employees still working here a report may name, found by name - for an employee making a report' })\n async complianceCasePeople(@Arg('text') text: string, @Ctx() context: ResolverContext): Promise<ComplianceCasePerson[]> {\n return await casePeople(text, context)\n }\n\n @Directive('@privilege(category: \"compliance-case\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Query(returns => [ComplianceCasePerson], { description: 'Users of the domain a case handler may name as investigators, found by name or mail' })\n async complianceCaseInvestigatorChoices(@Arg('text') text: string, @Ctx() context: ResolverContext): Promise<ComplianceCasePerson[]> {\n return await investigatorChoices(text, context)\n }\n\n @FieldResolver(type => Employee, { nullable: true })\n async reporter(@Root() row: ComplianceCase): Promise<Employee | null> {\n return row.reporterId ? await getRepository(Employee).findOne({ where: { id: row.reporterId } }) : null\n }\n\n @FieldResolver(type => Employee, { nullable: true })\n async victim(@Root() row: ComplianceCase): Promise<Employee | null> {\n return row.victimId ? await getRepository(Employee).findOne({ where: { id: row.victimId } }) : null\n }\n\n @FieldResolver(type => [Employee])\n async accused(@Root() row: ComplianceCase): Promise<Employee[]> {\n return row.accused ?? (await getRepository(ComplianceCase).findOne({ where: { id: row.id }, relations: ['accused'] }))?.accused ?? []\n }\n\n @FieldResolver(type => [User])\n async investigators(@Root() row: ComplianceCase): Promise<User[]> {\n return row.investigators ?? (await getRepository(ComplianceCase).findOne({ where: { id: row.id }, relations: ['investigators'] }))?.investigators ?? []\n }\n\n @FieldResolver(type => [ComplianceCaseEntry], { description: 'The investigation record, oldest first' })\n async entries(@Root() row: ComplianceCase): Promise<ComplianceCaseEntry[]> {\n return await getRepository(ComplianceCaseEntry).find({ where: { complianceCase: { id: row.id } } as any, order: { writtenOn: 'ASC', createdAt: 'ASC' } as any })\n }\n\n @FieldResolver(type => [Attachment], { description: 'The files of the report' })\n async attachments(@Root() row: ComplianceCase, @Ctx() context: ResolverContext): Promise<Attachment[]> {\n return await getRepository(Attachment).find({ where: { domain: { id: context.state.domain.id }, refType: CASE_REF_TYPE, refBy: row.id } as any, order: { createdAt: 'ASC' } as any })\n }\n\n @FieldResolver(type => [ComplianceCorrection], { description: 'The values changed after they were written' })\n async corrections(@Root() row: ComplianceCase, @Ctx() context: ResolverContext): Promise<ComplianceCorrection[]> {\n return await correctionsOf(getRepository(ComplianceCase).manager, context.state.domain, { kind: CASE_REF_TYPE, id: row.id })\n }\n\n @FieldResolver(type => User, { nullable: true })\n async creator(@Root() row: ComplianceCase): Promise<User | null> {\n return row.creatorId ? await getRepository(User).findOne({ where: { id: row.creatorId } }) : null\n }\n}\n\n@Resolver(ComplianceCaseEntry)\nexport class ComplianceCaseEntryQuery {\n @FieldResolver(type => [Attachment], { description: 'The files of the entry' })\n async attachments(@Root() row: ComplianceCaseEntry, @Ctx() context: ResolverContext): Promise<Attachment[]> {\n return await getRepository(Attachment).find({ where: { domain: { id: context.state.domain.id }, refType: CASE_ENTRY_REF_TYPE, refBy: row.id } as any, order: { createdAt: 'ASC' } as any })\n }\n\n @FieldResolver(type => User, { nullable: true })\n async creator(@Root() row: ComplianceCaseEntry): Promise<User | null> {\n return row.creatorId ? await getRepository(User).findOne({ where: { id: row.creatorId } }) : null\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"compliance-case-query.js","sourceRoot":"","sources":["../../../server/service/compliance-case/compliance-case-query.ts"],"names":[],"mappings":";;;;AAAA,+CAA6G;AAE7G,qEAA4D;AAC5D,yDAAgD;AAChD,+DAAuD;AACvD,iDAA+E;AAE/E,qDAA0E;AAC1E,uDAAuE;AACvE,uEAAgN;AAChN,iEAAuG;AAEvG;;;;GAIG;AAGI,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAGxB,AAAN,KAAK,CAAC,eAAe,CAA0B,MAAiB,EAAS,OAAwB;QAC/F,OAAO,MAAM,IAAA,4CAAkB,EAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAClD,CAAC;IAGK,AAAN,KAAK,CAAC,cAAc,CAAY,EAAU,EAAS,OAAwB;QACzE,OAAO,MAAM,IAAA,2CAAiB,EAAC,EAAE,EAAE,OAAO,CAAC,CAAA;IAC7C,CAAC;IAGK,AAAN,KAAK,CAAC,0BAA0B,CAAQ,OAAwB;QAC9D,OAAO,MAAM,IAAA,0CAAgB,EAAC,OAAO,C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,qBAAa,EAAC,4BAAU,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,6CAAmB,EAAE,KAAK,EAAE,GAAG,CAAC,EAAE,EAAS,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,KAAK,EAAS,EAAE,CAAC,CAAA;IAC7L,CAAC;IAGK,AAAN,KAAK,CAAC,OAAO,CAAS,GAAwB;QAC5C,OAAO,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,IAAA,qBAAa,EAAC,gBAAI,CAAC,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;IACnG,CAAC;CACF,CAAA;AAVY,4DAAwB;AAE7B;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,4BAAU,CAAC,EAAE,EAAE,WAAW,EAAE,wBAAwB,EAAE,CAAC;IAC5D,mBAAA,IAAA,mBAAI,GAAE,CAAA;IAA4B,mBAAA,IAAA,kBAAG,GAAE,CAAA;;6CAA3B,qCAAmB;;2DAEjD;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACjC,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAM,qCAAmB;;uDAE7C;mCATU,wBAAwB;IADpC,IAAA,uBAAQ,EAAC,qCAAmB,CAAC;GACjB,wBAAwB,CAUpC","sourcesContent":["import { Arg, Args, Ctx, Directive, FieldResolver, Query, Resolver, Root, UseMiddleware } from 'type-graphql'\n\nimport { Attachment } from '@things-factory/attachment-base'\nimport { User } from '@things-factory/auth-base'\nimport { Employee } from '@things-factory/organization'\nimport { getRepository, ListParam, SpeakRefusals } from '@things-factory/shell'\n\nimport { ComplianceCorrection, correctionsOf } from '../common/correction'\nimport { ComplianceCase, ComplianceCaseEntry } from './compliance-case'\nimport { CASE_ENTRY_REF_TYPE, CASE_REF_TYPE, casePeople, complianceCaseFor, complianceCasesFor, insideHandlerLeft, investigatorChoices, myComplianceReports, myInvestigations } from './compliance-case-service'\nimport { ComplianceCaseList, ComplianceCasePerson, ComplianceReportView } from './compliance-case-type'\n\n/*\n * The doors that hand out cases (ADR-0187 decision 21). The `ComplianceCase` type, investigation and all, is answered\n * only by the doors that ask for the whole sight - the handlers' list, one case, an investigator's list; the reporter\n * and the victim read `ComplianceReportView`, which has no field of the investigation.\n */\n@Resolver(ComplianceCase)\n@UseMiddleware(SpeakRefusals)\nexport class ComplianceCaseQuery {\n @Directive('@privilege(category: \"compliance-case\", privilege: \"query\", domainOwnerGranted: true)')\n @Query(returns => ComplianceCaseList, { description: '신고 사건 - the cases the handler reads; never one they are reported against (ADR-0187 decision 21)' })\n async complianceCases(@Args(type => ListParam) params: ListParam, @Ctx() context: ResolverContext): Promise<ComplianceCaseList> {\n return await complianceCasesFor(params, context)\n }\n\n @Query(returns => ComplianceCase, { description: 'One case, whole - for its handlers and its investigators, never one reported against' })\n async complianceCase(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<ComplianceCase> {\n return await complianceCaseFor(id, context)\n }\n\n @Query(returns => [ComplianceCase], { description: 'The cases the request investigates - an investigator who is no case handler reads them here' })\n async myComplianceInvestigations(@Ctx() context: ResolverContext): Promise<ComplianceCase[]> {\n return await myInvestigations(context)\n }\n\n @Query(returns => [ComplianceReportView], { description: 'The cases the request reported or that happened to them - their progress, protection and result' })\n async myComplianceReports(@Ctx() context: ResolverContext): Promise<ComplianceReportView[]> {\n return await myComplianceReports(context)\n }\n\n @Query(returns => Boolean, { description: 'Whether a case handler is left to take a report against these employees - false: it waits for the handler the company names' })\n async complianceCaseHandlerLeft(@Arg('accusedIds', type => [String]) accusedIds: string[], @Ctx() context: ResolverContext): Promise<boolean> {\n return await insideHandlerLeft(accusedIds, context)\n }\n\n @Query(returns => [ComplianceCasePerson], { description: 'Employees still working here a report may name, found by name - for an employee making a report' })\n async complianceCasePeople(@Arg('text') text: string, @Ctx() context: ResolverContext): Promise<ComplianceCasePerson[]> {\n return await casePeople(text, context)\n }\n\n @Directive('@privilege(category: \"compliance-case\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Query(returns => [ComplianceCasePerson], { description: 'Users of the domain a case handler may name as investigators, found by name or mail' })\n async complianceCaseInvestigatorChoices(@Arg('text') text: string, @Ctx() context: ResolverContext): Promise<ComplianceCasePerson[]> {\n return await investigatorChoices(text, context)\n }\n\n @FieldResolver(type => Employee, { nullable: true })\n async reporter(@Root() row: ComplianceCase): Promise<Employee | null> {\n return row.reporterId ? await getRepository(Employee).findOne({ where: { id: row.reporterId } }) : null\n }\n\n @FieldResolver(type => Employee, { nullable: true })\n async victim(@Root() row: ComplianceCase): Promise<Employee | null> {\n return row.victimId ? await getRepository(Employee).findOne({ where: { id: row.victimId } }) : null\n }\n\n @FieldResolver(type => [Employee])\n async accused(@Root() row: ComplianceCase): Promise<Employee[]> {\n return row.accused ?? (await getRepository(ComplianceCase).findOne({ where: { id: row.id }, relations: ['accused'] }))?.accused ?? []\n }\n\n @FieldResolver(type => [User])\n async investigators(@Root() row: ComplianceCase): Promise<User[]> {\n return row.investigators ?? (await getRepository(ComplianceCase).findOne({ where: { id: row.id }, relations: ['investigators'] }))?.investigators ?? []\n }\n\n @FieldResolver(type => [ComplianceCaseEntry], { description: 'The investigation record, oldest first' })\n async entries(@Root() row: ComplianceCase): Promise<ComplianceCaseEntry[]> {\n return await getRepository(ComplianceCaseEntry).find({ where: { complianceCase: { id: row.id } } as any, order: { writtenOn: 'ASC', createdAt: 'ASC' } as any })\n }\n\n @FieldResolver(type => [Attachment], { description: 'The files of the report' })\n async attachments(@Root() row: ComplianceCase, @Ctx() context: ResolverContext): Promise<Attachment[]> {\n return await getRepository(Attachment).find({ where: { domain: { id: context.state.domain.id }, refType: CASE_REF_TYPE, refBy: row.id } as any, order: { createdAt: 'ASC' } as any })\n }\n\n @FieldResolver(type => [ComplianceCorrection], { description: 'The values changed after they were written' })\n async corrections(@Root() row: ComplianceCase, @Ctx() context: ResolverContext): Promise<ComplianceCorrection[]> {\n return await correctionsOf(getRepository(ComplianceCase).manager, context.state.domain, { kind: CASE_REF_TYPE, id: row.id })\n }\n\n @FieldResolver(type => User, { nullable: true })\n async creator(@Root() row: ComplianceCase): Promise<User | null> {\n return row.creatorId ? await getRepository(User).findOne({ where: { id: row.creatorId } }) : null\n }\n}\n\n@Resolver(ComplianceCaseEntry)\nexport class ComplianceCaseEntryQuery {\n @FieldResolver(type => [Attachment], { description: 'The files of the entry' })\n async attachments(@Root() row: ComplianceCaseEntry, @Ctx() context: ResolverContext): Promise<Attachment[]> {\n return await getRepository(Attachment).find({ where: { domain: { id: context.state.domain.id }, refType: CASE_ENTRY_REF_TYPE, refBy: row.id } as any, order: { createdAt: 'ASC' } as any })\n }\n\n @FieldResolver(type => User, { nullable: true })\n async creator(@Root() row: ComplianceCaseEntry): Promise<User | null> {\n return row.creatorId ? await getRepository(User).findOne({ where: { id: row.creatorId } }) : null\n }\n}\n"]}
|
|
@@ -20,8 +20,6 @@ export interface CaseFacts {
|
|
|
20
20
|
accusedUserIds: readonly string[];
|
|
21
21
|
accusedEmployeeIds: readonly string[];
|
|
22
22
|
investigatorIds: readonly string[];
|
|
23
|
-
/** Every handler was among those reported against when it came in - nobody inside the company investigates it. */
|
|
24
|
-
noInsideHandler?: boolean | null;
|
|
25
23
|
}
|
|
26
24
|
export interface CaseViewer {
|
|
27
25
|
userId: string;
|
|
@@ -34,7 +32,7 @@ export interface CaseViewer {
|
|
|
34
32
|
export declare function isAccused(facts: CaseFacts, viewer: CaseViewer): boolean;
|
|
35
33
|
/** What the viewer reads of the case. One reported against reads nothing of it, handler or investigator though they be. */
|
|
36
34
|
export declare function caseSightOf(facts: CaseFacts, viewer: CaseViewer): CaseSight;
|
|
37
|
-
/** The handlers left to take a case - those not reported against. None left means
|
|
35
|
+
/** The handlers left to take a case - those not reported against. None left means the case waits until the company names a handler. */
|
|
38
36
|
export declare function handlersLeft(handlerUserIds: readonly string[], accusedUserIds: readonly string[]): string[];
|
|
39
37
|
/** Where a case stands, read from what has been written on it. */
|
|
40
38
|
export declare function caseStatusOf(row: {
|
|
@@ -34,16 +34,14 @@ function caseSightOf(facts, viewer) {
|
|
|
34
34
|
if (isAccused(facts, viewer))
|
|
35
35
|
return null;
|
|
36
36
|
const reporter = !!facts.reporterUserId && facts.reporterUserId === viewer.userId;
|
|
37
|
-
/*
|
|
38
|
-
if (facts.noInsideHandler)
|
|
39
|
-
return reporter ? 'PARTY' : null;
|
|
37
|
+
/* A case that came in with no handler left is read by the handler the company names after it (amendment 5). */
|
|
40
38
|
if (viewer.handler || facts.investigatorIds.includes(viewer.userId))
|
|
41
39
|
return 'FULL';
|
|
42
40
|
if (reporter || (!!facts.victimUserId && facts.victimUserId === viewer.userId))
|
|
43
41
|
return 'PARTY';
|
|
44
42
|
return null;
|
|
45
43
|
}
|
|
46
|
-
/** The handlers left to take a case - those not reported against. None left means
|
|
44
|
+
/** The handlers left to take a case - those not reported against. None left means the case waits until the company names a handler. */
|
|
47
45
|
function handlersLeft(handlerUserIds, accusedUserIds) {
|
|
48
46
|
return handlerUserIds.filter(id => !accusedUserIds.includes(id));
|
|
49
47
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compliance-case-rules.js","sourceRoot":"","sources":["../../../server/service/compliance-case/compliance-case-rules.ts"],"names":[],"mappings":";;;AA8CA,8BAEC;AAGD,kCAQC;AAGD,oCAEC;AAGD,oCAMC;AAGD,0BAGC;AAGD,kDAGC;AAGD,8CAEC;AAUD,8CAMC;AAOD,kDAYC;AA7HD,iDAA+C;AAE/C;;;GAGG;AAEU,QAAA,UAAU,GAAG,CAAC,YAAY,EAAE,mBAAmB,CAAC,C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decision 21): who reads it and how much,\n * where it stands, and its deadline. Pure - the service reads the case and the people, these say yes or no.\n */\n\nexport const CASE_KINDS = ['HARASSMENT', 'SEXUAL_HARASSMENT']\nexport const CASE_STATUSES = ['RECEIVED', 'INVESTIGATING', 'DECIDED', 'TOLD', 'CLOSED']\n\n/** Days from receipt the investigation is to start in, when the domain has set none (decision 21 ⚖). */\nexport const DEFAULT_INVESTIGATION_DAYS = 7\n/** The domain setting (setting-base `Setting.name`) that changes it. */\nexport const INVESTIGATION_DAYS_SETTING = 'compliance-case-investigation-days'\n\nconst DAY = /^\\d{4}-\\d{2}-\\d{2}$/\n/** `investigationStartedOn` as a refusal code names it - `investigation-started-on`. */\nexport const kebabOf = (field: string) => field.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase()\n\n/**\n * How much of a case one person reads:\n * - `FULL` - the case handlers and that case's investigators: everything, the investigation with it;\n * - `PARTY` - the reporter and the victim: where it stands, the protection measures and the result told;\n * - null - nothing, and one answer for \"none\" and \"not yours\".\n */\nexport type CaseSight = 'FULL' | 'PARTY' | null\n\nexport interface CaseFacts {\n reporterUserId?: string | null\n victimUserId?: string | null\n accusedUserIds: readonly string[]\n accusedEmployeeIds: readonly string[]\n investigatorIds: readonly string[]\n /** Every handler was among those reported against when it came in - nobody inside the company investigates it. */\n noInsideHandler?: boolean | null\n}\n\nexport interface CaseViewer {\n userId: string\n /** Holds `compliance-case` - a case handler (`compliance.case-handling`). */\n handler: boolean\n /** The viewer's own employee records in the domain. */\n employeeIds: readonly string[]\n}\n\n/** Whether the viewer is one of those reported against - by their account or by any of their employee records. */\nexport function isAccused(facts: CaseFacts, viewer: CaseViewer): boolean {\n return facts.accusedUserIds.includes(viewer.userId) || viewer.employeeIds.some(id => facts.accusedEmployeeIds.includes(id))\n}\n\n/** What the viewer reads of the case. One reported against reads nothing of it, handler or investigator though they be. */\nexport function caseSightOf(facts: CaseFacts, viewer: CaseViewer): CaseSight {\n if (isAccused(facts, viewer)) return null\n const reporter = !!facts.reporterUserId && facts.reporterUserId === viewer.userId\n /* With nobody inside to investigate, the record is the reporter's alone - the way out is the labour ministry. */\n if (facts.noInsideHandler) return reporter ? 'PARTY' : null\n if (viewer.handler || facts.investigatorIds.includes(viewer.userId)) return 'FULL'\n if (reporter || (!!facts.victimUserId && facts.victimUserId === viewer.userId)) return 'PARTY'\n return null\n}\n\n/** The handlers left to take a case - those not reported against. None left means nobody inside may investigate it. */\nexport function handlersLeft(handlerUserIds: readonly string[], accusedUserIds: readonly string[]): string[] {\n return handlerUserIds.filter(id => !accusedUserIds.includes(id))\n}\n\n/** Where a case stands, read from what has been written on it. */\nexport function caseStatusOf(row: { investigationStartedOn?: string | null; finding?: string | null; resultToldOn?: string | null; closedOn?: string | null }): string {\n if (row.closedOn) return 'CLOSED'\n if (row.resultToldOn) return 'TOLD'\n if (row.finding?.trim()) return 'DECIDED'\n if (row.investigationStartedOn) return 'INVESTIGATING'\n return 'RECEIVED'\n}\n\n/** `day` moved by `days` calendar days. */\nexport function dayPlus(day: string, days: number): string {\n const [year, month, date] = day.split('-').map(Number)\n return new Date(Date.UTC(year, month - 1, date + days)).toISOString().slice(0, 10)\n}\n\n/** The investigation-start days a setting value gives - a whole number of 1 or more, else the default. */\nexport function investigationDaysOf(value: unknown): number {\n const days = Number(value)\n return Number.isInteger(days) && days >= 1 ? days : DEFAULT_INVESTIGATION_DAYS\n}\n\n/** A case whose investigation has not started by its due day, while it is still open. */\nexport function investigationLate(row: { investigationStartedOn?: string | null; closedOn?: string | null; investigationDueOn?: string | null; noInsideHandler?: boolean | null }, today: string): boolean {\n return !row.investigationStartedOn && !row.closedOn && !row.noInsideHandler && !!row.investigationDueOn && row.investigationDueOn < today\n}\n\nexport interface CaseReportInput {\n kind?: string | null\n occurredOn?: string | null\n description?: string | null\n accusedIds?: readonly string[] | null\n}\n\n/** What a report asks for before it is written, or nothing. */\nexport function caseReportRefusal(input: CaseReportInput): Refusal | null {\n if (!CASE_KINDS.includes(input.kind ?? '')) return new Refusal('compliance-case-kind-required', {}, 'pick what it is - workplace harassment or sexual harassment')\n if (input.occurredOn && !DAY.test(input.occurredOn)) return new Refusal('compliance-case-occurred-on-invalid', {}, 'give the day it happened as YYYY-MM-DD')\n if (!input.description?.trim()) return new Refusal('compliance-case-description-required', {}, 'say what happened')\n if (!input.accusedIds?.length) return new Refusal('compliance-case-accused-required', {}, 'name at least one person reported against')\n return null\n}\n\n/** What a handler writes on a case as it goes - the fields and the days among them. */\nexport const HANDLING_FIELDS = ['investigationStartedOn', 'protectionMeasures', 'victimOpinion', 'finding', 'actionOnAccused', 'resultNotice', 'resultToldOn', 'closedOn'] as const\nconst HANDLING_DAYS = ['investigationStartedOn', 'resultToldOn', 'closedOn']\n\n/** What a handling patch asks for before it is written on `row`, or nothing. */\nexport function caseHandlingRefusal(patch: Record<string, any>, row: { receivedOn: string; closedOn?: string | null } & Record<string, any>): Refusal | null {\n if (row.closedOn) return new Refusal('compliance-case-closed', {}, 'a closed case is not written on')\n for (const field of HANDLING_DAYS) {\n const day = patch[field]\n if (day === undefined || day === null || day === '') continue\n if (!DAY.test(day)) return new Refusal(`compliance-case-${kebabOf(field)}-invalid`, {}, `give ${field} as YYYY-MM-DD`)\n if (day < row.receivedOn) return new Refusal(`compliance-case-${kebabOf(field)}-before-receipt`, { receivedOn: row.receivedOn }, `${field} cannot be before the day it was received (${row.receivedOn})`)\n }\n const next = { ...row, ...patch }\n if (next.resultToldOn && !next.resultNotice?.trim()) return new Refusal('compliance-case-notice-required', {}, 'write the result told before its day')\n if (next.closedOn && !next.resultToldOn) return new Refusal('compliance-case-close-before-told', {}, 'tell the reporter and the victim the result before closing it')\n return null\n}\n"]}
|
|
1
|
+
{"version":3,"file":"compliance-case-rules.js","sourceRoot":"","sources":["../../../server/service/compliance-case/compliance-case-rules.ts"],"names":[],"mappings":";;;AA4CA,8BAEC;AAGD,kCAOC;AAGD,oCAEC;AAGD,oCAMC;AAGD,0BAGC;AAGD,kDAGC;AAGD,8CAE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ment holds to (ADR-0187 decision 21): who reads it and how much,\n * where it stands, and its deadline. Pure - the service reads the case and the people, these say yes or no.\n */\n\nexport const CASE_KINDS = ['HARASSMENT', 'SEXUAL_HARASSMENT']\nexport const CASE_STATUSES = ['RECEIVED', 'INVESTIGATING', 'DECIDED', 'TOLD', 'CLOSED']\n\n/** Days from receipt the investigation is to start in, when the domain has set none (decision 21 ⚖). */\nexport const DEFAULT_INVESTIGATION_DAYS = 7\n/** The domain setting (setting-base `Setting.name`) that changes it. */\nexport const INVESTIGATION_DAYS_SETTING = 'compliance-case-investigation-days'\n\nconst DAY = /^\\d{4}-\\d{2}-\\d{2}$/\n/** `investigationStartedOn` as a refusal code names it - `investigation-started-on`. */\nexport const kebabOf = (field: string) => field.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase()\n\n/**\n * How much of a case one person reads:\n * - `FULL` - the case handlers and that case's investigators: everything, the investigation with it;\n * - `PARTY` - the reporter and the victim: where it stands, the protection measures and the result told;\n * - null - nothing, and one answer for \"none\" and \"not yours\".\n */\nexport type CaseSight = 'FULL' | 'PARTY' | null\n\nexport interface CaseFacts {\n reporterUserId?: string | null\n victimUserId?: string | null\n accusedUserIds: readonly string[]\n accusedEmployeeIds: readonly string[]\n investigatorIds: readonly string[]\n}\n\nexport interface CaseViewer {\n userId: string\n /** Holds `compliance-case` - a case handler (`compliance.case-handling`). */\n handler: boolean\n /** The viewer's own employee records in the domain. */\n employeeIds: readonly string[]\n}\n\n/** Whether the viewer is one of those reported against - by their account or by any of their employee records. */\nexport function isAccused(facts: CaseFacts, viewer: CaseViewer): boolean {\n return facts.accusedUserIds.includes(viewer.userId) || viewer.employeeIds.some(id => facts.accusedEmployeeIds.includes(id))\n}\n\n/** What the viewer reads of the case. One reported against reads nothing of it, handler or investigator though they be. */\nexport function caseSightOf(facts: CaseFacts, viewer: CaseViewer): CaseSight {\n if (isAccused(facts, viewer)) return null\n const reporter = !!facts.reporterUserId && facts.reporterUserId === viewer.userId\n /* A case that came in with no handler left is read by the handler the company names after it (amendment 5). */\n if (viewer.handler || facts.investigatorIds.includes(viewer.userId)) return 'FULL'\n if (reporter || (!!facts.victimUserId && facts.victimUserId === viewer.userId)) return 'PARTY'\n return null\n}\n\n/** The handlers left to take a case - those not reported against. None left means the case waits until the company names a handler. */\nexport function handlersLeft(handlerUserIds: readonly string[], accusedUserIds: readonly string[]): string[] {\n return handlerUserIds.filter(id => !accusedUserIds.includes(id))\n}\n\n/** Where a case stands, read from what has been written on it. */\nexport function caseStatusOf(row: { investigationStartedOn?: string | null; finding?: string | null; resultToldOn?: string | null; closedOn?: string | null }): string {\n if (row.closedOn) return 'CLOSED'\n if (row.resultToldOn) return 'TOLD'\n if (row.finding?.trim()) return 'DECIDED'\n if (row.investigationStartedOn) return 'INVESTIGATING'\n return 'RECEIVED'\n}\n\n/** `day` moved by `days` calendar days. */\nexport function dayPlus(day: string, days: number): string {\n const [year, month, date] = day.split('-').map(Number)\n return new Date(Date.UTC(year, month - 1, date + days)).toISOString().slice(0, 10)\n}\n\n/** The investigation-start days a setting value gives - a whole number of 1 or more, else the default. */\nexport function investigationDaysOf(value: unknown): number {\n const days = Number(value)\n return Number.isInteger(days) && days >= 1 ? days : DEFAULT_INVESTIGATION_DAYS\n}\n\n/** A case whose investigation has not started by its due day, while it is still open. */\nexport function investigationLate(row: { investigationStartedOn?: string | null; closedOn?: string | null; investigationDueOn?: string | null; noInsideHandler?: boolean | null }, today: string): boolean {\n return !row.investigationStartedOn && !row.closedOn && !row.noInsideHandler && !!row.investigationDueOn && row.investigationDueOn < today\n}\n\nexport interface CaseReportInput {\n kind?: string | null\n occurredOn?: string | null\n description?: string | null\n accusedIds?: readonly string[] | null\n}\n\n/** What a report asks for before it is written, or nothing. */\nexport function caseReportRefusal(input: CaseReportInput): Refusal | null {\n if (!CASE_KINDS.includes(input.kind ?? '')) return new Refusal('compliance-case-kind-required', {}, 'pick what it is - workplace harassment or sexual harassment')\n if (input.occurredOn && !DAY.test(input.occurredOn)) return new Refusal('compliance-case-occurred-on-invalid', {}, 'give the day it happened as YYYY-MM-DD')\n if (!input.description?.trim()) return new Refusal('compliance-case-description-required', {}, 'say what happened')\n if (!input.accusedIds?.length) return new Refusal('compliance-case-accused-required', {}, 'name at least one person reported against')\n return null\n}\n\n/** What a handler writes on a case as it goes - the fields and the days among them. */\nexport const HANDLING_FIELDS = ['investigationStartedOn', 'protectionMeasures', 'victimOpinion', 'finding', 'actionOnAccused', 'resultNotice', 'resultToldOn', 'closedOn'] as const\nconst HANDLING_DAYS = ['investigationStartedOn', 'resultToldOn', 'closedOn']\n\n/** What a handling patch asks for before it is written on `row`, or nothing. */\nexport function caseHandlingRefusal(patch: Record<string, any>, row: { receivedOn: string; closedOn?: string | null } & Record<string, any>): Refusal | null {\n if (row.closedOn) return new Refusal('compliance-case-closed', {}, 'a closed case is not written on')\n for (const field of HANDLING_DAYS) {\n const day = patch[field]\n if (day === undefined || day === null || day === '') continue\n if (!DAY.test(day)) return new Refusal(`compliance-case-${kebabOf(field)}-invalid`, {}, `give ${field} as YYYY-MM-DD`)\n if (day < row.receivedOn) return new Refusal(`compliance-case-${kebabOf(field)}-before-receipt`, { receivedOn: row.receivedOn }, `${field} cannot be before the day it was received (${row.receivedOn})`)\n }\n const next = { ...row, ...patch }\n if (next.resultToldOn && !next.resultNotice?.trim()) return new Refusal('compliance-case-notice-required', {}, 'write the result told before its day')\n if (next.closedOn && !next.resultToldOn) return new Refusal('compliance-case-close-before-told', {}, 'tell the reporter and the victim the result before closing it')\n return null\n}\n"]}
|
|
@@ -44,7 +44,7 @@ export declare function recordComplianceCase(input: NewComplianceCase, files: an
|
|
|
44
44
|
export declare function handleComplianceCase(patch: ComplianceCaseHandling, context: any): Promise<ComplianceCase>;
|
|
45
45
|
/** One entry of the investigation record - written once, never changed. */
|
|
46
46
|
export declare function addComplianceCaseEntry(caseId: string, writtenOn: string, body: string, files: any[] | undefined, context: any): Promise<ComplianceCaseEntry>;
|
|
47
|
-
/** The cases the handler reads, a page of them - never one they are reported against
|
|
47
|
+
/** The cases the handler reads, a page of them - never one they are reported against. */
|
|
48
48
|
export declare function complianceCasesFor(params: ListParam, context: any): Promise<{
|
|
49
49
|
items: ComplianceCase[];
|
|
50
50
|
total: number;
|
|
@@ -66,8 +66,8 @@ export declare function investigatorChoices(words: string, context: any): Promis
|
|
|
66
66
|
export declare function mayReadCaseFile(attachment: Attachment, context: any): Promise<boolean>;
|
|
67
67
|
/**
|
|
68
68
|
* Cases past their investigation-start day with no investigation started (decision 21). Only the day and the count -
|
|
69
|
-
* a check is read by more than the case handlers, so nothing of a case is in it. A case
|
|
70
|
-
*
|
|
69
|
+
* a check is read by more than the case handlers, so nothing of a case is in it. A case that came in with every handler
|
|
70
|
+
* reported against is not on it: the handlers who read the check are those it is against.
|
|
71
71
|
*/
|
|
72
72
|
export declare function complianceCasesNotInvestigated(tx: EntityManager, domain: Domain, today: string): Promise<{
|
|
73
73
|
id: string;
|
|
@@ -75,8 +75,7 @@ async function factsOf(row, tx) {
|
|
|
75
75
|
victimUserId: row.victimId ? users.get(row.victimId) ?? null : null,
|
|
76
76
|
accusedUserIds: accusedEmployeeIds.map(id => users.get(id)).filter(Boolean),
|
|
77
77
|
accusedEmployeeIds,
|
|
78
|
-
investigatorIds: (row.investigators ?? []).map(one => one.id)
|
|
79
|
-
noInsideHandler: row.noInsideHandler
|
|
78
|
+
investigatorIds: (row.investigators ?? []).map(one => one.id)
|
|
80
79
|
};
|
|
81
80
|
}
|
|
82
81
|
/** The case and what the request reads of it - one answer, `null`, for "none" and "not yours". */
|
|
@@ -272,7 +271,7 @@ async function addComplianceCaseEntry(caseId, writtenOn, body, files, context) {
|
|
|
272
271
|
/*
|
|
273
272
|
* ---------------------------------------------------------------- reading cases
|
|
274
273
|
*/
|
|
275
|
-
/** The cases the handler reads, a page of them - never one they are reported against
|
|
274
|
+
/** The cases the handler reads, a page of them - never one they are reported against. */
|
|
276
275
|
async function complianceCasesFor(params, context) {
|
|
277
276
|
const { domain } = context.state;
|
|
278
277
|
const viewer = await caseViewerOf(context);
|
|
@@ -284,7 +283,6 @@ async function complianceCasesFor(params, context) {
|
|
|
284
283
|
alias: 'cc',
|
|
285
284
|
defaultSortings: [{ name: 'receivedOn', desc: true }]
|
|
286
285
|
});
|
|
287
|
-
queryBuilder.andWhere('cc.noInsideHandler = :none', { none: false });
|
|
288
286
|
if (viewer.employeeIds.length) {
|
|
289
287
|
const against = (0, shell_1.getRepository)(compliance_case_1.ComplianceCase)
|
|
290
288
|
.createQueryBuilder('ac')
|
|
@@ -415,8 +413,8 @@ async function mayReadCaseFile(attachment, context) {
|
|
|
415
413
|
*/
|
|
416
414
|
/**
|
|
417
415
|
* Cases past their investigation-start day with no investigation started (decision 21). Only the day and the count -
|
|
418
|
-
* a check is read by more than the case handlers, so nothing of a case is in it. A case
|
|
419
|
-
*
|
|
416
|
+
* a check is read by more than the case handlers, so nothing of a case is in it. A case that came in with every handler
|
|
417
|
+
* reported against is not on it: the handlers who read the check are those it is against.
|
|
420
418
|
*/
|
|
421
419
|
async function complianceCasesNotInvestigated(tx, domain, today) {
|
|
422
420
|
const open = await tx.getRepository(compliance_case_1.ComplianceCase).find({ where: { domain: { id: domain.id }, noInsideHandler: false }, order: { receivedOn: 'ASC' } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compliance-case-service.js","sourceRoot":"","sources":["../../../server/service/compliance-case/compliance-case-service.ts"],"names":[],"mappings":";;;AAmDA,oCAQC;AAUD,0BAWC;AAGD,kCAOC;AAGD,wCAOC;AAOD,gDAWC;AAGD,8CAIC;AAGD,8CAGC;AAaD,0CAIC;AA6DD,oDAMC;AAGD,oDASC;AAUD,oDAuBC;AAGD,wDAUC;AAOD,gDAwBC;AAGD,4CAgBC;AAGD,8CAIC;AA0BD,kDAiBC;AAGD,gCAWC;AAGD,kDAOC;AAUD,0CAQC;AAWD,wEAGC;AA7aD,qCAA2C;AAE3C,qEAA8E;AAC9E,yDAAkL;AAClL,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AAEH;;;;GAIG;AACI,KAAK,UAAU,8BAA8B,CAAC,EAAiB,EAAE,MAAc,EAAE,KAAa;IACnG,MAAM,IAAI,GAAG,MAAM,EAAE,CAAC,aAAa,CAAC,gCAAc,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,eAAe,EAAE,KAAK,EAAS,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,KAAK,EAAS,EAAE,CAAC,CAAA;IACtK,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,IAAA,yCAAiB,EAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,GAAG,CAAC,EAAE,EAAE,UAAU,EAAE,GAAG,CAAC,UAAU,EAAE,kBAAkB,EAAE,GAAG,CAAC,kBAAmB,EAAE,CAAC,CAAC,CAAA;AAChK,CAAC","sourcesContent":["import { EntityManager, In } from 'typeorm'\n\nimport { Attachment, createAttachment } from '@things-factory/attachment-base'\nimport { buildDomainUsersQueryBuilder, findDomainOwnerUserIds, getDomainAssignees, recordAuditAction, registerAuditKind, Role, User, UserStatus } from '@things-factory/auth-base'\nimport { translatorFor } from '@things-factory/i18n-base/translator'\nimport { sendNoticeWhenCommitted, type Notice } from '@things-factory/notification'\nimport { Employee } from '@things-factory/organization'\nimport { myEmployees } from '@things-factory/organization/dist-server/service/employee/my-employee.js'\nimport { Setting } from '@things-factory/setting-base'\nimport { Domain, getQueryBuilderFromListParams, getRepository, ListParam, Refusal } from '@things-factory/shell'\n\nimport { recordCorrections } from '../common/correction'\nimport { holds, requireWorkingEmployee, todayIn } from '../common/employee-reader'\nimport { ComplianceCase, ComplianceCaseEntry, ComplianceCaseStatus } from './compliance-case'\nimport {\n caseHandlingRefusal,\n caseReportRefusal,\n CaseFacts,\n CaseSight,\n caseSightOf,\n caseStatusOf,\n CaseViewer,\n dayPlus,\n HANDLING_FIELDS,\n handlersLeft,\n INVESTIGATION_DAYS_SETTING,\n investigationDaysOf,\n investigationLate\n} from './compliance-case-rules'\nimport { ComplianceCaseHandling, ComplianceCasePerson, ComplianceReportView, NewComplianceCase, NewComplianceCaseReport } from './compliance-case-type'\n\n/*\n * 신고 사건 (ADR-0187 decision 21) and the database. Every door that hands out a case - a list, one case, a file - asks\n * `caseSightOf` here on the server and writes the read to the audit record (ADR-0141 §3.3: the service records the\n * targets it handled). Nothing of a case is registered for AI reading or search, and the notice of a new one carries\n * no word of it.\n */\n\n/** The files of a report hang on the case under this `refType`, those of the investigation on its entries (attachment-base). */\nexport const CASE_REF_TYPE = 'ComplianceCase'\nexport const CASE_ENTRY_REF_TYPE = 'ComplianceCaseEntry'\n/** The privilege category of the case handlers (`compliance.case-handling`). */\nexport const CASE_CATEGORY = 'compliance-case'\n\n/* A read of a case is an event of its own; `sight` says how much was read - FULL or PARTY. */\nregisterAuditKind('compliance-case.read', ['sight'])\n\nconst RELATIONS = ['accused', 'investigators']\nconst text = (value: unknown) => (typeof value === 'string' && value.trim() ? value.trim() : null)\n\n/** The request's person as a case sees them - asked once per request. */\nexport async function caseViewerOf(context: any): Promise<CaseViewer> {\n const state = context.state\n state.__complianceCaseViewer ??= (async () => ({\n userId: state.user.id,\n handler: await holds(context, CASE_CATEGORY, 'query'),\n employeeIds: (await myEmployees(context)).map(one => one.id)\n }))()\n return await state.__complianceCaseViewer\n}\n\n/** The accounts of employees, by employee id. */\nasync function usersOfEmployees(ids: readonly string[], tx?: EntityManager): Promise<Map<string, string>> {\n if (!ids.length) return new Map()\n const employees = await getRepository(Employee, tx).find({ where: { id: In([...ids]) } as any })\n return new Map(employees.filter(one => one.userId).map(one => [one.id, one.userId!]))\n}\n\n/** What the reading rule needs of a case loaded with its accused and investigators. */\nexport async function factsOf(row: ComplianceCase, tx?: EntityManager): Promise<CaseFacts> {\n const accusedEmployeeIds = (row.accused ?? []).map(one => one.id)\n const users = await usersOfEmployees([...accusedEmployeeIds, ...(row.victimId ? [row.victimId] : [])], tx)\n return {\n reporterUserId: row.reporterUserId,\n victimUserId: row.victimId ? users.get(row.victimId) ?? null : null,\n accusedUserIds: accusedEmployeeIds.map(id => users.get(id)).filter(Boolean) as string[],\n accusedEmployeeIds,\n investigatorIds: (row.investigators ?? []).map(one => one.id),\n noInsideHandler: row.noInsideHandler\n }\n}\n\n/** The case and what the request reads of it - one answer, `null`, for \"none\" and \"not yours\". */\nexport async function caseInSight(id: string, context: any, tx?: EntityManager): Promise<{ row: ComplianceCase; sight: CaseSight } | null> {\n const { domain } = context.state\n if (!id || !/^[0-9a-f-]{36}$/i.test(id)) return null\n const row = await getRepository(ComplianceCase, tx).findOne({ where: { id, domain: { id: domain.id } } as any, relations: RELATIONS })\n if (!row) return null\n const sight = caseSightOf(await factsOf(row, tx), await caseViewerOf(context))\n return sight ? { row, sight } : null\n}\n\n/** Writes that the request read these cases - on its own, so a failed write never holds the answer back (ADR-0141 §4-4). */\nexport async function recordCaseRead(context: any, ids: readonly string[], sight: 'FULL' | 'PARTY'): Promise<void> {\n if (!ids.length) return\n const { domain, user } = context.state\n await recordAuditAction(\n { kind: 'compliance-case.read', targetKind: CASE_REF_TYPE, targetIds: [...ids], targetRole: 'handled', returned: ids.length, detail: { sight } },\n { actorId: user?.id ?? null, domainId: domain?.id ?? null }\n )\n}\n\n/*\n * ---------------------------------------------------------------- the case handlers\n */\n\n/** The users who hold `compliance-case` in the domain - those in a role that gives it, and the domain's owners. */\nexport async function caseHandlerUserIds(domain: Domain, tx?: EntityManager): Promise<string[]> {\n const roles = await getRepository(Role, tx)\n .createQueryBuilder('R')\n .innerJoin('R.privileges', 'P')\n .leftJoinAndSelect('R.users', 'U')\n .where('R.domain = :domain', { domain: domain.id })\n .andWhere('P.category = :category', { category: CASE_CATEGORY })\n .getMany()\n const ids = new Set<string>(roles.flatMap(one => (one.users ?? []).map(user => user.id)))\n for (const owner of await findDomainOwnerUserIds(domain, tx)) ids.add(owner)\n return [...ids]\n}\n\n/** Whether, with these employees reported against, a case handler is left to take it. */\nexport async function insideHandlerLeft(accusedIds: readonly string[], context: any): Promise<boolean> {\n const { domain, tx } = context.state\n const accusedUserIds = [...(await usersOfEmployees(accusedIds, tx)).values()]\n return handlersLeft(await caseHandlerUserIds(domain, tx), accusedUserIds).length > 0\n}\n\n/** The investigation-start days of the domain - its setting, or seven. */\nexport async function investigationDays(domain: Domain, tx?: EntityManager): Promise<number> {\n const setting = await getRepository(Setting, tx).findOne({ where: { domain: { id: domain.id }, name: INVESTIGATION_DAYS_SETTING } as any })\n return investigationDaysOf(setting?.value)\n}\n\n/*\n * ---------------------------------------------------------------- writing a case\n */\n\n/** The sentences in `lng` from this module's translations, the English one where `lng` has none. */\nconst sayIn = (lng: string) => (key: string, english: string) => translatorFor(lng)(key, { defaultValue: english })\n\n/**\n * The words of the notice of a new case - the same for every case: 「새 신고가 있습니다」 and nothing of it, not its\n * kind, not a name. The handler opens the list to read it, and that read is recorded.\n */\nexport function caseNoticeWords(lng: string) {\n const say = sayIn(lng)\n const subject = say('text.compliance-case-notice', 'There is a new report')\n return { subject, body: subject, action: say('button.compliance-case-notice-open', 'Open'), note: '' }\n}\n\n/** Tells the handlers not reported against that there is a new case, once the request's transaction has committed. */\nasync function tellHandlers(context: any, userIds: string[]): Promise<void> {\n const ids = userIds.filter(id => id !== context.state.user?.id)\n if (!ids.length) return\n const people = await getRepository(User, context.state.tx).find({ where: { id: In(ids) } as any })\n const receivers = people.filter(one => one.status === UserStatus.ACTIVATED).map(one => ({ id: one.id, email: one.email, locale: (one as any).locale }))\n if (!receivers.length) return\n const notice: Notice = { type: 'compliance-case', level: 'info', receivers, words: caseNoticeWords, address: 'compliance-case-list', label: 'compliance-case new' }\n sendNoticeWhenCommitted(context, notice)\n}\n\nasync function employeesOf(ids: readonly string[], domain: Domain, tx: EntityManager, field: string): Promise<Employee[]> {\n const wanted = [...new Set(ids)]\n if (!wanted.length) return []\n const found = await tx.getRepository(Employee).find({ where: { id: In(wanted), domain: { id: domain.id } } as any })\n if (found.length !== wanted.length) throw new Refusal(`compliance-case-${field === 'accusedIds' ? 'accused' : field === 'victimId' ? 'victim' : 'reporter'}-unknown`, {}, `${field} must be employees of this domain`)\n return found\n}\n\nasync function attach(files: any[] | undefined, refType: string, refBy: string, context: any) {\n for (const file of files ?? []) await createAttachment(null, { attachment: { file, refType, refBy } } as any, context)\n}\n\n/** Writes one case and tells the handlers left of it - the one way a case comes in, by the reporter or by a handler. */\nasync function writeCase(input: NewComplianceCaseReport, receivedOn: string, reporter: Employee | null, reporterUser: User | null, files: any[] | undefined, context: any): Promise<ComplianceCase> {\n const { domain, user, tx } = context.state\n const refusal = caseReportRefusal(input)\n if (refusal) throw refusal\n const accused = await employeesOf(input.accusedIds, domain, tx, 'accusedIds')\n const [victim] = input.victimId ? await employeesOf([input.victimId], domain, tx, 'victimId') : [null]\n const accusedUserIds = accused.map(one => one.userId).filter(Boolean) as string[]\n const left = handlersLeft(await caseHandlerUserIds(domain, tx), accusedUserIds)\n\n const repository = tx.getRepository(ComplianceCase)\n const saved = await repository.save(\n repository.create({\n domain,\n kind: input.kind,\n reporter,\n reporterUser,\n victim,\n accused,\n occurredOn: text(input.occurredOn),\n description: input.description.trim(),\n receivedOn,\n investigationDueOn: dayPlus(receivedOn, await investigationDays(domain, tx)),\n noInsideHandler: left.length === 0,\n investigators: [],\n status: ComplianceCaseStatus.RECEIVED,\n creator: user,\n updater: user\n } as any) as unknown as ComplianceCase\n )\n await attach(files, CASE_REF_TYPE, saved.id, context)\n if (!saved.noInsideHandler) await tellHandlers(context, left)\n return saved\n}\n\n/** An employee reports a case of their own seeing - a partner, or an account with no employee record, is refused. */\nexport async function reportComplianceCase(input: NewComplianceCaseReport, files: any[] | undefined, context: any): Promise<ComplianceReportView> {\n const { domain, user, tx } = context.state\n const me = await requireWorkingEmployee(context)\n const saved = await writeCase(input, todayIn(domain), me, user, files, context)\n const row = await tx.getRepository(ComplianceCase).findOne({ where: { id: saved.id } as any, relations: RELATIONS })\n return await reportViewOf(row, 'REPORTER', context, tx)\n}\n\n/** A handler writes down a report received another way - by mouth, by mail. One reported against is not its handler. */\nexport async function recordComplianceCase(input: NewComplianceCase, files: any[] | undefined, context: any): Promise<ComplianceCase> {\n const { domain, tx } = context.state\n if (!input.receivedOn || !/^\\d{4}-\\d{2}-\\d{2}$/.test(input.receivedOn)) throw new Refusal('compliance-case-received-on-invalid', {}, 'give the day it was received as YYYY-MM-DD')\n const viewer = await caseViewerOf(context)\n if (viewer.employeeIds.some(id => input.accusedIds?.includes(id))) throw new Refusal('compliance-case-accused-may-not-handle', {}, 'one reported against does not write the case')\n const [reporter] = input.reporterId ? await employeesOf([input.reporterId], domain, tx, 'reporterId') : [null]\n const reporterUser = reporter?.userId ? await tx.getRepository(User).findOne({ where: { id: reporter.userId } as any }) : null\n const saved = await writeCase(input, input.receivedOn, reporter, reporterUser, files, context)\n return (await tx.getRepository(ComplianceCase).findOne({ where: { id: saved.id } as any, relations: RELATIONS }))!\n}\n\n/** The case as one who reads all of it, or refused - one answer for \"none\", \"not yours\" and \"reported against\". */\nasync function fullCase(id: string, context: any, tx: EntityManager): Promise<ComplianceCase> {\n const found = await caseInSight(id, context, tx)\n if (!found || found.sight !== 'FULL') throw new Refusal('compliance-case-not-found', {}, 'the case was not found. reload and try again.')\n return found.row\n}\n\n/** What the handler writes on a case as it goes. A value already written changes with a correction kept. */\nexport async function handleComplianceCase(patch: ComplianceCaseHandling, context: any): Promise<ComplianceCase> {\n const { domain, user, tx } = context.state\n const row = await fullCase(patch.id, context, tx)\n const values: Record<string, any> = {}\n for (const field of HANDLING_FIELDS) if ((patch as any)[field] !== undefined) values[field] = text((patch as any)[field])\n const refusal = caseHandlingRefusal(values, row as any)\n if (refusal) throw refusal\n\n const before: Record<string, any> = { ...row, investigatorIds: (row.investigators ?? []).map(one => one.id).sort().join(',') }\n if (patch.investigatorIds) {\n const wanted = [...new Set(patch.investigatorIds)]\n const people = wanted.length ? await buildDomainUsersQueryBuilder(domain.id, 'USER', tx).andWhere('USER.id IN (:...ids)', { ids: wanted }).getMany() : []\n if (people.length !== wanted.length) throw new Refusal('compliance-case-investigator-unknown', {}, 'an investigator must be a user of this domain')\n const facts = await factsOf(row, tx)\n if (people.some(one => facts.accusedUserIds.includes(one.id))) throw new Refusal('compliance-case-investigator-accused', {}, 'one reported against does not investigate the case')\n row.investigators = people\n }\n Object.assign(row, values)\n const after = { ...values, ...(patch.investigatorIds ? { investigatorIds: (row.investigators ?? []).map(one => one.id).sort().join(',') } : {}) }\n await recordCorrections(tx, domain, user, { kind: CASE_REF_TYPE, id: row.id }, before, after, [...HANDLING_FIELDS, 'investigatorIds'])\n row.status = caseStatusOf(row) as ComplianceCaseStatus\n row.updater = user\n return await tx.getRepository(ComplianceCase).save(row)\n}\n\n/** One entry of the investigation record - written once, never changed. */\nexport async function addComplianceCaseEntry(caseId: string, writtenOn: string, body: string, files: any[] | undefined, context: any): Promise<ComplianceCaseEntry> {\n const { domain, user, tx } = context.state\n const row = await fullCase(caseId, context, tx)\n if (row.closedOn) throw new Refusal('compliance-case-closed', {}, 'a closed case is not written on')\n if (!writtenOn || !/^\\d{4}-\\d{2}-\\d{2}$/.test(writtenOn)) throw new Refusal('compliance-case-written-on-invalid', {}, 'give the day as YYYY-MM-DD')\n if (!body?.trim()) throw new Refusal('compliance-case-entry-required', {}, 'write what the entry records')\n const repository = tx.getRepository(ComplianceCaseEntry)\n const saved = await repository.save(repository.create({ domain, complianceCase: row, writtenOn, body: body.trim(), creator: user } as any) as unknown as ComplianceCaseEntry)\n await attach(files, CASE_ENTRY_REF_TYPE, saved.id, context)\n return saved\n}\n\n/*\n * ---------------------------------------------------------------- reading cases\n */\n\n/** The cases the handler reads, a page of them - never one they are reported against, never one left to the reporter. */\nexport async function complianceCasesFor(params: ListParam, context: any): Promise<{ items: ComplianceCase[]; total: number }> {\n const { domain } = context.state\n const viewer = await caseViewerOf(context)\n const queryBuilder = getQueryBuilderFromListParams({\n domain,\n params,\n repository: getRepository(ComplianceCase),\n searchables: [],\n alias: 'cc',\n defaultSortings: [{ name: 'receivedOn', desc: true }]\n })\n queryBuilder.andWhere('cc.noInsideHandler = :none', { none: false })\n if (viewer.employeeIds.length) {\n const against = getRepository(ComplianceCase)\n .createQueryBuilder('ac')\n .select('ac.id')\n .innerJoin('ac.accused', 'accused')\n .where('accused.id IN (:...mine)')\n queryBuilder.andWhere(`cc.id NOT IN (${against.getQuery()})`, { mine: viewer.employeeIds })\n }\n if (!viewer.handler) queryBuilder.andWhere('1 = 0')\n const [items, total] = await queryBuilder.getManyAndCount()\n await recordCaseRead(context, items.map(one => one.id), 'FULL')\n return { items, total }\n}\n\n/** The cases the request investigates - for an investigator who is no handler, an outside labour attorney. */\nexport async function myInvestigations(context: any): Promise<ComplianceCase[]> {\n const { domain, user } = context.state\n const rows = await getRepository(ComplianceCase)\n .createQueryBuilder('cc')\n .innerJoin('cc.investigators', 'investigator', 'investigator.id = :me', { me: user.id })\n .where('cc.domain = :domain', { domain: domain.id })\n .orderBy('cc.receivedOn', 'DESC')\n .getMany()\n const viewer = await caseViewerOf(context)\n const kept: ComplianceCase[] = []\n for (const one of rows) {\n const full = await getRepository(ComplianceCase).findOne({ where: { id: one.id } as any, relations: RELATIONS })\n if (full && caseSightOf(await factsOf(full), viewer) === 'FULL') kept.push(full)\n }\n await recordCaseRead(context, kept.map(one => one.id), 'FULL')\n return kept\n}\n\n/** One case, whole - for its handlers and investigators. */\nexport async function complianceCaseFor(id: string, context: any): Promise<ComplianceCase> {\n const row = await fullCase(id, context, context.state.tx)\n await recordCaseRead(context, [row.id], 'FULL')\n return row\n}\n\n/** A case as the reporter or the victim reads it - what they may, and no field of the investigation. */\nasync function reportViewOf(row: ComplianceCase, standing: 'REPORTER' | 'VICTIM', context: any, tx?: EntityManager): Promise<ComplianceReportView> {\n const reporter = standing === 'REPORTER'\n const victim = reporter && row.victimId ? await getRepository(Employee, tx).findOne({ where: { id: row.victimId } as any }) : null\n const files = reporter\n ? await getRepository(Attachment, tx).find({ where: { domain: { id: context.state.domain.id }, refType: CASE_REF_TYPE, refBy: row.id, creator: { id: context.state.user.id } } as any })\n : []\n return {\n id: row.id,\n kind: row.kind,\n status: row.status,\n standing,\n receivedOn: row.receivedOn,\n noInsideHandler: row.noInsideHandler,\n ...(reporter ? { occurredOn: row.occurredOn, description: row.description, accusedNames: (row.accused ?? []).map(one => one.name), victimName: victim?.name, attachments: files } : {}),\n protectionMeasures: row.protectionMeasures,\n victimOpinion: row.victimOpinion,\n resultNotice: row.resultToldOn ? row.resultNotice : null,\n resultToldOn: row.resultToldOn,\n closedOn: row.closedOn\n } as ComplianceReportView\n}\n\n/** The cases the request reported, or that happened to them - each as a party reads it. */\nexport async function myComplianceReports(context: any): Promise<ComplianceReportView[]> {\n const { domain, user } = context.state\n const viewer = await caseViewerOf(context)\n const queryBuilder = getRepository(ComplianceCase).createQueryBuilder('cc').where('cc.domain = :domain', { domain: domain.id })\n if (viewer.employeeIds.length) queryBuilder.andWhere('(cc.reporterUser = :me OR cc.victim IN (:...mine))', { me: user.id, mine: viewer.employeeIds })\n else queryBuilder.andWhere('cc.reporterUser = :me', { me: user.id })\n const rows = await queryBuilder.orderBy('cc.receivedOn', 'DESC').getMany()\n const views: ComplianceReportView[] = []\n for (const one of rows) {\n const row = await getRepository(ComplianceCase).findOne({ where: { id: one.id } as any, relations: RELATIONS })\n const facts = await factsOf(row!)\n /* The party view, whatever more the reader may read on the handlers' side. */\n const party = caseSightOf(facts, { ...viewer, handler: false })\n if (party) views.push(await reportViewOf(row!, facts.reporterUserId === user.id ? 'REPORTER' : 'VICTIM', context))\n }\n await recordCaseRead(context, views.map(one => one.id), 'PARTY')\n return views\n}\n\n/** The employees still working here a reporter may name, found by name - for a working employee only. */\nexport async function casePeople(words: string, context: any): Promise<ComplianceCasePerson[]> {\n const { domain } = context.state\n await requireWorkingEmployee(context)\n const wanted = (words ?? '').trim().toLowerCase()\n if (!wanted) return []\n const today = todayIn(domain)\n const employees = await getRepository(Employee).find({ where: { domain: { id: domain.id } } as any, order: { name: 'ASC' } as any })\n return employees\n .filter(one => one.active !== false && (!one.retiredOn || one.retiredOn > today) && one.name?.toLowerCase().includes(wanted))\n .slice(0, 20)\n .map(one => ({ id: one.id, name: one.name, note: one.controlNo }))\n}\n\n/** The users of the domain a handler may name as investigators, found by name or mail. */\nexport async function investigatorChoices(words: string, context: any): Promise<ComplianceCasePerson[]> {\n const wanted = (words ?? '').trim().toLowerCase()\n if (!wanted) return []\n return (await getDomainAssignees(context.state.domain))\n .filter(one => `${one.name ?? ''} ${one.email ?? ''}`.toLowerCase().includes(wanted))\n .slice(0, 20)\n .map(one => ({ id: one.id, name: one.name || one.email, note: one.email }))\n}\n\n/*\n * ---------------------------------------------------------------- files\n */\n\n/**\n * Who opens a file of a case. The report's files: those who read all of it, and the reporter their own. The\n * investigation's files: those who read all of it. Every opening is a read of the case, recorded.\n */\nexport async function mayReadCaseFile(attachment: Attachment, context: any): Promise<boolean> {\n const entry = attachment.refType === CASE_ENTRY_REF_TYPE\n const caseId = entry ? (await getRepository(ComplianceCaseEntry).findOne({ where: { id: attachment.refBy } as any }))?.complianceCaseId : attachment.refBy\n const found = caseId ? await caseInSight(caseId, context) : null\n if (!found) return false\n const allowed = found.sight === 'FULL' || (!entry && found.row.reporterUserId === context.state.user.id && attachment.creatorId === context.state.user.id)\n if (allowed) await recordCaseRead(context, [found.row.id], found.sight!)\n return allowed\n}\n\n/*\n * ---------------------------------------------------------------- the management check (ADR-0146)\n */\n\n/**\n * Cases past their investigation-start day with no investigation started (decision 21). Only the day and the count -\n * a check is read by more than the case handlers, so nothing of a case is in it. A case left to the reporter alone,\n * with nobody inside to investigate it, is not on it.\n */\nexport async function complianceCasesNotInvestigated(tx: EntityManager, domain: Domain, today: string): Promise<{ id: string; receivedOn: string; investigationDueOn: string }[]> {\n const open = await tx.getRepository(ComplianceCase).find({ where: { domain: { id: domain.id }, noInsideHandler: false } as any, order: { receivedOn: 'ASC' } as any })\n return open.filter(one => investigationLate(one, today)).map(one => ({ id: one.id, receivedOn: one.receivedOn, investigationDueOn: one.investigationDueOn! }))\n}\n"]}
|
|
1
|
+
{"version":3,"file":"compliance-case-service.js","sourceRoot":"","sources":["../../../server/service/compliance-case/compliance-case-service.ts"],"names":[],"mappings":";;;AAmDA,oCAQC;AAUD,0BAUC;AAGD,kCAOC;AAGD,wCAOC;AAOD,gDAWC;AAGD,8CAIC;AAGD,8CAGC;AAaD,0CAIC;AA6DD,oDAMC;AAGD,oDASC;AAUD,oDAuBC;AAGD,wDAUC;AAOD,gDAuBC;AAGD,4CAgBC;AAGD,8CAIC;AA0BD,kDAiBC;AAGD,gCAWC;AAGD,kDAOC;AAUD,0CAQC;AAWD,wEAGC;AA3aD,qCAA2C;AAE3C,qEAA8E;AAC9E,yDAAkL;AAClL,qEAAoE;AACpE,+DAAmF;AACnF,+DAAuD;AACvD,6GAAsG;AACtG,+DAAsD;AACtD,iDAAgH;AAEhH,qDAAwD;AACxD,+DAAkF;AAClF,uDAA6F;AAC7F,mEAcgC;AAGhC;;;;;GAKG;AAEH,gIAAgI;AACnH,QAAA,aAAa,GAAG,gBAAgB,CAAA;AAChC,QAAA,mBAAmB,GAAG,qBAAqB,CAAA;AACxD,gFAAgF;AACnE,QAAA,aAAa,GAAG,iBAAiB,CAAA;AAE9C,8FAA8F;AAC9F,IAAA,6BAAiB,EAAC,sBAAsB,EAAE,CAAC,OAAO,CAAC,CAAC,CAAA;AAEpD,MAAM,SAAS,GAAG,CAAC,SAAS,EAAE,eAAe,CAAC,CAAA;AAC9C,MAAM,IAAI,GAAG,CAAC,KAAc,EAAE,EAAE,CAAC,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;AAElG,yEA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E,OAAO,KAAK,CAAA;IACxB,MAAM,OAAO,GAAG,KAAK,CAAC,KAAK,KAAK,MAAM,IAAI,CAAC,CAAC,KAAK,IAAI,KAAK,CAAC,GAAG,CAAC,cAAc,KAAK,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,UAAU,CAAC,SAAS,KAAK,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IAC1J,IAAI,OAAO;QAAE,MAAM,cAAc,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,KAAM,CAAC,CAAA;IACxE,OAAO,OAAO,CAAA;AAChB,CAAC;AAED;;GAEG;AAEH;;;;GAIG;AACI,KAAK,UAAU,8BAA8B,CAAC,EAAiB,EAAE,MAAc,EAAE,KAAa;IACnG,MAAM,IAAI,GAAG,MAAM,EAAE,CAAC,aAAa,CAAC,gCAAc,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,eAAe,EAAE,KAAK,EAAS,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,KAAK,EAAS,EAAE,CAAC,CAAA;IACtK,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,IAAA,yCAAiB,EAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,GAAG,CAAC,EAAE,EAAE,UAAU,EAAE,GAAG,CAAC,UAAU,EAAE,kBAAkB,EAAE,GAAG,CAAC,kBAAmB,EAAE,CAAC,CAAC,CAAA;AAChK,CAAC","sourcesContent":["import { EntityManager, In } from 'typeorm'\n\nimport { Attachment, createAttachment } from '@things-factory/attachment-base'\nimport { buildDomainUsersQueryBuilder, findDomainOwnerUserIds, getDomainAssignees, recordAuditAction, registerAuditKind, Role, User, UserStatus } from '@things-factory/auth-base'\nimport { translatorFor } from '@things-factory/i18n-base/translator'\nimport { sendNoticeWhenCommitted, type Notice } from '@things-factory/notification'\nimport { Employee } from '@things-factory/organization'\nimport { myEmployees } from '@things-factory/organization/dist-server/service/employee/my-employee.js'\nimport { Setting } from '@things-factory/setting-base'\nimport { Domain, getQueryBuilderFromListParams, getRepository, ListParam, Refusal } from '@things-factory/shell'\n\nimport { recordCorrections } from '../common/correction'\nimport { holds, requireWorkingEmployee, todayIn } from '../common/employee-reader'\nimport { ComplianceCase, ComplianceCaseEntry, ComplianceCaseStatus } from './compliance-case'\nimport {\n caseHandlingRefusal,\n caseReportRefusal,\n CaseFacts,\n CaseSight,\n caseSightOf,\n caseStatusOf,\n CaseViewer,\n dayPlus,\n HANDLING_FIELDS,\n handlersLeft,\n INVESTIGATION_DAYS_SETTING,\n investigationDaysOf,\n investigationLate\n} from './compliance-case-rules'\nimport { ComplianceCaseHandling, ComplianceCasePerson, ComplianceReportView, NewComplianceCase, NewComplianceCaseReport } from './compliance-case-type'\n\n/*\n * 신고 사건 (ADR-0187 decision 21) and the database. Every door that hands out a case - a list, one case, a file - asks\n * `caseSightOf` here on the server and writes the read to the audit record (ADR-0141 §3.3: the service records the\n * targets it handled). Nothing of a case is registered for AI reading or search, and the notice of a new one carries\n * no word of it.\n */\n\n/** The files of a report hang on the case under this `refType`, those of the investigation on its entries (attachment-base). */\nexport const CASE_REF_TYPE = 'ComplianceCase'\nexport const CASE_ENTRY_REF_TYPE = 'ComplianceCaseEntry'\n/** The privilege category of the case handlers (`compliance.case-handling`). */\nexport const CASE_CATEGORY = 'compliance-case'\n\n/* A read of a case is an event of its own; `sight` says how much was read - FULL or PARTY. */\nregisterAuditKind('compliance-case.read', ['sight'])\n\nconst RELATIONS = ['accused', 'investigators']\nconst text = (value: unknown) => (typeof value === 'string' && value.trim() ? value.trim() : null)\n\n/** The request's person as a case sees them - asked once per request. */\nexport async function caseViewerOf(context: any): Promise<CaseViewer> {\n const state = context.state\n state.__complianceCaseViewer ??= (async () => ({\n userId: state.user.id,\n handler: await holds(context, CASE_CATEGORY, 'query'),\n employeeIds: (await myEmployees(context)).map(one => one.id)\n }))()\n return await state.__complianceCaseViewer\n}\n\n/** The accounts of employees, by employee id. */\nasync function usersOfEmployees(ids: readonly string[], tx?: EntityManager): Promise<Map<string, string>> {\n if (!ids.length) return new Map()\n const employees = await getRepository(Employee, tx).find({ where: { id: In([...ids]) } as any })\n return new Map(employees.filter(one => one.userId).map(one => [one.id, one.userId!]))\n}\n\n/** What the reading rule needs of a case loaded with its accused and investigators. */\nexport async function factsOf(row: ComplianceCase, tx?: EntityManager): Promise<CaseFacts> {\n const accusedEmployeeIds = (row.accused ?? []).map(one => one.id)\n const users = await usersOfEmployees([...accusedEmployeeIds, ...(row.victimId ? [row.victimId] : [])], tx)\n return {\n reporterUserId: row.reporterUserId,\n victimUserId: row.victimId ? users.get(row.victimId) ?? null : null,\n accusedUserIds: accusedEmployeeIds.map(id => users.get(id)).filter(Boolean) as string[],\n accusedEmployeeIds,\n investigatorIds: (row.investigators ?? []).map(one => one.id)\n }\n}\n\n/** The case and what the request reads of it - one answer, `null`, for \"none\" and \"not yours\". */\nexport async function caseInSight(id: string, context: any, tx?: EntityManager): Promise<{ row: ComplianceCase; sight: CaseSight } | null> {\n const { domain } = context.state\n if (!id || !/^[0-9a-f-]{36}$/i.test(id)) return null\n const row = await getRepository(ComplianceCase, tx).findOne({ where: { id, domain: { id: domain.id } } as any, relations: RELATIONS })\n if (!row) return null\n const sight = caseSightOf(await factsOf(row, tx), await caseViewerOf(context))\n return sight ? { row, sight } : null\n}\n\n/** Writes that the request read these cases - on its own, so a failed write never holds the answer back (ADR-0141 §4-4). */\nexport async function recordCaseRead(context: any, ids: readonly string[], sight: 'FULL' | 'PARTY'): Promise<void> {\n if (!ids.length) return\n const { domain, user } = context.state\n await recordAuditAction(\n { kind: 'compliance-case.read', targetKind: CASE_REF_TYPE, targetIds: [...ids], targetRole: 'handled', returned: ids.length, detail: { sight } },\n { actorId: user?.id ?? null, domainId: domain?.id ?? null }\n )\n}\n\n/*\n * ---------------------------------------------------------------- the case handlers\n */\n\n/** The users who hold `compliance-case` in the domain - those in a role that gives it, and the domain's owners. */\nexport async function caseHandlerUserIds(domain: Domain, tx?: EntityManager): Promise<string[]> {\n const roles = await getRepository(Role, tx)\n .createQueryBuilder('R')\n .innerJoin('R.privileges', 'P')\n .leftJoinAndSelect('R.users', 'U')\n .where('R.domain = :domain', { domain: domain.id })\n .andWhere('P.category = :category', { category: CASE_CATEGORY })\n .getMany()\n const ids = new Set<string>(roles.flatMap(one => (one.users ?? []).map(user => user.id)))\n for (const owner of await findDomainOwnerUserIds(domain, tx)) ids.add(owner)\n return [...ids]\n}\n\n/** Whether, with these employees reported against, a case handler is left to take it. */\nexport async function insideHandlerLeft(accusedIds: readonly string[], context: any): Promise<boolean> {\n const { domain, tx } = context.state\n const accusedUserIds = [...(await usersOfEmployees(accusedIds, tx)).values()]\n return handlersLeft(await caseHandlerUserIds(domain, tx), accusedUserIds).length > 0\n}\n\n/** The investigation-start days of the domain - its setting, or seven. */\nexport async function investigationDays(domain: Domain, tx?: EntityManager): Promise<number> {\n const setting = await getRepository(Setting, tx).findOne({ where: { domain: { id: domain.id }, name: INVESTIGATION_DAYS_SETTING } as any })\n return investigationDaysOf(setting?.value)\n}\n\n/*\n * ---------------------------------------------------------------- writing a case\n */\n\n/** The sentences in `lng` from this module's translations, the English one where `lng` has none. */\nconst sayIn = (lng: string) => (key: string, english: string) => translatorFor(lng)(key, { defaultValue: english })\n\n/**\n * The words of the notice of a new case - the same for every case: 「새 신고가 있습니다」 and nothing of it, not its\n * kind, not a name. The handler opens the list to read it, and that read is recorded.\n */\nexport function caseNoticeWords(lng: string) {\n const say = sayIn(lng)\n const subject = say('text.compliance-case-notice', 'There is a new report')\n return { subject, body: subject, action: say('button.compliance-case-notice-open', 'Open'), note: '' }\n}\n\n/** Tells the handlers not reported against that there is a new case, once the request's transaction has committed. */\nasync function tellHandlers(context: any, userIds: string[]): Promise<void> {\n const ids = userIds.filter(id => id !== context.state.user?.id)\n if (!ids.length) return\n const people = await getRepository(User, context.state.tx).find({ where: { id: In(ids) } as any })\n const receivers = people.filter(one => one.status === UserStatus.ACTIVATED).map(one => ({ id: one.id, email: one.email, locale: (one as any).locale }))\n if (!receivers.length) return\n const notice: Notice = { type: 'compliance-case', level: 'info', receivers, words: caseNoticeWords, address: 'compliance-case-list', label: 'compliance-case new' }\n sendNoticeWhenCommitted(context, notice)\n}\n\nasync function employeesOf(ids: readonly string[], domain: Domain, tx: EntityManager, field: string): Promise<Employee[]> {\n const wanted = [...new Set(ids)]\n if (!wanted.length) return []\n const found = await tx.getRepository(Employee).find({ where: { id: In(wanted), domain: { id: domain.id } } as any })\n if (found.length !== wanted.length) throw new Refusal(`compliance-case-${field === 'accusedIds' ? 'accused' : field === 'victimId' ? 'victim' : 'reporter'}-unknown`, {}, `${field} must be employees of this domain`)\n return found\n}\n\nasync function attach(files: any[] | undefined, refType: string, refBy: string, context: any) {\n for (const file of files ?? []) await createAttachment(null, { attachment: { file, refType, refBy } } as any, context)\n}\n\n/** Writes one case and tells the handlers left of it - the one way a case comes in, by the reporter or by a handler. */\nasync function writeCase(input: NewComplianceCaseReport, receivedOn: string, reporter: Employee | null, reporterUser: User | null, files: any[] | undefined, context: any): Promise<ComplianceCase> {\n const { domain, user, tx } = context.state\n const refusal = caseReportRefusal(input)\n if (refusal) throw refusal\n const accused = await employeesOf(input.accusedIds, domain, tx, 'accusedIds')\n const [victim] = input.victimId ? await employeesOf([input.victimId], domain, tx, 'victimId') : [null]\n const accusedUserIds = accused.map(one => one.userId).filter(Boolean) as string[]\n const left = handlersLeft(await caseHandlerUserIds(domain, tx), accusedUserIds)\n\n const repository = tx.getRepository(ComplianceCase)\n const saved = await repository.save(\n repository.create({\n domain,\n kind: input.kind,\n reporter,\n reporterUser,\n victim,\n accused,\n occurredOn: text(input.occurredOn),\n description: input.description.trim(),\n receivedOn,\n investigationDueOn: dayPlus(receivedOn, await investigationDays(domain, tx)),\n noInsideHandler: left.length === 0,\n investigators: [],\n status: ComplianceCaseStatus.RECEIVED,\n creator: user,\n updater: user\n } as any) as unknown as ComplianceCase\n )\n await attach(files, CASE_REF_TYPE, saved.id, context)\n if (!saved.noInsideHandler) await tellHandlers(context, left)\n return saved\n}\n\n/** An employee reports a case of their own seeing - a partner, or an account with no employee record, is refused. */\nexport async function reportComplianceCase(input: NewComplianceCaseReport, files: any[] | undefined, context: any): Promise<ComplianceReportView> {\n const { domain, user, tx } = context.state\n const me = await requireWorkingEmployee(context)\n const saved = await writeCase(input, todayIn(domain), me, user, files, context)\n const row = await tx.getRepository(ComplianceCase).findOne({ where: { id: saved.id } as any, relations: RELATIONS })\n return await reportViewOf(row, 'REPORTER', context, tx)\n}\n\n/** A handler writes down a report received another way - by mouth, by mail. One reported against is not its handler. */\nexport async function recordComplianceCase(input: NewComplianceCase, files: any[] | undefined, context: any): Promise<ComplianceCase> {\n const { domain, tx } = context.state\n if (!input.receivedOn || !/^\\d{4}-\\d{2}-\\d{2}$/.test(input.receivedOn)) throw new Refusal('compliance-case-received-on-invalid', {}, 'give the day it was received as YYYY-MM-DD')\n const viewer = await caseViewerOf(context)\n if (viewer.employeeIds.some(id => input.accusedIds?.includes(id))) throw new Refusal('compliance-case-accused-may-not-handle', {}, 'one reported against does not write the case')\n const [reporter] = input.reporterId ? await employeesOf([input.reporterId], domain, tx, 'reporterId') : [null]\n const reporterUser = reporter?.userId ? await tx.getRepository(User).findOne({ where: { id: reporter.userId } as any }) : null\n const saved = await writeCase(input, input.receivedOn, reporter, reporterUser, files, context)\n return (await tx.getRepository(ComplianceCase).findOne({ where: { id: saved.id } as any, relations: RELATIONS }))!\n}\n\n/** The case as one who reads all of it, or refused - one answer for \"none\", \"not yours\" and \"reported against\". */\nasync function fullCase(id: string, context: any, tx: EntityManager): Promise<ComplianceCase> {\n const found = await caseInSight(id, context, tx)\n if (!found || found.sight !== 'FULL') throw new Refusal('compliance-case-not-found', {}, 'the case was not found. reload and try again.')\n return found.row\n}\n\n/** What the handler writes on a case as it goes. A value already written changes with a correction kept. */\nexport async function handleComplianceCase(patch: ComplianceCaseHandling, context: any): Promise<ComplianceCase> {\n const { domain, user, tx } = context.state\n const row = await fullCase(patch.id, context, tx)\n const values: Record<string, any> = {}\n for (const field of HANDLING_FIELDS) if ((patch as any)[field] !== undefined) values[field] = text((patch as any)[field])\n const refusal = caseHandlingRefusal(values, row as any)\n if (refusal) throw refusal\n\n const before: Record<string, any> = { ...row, investigatorIds: (row.investigators ?? []).map(one => one.id).sort().join(',') }\n if (patch.investigatorIds) {\n const wanted = [...new Set(patch.investigatorIds)]\n const people = wanted.length ? await buildDomainUsersQueryBuilder(domain.id, 'USER', tx).andWhere('USER.id IN (:...ids)', { ids: wanted }).getMany() : []\n if (people.length !== wanted.length) throw new Refusal('compliance-case-investigator-unknown', {}, 'an investigator must be a user of this domain')\n const facts = await factsOf(row, tx)\n if (people.some(one => facts.accusedUserIds.includes(one.id))) throw new Refusal('compliance-case-investigator-accused', {}, 'one reported against does not investigate the case')\n row.investigators = people\n }\n Object.assign(row, values)\n const after = { ...values, ...(patch.investigatorIds ? { investigatorIds: (row.investigators ?? []).map(one => one.id).sort().join(',') } : {}) }\n await recordCorrections(tx, domain, user, { kind: CASE_REF_TYPE, id: row.id }, before, after, [...HANDLING_FIELDS, 'investigatorIds'])\n row.status = caseStatusOf(row) as ComplianceCaseStatus\n row.updater = user\n return await tx.getRepository(ComplianceCase).save(row)\n}\n\n/** One entry of the investigation record - written once, never changed. */\nexport async function addComplianceCaseEntry(caseId: string, writtenOn: string, body: string, files: any[] | undefined, context: any): Promise<ComplianceCaseEntry> {\n const { domain, user, tx } = context.state\n const row = await fullCase(caseId, context, tx)\n if (row.closedOn) throw new Refusal('compliance-case-closed', {}, 'a closed case is not written on')\n if (!writtenOn || !/^\\d{4}-\\d{2}-\\d{2}$/.test(writtenOn)) throw new Refusal('compliance-case-written-on-invalid', {}, 'give the day as YYYY-MM-DD')\n if (!body?.trim()) throw new Refusal('compliance-case-entry-required', {}, 'write what the entry records')\n const repository = tx.getRepository(ComplianceCaseEntry)\n const saved = await repository.save(repository.create({ domain, complianceCase: row, writtenOn, body: body.trim(), creator: user } as any) as unknown as ComplianceCaseEntry)\n await attach(files, CASE_ENTRY_REF_TYPE, saved.id, context)\n return saved\n}\n\n/*\n * ---------------------------------------------------------------- reading cases\n */\n\n/** The cases the handler reads, a page of them - never one they are reported against. */\nexport async function complianceCasesFor(params: ListParam, context: any): Promise<{ items: ComplianceCase[]; total: number }> {\n const { domain } = context.state\n const viewer = await caseViewerOf(context)\n const queryBuilder = getQueryBuilderFromListParams({\n domain,\n params,\n repository: getRepository(ComplianceCase),\n searchables: [],\n alias: 'cc',\n defaultSortings: [{ name: 'receivedOn', desc: true }]\n })\n if (viewer.employeeIds.length) {\n const against = getRepository(ComplianceCase)\n .createQueryBuilder('ac')\n .select('ac.id')\n .innerJoin('ac.accused', 'accused')\n .where('accused.id IN (:...mine)')\n queryBuilder.andWhere(`cc.id NOT IN (${against.getQuery()})`, { mine: viewer.employeeIds })\n }\n if (!viewer.handler) queryBuilder.andWhere('1 = 0')\n const [items, total] = await queryBuilder.getManyAndCount()\n await recordCaseRead(context, items.map(one => one.id), 'FULL')\n return { items, total }\n}\n\n/** The cases the request investigates - for an investigator who is no handler, an outside labour attorney. */\nexport async function myInvestigations(context: any): Promise<ComplianceCase[]> {\n const { domain, user } = context.state\n const rows = await getRepository(ComplianceCase)\n .createQueryBuilder('cc')\n .innerJoin('cc.investigators', 'investigator', 'investigator.id = :me', { me: user.id })\n .where('cc.domain = :domain', { domain: domain.id })\n .orderBy('cc.receivedOn', 'DESC')\n .getMany()\n const viewer = await caseViewerOf(context)\n const kept: ComplianceCase[] = []\n for (const one of rows) {\n const full = await getRepository(ComplianceCase).findOne({ where: { id: one.id } as any, relations: RELATIONS })\n if (full && caseSightOf(await factsOf(full), viewer) === 'FULL') kept.push(full)\n }\n await recordCaseRead(context, kept.map(one => one.id), 'FULL')\n return kept\n}\n\n/** One case, whole - for its handlers and investigators. */\nexport async function complianceCaseFor(id: string, context: any): Promise<ComplianceCase> {\n const row = await fullCase(id, context, context.state.tx)\n await recordCaseRead(context, [row.id], 'FULL')\n return row\n}\n\n/** A case as the reporter or the victim reads it - what they may, and no field of the investigation. */\nasync function reportViewOf(row: ComplianceCase, standing: 'REPORTER' | 'VICTIM', context: any, tx?: EntityManager): Promise<ComplianceReportView> {\n const reporter = standing === 'REPORTER'\n const victim = reporter && row.victimId ? await getRepository(Employee, tx).findOne({ where: { id: row.victimId } as any }) : null\n const files = reporter\n ? await getRepository(Attachment, tx).find({ where: { domain: { id: context.state.domain.id }, refType: CASE_REF_TYPE, refBy: row.id, creator: { id: context.state.user.id } } as any })\n : []\n return {\n id: row.id,\n kind: row.kind,\n status: row.status,\n standing,\n receivedOn: row.receivedOn,\n noInsideHandler: row.noInsideHandler,\n ...(reporter ? { occurredOn: row.occurredOn, description: row.description, accusedNames: (row.accused ?? []).map(one => one.name), victimName: victim?.name, attachments: files } : {}),\n protectionMeasures: row.protectionMeasures,\n victimOpinion: row.victimOpinion,\n resultNotice: row.resultToldOn ? row.resultNotice : null,\n resultToldOn: row.resultToldOn,\n closedOn: row.closedOn\n } as ComplianceReportView\n}\n\n/** The cases the request reported, or that happened to them - each as a party reads it. */\nexport async function myComplianceReports(context: any): Promise<ComplianceReportView[]> {\n const { domain, user } = context.state\n const viewer = await caseViewerOf(context)\n const queryBuilder = getRepository(ComplianceCase).createQueryBuilder('cc').where('cc.domain = :domain', { domain: domain.id })\n if (viewer.employeeIds.length) queryBuilder.andWhere('(cc.reporterUser = :me OR cc.victim IN (:...mine))', { me: user.id, mine: viewer.employeeIds })\n else queryBuilder.andWhere('cc.reporterUser = :me', { me: user.id })\n const rows = await queryBuilder.orderBy('cc.receivedOn', 'DESC').getMany()\n const views: ComplianceReportView[] = []\n for (const one of rows) {\n const row = await getRepository(ComplianceCase).findOne({ where: { id: one.id } as any, relations: RELATIONS })\n const facts = await factsOf(row!)\n /* The party view, whatever more the reader may read on the handlers' side. */\n const party = caseSightOf(facts, { ...viewer, handler: false })\n if (party) views.push(await reportViewOf(row!, facts.reporterUserId === user.id ? 'REPORTER' : 'VICTIM', context))\n }\n await recordCaseRead(context, views.map(one => one.id), 'PARTY')\n return views\n}\n\n/** The employees still working here a reporter may name, found by name - for a working employee only. */\nexport async function casePeople(words: string, context: any): Promise<ComplianceCasePerson[]> {\n const { domain } = context.state\n await requireWorkingEmployee(context)\n const wanted = (words ?? '').trim().toLowerCase()\n if (!wanted) return []\n const today = todayIn(domain)\n const employees = await getRepository(Employee).find({ where: { domain: { id: domain.id } } as any, order: { name: 'ASC' } as any })\n return employees\n .filter(one => one.active !== false && (!one.retiredOn || one.retiredOn > today) && one.name?.toLowerCase().includes(wanted))\n .slice(0, 20)\n .map(one => ({ id: one.id, name: one.name, note: one.controlNo }))\n}\n\n/** The users of the domain a handler may name as investigators, found by name or mail. */\nexport async function investigatorChoices(words: string, context: any): Promise<ComplianceCasePerson[]> {\n const wanted = (words ?? '').trim().toLowerCase()\n if (!wanted) return []\n return (await getDomainAssignees(context.state.domain))\n .filter(one => `${one.name ?? ''} ${one.email ?? ''}`.toLowerCase().includes(wanted))\n .slice(0, 20)\n .map(one => ({ id: one.id, name: one.name || one.email, note: one.email }))\n}\n\n/*\n * ---------------------------------------------------------------- files\n */\n\n/**\n * Who opens a file of a case. The report's files: those who read all of it, and the reporter their own. The\n * investigation's files: those who read all of it. Every opening is a read of the case, recorded.\n */\nexport async function mayReadCaseFile(attachment: Attachment, context: any): Promise<boolean> {\n const entry = attachment.refType === CASE_ENTRY_REF_TYPE\n const caseId = entry ? (await getRepository(ComplianceCaseEntry).findOne({ where: { id: attachment.refBy } as any }))?.complianceCaseId : attachment.refBy\n const found = caseId ? await caseInSight(caseId, context) : null\n if (!found) return false\n const allowed = found.sight === 'FULL' || (!entry && found.row.reporterUserId === context.state.user.id && attachment.creatorId === context.state.user.id)\n if (allowed) await recordCaseRead(context, [found.row.id], found.sight!)\n return allowed\n}\n\n/*\n * ---------------------------------------------------------------- the management check (ADR-0146)\n */\n\n/**\n * Cases past their investigation-start day with no investigation started (decision 21). Only the day and the count -\n * a check is read by more than the case handlers, so nothing of a case is in it. A case that came in with every handler\n * reported against is not on it: the handlers who read the check are those it is against.\n */\nexport async function complianceCasesNotInvestigated(tx: EntityManager, domain: Domain, today: string): Promise<{ id: string; receivedOn: string; investigationDueOn: string }[]> {\n const open = await tx.getRepository(ComplianceCase).find({ where: { domain: { id: domain.id }, noInsideHandler: false } as any, order: { receivedOn: 'ASC' } as any })\n return open.filter(one => investigationLate(one, today)).map(one => ({ id: one.id, receivedOn: one.receivedOn, investigationDueOn: one.investigationDueOn! }))\n}\n"]}
|
|
@@ -133,7 +133,7 @@ tslib_1.__decorate([
|
|
|
133
133
|
tslib_1.__metadata("design:type", String)
|
|
134
134
|
], ComplianceReportView.prototype, "receivedOn", void 0);
|
|
135
135
|
tslib_1.__decorate([
|
|
136
|
-
(0, type_graphql_1.Field)({ description: '
|
|
136
|
+
(0, type_graphql_1.Field)({ description: 'No case handler was left when it came in - it waits for the handler the company names' }),
|
|
137
137
|
tslib_1.__metadata("design:type", Boolean)
|
|
138
138
|
], ComplianceReportView.prototype, "noInsideHandler", void 0);
|
|
139
139
|
tslib_1.__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compliance-case-type.js","sourceRoot":"","sources":["../../../server/service/compliance-case/compliance-case-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAoE;AAEpE,qEAA4D;AAE5D,uDAA4F;AAGrF,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;CAMnC,CAAA;AANY,0DAAuB;AACC;IAAlC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,oCAAkB,CAAC;;qDAAyB;AAC+E;IAAzI,IAAA,oBAAK,EAA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,iEAAiE,EAAE,CAAC;;kDAAc;+BAH7G,oBAAoB;IADhC,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,0FAA0F,EAAE,CAAC;GAC3G,oBAAoB,CAIhC","sourcesContent":["import { Field, ID, InputType, Int, ObjectType } from 'type-graphql'\n\nimport { Attachment } from '@things-factory/attachment-base'\n\nimport { ComplianceCase, ComplianceCaseKind, ComplianceCaseStatus } from './compliance-case'\n\n@InputType({ description: 'A report as an employee makes it - 「회사 규정과 안내 › 신고하기」' })\nexport class NewComplianceCaseReport {\n @Field(type => ComplianceCaseKind) kind: ComplianceCaseKind\n @Field({ nullable: true, description: 'The employee it happened to - left empty when it is the reporter, or the reporter will not say' }) victimId?: string\n @Field(type => [String], { description: 'The employees reported against' }) accusedIds: string[]\n @Field({ nullable: true, description: 'YYYY-MM-DD it happened' }) occurredOn?: string\n @Field({ description: 'What happened' }) description: string\n}\n\n@InputType({ description: 'A report the case handler received and writes down' })\nexport class NewComplianceCase extends NewComplianceCaseReport {\n @Field({ nullable: true, description: 'The employee who reported it' }) reporterId?: string\n @Field({ description: 'YYYY-MM-DD it was received' }) receivedOn: string\n}\n\n@InputType({ description: 'What the case handler writes on a case as it goes - a value already written is changed with a correction kept' })\nexport class ComplianceCaseHandling {\n @Field(type => ID) id: string\n @Field(type => [String], { nullable: true, description: 'The users who investigate it' }) investigatorIds?: string[]\n @Field({ nullable: true, description: 'YYYY-MM-DD' }) investigationStartedOn?: string\n @Field({ nullable: true }) protectionMeasures?: string\n @Field({ nullable: true }) victimOpinion?: string\n @Field({ nullable: true }) finding?: string\n @Field({ nullable: true }) actionOnAccused?: string\n @Field({ nullable: true, description: 'The result as told to the reporter and the victim' }) resultNotice?: string\n @Field({ nullable: true, description: 'YYYY-MM-DD' }) resultToldOn?: string\n @Field({ nullable: true, description: 'YYYY-MM-DD' }) closedOn?: string\n}\n\n@ObjectType({ description: 'A page of cases' })\nexport class ComplianceCaseList {\n @Field(type => [ComplianceCase]) items: ComplianceCase[]\n @Field(type => Int) total: number\n}\n\n/**\n * A case as the reporter or the victim reads it - where it stands, the protection measures and the result told; the\n * reporter also what they reported. No investigation is on this type, so no door answering it can hand one out.\n */\n@ObjectType({ description: 'A case as the reporter or the victim reads it - its progress, protection and result, never the investigation' })\nexport class ComplianceReportView {\n @Field(type => ID) id: string\n @Field(type => ComplianceCaseKind) kind: ComplianceCaseKind\n @Field(type => ComplianceCaseStatus) status: ComplianceCaseStatus\n @Field({ description: 'REPORTER or VICTIM - why the reader reads it' }) standing: string\n @Field() receivedOn: string\n @Field({ description: 'No case handler was left when it came in - it waits for the handler the company names' }) noInsideHandler: boolean\n @Field({ nullable: true, description: 'The reporter\\'s own: YYYY-MM-DD it happened' }) occurredOn?: string\n @Field({ nullable: true, description: 'The reporter\\'s own: what they reported' }) description?: string\n @Field(type => [String], { nullable: true, description: 'The reporter\\'s own: the names they reported against' }) accusedNames?: string[]\n @Field({ nullable: true, description: 'The reporter\\'s own: the name of the victim they gave' }) victimName?: string\n @Field({ nullable: true }) protectionMeasures?: string\n @Field({ nullable: true }) victimOpinion?: string\n @Field({ nullable: true }) resultNotice?: string\n @Field({ nullable: true }) resultToldOn?: string\n @Field({ nullable: true }) closedOn?: string\n @Field(type => [Attachment], { nullable: true, description: 'The reporter\\'s own files' }) attachments?: Attachment[]\n}\n\n@ObjectType({ description: 'One person a report names or a case is given to - an employee, or a user as investigator' })\nexport class ComplianceCasePerson {\n @Field(type => ID) id: string\n @Field() name: string\n @Field({ nullable: true, description: 'What tells two of one name apart - the control number, the mail' }) note?: string\n}\n"]}
|
|
@@ -111,7 +111,7 @@ tslib_1.__decorate([
|
|
|
111
111
|
], ComplianceCase.prototype, "investigationDueOn", void 0);
|
|
112
112
|
tslib_1.__decorate([
|
|
113
113
|
(0, typeorm_1.Column)({ default: false }),
|
|
114
|
-
(0, type_graphql_1.Field)({ description: '
|
|
114
|
+
(0, type_graphql_1.Field)({ description: 'No case handler was left to take it when it came in - it waits for the handler the company names (amendment 5)' }),
|
|
115
115
|
tslib_1.__metadata("design:type", Boolean)
|
|
116
116
|
], ComplianceCase.prototype, "noInsideHandler", void 0);
|
|
117
117
|
tslib_1.__decorate([
|