@things-factory/biz-base 10.1.250 → 10.1.255
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-server/index.d.ts +1 -1
- package/dist-server/index.js +1 -1
- package/dist-server/index.js.map +1 -1
- package/dist-server/role-tasks.js +2 -0
- package/dist-server/role-tasks.js.map +1 -1
- package/dist-server/service/company/company-mutation.d.ts +0 -3
- package/dist-server/service/company/company-mutation.js +0 -21
- package/dist-server/service/company/company-mutation.js.map +1 -1
- package/dist-server/service/company/company-query.d.ts +0 -2
- package/dist-server/service/company/company-query.js +0 -12
- package/dist-server/service/company/company-query.js.map +1 -1
- package/dist-server/service/company/company.js +1 -1
- package/dist-server/service/company/company.js.map +1 -1
- package/dist-server/service/company/our-company.d.ts +3 -9
- package/dist-server/service/company/our-company.js +5 -17
- package/dist-server/service/company/our-company.js.map +1 -1
- package/dist-server/service/company-seal/company-seal-mutation.d.ts +8 -0
- package/dist-server/service/company-seal/company-seal-mutation.js +52 -0
- package/dist-server/service/company-seal/company-seal-mutation.js.map +1 -0
- package/dist-server/service/company-seal/company-seal-query.d.ts +13 -0
- package/dist-server/service/company-seal/company-seal-query.js +91 -0
- package/dist-server/service/company-seal/company-seal-query.js.map +1 -0
- package/dist-server/service/company-seal/company-seal-reader.d.ts +6 -0
- package/dist-server/service/company-seal/company-seal-reader.js +16 -0
- package/dist-server/service/company-seal/company-seal-reader.js.map +1 -0
- package/dist-server/service/company-seal/company-seal-rules.d.ts +14 -0
- package/dist-server/service/company-seal/company-seal-rules.js +44 -0
- package/dist-server/service/company-seal/company-seal-rules.js.map +1 -0
- package/dist-server/service/company-seal/company-seal-service.d.ts +30 -0
- package/dist-server/service/company-seal/company-seal-service.js +77 -0
- package/dist-server/service/company-seal/company-seal-service.js.map +1 -0
- package/dist-server/service/company-seal/company-seal-types.d.ts +24 -0
- package/dist-server/service/company-seal/company-seal-types.js +93 -0
- package/dist-server/service/company-seal/company-seal-types.js.map +1 -0
- package/dist-server/service/company-seal/company-seal.d.ts +42 -0
- package/dist-server/service/company-seal/company-seal.js +134 -0
- package/dist-server/service/company-seal/company-seal.js.map +1 -0
- package/dist-server/service/company-seal/index.d.ts +5 -0
- package/dist-server/service/company-seal/index.js +9 -0
- package/dist-server/service/company-seal/index.js.map +1 -0
- package/dist-server/service/index.d.ts +6 -2
- package/dist-server/service/index.js +7 -0
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/tests/company-seal.test.mjs +103 -0
- package/tests/our-company.test.mjs +5 -17
- package/translations/en.json +16 -1
- package/translations/es.json +16 -1
- package/translations/ja.json +16 -1
- package/translations/ko.json +16 -1
- package/translations/ms.json +16 -1
- package/translations/zh.json +16 -1
- package/dist-server/service/company/company-seal-reader.d.ts +0 -6
- package/dist-server/service/company/company-seal-reader.js +0 -16
- package/dist-server/service/company/company-seal-reader.js.map +0 -1
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { checkPermission } from '@things-factory/auth-base';
|
|
2
|
+
/**
|
|
3
|
+
* Who may open a seal's impression by its attachment path (ADR-0188 decision 1): whoever reads the seal register.
|
|
4
|
+
* Everyone else meets the printed seal only on a document.
|
|
5
|
+
*/
|
|
6
|
+
export declare function companySealReader(_attachment: unknown, context: any, check?: typeof checkPermission): Promise<boolean>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.companySealReader = companySealReader;
|
|
4
|
+
const attachment_base_1 = require("@things-factory/attachment-base");
|
|
5
|
+
const auth_base_1 = require("@things-factory/auth-base");
|
|
6
|
+
const company_seal_service_1 = require("./company-seal-service");
|
|
7
|
+
/**
|
|
8
|
+
* Who may open a seal's impression by its attachment path (ADR-0188 decision 1): whoever reads the seal register.
|
|
9
|
+
* Everyone else meets the printed seal only on a document.
|
|
10
|
+
*/
|
|
11
|
+
async function companySealReader(_attachment, context, check = auth_base_1.checkPermission) {
|
|
12
|
+
const { domain, user, unsafeIP, prohibitedPrivileges } = context?.state ?? {};
|
|
13
|
+
return !!(await check({ category: 'company-seal', privilege: 'query', owner: true }, user, domain, unsafeIP, prohibitedPrivileges));
|
|
14
|
+
}
|
|
15
|
+
(0, attachment_base_1.registerAttachmentReader)(company_seal_service_1.COMPANY_SEAL_REF_TYPE, (attachment, context) => companySealReader(attachment, context));
|
|
16
|
+
//# sourceMappingURL=company-seal-reader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"company-seal-reader.js","sourceRoot":"","sources":["../../../server/service/company-seal/company-seal-reader.ts"],"names":[],"mappings":";;AASA,8CAGC;AAZD,qEAA0E;AAC1E,yDAA2D;AAE3D,iEAA8D;AAE9D;;;GAGG;AACI,KAAK,UAAU,iBAAiB,CAAC,WAAoB,EAAE,OAAY,EAAE,QAAgC,2BAAe;IACzH,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,oBAAoB,EAAE,GAAG,OAAO,EAAE,KAAK,IAAI,EAAE,CAAA;IAC7E,OAAO,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,QAAQ,EAAE,cAAc,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,oBAAoB,CAAC,CAAC,CAAA;AACrI,CAAC;AAED,IAAA,0CAAwB,EAAC,4CAAqB,EAAE,CAAC,UAAU,EAAE,OAAO,EAAE,EAAE,CAAC,iBAAiB,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,CAAA","sourcesContent":["import { registerAttachmentReader } from '@things-factory/attachment-base'\nimport { checkPermission } from '@things-factory/auth-base'\n\nimport { COMPANY_SEAL_REF_TYPE } from './company-seal-service'\n\n/**\n * Who may open a seal's impression by its attachment path (ADR-0188 decision 1): whoever reads the seal register.\n * Everyone else meets the printed seal only on a document.\n */\nexport async function companySealReader(_attachment: unknown, context: any, check: typeof checkPermission = checkPermission): Promise<boolean> {\n const { domain, user, unsafeIP, prohibitedPrivileges } = context?.state ?? {}\n return !!(await check({ category: 'company-seal', privilege: 'query', owner: true }, user, domain, unsafeIP, prohibitedPrivileges))\n}\n\nregisterAttachmentReader(COMPANY_SEAL_REF_TYPE, (attachment, context) => companySealReader(attachment, context))\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Refusal } from '@things-factory/shell';
|
|
2
|
+
export interface SealRow {
|
|
3
|
+
id?: string;
|
|
4
|
+
kind?: string | null;
|
|
5
|
+
name?: string | null;
|
|
6
|
+
registeredOn?: string | null;
|
|
7
|
+
printed?: boolean | null;
|
|
8
|
+
disposedOn?: string | null;
|
|
9
|
+
disposeReason?: string | null;
|
|
10
|
+
}
|
|
11
|
+
/** A seal not disposed of. */
|
|
12
|
+
export declare const inUse: (row: SealRow) => boolean;
|
|
13
|
+
/** The first thing wrong with the rows, or nothing. */
|
|
14
|
+
export declare function sealRefusal(rows: readonly SealRow[]): Refusal | null;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.inUse = void 0;
|
|
4
|
+
exports.sealRefusal = sealRefusal;
|
|
5
|
+
const shell_1 = require("@things-factory/shell");
|
|
6
|
+
const KINDS = ['CORPORATE', 'USE', 'OFFICIAL', 'NAMEPLATE', 'CONFIDENTIAL'];
|
|
7
|
+
/** Rubber stamps kept in the register for who holds them - not seals, so a document never prints one. */
|
|
8
|
+
const STAMPS = ['NAMEPLATE', 'CONFIDENTIAL'];
|
|
9
|
+
const DAY = /^\d{4}-\d{2}-\d{2}$/;
|
|
10
|
+
/** A seal not disposed of. */
|
|
11
|
+
const inUse = (row) => !row.disposedOn;
|
|
12
|
+
exports.inUse = inUse;
|
|
13
|
+
/** The first thing wrong with the rows, or nothing. */
|
|
14
|
+
function sealRefusal(rows) {
|
|
15
|
+
for (const row of rows) {
|
|
16
|
+
const name = row.name?.trim() ?? '';
|
|
17
|
+
if (!name)
|
|
18
|
+
return new shell_1.Refusal('company-seal-name-required', {}, 'a seal needs a name');
|
|
19
|
+
if (!KINDS.includes(row.kind ?? ''))
|
|
20
|
+
return new shell_1.Refusal('company-seal-kind-required', { name }, `seal ${name}: pick its kind`);
|
|
21
|
+
if (row.registeredOn && !DAY.test(row.registeredOn))
|
|
22
|
+
return new shell_1.Refusal('company-seal-day-invalid', { name, value: row.registeredOn }, `seal ${name}: a day is YYYY-MM-DD`);
|
|
23
|
+
if (row.disposedOn && !DAY.test(row.disposedOn))
|
|
24
|
+
return new shell_1.Refusal('company-seal-day-invalid', { name, value: row.disposedOn }, `seal ${name}: a day is YYYY-MM-DD`);
|
|
25
|
+
if (row.disposedOn && !row.disposeReason?.trim())
|
|
26
|
+
return new shell_1.Refusal('company-seal-dispose-reason-required', { name }, `seal ${name}: say why it was disposed of`);
|
|
27
|
+
if (row.disposedOn && row.registeredOn && row.disposedOn < row.registeredOn)
|
|
28
|
+
return new shell_1.Refusal('company-seal-disposed-before-registered', { name }, `seal ${name}: disposed of before it was filed`);
|
|
29
|
+
if (row.printed && row.kind === 'CORPORATE')
|
|
30
|
+
return new shell_1.Refusal('company-seal-corporate-not-printed', { name }, 'the corporate seal is stamped on paper, never printed');
|
|
31
|
+
/* A document already prints the company's name, representative and address as words; a stamp would say it again and seals nothing. */
|
|
32
|
+
if (row.printed && STAMPS.includes(row.kind ?? ''))
|
|
33
|
+
return new shell_1.Refusal('company-seal-stamp-not-printed', { name }, `${name} is a rubber stamp for paper - documents print a seal`);
|
|
34
|
+
if (row.printed && !(0, exports.inUse)(row))
|
|
35
|
+
return new shell_1.Refusal('company-seal-disposed-printed', { name }, `seal ${name} is disposed of - documents cannot print it`);
|
|
36
|
+
}
|
|
37
|
+
const used = rows.filter(exports.inUse);
|
|
38
|
+
if (used.filter(row => row.kind === 'CORPORATE').length > 1)
|
|
39
|
+
return new shell_1.Refusal('company-seal-two-corporate', {}, 'only one corporate seal is filed at a time - dispose of the old one');
|
|
40
|
+
if (used.filter(row => row.printed).length > 1)
|
|
41
|
+
return new shell_1.Refusal('company-seal-two-printed', {}, 'documents print one seal - unmark the other');
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=company-seal-rules.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"company-seal-rules.js","sourceRoot":"","sources":["../../../server/service/company-seal/company-seal-rules.ts"],"names":[],"mappings":";;;AAyBA,kCAkBC;AA3CD,iDAA+C;AAgB/C,MAAM,KAAK,GAAG,CAAC,WAAW,EAAE,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,cAAc,CAAC,CAAA;AAC3E,yGAAyG;AACzG,MAAM,MAAM,GAAG,CAAC,WAAW,EAAE,cAAc,CAAC,CAAA;AAC5C,MAAM,GAAG,GAAG,qBAAqB,CAAA;AAEjC,8BAA8B;AACvB,MAAM,KAAK,GAAG,CAAC,GAAY,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,UAAU,CAAA;AAAzC,QAAA,KAAK,SAAoC;AAEtD,uDAAuD;AACvD,SAAgB,WAAW,CAAC,IAAwB;IAClD,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAA;QACnC,IAAI,CAAC,IAAI;YAAE,OAAO,IAAI,eAAO,CAAC,4BAA4B,EAAE,EAAE,EAAE,qBAAqB,CAAC,CAAA;QACtF,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC;YAAE,OAAO,IAAI,eAAO,CAAC,4BAA4B,EAAE,EAAE,IAAI,EAAE,EAAE,QAAQ,IAAI,iBAAiB,CAAC,CAAA;QAC9H,IAAI,GAAG,CAAC,YAAY,IAAI,CAAC,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AG,CAAC;YAAE,OAAO,IAAI,eAAO,CAAC,+BAA+B,EAAE,EAAE,IAAI,EAAE,EAAE,QAAQ,IAAI,6CAA6C,CAAC,CAAA;IAC1J,CAAC;IACD,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,aAAK,CAAC,CAAA;IAC/B,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,KAAK,WAAW,CAAC,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,IAAI,eAAO,CAAC,4BAA4B,EAAE,EAAE,EAAE,qEAAqE,CAAC,CAAA;IACxL,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,IAAI,eAAO,CAAC,0BAA0B,EAAE,EAAE,EAAE,6CAA6C,CAAC,CAAA;IACjJ,OAAO,IAAI,CAAA;AACb,CAAC","sourcesContent":["import { Refusal } from '@things-factory/shell'\n\n/*\n * What the seal register holds to (ADR-0188 decision 1), on its rows as they would stand after a save. Pure.\n */\n\nexport interface SealRow {\n id?: string\n kind?: string | null\n name?: string | null\n registeredOn?: string | null\n printed?: boolean | null\n disposedOn?: string | null\n disposeReason?: string | null\n}\n\nconst KINDS = ['CORPORATE', 'USE', 'OFFICIAL', 'NAMEPLATE', 'CONFIDENTIAL']\n/** Rubber stamps kept in the register for who holds them - not seals, so a document never prints one. */\nconst STAMPS = ['NAMEPLATE', 'CONFIDENTIAL']\nconst DAY = /^\\d{4}-\\d{2}-\\d{2}$/\n\n/** A seal not disposed of. */\nexport const inUse = (row: SealRow) => !row.disposedOn\n\n/** The first thing wrong with the rows, or nothing. */\nexport function sealRefusal(rows: readonly SealRow[]): Refusal | null {\n for (const row of rows) {\n const name = row.name?.trim() ?? ''\n if (!name) return new Refusal('company-seal-name-required', {}, 'a seal needs a name')\n if (!KINDS.includes(row.kind ?? '')) return new Refusal('company-seal-kind-required', { name }, `seal ${name}: pick its kind`)\n if (row.registeredOn && !DAY.test(row.registeredOn)) return new Refusal('company-seal-day-invalid', { name, value: row.registeredOn }, `seal ${name}: a day is YYYY-MM-DD`)\n if (row.disposedOn && !DAY.test(row.disposedOn)) return new Refusal('company-seal-day-invalid', { name, value: row.disposedOn }, `seal ${name}: a day is YYYY-MM-DD`)\n if (row.disposedOn && !row.disposeReason?.trim()) return new Refusal('company-seal-dispose-reason-required', { name }, `seal ${name}: say why it was disposed of`)\n if (row.disposedOn && row.registeredOn && row.disposedOn < row.registeredOn) return new Refusal('company-seal-disposed-before-registered', { name }, `seal ${name}: disposed of before it was filed`)\n if (row.printed && row.kind === 'CORPORATE') return new Refusal('company-seal-corporate-not-printed', { name }, 'the corporate seal is stamped on paper, never printed')\n /* A document already prints the company's name, representative and address as words; a stamp would say it again and seals nothing. */\n if (row.printed && STAMPS.includes(row.kind ?? '')) return new Refusal('company-seal-stamp-not-printed', { name }, `${name} is a rubber stamp for paper - documents print a seal`)\n if (row.printed && !inUse(row)) return new Refusal('company-seal-disposed-printed', { name }, `seal ${name} is disposed of - documents cannot print it`)\n }\n const used = rows.filter(inUse)\n if (used.filter(row => row.kind === 'CORPORATE').length > 1) return new Refusal('company-seal-two-corporate', {}, 'only one corporate seal is filed at a time - dispose of the old one')\n if (used.filter(row => row.printed).length > 1) return new Refusal('company-seal-two-printed', {}, 'documents print one seal - unmark the other')\n return null\n}\n"]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { EntityManager } from 'typeorm';
|
|
2
|
+
import { Attachment } from '@things-factory/attachment-base';
|
|
3
|
+
import { User } from '@things-factory/auth-base';
|
|
4
|
+
import { Domain, getRepository } from '@things-factory/shell';
|
|
5
|
+
import { CompanySeal } from './company-seal';
|
|
6
|
+
import { CompanySealPatch } from './company-seal-types';
|
|
7
|
+
/** The attachment `refType` of a seal's impression - refBy is the seal's row. */
|
|
8
|
+
export declare const COMPANY_SEAL_REF_TYPE = "Company Seal";
|
|
9
|
+
type Source = {
|
|
10
|
+
getRepository: typeof getRepository;
|
|
11
|
+
};
|
|
12
|
+
/** Save the grid's rows - new and changed ones, never deleted - after the register's rules hold for all of the domain's seals. */
|
|
13
|
+
export declare function saveCompanySeals(patches: CompanySealPatch[], domain: Domain, user: User, tx: EntityManager): Promise<CompanySeal[]>;
|
|
14
|
+
/** A seal of the domain by its id, or none. */
|
|
15
|
+
export declare function companySealOf(domain: {
|
|
16
|
+
id: string;
|
|
17
|
+
}, id: string, manager?: Source): Promise<CompanySeal | null>;
|
|
18
|
+
/** The corporate seal in use - none when it is not in the register. */
|
|
19
|
+
export declare function corporateSealOf(domain: {
|
|
20
|
+
id: string;
|
|
21
|
+
}, manager?: Source): Promise<CompanySeal | null>;
|
|
22
|
+
/** The seal official documents print, if one is marked. */
|
|
23
|
+
export declare function printedSealOf(domain: {
|
|
24
|
+
id: string;
|
|
25
|
+
}, manager?: Source): Promise<CompanySeal | null>;
|
|
26
|
+
/** A seal's impression, if one was put on it. */
|
|
27
|
+
export declare function sealImpressionOf(seal: {
|
|
28
|
+
id: string;
|
|
29
|
+
} | null, manager?: Source): Promise<Attachment | null>;
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.COMPANY_SEAL_REF_TYPE = void 0;
|
|
4
|
+
exports.saveCompanySeals = saveCompanySeals;
|
|
5
|
+
exports.companySealOf = companySealOf;
|
|
6
|
+
exports.corporateSealOf = corporateSealOf;
|
|
7
|
+
exports.printedSealOf = printedSealOf;
|
|
8
|
+
exports.sealImpressionOf = sealImpressionOf;
|
|
9
|
+
const attachment_base_1 = require("@things-factory/attachment-base");
|
|
10
|
+
const auth_base_1 = require("@things-factory/auth-base");
|
|
11
|
+
const shell_1 = require("@things-factory/shell");
|
|
12
|
+
const company_seal_1 = require("./company-seal");
|
|
13
|
+
const company_seal_rules_1 = require("./company-seal-rules");
|
|
14
|
+
/*
|
|
15
|
+
* The seal register's one way in and its readers (ADR-0188 decision 1). Whoever needs a seal - the print of an official
|
|
16
|
+
* document, a 사용인감계, a stamp record of compliance - reads it from here.
|
|
17
|
+
*/
|
|
18
|
+
/** The attachment `refType` of a seal's impression - refBy is the seal's row. */
|
|
19
|
+
exports.COMPANY_SEAL_REF_TYPE = 'Company Seal';
|
|
20
|
+
const sourceOf = (manager) => manager ?? { getRepository: shell_1.getRepository };
|
|
21
|
+
const WORDS = ['kind', 'name', 'registeredOn', 'keptAt', 'usage', 'printed', 'disposedOn', 'disposeReason', 'notes'];
|
|
22
|
+
/** Save the grid's rows - new and changed ones, never deleted - after the register's rules hold for all of the domain's seals. */
|
|
23
|
+
async function saveCompanySeals(patches, domain, user, tx) {
|
|
24
|
+
const repository = tx.getRepository(company_seal_1.CompanySeal);
|
|
25
|
+
if (patches.some(patch => patch.cuFlag === '-'))
|
|
26
|
+
throw new shell_1.Refusal('company-seal-not-deleted', {}, 'a seal is never deleted - write the day it was disposed of');
|
|
27
|
+
const seals = await repository.find({ where: { domain: { id: domain.id } } });
|
|
28
|
+
const byId = new Map(seals.map(seal => [seal.id, seal]));
|
|
29
|
+
const members = new Set((await (0, auth_base_1.getDomainUsers)(domain, tx)).map(one => one.id));
|
|
30
|
+
const touched = [];
|
|
31
|
+
for (const patch of patches) {
|
|
32
|
+
const current = patch.id ? byId.get(patch.id) : undefined;
|
|
33
|
+
if (patch.id && !current)
|
|
34
|
+
throw new shell_1.Refusal('company-seal-not-found', {}, 'the seal was not found. reload and try again.');
|
|
35
|
+
const row = current ?? repository.create({ domain, printed: false, creator: user });
|
|
36
|
+
for (const field of WORDS) {
|
|
37
|
+
const value = patch[field];
|
|
38
|
+
if (value === undefined)
|
|
39
|
+
continue;
|
|
40
|
+
row[field] = typeof value === 'string' ? value.trim() || null : value;
|
|
41
|
+
}
|
|
42
|
+
if (patch.custodianId !== undefined) {
|
|
43
|
+
if (patch.custodianId && !members.has(patch.custodianId))
|
|
44
|
+
throw new shell_1.Refusal('company-seal-custodian-unknown', {}, 'the keeper must be a person of this domain');
|
|
45
|
+
row.custodian = patch.custodianId ? { id: patch.custodianId } : null;
|
|
46
|
+
}
|
|
47
|
+
row.updater = user;
|
|
48
|
+
if (!current)
|
|
49
|
+
seals.push(row);
|
|
50
|
+
touched.push(row);
|
|
51
|
+
}
|
|
52
|
+
const refusal = (0, company_seal_rules_1.sealRefusal)(seals);
|
|
53
|
+
if (refusal)
|
|
54
|
+
throw refusal;
|
|
55
|
+
return await repository.save(touched);
|
|
56
|
+
}
|
|
57
|
+
/** A seal of the domain by its id, or none. */
|
|
58
|
+
async function companySealOf(domain, id, manager) {
|
|
59
|
+
return (await sourceOf(manager).getRepository(company_seal_1.CompanySeal).findOne({ where: { id, domain: { id: domain.id } } })) ?? null;
|
|
60
|
+
}
|
|
61
|
+
/** The corporate seal in use - none when it is not in the register. */
|
|
62
|
+
async function corporateSealOf(domain, manager) {
|
|
63
|
+
const seals = await sourceOf(manager).getRepository(company_seal_1.CompanySeal).find({ where: { domain: { id: domain.id }, kind: company_seal_1.CompanySealKind.CORPORATE } });
|
|
64
|
+
return seals.find(company_seal_rules_1.inUse) ?? null;
|
|
65
|
+
}
|
|
66
|
+
/** The seal official documents print, if one is marked. */
|
|
67
|
+
async function printedSealOf(domain, manager) {
|
|
68
|
+
const seals = await sourceOf(manager).getRepository(company_seal_1.CompanySeal).find({ where: { domain: { id: domain.id }, printed: true } });
|
|
69
|
+
return seals.find(company_seal_rules_1.inUse) ?? null;
|
|
70
|
+
}
|
|
71
|
+
/** A seal's impression, if one was put on it. */
|
|
72
|
+
async function sealImpressionOf(seal, manager) {
|
|
73
|
+
if (!seal)
|
|
74
|
+
return null;
|
|
75
|
+
return (await sourceOf(manager).getRepository(attachment_base_1.Attachment).findOne({ where: { refType: exports.COMPANY_SEAL_REF_TYPE, refBy: seal.id }, order: { createdAt: 'DESC' } })) ?? null;
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=company-seal-service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"company-seal-service.js","sourceRoot":"","sources":["../../../server/service/company-seal/company-seal-service.ts"],"names":[],"mappings":";;;AAwBA,4CA6BC;AAGD,sCAEC;AAGD,0CAGC;AAGD,sCAGC;AAGD,4CAGC;AA1ED,qEAA4D;AAC5D,yDAAgE;AAChE,iDAAsE;AAEtE,iDAA6D;AAC7D,6DAAyD;AAGzD;;;GAGG;AAEH,iFAAiF;AACpE,QAAA,qBAAqB,GAAG,cAAc,CAAA;AAGnD,MAAM,QAAQ,GAAG,CAAC,OAAgB,EAAE,EAAE,CAAC,OAAO,IAAI,EAAE,aAAa,EAAb,qBAAa,EAAE,CAAA;AAEnE,MAAM,KAAK,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,eAAe,EAAE,OAAO,CAAU,CAAA;AAE7H,kIAAkI;AAC3H,KAAK,UAAU,gBAAgB,CAAC,OAA2B,EAAE,MAAc,EAAE,IAAU,EAAE,EAAiB;IAC/G,MAAM,UAAU,GAAG,EAAE,CAAC,aAAa,CAAC,0BAAW,CAAC,CAAA;IAChD,IAAI,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,KAAK,GAAG,CAAC;QAAE,MAAM,IAAI,eAAO,CAAC,0BAA0B,EAAE,EAAE,EAAE,4DAA4D,CAAC,CAAA;IAChK,MAAM,KAAK,GAAG,MAAM,UAAU,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAS,EAAE,CAAC,CAAA;IACpF,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,I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K,UAAU,aAAa,CAAC,MAAsB,EAAE,OAAgB;IAC1E,MAAM,KAAK,GAAG,MAAM,QAAQ,CAAC,OAAO,CAAC,CAAC,aAAa,CAAC,0BAAW,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,EAAS,EAAE,CAAC,CAAA;IACrI,OAAO,KAAK,CAAC,IAAI,CAAC,0BAAK,CAAC,IAAI,IAAI,CAAA;AAClC,CAAC;AAED,iDAAiD;AAC1C,KAAK,UAAU,gBAAgB,CAAC,IAA2B,EAAE,OAAgB;IAClF,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAA;IACtB,OAAO,CAAC,MAAM,QAAQ,CAAC,OAAO,CAAC,CAAC,aAAa,CAAC,4BAAU,CAAC,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,6BAAqB,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC,IAAI,IAAI,CAAA;AACzK,CAAC","sourcesContent":["import { EntityManager } from 'typeorm'\n\nimport { Attachment } from '@things-factory/attachment-base'\nimport { getDomainUsers, User } from '@things-factory/auth-base'\nimport { Domain, getRepository, Refusal } from '@things-factory/shell'\n\nimport { CompanySeal, CompanySealKind } from './company-seal'\nimport { inUse, sealRefusal } from './company-seal-rules'\nimport { CompanySealPatch } from './company-seal-types'\n\n/*\n * The seal register's one way in and its readers (ADR-0188 decision 1). Whoever needs a seal - the print of an official\n * document, a 사용인감계, a stamp record of compliance - reads it from here.\n */\n\n/** The attachment `refType` of a seal's impression - refBy is the seal's row. */\nexport const COMPANY_SEAL_REF_TYPE = 'Company Seal'\n\ntype Source = { getRepository: typeof getRepository }\nconst sourceOf = (manager?: Source) => manager ?? { getRepository }\n\nconst WORDS = ['kind', 'name', 'registeredOn', 'keptAt', 'usage', 'printed', 'disposedOn', 'disposeReason', 'notes'] as const\n\n/** Save the grid's rows - new and changed ones, never deleted - after the register's rules hold for all of the domain's seals. */\nexport async function saveCompanySeals(patches: CompanySealPatch[], domain: Domain, user: User, tx: EntityManager): Promise<CompanySeal[]> {\n const repository = tx.getRepository(CompanySeal)\n if (patches.some(patch => patch.cuFlag === '-')) throw new Refusal('company-seal-not-deleted', {}, 'a seal is never deleted - write the day it was disposed of')\n const seals = await repository.find({ where: { domain: { id: domain.id } } as any })\n const byId = new Map(seals.map(seal => [seal.id, seal]))\n const members = new Set((await getDomainUsers(domain, tx)).map(one => one.id))\n\n const touched: CompanySeal[] = []\n for (const patch of patches) {\n const current = patch.id ? byId.get(patch.id) : undefined\n if (patch.id && !current) throw new Refusal('company-seal-not-found', {}, 'the seal was not found. reload and try again.')\n const row: any = current ?? repository.create({ domain, printed: false, creator: user } as any)\n for (const field of WORDS) {\n const value = (patch as any)[field]\n if (value === undefined) continue\n row[field] = typeof value === 'string' ? value.trim() || null : value\n }\n if (patch.custodianId !== undefined) {\n if (patch.custodianId && !members.has(patch.custodianId)) throw new Refusal('company-seal-custodian-unknown', {}, 'the keeper must be a person of this domain')\n row.custodian = patch.custodianId ? ({ id: patch.custodianId } as User) : null\n }\n row.updater = user\n if (!current) seals.push(row)\n touched.push(row)\n }\n\n const refusal = sealRefusal(seals)\n if (refusal) throw refusal\n return await repository.save(touched)\n}\n\n/** A seal of the domain by its id, or none. */\nexport async function companySealOf(domain: { id: string }, id: string, manager?: Source): Promise<CompanySeal | null> {\n return (await sourceOf(manager).getRepository(CompanySeal).findOne({ where: { id, domain: { id: domain.id } } as any })) ?? null\n}\n\n/** The corporate seal in use - none when it is not in the register. */\nexport async function corporateSealOf(domain: { id: string }, manager?: Source): Promise<CompanySeal | null> {\n const seals = await sourceOf(manager).getRepository(CompanySeal).find({ where: { domain: { id: domain.id }, kind: CompanySealKind.CORPORATE } as any })\n return seals.find(inUse) ?? null\n}\n\n/** The seal official documents print, if one is marked. */\nexport async function printedSealOf(domain: { id: string }, manager?: Source): Promise<CompanySeal | null> {\n const seals = await sourceOf(manager).getRepository(CompanySeal).find({ where: { domain: { id: domain.id }, printed: true } as any })\n return seals.find(inUse) ?? null\n}\n\n/** A seal's impression, if one was put on it. */\nexport async function sealImpressionOf(seal: { id: string } | null, manager?: Source): Promise<Attachment | null> {\n if (!seal) return null\n return (await sourceOf(manager).getRepository(Attachment).findOne({ where: { refType: COMPANY_SEAL_REF_TYPE, refBy: seal.id }, order: { createdAt: 'DESC' } })) ?? null\n}\n"]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { CompanySeal, CompanySealKind } from './company-seal';
|
|
2
|
+
export declare class CompanySealPatch {
|
|
3
|
+
id?: string;
|
|
4
|
+
kind?: CompanySealKind;
|
|
5
|
+
name?: string;
|
|
6
|
+
registeredOn?: string;
|
|
7
|
+
custodianId?: string;
|
|
8
|
+
keptAt?: string;
|
|
9
|
+
usage?: string;
|
|
10
|
+
printed?: boolean;
|
|
11
|
+
disposedOn?: string;
|
|
12
|
+
disposeReason?: string;
|
|
13
|
+
notes?: string;
|
|
14
|
+
cuFlag?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare class CompanySealList {
|
|
17
|
+
items: CompanySeal[];
|
|
18
|
+
total: number;
|
|
19
|
+
}
|
|
20
|
+
export declare class CompanySealCustodianChoice {
|
|
21
|
+
id: string;
|
|
22
|
+
name?: string;
|
|
23
|
+
email?: string;
|
|
24
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CompanySealCustodianChoice = exports.CompanySealList = exports.CompanySealPatch = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const type_graphql_1 = require("type-graphql");
|
|
6
|
+
const company_seal_1 = require("./company-seal");
|
|
7
|
+
let CompanySealPatch = class CompanySealPatch {
|
|
8
|
+
};
|
|
9
|
+
exports.CompanySealPatch = CompanySealPatch;
|
|
10
|
+
tslib_1.__decorate([
|
|
11
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true, description: 'The seal - empty for a new one' }),
|
|
12
|
+
tslib_1.__metadata("design:type", String)
|
|
13
|
+
], CompanySealPatch.prototype, "id", void 0);
|
|
14
|
+
tslib_1.__decorate([
|
|
15
|
+
(0, type_graphql_1.Field)(type => company_seal_1.CompanySealKind, { nullable: true }),
|
|
16
|
+
tslib_1.__metadata("design:type", String)
|
|
17
|
+
], CompanySealPatch.prototype, "kind", void 0);
|
|
18
|
+
tslib_1.__decorate([
|
|
19
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
20
|
+
tslib_1.__metadata("design:type", String)
|
|
21
|
+
], CompanySealPatch.prototype, "name", void 0);
|
|
22
|
+
tslib_1.__decorate([
|
|
23
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'YYYY-MM-DD' }),
|
|
24
|
+
tslib_1.__metadata("design:type", String)
|
|
25
|
+
], CompanySealPatch.prototype, "registeredOn", void 0);
|
|
26
|
+
tslib_1.__decorate([
|
|
27
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'The account who keeps it - one of the domain' }),
|
|
28
|
+
tslib_1.__metadata("design:type", String)
|
|
29
|
+
], CompanySealPatch.prototype, "custodianId", void 0);
|
|
30
|
+
tslib_1.__decorate([
|
|
31
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
32
|
+
tslib_1.__metadata("design:type", String)
|
|
33
|
+
], CompanySealPatch.prototype, "keptAt", void 0);
|
|
34
|
+
tslib_1.__decorate([
|
|
35
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
36
|
+
tslib_1.__metadata("design:type", String)
|
|
37
|
+
], CompanySealPatch.prototype, "usage", void 0);
|
|
38
|
+
tslib_1.__decorate([
|
|
39
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
40
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
41
|
+
], CompanySealPatch.prototype, "printed", void 0);
|
|
42
|
+
tslib_1.__decorate([
|
|
43
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'YYYY-MM-DD' }),
|
|
44
|
+
tslib_1.__metadata("design:type", String)
|
|
45
|
+
], CompanySealPatch.prototype, "disposedOn", void 0);
|
|
46
|
+
tslib_1.__decorate([
|
|
47
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
48
|
+
tslib_1.__metadata("design:type", String)
|
|
49
|
+
], CompanySealPatch.prototype, "disposeReason", void 0);
|
|
50
|
+
tslib_1.__decorate([
|
|
51
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
52
|
+
tslib_1.__metadata("design:type", String)
|
|
53
|
+
], CompanySealPatch.prototype, "notes", void 0);
|
|
54
|
+
tslib_1.__decorate([
|
|
55
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'How the row changed: + new, M changed' }),
|
|
56
|
+
tslib_1.__metadata("design:type", String)
|
|
57
|
+
], CompanySealPatch.prototype, "cuFlag", void 0);
|
|
58
|
+
exports.CompanySealPatch = CompanySealPatch = tslib_1.__decorate([
|
|
59
|
+
(0, type_graphql_1.InputType)()
|
|
60
|
+
], CompanySealPatch);
|
|
61
|
+
let CompanySealList = class CompanySealList {
|
|
62
|
+
};
|
|
63
|
+
exports.CompanySealList = CompanySealList;
|
|
64
|
+
tslib_1.__decorate([
|
|
65
|
+
(0, type_graphql_1.Field)(type => [company_seal_1.CompanySeal]),
|
|
66
|
+
tslib_1.__metadata("design:type", Array)
|
|
67
|
+
], CompanySealList.prototype, "items", void 0);
|
|
68
|
+
tslib_1.__decorate([
|
|
69
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int),
|
|
70
|
+
tslib_1.__metadata("design:type", Number)
|
|
71
|
+
], CompanySealList.prototype, "total", void 0);
|
|
72
|
+
exports.CompanySealList = CompanySealList = tslib_1.__decorate([
|
|
73
|
+
(0, type_graphql_1.ObjectType)()
|
|
74
|
+
], CompanySealList);
|
|
75
|
+
let CompanySealCustodianChoice = class CompanySealCustodianChoice {
|
|
76
|
+
};
|
|
77
|
+
exports.CompanySealCustodianChoice = CompanySealCustodianChoice;
|
|
78
|
+
tslib_1.__decorate([
|
|
79
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID),
|
|
80
|
+
tslib_1.__metadata("design:type", String)
|
|
81
|
+
], CompanySealCustodianChoice.prototype, "id", void 0);
|
|
82
|
+
tslib_1.__decorate([
|
|
83
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
84
|
+
tslib_1.__metadata("design:type", String)
|
|
85
|
+
], CompanySealCustodianChoice.prototype, "name", void 0);
|
|
86
|
+
tslib_1.__decorate([
|
|
87
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
88
|
+
tslib_1.__metadata("design:type", String)
|
|
89
|
+
], CompanySealCustodianChoice.prototype, "email", void 0);
|
|
90
|
+
exports.CompanySealCustodianChoice = CompanySealCustodianChoice = tslib_1.__decorate([
|
|
91
|
+
(0, type_graphql_1.ObjectType)({ description: 'An account that can keep a seal - who, and nothing about them' })
|
|
92
|
+
], CompanySealCustodianChoice);
|
|
93
|
+
//# sourceMappingURL=company-seal-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"company-seal-types.js","sourceRoot":"","sources":["../../../server/service/company-seal/company-seal-types.ts"],"names":[],"mappings":";;;;AAAA,+CAAoE;AAEpE,iDAA6D;AAGtD,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;CAa5B,CAAA;AAbY,4CAAgB;AAC2D;IAArF,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,gCAAgC,EAAE,CAAC;;4CAAY;AAC7C;IAAnD,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,8BAAe,EAAE,EAAE,QAAQ,EAAE,IAAI,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BAAU,GAAE;GACA,eAAe,CAG3B;AAGM,IAAM,0BAA0B,GAAhC,MAAM,0BAA0B;CAItC,CAAA;AAJY,gEAA0B;AAClB;IAAlB,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;sDAAW;AACF;IAA1B,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;wDAAc;AACb;IAA1B,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yDAAe;qCAH9B,0BAA0B;IADtC,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,+DAA+D,EAAE,CAAC;GAChF,0BAA0B,CAItC","sourcesContent":["import { Field, ID, InputType, Int, ObjectType } from 'type-graphql'\n\nimport { CompanySeal, CompanySealKind } from './company-seal'\n\n@InputType()\nexport class CompanySealPatch {\n @Field(type => ID, { nullable: true, description: 'The seal - empty for a new one' }) id?: string\n @Field(type => CompanySealKind, { nullable: true }) kind?: CompanySealKind\n @Field({ nullable: true }) name?: string\n @Field({ nullable: true, description: 'YYYY-MM-DD' }) registeredOn?: string\n @Field({ nullable: true, description: 'The account who keeps it - one of the domain' }) custodianId?: string\n @Field({ nullable: true }) keptAt?: string\n @Field({ nullable: true }) usage?: string\n @Field({ nullable: true }) printed?: boolean\n @Field({ nullable: true, description: 'YYYY-MM-DD' }) disposedOn?: string\n @Field({ nullable: true }) disposeReason?: string\n @Field({ nullable: true }) notes?: string\n @Field({ nullable: true, description: 'How the row changed: + new, M changed' }) cuFlag?: string\n}\n\n@ObjectType()\nexport class CompanySealList {\n @Field(type => [CompanySeal]) items: CompanySeal[]\n @Field(type => Int) total: number\n}\n\n@ObjectType({ description: 'An account that can keep a seal - who, and nothing about them' })\nexport class CompanySealCustodianChoice {\n @Field(type => ID) id: string\n @Field({ nullable: true }) name?: string\n @Field({ nullable: true }) email?: string\n}\n"]}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { User } from '@things-factory/auth-base';
|
|
2
|
+
import { Domain } from '@things-factory/shell';
|
|
3
|
+
/** What a seal is: the one filed with the registry, one used in its place, or the stamp documents carry. */
|
|
4
|
+
export declare enum CompanySealKind {
|
|
5
|
+
/** 법인인감 - filed with the registry; matched against the 인감증명서. */
|
|
6
|
+
CORPORATE = "CORPORATE",
|
|
7
|
+
/** 사용인감 - used in the corporate seal's place, declared by a 사용인감계. */
|
|
8
|
+
USE = "USE",
|
|
9
|
+
/** 직인 - the company's stamp on its own papers. */
|
|
10
|
+
OFFICIAL = "OFFICIAL",
|
|
11
|
+
/** 명판 - the rubber stamp of the company's name, representative and address, put beside a seal on paper; never a seal itself. */
|
|
12
|
+
NAMEPLATE = "NAMEPLATE",
|
|
13
|
+
/** 대외비 명판 - the rubber stamp that marks a paper as not to leave the company; never a seal itself. */
|
|
14
|
+
CONFIDENTIAL = "CONFIDENTIAL"
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* 인감 대장 (ADR-0188 decision 1) - each seal of 「우리 회사」: what kind, since when, who keeps it and where, and its
|
|
18
|
+
* impression - an attachment of the row (`COMPANY_SEAL_REF_TYPE`). The seal official documents print is the one
|
|
19
|
+
* `printed` (ADR-0176 decision 4). Rows are never deleted: a seal no longer used is closed by its disposal.
|
|
20
|
+
*/
|
|
21
|
+
export declare class CompanySeal {
|
|
22
|
+
readonly id: string;
|
|
23
|
+
domain?: Domain;
|
|
24
|
+
domainId?: string;
|
|
25
|
+
kind: CompanySealKind;
|
|
26
|
+
name: string;
|
|
27
|
+
registeredOn?: string;
|
|
28
|
+
custodian?: User;
|
|
29
|
+
custodianId?: string;
|
|
30
|
+
keptAt?: string;
|
|
31
|
+
usage?: string;
|
|
32
|
+
printed: boolean;
|
|
33
|
+
disposedOn?: string;
|
|
34
|
+
disposeReason?: string;
|
|
35
|
+
notes?: string;
|
|
36
|
+
createdAt?: Date;
|
|
37
|
+
updatedAt?: Date;
|
|
38
|
+
creator?: User;
|
|
39
|
+
creatorId?: string;
|
|
40
|
+
updater?: User;
|
|
41
|
+
updaterId?: string;
|
|
42
|
+
}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CompanySeal = exports.CompanySealKind = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const type_graphql_1 = require("type-graphql");
|
|
6
|
+
const typeorm_1 = require("typeorm");
|
|
7
|
+
const auth_base_1 = require("@things-factory/auth-base");
|
|
8
|
+
const shell_1 = require("@things-factory/shell");
|
|
9
|
+
/** What a seal is: the one filed with the registry, one used in its place, or the stamp documents carry. */
|
|
10
|
+
var CompanySealKind;
|
|
11
|
+
(function (CompanySealKind) {
|
|
12
|
+
/** 법인인감 - filed with the registry; matched against the 인감증명서. */
|
|
13
|
+
CompanySealKind["CORPORATE"] = "CORPORATE";
|
|
14
|
+
/** 사용인감 - used in the corporate seal's place, declared by a 사용인감계. */
|
|
15
|
+
CompanySealKind["USE"] = "USE";
|
|
16
|
+
/** 직인 - the company's stamp on its own papers. */
|
|
17
|
+
CompanySealKind["OFFICIAL"] = "OFFICIAL";
|
|
18
|
+
/** 명판 - the rubber stamp of the company's name, representative and address, put beside a seal on paper; never a seal itself. */
|
|
19
|
+
CompanySealKind["NAMEPLATE"] = "NAMEPLATE";
|
|
20
|
+
/** 대외비 명판 - the rubber stamp that marks a paper as not to leave the company; never a seal itself. */
|
|
21
|
+
CompanySealKind["CONFIDENTIAL"] = "CONFIDENTIAL";
|
|
22
|
+
})(CompanySealKind || (exports.CompanySealKind = CompanySealKind = {}));
|
|
23
|
+
(0, type_graphql_1.registerEnumType)(CompanySealKind, { name: 'CompanySealKind', description: '법인인감 · 사용인감 · 직인 · 명판 · 대외비 명판' });
|
|
24
|
+
/**
|
|
25
|
+
* 인감 대장 (ADR-0188 decision 1) - each seal of 「우리 회사」: what kind, since when, who keeps it and where, and its
|
|
26
|
+
* impression - an attachment of the row (`COMPANY_SEAL_REF_TYPE`). The seal official documents print is the one
|
|
27
|
+
* `printed` (ADR-0176 decision 4). Rows are never deleted: a seal no longer used is closed by its disposal.
|
|
28
|
+
*/
|
|
29
|
+
let CompanySeal = class CompanySeal {
|
|
30
|
+
};
|
|
31
|
+
exports.CompanySeal = CompanySeal;
|
|
32
|
+
tslib_1.__decorate([
|
|
33
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
34
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID),
|
|
35
|
+
tslib_1.__metadata("design:type", String)
|
|
36
|
+
], CompanySeal.prototype, "id", void 0);
|
|
37
|
+
tslib_1.__decorate([
|
|
38
|
+
(0, typeorm_1.ManyToOne)(type => shell_1.Domain),
|
|
39
|
+
(0, type_graphql_1.Field)(type => shell_1.Domain, { nullable: true }),
|
|
40
|
+
tslib_1.__metadata("design:type", shell_1.Domain)
|
|
41
|
+
], CompanySeal.prototype, "domain", void 0);
|
|
42
|
+
tslib_1.__decorate([
|
|
43
|
+
(0, typeorm_1.RelationId)((seal) => seal.domain),
|
|
44
|
+
tslib_1.__metadata("design:type", String)
|
|
45
|
+
], CompanySeal.prototype, "domainId", void 0);
|
|
46
|
+
tslib_1.__decorate([
|
|
47
|
+
(0, typeorm_1.Column)(),
|
|
48
|
+
(0, type_graphql_1.Field)(type => CompanySealKind),
|
|
49
|
+
tslib_1.__metadata("design:type", String)
|
|
50
|
+
], CompanySeal.prototype, "kind", void 0);
|
|
51
|
+
tslib_1.__decorate([
|
|
52
|
+
(0, typeorm_1.Column)(),
|
|
53
|
+
(0, type_graphql_1.Field)({ description: 'What people call it - 법인인감, 사용인감 1호' }),
|
|
54
|
+
tslib_1.__metadata("design:type", String)
|
|
55
|
+
], CompanySeal.prototype, "name", void 0);
|
|
56
|
+
tslib_1.__decorate([
|
|
57
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
58
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'YYYY-MM-DD filed with the registry (법인인감), or first used' }),
|
|
59
|
+
tslib_1.__metadata("design:type", String)
|
|
60
|
+
], CompanySeal.prototype, "registeredOn", void 0);
|
|
61
|
+
tslib_1.__decorate([
|
|
62
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
63
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'Who keeps it' }),
|
|
64
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
65
|
+
], CompanySeal.prototype, "custodian", void 0);
|
|
66
|
+
tslib_1.__decorate([
|
|
67
|
+
(0, typeorm_1.RelationId)((seal) => seal.custodian),
|
|
68
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
69
|
+
tslib_1.__metadata("design:type", String)
|
|
70
|
+
], CompanySeal.prototype, "custodianId", void 0);
|
|
71
|
+
tslib_1.__decorate([
|
|
72
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
73
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Where it is kept' }),
|
|
74
|
+
tslib_1.__metadata("design:type", String)
|
|
75
|
+
], CompanySeal.prototype, "keptAt", void 0);
|
|
76
|
+
tslib_1.__decorate([
|
|
77
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
78
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'What it is used for - a 사용인감 for bids, contracts, public offices' }),
|
|
79
|
+
tslib_1.__metadata("design:type", String)
|
|
80
|
+
], CompanySeal.prototype, "usage", void 0);
|
|
81
|
+
tslib_1.__decorate([
|
|
82
|
+
(0, typeorm_1.Column)({ default: false }),
|
|
83
|
+
(0, type_graphql_1.Field)({ description: 'The impression official documents print - one seal of a domain, never the corporate seal' }),
|
|
84
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
85
|
+
], CompanySeal.prototype, "printed", void 0);
|
|
86
|
+
tslib_1.__decorate([
|
|
87
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
88
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'YYYY-MM-DD it was disposed of, lost or replaced' }),
|
|
89
|
+
tslib_1.__metadata("design:type", String)
|
|
90
|
+
], CompanySeal.prototype, "disposedOn", void 0);
|
|
91
|
+
tslib_1.__decorate([
|
|
92
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
93
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
94
|
+
tslib_1.__metadata("design:type", String)
|
|
95
|
+
], CompanySeal.prototype, "disposeReason", void 0);
|
|
96
|
+
tslib_1.__decorate([
|
|
97
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
98
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
99
|
+
tslib_1.__metadata("design:type", String)
|
|
100
|
+
], CompanySeal.prototype, "notes", void 0);
|
|
101
|
+
tslib_1.__decorate([
|
|
102
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
103
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
104
|
+
tslib_1.__metadata("design:type", Date)
|
|
105
|
+
], CompanySeal.prototype, "createdAt", void 0);
|
|
106
|
+
tslib_1.__decorate([
|
|
107
|
+
(0, typeorm_1.UpdateDateColumn)(),
|
|
108
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
109
|
+
tslib_1.__metadata("design:type", Date)
|
|
110
|
+
], CompanySeal.prototype, "updatedAt", void 0);
|
|
111
|
+
tslib_1.__decorate([
|
|
112
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
113
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
|
|
114
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
115
|
+
], CompanySeal.prototype, "creator", void 0);
|
|
116
|
+
tslib_1.__decorate([
|
|
117
|
+
(0, typeorm_1.RelationId)((seal) => seal.creator),
|
|
118
|
+
tslib_1.__metadata("design:type", String)
|
|
119
|
+
], CompanySeal.prototype, "creatorId", void 0);
|
|
120
|
+
tslib_1.__decorate([
|
|
121
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
122
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
|
|
123
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
124
|
+
], CompanySeal.prototype, "updater", void 0);
|
|
125
|
+
tslib_1.__decorate([
|
|
126
|
+
(0, typeorm_1.RelationId)((seal) => seal.updater),
|
|
127
|
+
tslib_1.__metadata("design:type", String)
|
|
128
|
+
], CompanySeal.prototype, "updaterId", void 0);
|
|
129
|
+
exports.CompanySeal = CompanySeal = tslib_1.__decorate([
|
|
130
|
+
(0, typeorm_1.Entity)(),
|
|
131
|
+
(0, typeorm_1.Index)('ix_company_seals_0', (seal) => [seal.domain, seal.kind]),
|
|
132
|
+
(0, type_graphql_1.ObjectType)({ description: 'Entity for CompanySeal - a seal of 「우리 회사」 and who keeps it' })
|
|
133
|
+
], CompanySeal);
|
|
134
|
+
//# sourceMappingURL=company-seal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"company-seal.js","sourceRoot":"","sources":["../../../server/service/company-seal/company-seal.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAAkI;AAElI,yDAAgD;AAChD,iDAA8C;AAE9C,4GAA4G;AAC5G,IAAY,eAWX;AAXD,WAAY,eAAe;IACzB,iEAAiE;IACjE,0CAAuB,CAAA;IACvB,sEAAsE;IACtE,8BAAW,CAAA;IACX,kDAAkD;IAClD,wCAAqB,CAAA;IACrB,gIAAgI;IAChI,0CAAuB,CAAA;IACvB,qGAAqG;IACrG,gDAA6B,CAAA;AAC/B,CAAC,EAXW,eAAe,+BAAf,eAAe,QAW1B;AAED,IAAA,+BAAgB,EAAC,eAAe,EAAE,EAAE,IAAI,EAAE,iBAAiB,EAAE,WAAW,EAAE,gCAAgC,EAAE,CAAC,CAAA;AAE7G;;;;GAIG;AAII,IAAM,WAAW,GAAjB,MAAM,WAAW;CA6EvB,CA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AE,IAAI,EAAE,CAAC;IAC3C,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCAC9B,gBAAI;4CAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,IAAiB,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC;;8CAC9B;AAIlB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC3C,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCAC9B,gBAAI;4CAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,IAAiB,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC;;8CAC9B;sBA5EP,WAAW;IAHvB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,oBAAoB,EAAE,CAAC,IAAiB,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IAC5E,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,6DAA6D,EAAE,CAAC;GAC9E,WAAW,CA6EvB","sourcesContent":["import { Field, ID, ObjectType, registerEnumType } from 'type-graphql'\nimport { Column, CreateDateColumn, Entity, Index, ManyToOne, PrimaryGeneratedColumn, RelationId, UpdateDateColumn } from 'typeorm'\n\nimport { User } from '@things-factory/auth-base'\nimport { Domain } from '@things-factory/shell'\n\n/** What a seal is: the one filed with the registry, one used in its place, or the stamp documents carry. */\nexport enum CompanySealKind {\n /** 법인인감 - filed with the registry; matched against the 인감증명서. */\n CORPORATE = 'CORPORATE',\n /** 사용인감 - used in the corporate seal's place, declared by a 사용인감계. */\n USE = 'USE',\n /** 직인 - the company's stamp on its own papers. */\n OFFICIAL = 'OFFICIAL',\n /** 명판 - the rubber stamp of the company's name, representative and address, put beside a seal on paper; never a seal itself. */\n NAMEPLATE = 'NAMEPLATE',\n /** 대외비 명판 - the rubber stamp that marks a paper as not to leave the company; never a seal itself. */\n CONFIDENTIAL = 'CONFIDENTIAL'\n}\n\nregisterEnumType(CompanySealKind, { name: 'CompanySealKind', description: '법인인감 · 사용인감 · 직인 · 명판 · 대외비 명판' })\n\n/**\n * 인감 대장 (ADR-0188 decision 1) - each seal of 「우리 회사」: what kind, since when, who keeps it and where, and its\n * impression - an attachment of the row (`COMPANY_SEAL_REF_TYPE`). The seal official documents print is the one\n * `printed` (ADR-0176 decision 4). Rows are never deleted: a seal no longer used is closed by its disposal.\n */\n@Entity()\n@Index('ix_company_seals_0', (seal: CompanySeal) => [seal.domain, seal.kind])\n@ObjectType({ description: 'Entity for CompanySeal - a seal of 「우리 회사」 and who keeps it' })\nexport class CompanySeal {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field(type => Domain, { nullable: true })\n domain?: Domain\n\n @RelationId((seal: CompanySeal) => seal.domain)\n domainId?: string\n\n @Column()\n @Field(type => CompanySealKind)\n kind: CompanySealKind\n\n @Column()\n @Field({ description: 'What people call it - 법인인감, 사용인감 1호' })\n name: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'YYYY-MM-DD filed with the registry (법인인감), or first used' })\n registeredOn?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'Who keeps it' })\n custodian?: User\n\n @RelationId((seal: CompanySeal) => seal.custodian)\n @Field({ nullable: true })\n custodianId?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Where it is kept' })\n keptAt?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'What it is used for - a 사용인감 for bids, contracts, public offices' })\n usage?: string\n\n @Column({ default: false })\n @Field({ description: 'The impression official documents print - one seal of a domain, never the corporate seal' })\n printed: boolean\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'YYYY-MM-DD it was disposed of, lost or replaced' })\n disposedOn?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n disposeReason?: string\n\n @Column({ type: 'text', nullable: true })\n @Field({ nullable: true })\n notes?: string\n\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n creator?: User\n\n @RelationId((seal: CompanySeal) => seal.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n @RelationId((seal: CompanySeal) => seal.updater)\n updaterId?: string\n}\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { CompanySeal } from './company-seal';
|
|
2
|
+
import { CompanySealMutation } from './company-seal-mutation';
|
|
3
|
+
import { CompanySealQuery } from './company-seal-query';
|
|
4
|
+
export declare const entities: (typeof CompanySeal)[];
|
|
5
|
+
export declare const resolvers: (typeof CompanySealMutation | typeof CompanySealQuery)[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolvers = exports.entities = void 0;
|
|
4
|
+
const company_seal_1 = require("./company-seal");
|
|
5
|
+
const company_seal_mutation_1 = require("./company-seal-mutation");
|
|
6
|
+
const company_seal_query_1 = require("./company-seal-query");
|
|
7
|
+
exports.entities = [company_seal_1.CompanySeal];
|
|
8
|
+
exports.resolvers = [company_seal_query_1.CompanySealQuery, company_seal_mutation_1.CompanySealMutation];
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/company-seal/index.ts"],"names":[],"mappings":";;;AAAA,iDAA4C;AAC5C,mEAA6D;AAC7D,6DAAuD;AAE1C,QAAA,QAAQ,GAAG,CAAC,0BAAW,CAAC,CAAA;AACxB,QAAA,SAAS,GAAG,CAAC,qCAAgB,EAAE,2CAAmB,CAAC,CAAA","sourcesContent":["import { CompanySeal } from './company-seal'\nimport { CompanySealMutation } from './company-seal-mutation'\nimport { CompanySealQuery } from './company-seal-query'\n\nexport const entities = [CompanySeal]\nexport const resolvers = [CompanySealQuery, CompanySealMutation]\n"]}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
export * from './company/company';
|
|
2
2
|
export * from './company/our-company';
|
|
3
|
+
export * from './company-seal/company-seal';
|
|
4
|
+
export * from './company-seal/company-seal-rules';
|
|
5
|
+
export * from './company-seal/company-seal-service';
|
|
6
|
+
export * from './company-seal/company-seal-types';
|
|
3
7
|
export * from './bizplace/bizplace';
|
|
4
8
|
export * from './biz-option/biz-option';
|
|
5
9
|
export * from './biz-option-detail/biz-option-detail';
|
|
@@ -16,9 +20,9 @@ export * from './biz-option/biz-option-types';
|
|
|
16
20
|
export * from './biz-option-detail/biz-option-detail-types';
|
|
17
21
|
export * from './counterparty/counterparty-type';
|
|
18
22
|
export * from './worker/worker-types';
|
|
19
|
-
export declare const entities: (typeof import("./biz-option-detail/biz-option-detail").BizOptionDetail | typeof import("./biz-option/biz-option").BizOption | typeof import("./company/company").Company | typeof import("./bizplace/bizplace").Bizplace | typeof import("./counterparty/counterparty").Counterparty | typeof import("./counterparty/counterparty-bank-account").CounterpartyBankAccount | typeof import("./worker/worker").Worker)[];
|
|
23
|
+
export declare const entities: (typeof import("./biz-option-detail/biz-option-detail").BizOptionDetail | typeof import("./biz-option/biz-option").BizOption | typeof import("./company/company").Company | typeof import("./bizplace/bizplace").Bizplace | typeof import("./company-seal/company-seal").CompanySeal | typeof import("./counterparty/counterparty").Counterparty | typeof import("./counterparty/counterparty-bank-account").CounterpartyBankAccount | typeof import("./worker/worker").Worker)[];
|
|
20
24
|
export declare const schema: {
|
|
21
|
-
resolverClasses: (typeof import("./biz-option/biz-option-mutation").BizOptionMutation | typeof import("./biz-option/biz-option-query").BizOptionQuery | typeof import("./biz-option-detail/biz-option-detail-mutation").BizOptionDetailMutation | typeof import("./biz-option-detail/biz-option-detail-query").BizOptionDetailQuery | typeof import("./bizplace/bizplace-mutation").BizplaceMutation | typeof import("./bizplace/bizplace-query").BizplaceQuery | typeof import("./company/company-mutation").CompanyMutation | typeof import("./company/company-query").CompanyQuery | typeof import("./counterparty/counterparty-bank-account-mutation").CounterpartyBankAccountMutation | typeof import("./counterparty/counterparty-bank-account-query").CounterpartyBankAccountQuery | typeof import("./counterparty/counterparty-bank-account-query").CounterpartyFilesQuery | typeof import("./counterparty/counterparty-mutation").CounterpartyMutation | typeof import("./counterparty/counterparty-query").CounterpartyQuery | typeof import("./worker/worker-mutation").WorkerMutation | typeof import("./worker/worker-query").WorkerQuery)[];
|
|
25
|
+
resolverClasses: (typeof import("./biz-option/biz-option-mutation").BizOptionMutation | typeof import("./biz-option/biz-option-query").BizOptionQuery | typeof import("./biz-option-detail/biz-option-detail-mutation").BizOptionDetailMutation | typeof import("./biz-option-detail/biz-option-detail-query").BizOptionDetailQuery | typeof import("./bizplace/bizplace-mutation").BizplaceMutation | typeof import("./bizplace/bizplace-query").BizplaceQuery | typeof import("./company/company-mutation").CompanyMutation | typeof import("./company/company-query").CompanyQuery | typeof import("./company-seal/company-seal-mutation").CompanySealMutation | typeof import("./company-seal/company-seal-query").CompanySealQuery | typeof import("./counterparty/counterparty-bank-account-mutation").CounterpartyBankAccountMutation | typeof import("./counterparty/counterparty-bank-account-query").CounterpartyBankAccountQuery | typeof import("./counterparty/counterparty-bank-account-query").CounterpartyFilesQuery | typeof import("./counterparty/counterparty-mutation").CounterpartyMutation | typeof import("./counterparty/counterparty-query").CounterpartyQuery | typeof import("./worker/worker-mutation").WorkerMutation | typeof import("./worker/worker-query").WorkerQuery)[];
|
|
22
26
|
};
|
|
23
27
|
export { createCompany, deleteCompanies, deleteCompany, OUR_COMPANY_FIELDS, saveOurCompany, updateCompany } from './company/company-mutation';
|
|
24
28
|
export { createWorker, deleteWorker, deleteWorkers, updateWorker } from './worker/worker-mutation';
|