@things-factory/organization 10.1.223 → 10.1.227
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/pages/employee-profile/employee-profile-files.d.ts +23 -0
- package/dist-client/pages/employee-profile/employee-profile-files.js +50 -0
- package/dist-client/pages/employee-profile/employee-profile-files.js.map +1 -0
- package/dist-client/pages/employee-profile/employee-profile-form.d.ts +63 -0
- package/dist-client/pages/employee-profile/employee-profile-form.js +132 -0
- package/dist-client/pages/employee-profile/employee-profile-form.js.map +1 -0
- package/dist-client/pages/employee-profile/employee-profile-list-page.d.ts +52 -0
- package/dist-client/pages/employee-profile/employee-profile-list-page.js +206 -0
- package/dist-client/pages/employee-profile/employee-profile-list-page.js.map +1 -0
- package/dist-client/pages/employee-profile/employee-profile-preview.d.ts +28 -0
- package/dist-client/pages/employee-profile/employee-profile-preview.js +179 -0
- package/dist-client/pages/employee-profile/employee-profile-preview.js.map +1 -0
- package/dist-client/pages/employee-profile/my-employee-profile-page.d.ts +56 -0
- package/dist-client/pages/employee-profile/my-employee-profile-page.js +656 -0
- package/dist-client/pages/employee-profile/my-employee-profile-page.js.map +1 -0
- package/dist-client/route.d.ts +1 -1
- package/dist-client/route.js +7 -0
- package/dist-client/route.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/ai-entry/employee-profile-entry.d.ts +10 -0
- package/dist-server/ai-entry/employee-profile-entry.js +88 -0
- package/dist-server/ai-entry/employee-profile-entry.js.map +1 -0
- package/dist-server/ai-entry/entry-target-shape.d.ts +11 -1
- package/dist-server/ai-entry/entry-target-shape.js.map +1 -1
- package/dist-server/ai-entry/organization-entry-targets.d.ts +8 -0
- package/dist-server/ai-entry/organization-entry-targets.js +26 -1
- package/dist-server/ai-entry/organization-entry-targets.js.map +1 -1
- package/dist-server/role-tasks.js +4 -1
- package/dist-server/role-tasks.js.map +1 -1
- package/dist-server/service/employee-profile/employee-profile-document.d.ts +122 -0
- package/dist-server/service/employee-profile/employee-profile-document.js +439 -0
- package/dist-server/service/employee-profile/employee-profile-document.js.map +1 -0
- package/dist-server/service/employee-profile/employee-profile-mutation.d.ts +6 -0
- package/dist-server/service/employee-profile/employee-profile-mutation.js +74 -0
- package/dist-server/service/employee-profile/employee-profile-mutation.js.map +1 -0
- package/dist-server/service/employee-profile/employee-profile-query.d.ts +14 -0
- package/dist-server/service/employee-profile/employee-profile-query.js +137 -0
- package/dist-server/service/employee-profile/employee-profile-query.js.map +1 -0
- package/dist-server/service/employee-profile/employee-profile-rows.d.ts +29 -0
- package/dist-server/service/employee-profile/employee-profile-rows.js +122 -0
- package/dist-server/service/employee-profile/employee-profile-rows.js.map +1 -0
- package/dist-server/service/employee-profile/employee-profile-rules.d.ts +61 -0
- package/dist-server/service/employee-profile/employee-profile-rules.js +104 -0
- package/dist-server/service/employee-profile/employee-profile-rules.js.map +1 -0
- package/dist-server/service/employee-profile/employee-profile-type.d.ts +35 -0
- package/dist-server/service/employee-profile/employee-profile-type.js +110 -0
- package/dist-server/service/employee-profile/employee-profile-type.js.map +1 -0
- package/dist-server/service/employee-profile/employee-profile.d.ts +24 -0
- package/dist-server/service/employee-profile/employee-profile.js +112 -0
- package/dist-server/service/employee-profile/employee-profile.js.map +1 -0
- package/dist-server/service/employee-profile/index.d.ts +5 -0
- package/dist-server/service/employee-profile/index.js +9 -0
- package/dist-server/service/employee-profile/index.js.map +1 -0
- package/dist-server/service/index.d.ts +3 -2
- package/dist-server/service/index.js +6 -2
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +8 -6
- package/tests/employee-profile-db.test.ts +247 -0
- package/tests/employee-profile-document.test.ts +219 -0
- package/tests/employee-profile-entry.test.ts +72 -0
- package/tests/employee-profile-rules.test.ts +103 -0
- package/things-factory.config.js +3 -0
- package/translations/en.json +78 -1
- package/translations/es.json +78 -1
- package/translations/ja.json +78 -1
- package/translations/ko.json +78 -1
- package/translations/ms.json +78 -1
- package/translations/zh.json +78 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"employee-profile-rules.js","sourceRoot":"","sources":["../../../server/service/employee-profile/employee-profile-rules.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAwCH,8CAUC;AAaD,wCAYC;AAeD,4CAGC;AAMD,sDAeC;AAGD,0BAGC;AA3GD,qFAAqF;AACxE,QAAA,kBAAkB,GAAG;IAChC,UAAU,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,CAAC;IACjE,YAAY,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,YAAY,CAAC;IAC9C,OAAO,EAAE,CAAC,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,CAAC;IAChF,QAAQ,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,CAAC;CAC9E,CAAA;AAEV,MAAM,IAAI,GAAG,CAAC,KAAc,EAAU,EAAE,CAAC,CAAC,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;AAExF,sGAAsG;AACtG,SAAS,MAAM,CAAC,IAAa,EAAE,MAAyB;IACtD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;QAAE,OAAO,EAAE,CAAA;IACnC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;QACxB,MAAM,IAAI,GAAQ,EAAE,CAAA;QACpB,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;YAC3B,MAAM,KAAK,GAAG,IAAI,CAAE,GAAkB,EAAE,CAAC,KAAK,CAAC,CAAC,CAAA;YAChD,IAAI,KAAK;gBAAE,IAAI,CAAC,KAAK,CAAC,GAAG,KAAK,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pF,SAAgB,OAAO,CAAC,GAAG,GAAG,IAAI,IAAI,EAAE;IACtC,MAAM,GAAG,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAA;IACrD,OAAO,GAAG,GAAG,CAAC,WAAW,EAAE,IAAI,GAAG,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,EAAE,CAAA;AAChF,CAAC","sourcesContent":["/*\n * The judgements of the profile's doors (ADR-0169) - pure, apart from the store, so the tests read them without the\n * entities (the employee record pulls in contact, which reads the configuration when it is loaded).\n */\n\ntype Row = Record<string, unknown>\n\nexport type ProfileDocument = {\n summary: string | null\n skills: string[]\n educations: Row[]\n certificates: Row[]\n careers: Row[]\n projects: Row[]\n}\n\n/** The fields each kind of row keeps; anything else a caller sends is not stored. */\nexport const PROFILE_ROW_FIELDS = {\n educations: ['school', 'major', 'degree', 'startedOn', 'endedOn'],\n certificates: ['name', 'issuer', 'acquiredOn'],\n careers: ['company', 'department', 'position', 'startedOn', 'endedOn', 'duties'],\n projects: ['name', 'client', 'startedOn', 'endedOn', 'role', 'duties', 'technologies']\n} as const\n\nconst text = (value: unknown): string => (typeof value === 'string' ? value.trim() : '')\n\n/** A row as kept: its own fields trimmed, empty ones left out. A row with nothing in it is no row. */\nfunction rowsOf(rows: unknown, fields: readonly string[]): Row[] {\n if (!Array.isArray(rows)) return []\n return rows.flatMap(row => {\n const kept: Row = {}\n for (const field of fields) {\n const value = text((row as Row | null)?.[field])\n if (value) kept[field] = value\n }\n return Object.keys(kept).length ? [kept] : []\n })\n}\n\n/**\n * The profile as it is saved - whole, as the screen sent it (ADR-0169 decision 2). Blank rows the screen added and did\n * not fill go, and a skill written twice is kept once.\n */\nexport function profileDocumentOf(input: any): ProfileDocument {\n const skills = [...new Set((Array.isArray(input?.skills) ? input.skills : []).map(text).filter(Boolean))] as string[]\n return {\n summary: text(input?.summary) || null,\n skills,\n educations: rowsOf(input?.educations, PROFILE_ROW_FIELDS.educations),\n certificates: rowsOf(input?.certificates, PROFILE_ROW_FIELDS.certificates),\n careers: rowsOf(input?.careers, PROFILE_ROW_FIELDS.careers),\n projects: rowsOf(input?.projects, PROFILE_ROW_FIELDS.projects)\n }\n}\n\n/** Two rows are the same entry when every field they keep is the same - spacing and letter case aside. */\nconst sameRow = (a: Row, b: Row) => {\n const keys = new Set([...Object.keys(a), ...Object.keys(b)])\n return [...keys].every(key => text(a[key]).toLowerCase() === text(b[key]).toLowerCase())\n}\n\n/**\n * What is added to a profile kept so far (ADR-0169 decision 10 - the assistant's 입력안 from a résumé): a summary given\n * takes the place of the one kept, skills are added after those held (a skill already held is not added twice), and\n * rows are added after those of their section unless the very same row is there. Nothing kept is taken away.\n */\nexport function addedProfileOf(held: Partial<ProfileDocument> | null | undefined, addition: any): ProfileDocument {\n const kept = profileDocumentOf(held ?? {})\n const added = profileDocumentOf(addition)\n const rows = (key: keyof typeof PROFILE_ROW_FIELDS) => [...kept[key], ...added[key].filter(row => !kept[key].some(one => sameRow(one, row)))]\n return {\n summary: added.summary ?? kept.summary,\n skills: [...kept.skills, ...added.skills.filter(skill => !kept.skills.some(one => one.toLowerCase() === skill.toLowerCase()))],\n educations: rows('educations'),\n certificates: rows('certificates'),\n careers: rows('careers'),\n projects: rows('projects')\n }\n}\n\nexport type ProfileEmployee = {\n id: string\n controlNo?: string\n name?: string\n active?: boolean | null\n retiredOn?: string | null\n jobPosition?: string\n jobResponsibility?: string\n hiredOn?: string\n department?: { name?: string } | null\n}\n\n/** Still working here: not marked inactive, and no retire day that has come. `today` is YYYY-MM-DD. */\nexport function isActiveEmployee(employee: ProfileEmployee, today: string): boolean {\n if (employee.active === false) return false\n return !employee.retiredOn || employee.retiredOn > today\n}\n\n/**\n * Every active employee with their profile, by name (ADR-0169 decision 4) - an employee who has written none is listed\n * with an empty one, so the list says who has not written it rather than leaving them out.\n */\nexport function employeesWithProfiles<P extends { employeeId?: string }>(employees: ProfileEmployee[], profiles: P[], today: string) {\n const byEmployee = new Map(profiles.map(profile => [profile.employeeId, profile]))\n return employees\n .filter(employee => isActiveEmployee(employee, today))\n .map(employee => ({\n employeeId: employee.id,\n controlNo: employee.controlNo,\n name: employee.name,\n departmentName: employee.department?.name,\n jobPosition: employee.jobPosition,\n jobResponsibility: employee.jobResponsibility,\n hiredOn: employee.hiredOn,\n profile: byEmployee.get(employee.id) ?? null\n }))\n .sort((a, b) => (a.name ?? '').localeCompare(b.name ?? '', 'ko') || (a.controlNo ?? '').localeCompare(b.controlNo ?? ''))\n}\n\n/** Today in the server's calendar, YYYY-MM-DD - the form `retiredOn` is kept in. */\nexport function todayOf(now = new Date()): string {\n const pad = (n: number) => String(n).padStart(2, '0')\n return `${now.getFullYear()}-${pad(now.getMonth() + 1)}-${pad(now.getDate())}`\n}\n"]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { EmployeeProfile } from './employee-profile';
|
|
2
|
+
import { EmployeeProfileCareer, EmployeeProfileCertificate, EmployeeProfileEducation, EmployeeProfileProject } from './employee-profile-rows';
|
|
3
|
+
/** The two forms the profiles are handed in as, and the page they are previewed on (ADR-0169 decisions 5 · 9). */
|
|
4
|
+
export declare enum EmployeeProfileFormat {
|
|
5
|
+
XLSX = "XLSX",
|
|
6
|
+
PDF = "PDF",
|
|
7
|
+
HTML = "HTML"
|
|
8
|
+
}
|
|
9
|
+
export declare class EmployeeProfileFile {
|
|
10
|
+
fileName: string;
|
|
11
|
+
mimeType: string;
|
|
12
|
+
content: string;
|
|
13
|
+
}
|
|
14
|
+
export declare class EmployeeProfileInput {
|
|
15
|
+
summary?: string;
|
|
16
|
+
skills?: string[];
|
|
17
|
+
educations?: EmployeeProfileEducation[];
|
|
18
|
+
certificates?: EmployeeProfileCertificate[];
|
|
19
|
+
careers?: EmployeeProfileCareer[];
|
|
20
|
+
projects?: EmployeeProfileProject[];
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* One active employee with their profile, for the list a quotation's profiles are taken from (ADR-0169 decisions 1 · 4).
|
|
24
|
+
* The basics are read from the employee record and nothing else of it - no contact, address, birthday, account or pay.
|
|
25
|
+
*/
|
|
26
|
+
export declare class EmployeeWithProfile {
|
|
27
|
+
employeeId: string;
|
|
28
|
+
controlNo?: string;
|
|
29
|
+
name?: string;
|
|
30
|
+
departmentName?: string;
|
|
31
|
+
jobPosition?: string;
|
|
32
|
+
jobResponsibility?: string;
|
|
33
|
+
hiredOn?: string;
|
|
34
|
+
profile?: EmployeeProfile;
|
|
35
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EmployeeWithProfile = exports.EmployeeProfileInput = exports.EmployeeProfileFile = exports.EmployeeProfileFormat = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
/* The documents the profile's doors take and give (ADR-0169 decisions 2 · 4). */
|
|
6
|
+
const type_graphql_1 = require("type-graphql");
|
|
7
|
+
const employee_profile_1 = require("./employee-profile");
|
|
8
|
+
const employee_profile_rows_1 = require("./employee-profile-rows");
|
|
9
|
+
/** The two forms the profiles are handed in as, and the page they are previewed on (ADR-0169 decisions 5 · 9). */
|
|
10
|
+
var EmployeeProfileFormat;
|
|
11
|
+
(function (EmployeeProfileFormat) {
|
|
12
|
+
EmployeeProfileFormat["XLSX"] = "XLSX";
|
|
13
|
+
EmployeeProfileFormat["PDF"] = "PDF";
|
|
14
|
+
EmployeeProfileFormat["HTML"] = "HTML";
|
|
15
|
+
})(EmployeeProfileFormat || (exports.EmployeeProfileFormat = EmployeeProfileFormat = {}));
|
|
16
|
+
(0, type_graphql_1.registerEnumType)(EmployeeProfileFormat, {
|
|
17
|
+
name: 'EmployeeProfileFormat',
|
|
18
|
+
description: 'The form of the employee profiles: an Excel workbook or a PDF to download, or an HTML page to preview them on screen.'
|
|
19
|
+
});
|
|
20
|
+
let EmployeeProfileFile = class EmployeeProfileFile {
|
|
21
|
+
};
|
|
22
|
+
exports.EmployeeProfileFile = EmployeeProfileFile;
|
|
23
|
+
tslib_1.__decorate([
|
|
24
|
+
(0, type_graphql_1.Field)({ description: 'The file name, with its extension.' }),
|
|
25
|
+
tslib_1.__metadata("design:type", String)
|
|
26
|
+
], EmployeeProfileFile.prototype, "fileName", void 0);
|
|
27
|
+
tslib_1.__decorate([
|
|
28
|
+
(0, type_graphql_1.Field)({ description: 'The media type.' }),
|
|
29
|
+
tslib_1.__metadata("design:type", String)
|
|
30
|
+
], EmployeeProfileFile.prototype, "mimeType", void 0);
|
|
31
|
+
tslib_1.__decorate([
|
|
32
|
+
(0, type_graphql_1.Field)({ description: 'The bytes of the file, base64.' }),
|
|
33
|
+
tslib_1.__metadata("design:type", String)
|
|
34
|
+
], EmployeeProfileFile.prototype, "content", void 0);
|
|
35
|
+
exports.EmployeeProfileFile = EmployeeProfileFile = tslib_1.__decorate([
|
|
36
|
+
(0, type_graphql_1.ObjectType)({ description: 'A file of employee profiles to download - its name, its media type and its bytes in base64.' })
|
|
37
|
+
], EmployeeProfileFile);
|
|
38
|
+
let EmployeeProfileInput = class EmployeeProfileInput {
|
|
39
|
+
};
|
|
40
|
+
exports.EmployeeProfileInput = EmployeeProfileInput;
|
|
41
|
+
tslib_1.__decorate([
|
|
42
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'A few lines about the employee.' }),
|
|
43
|
+
tslib_1.__metadata("design:type", String)
|
|
44
|
+
], EmployeeProfileInput.prototype, "summary", void 0);
|
|
45
|
+
tslib_1.__decorate([
|
|
46
|
+
(0, type_graphql_1.Field)(type => [String], { nullable: true, description: 'The skills, each a word or two.' }),
|
|
47
|
+
tslib_1.__metadata("design:type", Array)
|
|
48
|
+
], EmployeeProfileInput.prototype, "skills", void 0);
|
|
49
|
+
tslib_1.__decorate([
|
|
50
|
+
(0, type_graphql_1.Field)(type => [employee_profile_rows_1.EmployeeProfileEducation], { nullable: true, description: 'The schools.' }),
|
|
51
|
+
tslib_1.__metadata("design:type", Array)
|
|
52
|
+
], EmployeeProfileInput.prototype, "educations", void 0);
|
|
53
|
+
tslib_1.__decorate([
|
|
54
|
+
(0, type_graphql_1.Field)(type => [employee_profile_rows_1.EmployeeProfileCertificate], { nullable: true, description: 'The certificates and licences.' }),
|
|
55
|
+
tslib_1.__metadata("design:type", Array)
|
|
56
|
+
], EmployeeProfileInput.prototype, "certificates", void 0);
|
|
57
|
+
tslib_1.__decorate([
|
|
58
|
+
(0, type_graphql_1.Field)(type => [employee_profile_rows_1.EmployeeProfileCareer], { nullable: true, description: 'The jobs held before, at other companies.' }),
|
|
59
|
+
tslib_1.__metadata("design:type", Array)
|
|
60
|
+
], EmployeeProfileInput.prototype, "careers", void 0);
|
|
61
|
+
tslib_1.__decorate([
|
|
62
|
+
(0, type_graphql_1.Field)(type => [employee_profile_rows_1.EmployeeProfileProject], { nullable: true, description: 'The projects worked on.' }),
|
|
63
|
+
tslib_1.__metadata("design:type", Array)
|
|
64
|
+
], EmployeeProfileInput.prototype, "projects", void 0);
|
|
65
|
+
exports.EmployeeProfileInput = EmployeeProfileInput = tslib_1.__decorate([
|
|
66
|
+
(0, type_graphql_1.InputType)({ description: "The caller's own profile, whole - what is left out is emptied (ADR-0169 decision 2)." })
|
|
67
|
+
], EmployeeProfileInput);
|
|
68
|
+
/**
|
|
69
|
+
* One active employee with their profile, for the list a quotation's profiles are taken from (ADR-0169 decisions 1 · 4).
|
|
70
|
+
* The basics are read from the employee record and nothing else of it - no contact, address, birthday, account or pay.
|
|
71
|
+
*/
|
|
72
|
+
let EmployeeWithProfile = class EmployeeWithProfile {
|
|
73
|
+
};
|
|
74
|
+
exports.EmployeeWithProfile = EmployeeWithProfile;
|
|
75
|
+
tslib_1.__decorate([
|
|
76
|
+
(0, type_graphql_1.Field)({ description: 'The employee id.' }),
|
|
77
|
+
tslib_1.__metadata("design:type", String)
|
|
78
|
+
], EmployeeWithProfile.prototype, "employeeId", void 0);
|
|
79
|
+
tslib_1.__decorate([
|
|
80
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'The employee control number.' }),
|
|
81
|
+
tslib_1.__metadata("design:type", String)
|
|
82
|
+
], EmployeeWithProfile.prototype, "controlNo", void 0);
|
|
83
|
+
tslib_1.__decorate([
|
|
84
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'The name.' }),
|
|
85
|
+
tslib_1.__metadata("design:type", String)
|
|
86
|
+
], EmployeeWithProfile.prototype, "name", void 0);
|
|
87
|
+
tslib_1.__decorate([
|
|
88
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'The name of the department.' }),
|
|
89
|
+
tslib_1.__metadata("design:type", String)
|
|
90
|
+
], EmployeeWithProfile.prototype, "departmentName", void 0);
|
|
91
|
+
tslib_1.__decorate([
|
|
92
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'The position (rank).' }),
|
|
93
|
+
tslib_1.__metadata("design:type", String)
|
|
94
|
+
], EmployeeWithProfile.prototype, "jobPosition", void 0);
|
|
95
|
+
tslib_1.__decorate([
|
|
96
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'The responsibility (title).' }),
|
|
97
|
+
tslib_1.__metadata("design:type", String)
|
|
98
|
+
], EmployeeWithProfile.prototype, "jobResponsibility", void 0);
|
|
99
|
+
tslib_1.__decorate([
|
|
100
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'The hire day, YYYY-MM-DD.' }),
|
|
101
|
+
tslib_1.__metadata("design:type", String)
|
|
102
|
+
], EmployeeWithProfile.prototype, "hiredOn", void 0);
|
|
103
|
+
tslib_1.__decorate([
|
|
104
|
+
(0, type_graphql_1.Field)(type => employee_profile_1.EmployeeProfile, { nullable: true, description: 'The profile - empty when the employee has written none.' }),
|
|
105
|
+
tslib_1.__metadata("design:type", employee_profile_1.EmployeeProfile)
|
|
106
|
+
], EmployeeWithProfile.prototype, "profile", void 0);
|
|
107
|
+
exports.EmployeeWithProfile = EmployeeWithProfile = tslib_1.__decorate([
|
|
108
|
+
(0, type_graphql_1.ObjectType)({ description: 'An active employee of the domain with their profile - empty when they have written none.' })
|
|
109
|
+
], EmployeeWithProfile);
|
|
110
|
+
//# sourceMappingURL=employee-profile-type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"employee-profile-type.js","sourceRoot":"","sources":["../../../server/service/employee-profile/employee-profile-type.ts"],"names":[],"mappings":";;;;AAAA,iFAAiF;AACjF,+CAA6E;AAE7E,yDAAoD;AACpD,mEAA6I;AAE7I,kHAAkH;AAClH,IAAY,qBAIX;AAJD,WAAY,qBAAqB;IAC/B,sCAAa,CAAA;IACb,oCAAW,CAAA;IACX,sCAAa,CAAA;AACf,CAAC,EAJW,qBAAqB,qCAArB,qBAAqB,QAIhC;AAED,IAAA,+BAAgB,EAAC,qBAAqB,EAAE;IACtC,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EAAE,uHAAuH;CACrI,CAAC,CAAA;AAGK,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;CAS/B,CAAA;AATY,kDAAmB;AAE9B;IADC,IAAA,oBAAK,EAAC,EAAE,WAAW,EAAE,oCAAoC,EAAE,CAAC;;qDAC7C;AAGhB;IADC,IAAA,oBAAK,EAAC,EAAE,WAAW,EAAE,iBAAiB,EAAE,CAAC;;qDAC1B;AAGhB;IADC,IAAA,oBAAK,EAAC,EAAE,WAAW,EAAE,gCAAgC,EAAE,CAAC;;oDAC1C;8BARJ,mBAAmB;IAD/B,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,6FAA6F,EAAE,CAAC;GAC9G,mBAAmB,CAS/B;AAGM,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;CAkBhC,CAAA;AAlBY,oDAAoB;AAE/B;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,iCAAiC,EAAE,CAAC;;q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CAAC;;iDACvC;AAGb;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,6BAA6B,EAAE,CAAC;;2DAC/C;AAGvB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,sBAAsB,EAAE,CAAC;;wDAC3C;AAGpB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,6BAA6B,EAAE,CAAC;;8DAC5C;AAG1B;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,2BAA2B,EAAE,CAAC;;oDACpD;AAGhB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kCAAe,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,yDAAyD,EAAE,CAAC;sCACjH,kCAAe;oDAAA;8BAvBd,mBAAmB;IAD/B,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,0FAA0F,EAAE,CAAC;GAC3G,mBAAmB,CAwB/B","sourcesContent":["/* The documents the profile's doors take and give (ADR-0169 decisions 2 · 4). */\nimport { Field, InputType, ObjectType, registerEnumType } from 'type-graphql'\n\nimport { EmployeeProfile } from './employee-profile'\nimport { EmployeeProfileCareer, EmployeeProfileCertificate, EmployeeProfileEducation, EmployeeProfileProject } from './employee-profile-rows'\n\n/** The two forms the profiles are handed in as, and the page they are previewed on (ADR-0169 decisions 5 · 9). */\nexport enum EmployeeProfileFormat {\n XLSX = 'XLSX',\n PDF = 'PDF',\n HTML = 'HTML'\n}\n\nregisterEnumType(EmployeeProfileFormat, {\n name: 'EmployeeProfileFormat',\n description: 'The form of the employee profiles: an Excel workbook or a PDF to download, or an HTML page to preview them on screen.'\n})\n\n@ObjectType({ description: 'A file of employee profiles to download - its name, its media type and its bytes in base64.' })\nexport class EmployeeProfileFile {\n @Field({ description: 'The file name, with its extension.' })\n fileName: string\n\n @Field({ description: 'The media type.' })\n mimeType: string\n\n @Field({ description: 'The bytes of the file, base64.' })\n content: string\n}\n\n@InputType({ description: \"The caller's own profile, whole - what is left out is emptied (ADR-0169 decision 2).\" })\nexport class EmployeeProfileInput {\n @Field({ nullable: true, description: 'A few lines about the employee.' })\n summary?: string\n\n @Field(type => [String], { nullable: true, description: 'The skills, each a word or two.' })\n skills?: string[]\n\n @Field(type => [EmployeeProfileEducation], { nullable: true, description: 'The schools.' })\n educations?: EmployeeProfileEducation[]\n\n @Field(type => [EmployeeProfileCertificate], { nullable: true, description: 'The certificates and licences.' })\n certificates?: EmployeeProfileCertificate[]\n\n @Field(type => [EmployeeProfileCareer], { nullable: true, description: 'The jobs held before, at other companies.' })\n careers?: EmployeeProfileCareer[]\n\n @Field(type => [EmployeeProfileProject], { nullable: true, description: 'The projects worked on.' })\n projects?: EmployeeProfileProject[]\n}\n\n/**\n * One active employee with their profile, for the list a quotation's profiles are taken from (ADR-0169 decisions 1 · 4).\n * The basics are read from the employee record and nothing else of it - no contact, address, birthday, account or pay.\n */\n@ObjectType({ description: 'An active employee of the domain with their profile - empty when they have written none.' })\nexport class EmployeeWithProfile {\n @Field({ description: 'The employee id.' })\n employeeId: string\n\n @Field({ nullable: true, description: 'The employee control number.' })\n controlNo?: string\n\n @Field({ nullable: true, description: 'The name.' })\n name?: string\n\n @Field({ nullable: true, description: 'The name of the department.' })\n departmentName?: string\n\n @Field({ nullable: true, description: 'The position (rank).' })\n jobPosition?: string\n\n @Field({ nullable: true, description: 'The responsibility (title).' })\n jobResponsibility?: string\n\n @Field({ nullable: true, description: 'The hire day, YYYY-MM-DD.' })\n hiredOn?: string\n\n @Field(type => EmployeeProfile, { nullable: true, description: 'The profile - empty when the employee has written none.' })\n profile?: EmployeeProfile\n}\n"]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Domain } from '@things-factory/shell';
|
|
2
|
+
import { User } from '@things-factory/auth-base';
|
|
3
|
+
import { Employee } from '../employee/employee';
|
|
4
|
+
import { EmployeeProfileCareer, EmployeeProfileCertificate, EmployeeProfileEducation, EmployeeProfileProject } from './employee-profile-rows';
|
|
5
|
+
export declare class EmployeeProfile {
|
|
6
|
+
readonly id: string;
|
|
7
|
+
domain?: Domain;
|
|
8
|
+
domainId?: string;
|
|
9
|
+
employee?: Employee;
|
|
10
|
+
employeeId?: string;
|
|
11
|
+
summary?: string;
|
|
12
|
+
skills?: string[];
|
|
13
|
+
educations?: EmployeeProfileEducation[];
|
|
14
|
+
certificates?: EmployeeProfileCertificate[];
|
|
15
|
+
careers?: EmployeeProfileCareer[];
|
|
16
|
+
projects?: EmployeeProfileProject[];
|
|
17
|
+
creator?: User;
|
|
18
|
+
creatorId?: string;
|
|
19
|
+
updater?: User;
|
|
20
|
+
updaterId?: string;
|
|
21
|
+
createdAt?: Date;
|
|
22
|
+
updatedAt?: Date;
|
|
23
|
+
deletedAt?: Date;
|
|
24
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EmployeeProfile = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
/*
|
|
6
|
+
* An employee's profile - what they studied, hold, did before and worked on - written by the employee and taken by sales
|
|
7
|
+
* to attach to a quotation (ADR-0169).
|
|
8
|
+
*
|
|
9
|
+
* Its own table beside the employee record, one per employee: the record holds contact, address and the pay account,
|
|
10
|
+
* and the people who read profiles (sales) must not read those. Name, department, position and hire day are read from
|
|
11
|
+
* the record, never copied here. So neither the employee nor the writers are fields of this type - only their ids -
|
|
12
|
+
* and reaching a profile does not reach the record behind it.
|
|
13
|
+
*/
|
|
14
|
+
const typeorm_1 = require("typeorm");
|
|
15
|
+
const type_graphql_1 = require("type-graphql");
|
|
16
|
+
const shell_1 = require("@things-factory/shell");
|
|
17
|
+
const auth_base_1 = require("@things-factory/auth-base");
|
|
18
|
+
const employee_1 = require("../employee/employee");
|
|
19
|
+
const employee_profile_rows_1 = require("./employee-profile-rows");
|
|
20
|
+
let EmployeeProfile = class EmployeeProfile {
|
|
21
|
+
};
|
|
22
|
+
exports.EmployeeProfile = EmployeeProfile;
|
|
23
|
+
tslib_1.__decorate([
|
|
24
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
25
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { description: 'Profile id.' }),
|
|
26
|
+
tslib_1.__metadata("design:type", String)
|
|
27
|
+
], EmployeeProfile.prototype, "id", void 0);
|
|
28
|
+
tslib_1.__decorate([
|
|
29
|
+
(0, typeorm_1.ManyToOne)(type => shell_1.Domain),
|
|
30
|
+
(0, type_graphql_1.Field)(type => shell_1.Domain, { nullable: true, description: 'The domain the profile is in.' }),
|
|
31
|
+
tslib_1.__metadata("design:type", shell_1.Domain)
|
|
32
|
+
], EmployeeProfile.prototype, "domain", void 0);
|
|
33
|
+
tslib_1.__decorate([
|
|
34
|
+
(0, typeorm_1.RelationId)((one) => one.domain),
|
|
35
|
+
tslib_1.__metadata("design:type", String)
|
|
36
|
+
], EmployeeProfile.prototype, "domainId", void 0);
|
|
37
|
+
tslib_1.__decorate([
|
|
38
|
+
(0, typeorm_1.ManyToOne)(type => employee_1.Employee),
|
|
39
|
+
tslib_1.__metadata("design:type", employee_1.Employee)
|
|
40
|
+
], EmployeeProfile.prototype, "employee", void 0);
|
|
41
|
+
tslib_1.__decorate([
|
|
42
|
+
(0, typeorm_1.RelationId)((one) => one.employee),
|
|
43
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'The employee whose profile it is.' }),
|
|
44
|
+
tslib_1.__metadata("design:type", String)
|
|
45
|
+
], EmployeeProfile.prototype, "employeeId", void 0);
|
|
46
|
+
tslib_1.__decorate([
|
|
47
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
48
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'A few lines about the employee.' }),
|
|
49
|
+
tslib_1.__metadata("design:type", String)
|
|
50
|
+
], EmployeeProfile.prototype, "summary", void 0);
|
|
51
|
+
tslib_1.__decorate([
|
|
52
|
+
(0, typeorm_1.Column)('simple-json', { nullable: true }),
|
|
53
|
+
(0, type_graphql_1.Field)(type => [String], { nullable: true, description: 'The skills, each a word or two.' }),
|
|
54
|
+
tslib_1.__metadata("design:type", Array)
|
|
55
|
+
], EmployeeProfile.prototype, "skills", void 0);
|
|
56
|
+
tslib_1.__decorate([
|
|
57
|
+
(0, typeorm_1.Column)('simple-json', { nullable: true }),
|
|
58
|
+
(0, type_graphql_1.Field)(type => [employee_profile_rows_1.EmployeeProfileEducation], { nullable: true, description: 'The schools.' }),
|
|
59
|
+
tslib_1.__metadata("design:type", Array)
|
|
60
|
+
], EmployeeProfile.prototype, "educations", void 0);
|
|
61
|
+
tslib_1.__decorate([
|
|
62
|
+
(0, typeorm_1.Column)('simple-json', { nullable: true }),
|
|
63
|
+
(0, type_graphql_1.Field)(type => [employee_profile_rows_1.EmployeeProfileCertificate], { nullable: true, description: 'The certificates and licences.' }),
|
|
64
|
+
tslib_1.__metadata("design:type", Array)
|
|
65
|
+
], EmployeeProfile.prototype, "certificates", void 0);
|
|
66
|
+
tslib_1.__decorate([
|
|
67
|
+
(0, typeorm_1.Column)('simple-json', { nullable: true }),
|
|
68
|
+
(0, type_graphql_1.Field)(type => [employee_profile_rows_1.EmployeeProfileCareer], { nullable: true, description: 'The jobs held before, at other companies.' }),
|
|
69
|
+
tslib_1.__metadata("design:type", Array)
|
|
70
|
+
], EmployeeProfile.prototype, "careers", void 0);
|
|
71
|
+
tslib_1.__decorate([
|
|
72
|
+
(0, typeorm_1.Column)('simple-json', { nullable: true }),
|
|
73
|
+
(0, type_graphql_1.Field)(type => [employee_profile_rows_1.EmployeeProfileProject], { nullable: true, description: 'The projects worked on.' }),
|
|
74
|
+
tslib_1.__metadata("design:type", Array)
|
|
75
|
+
], EmployeeProfile.prototype, "projects", void 0);
|
|
76
|
+
tslib_1.__decorate([
|
|
77
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
78
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
79
|
+
], EmployeeProfile.prototype, "creator", void 0);
|
|
80
|
+
tslib_1.__decorate([
|
|
81
|
+
(0, typeorm_1.RelationId)((one) => one.creator),
|
|
82
|
+
tslib_1.__metadata("design:type", String)
|
|
83
|
+
], EmployeeProfile.prototype, "creatorId", void 0);
|
|
84
|
+
tslib_1.__decorate([
|
|
85
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
86
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
87
|
+
], EmployeeProfile.prototype, "updater", void 0);
|
|
88
|
+
tslib_1.__decorate([
|
|
89
|
+
(0, typeorm_1.RelationId)((one) => one.updater),
|
|
90
|
+
tslib_1.__metadata("design:type", String)
|
|
91
|
+
], EmployeeProfile.prototype, "updaterId", void 0);
|
|
92
|
+
tslib_1.__decorate([
|
|
93
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
94
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Creation timestamp.' }),
|
|
95
|
+
tslib_1.__metadata("design:type", Date)
|
|
96
|
+
], EmployeeProfile.prototype, "createdAt", void 0);
|
|
97
|
+
tslib_1.__decorate([
|
|
98
|
+
(0, typeorm_1.UpdateDateColumn)(),
|
|
99
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Last update timestamp.' }),
|
|
100
|
+
tslib_1.__metadata("design:type", Date)
|
|
101
|
+
], EmployeeProfile.prototype, "updatedAt", void 0);
|
|
102
|
+
tslib_1.__decorate([
|
|
103
|
+
(0, typeorm_1.DeleteDateColumn)(),
|
|
104
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Soft delete timestamp.' }),
|
|
105
|
+
tslib_1.__metadata("design:type", Date)
|
|
106
|
+
], EmployeeProfile.prototype, "deletedAt", void 0);
|
|
107
|
+
exports.EmployeeProfile = EmployeeProfile = tslib_1.__decorate([
|
|
108
|
+
(0, typeorm_1.Entity)(),
|
|
109
|
+
(0, typeorm_1.Index)('ix_employee_profile_0', (one) => [one.domain, one.employee], { unique: true, where: '"deleted_at" IS NULL' }),
|
|
110
|
+
(0, type_graphql_1.ObjectType)({ description: "An employee's profile - summary, skills, schools, certificates, past jobs and projects (ADR-0169)." })
|
|
111
|
+
], EmployeeProfile);
|
|
112
|
+
//# sourceMappingURL=employee-profile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"employee-profile.js","sourceRoot":"","sources":["../../../server/service/employee-profile/employee-profile.ts"],"names":[],"mappings":";;;;AAAA;;;;;;;;GAQG;AACH,qCAAoJ;AACpJ,+CAAoD;AAEpD,iDAA8C;AAC9C,yDAAgD;AAEhD,mDAA+C;AAC/C,mEAA6I;AAKtI,IAAM,eAAe,GAArB,MAAM,eAAe;CAkE3B,CAAA;AAlEY,0CAAe;AAGjB;IAFR,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,WAAW,EAAE,aAAa,EAAE,CAAC;;2CAC/B;AAInB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IACzB,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,+BAA+B,EAAE,CAAC;sCAC/E,cAAM;+CAAA;AAGf;IADC,IAAA,oBAAU,EAAC,CAAC,GAAoB,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC;;iDAChC;AAGjB;IADC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,mBAAQ,CAAC;sCACjB,mBAAQ;iDAAA;AAInB;IAFC,IAAA,oBAAU,EAAC,CAAC,GAAoB,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,CAA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Q,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,sBAAsB,EAAE,CAAC;IACrI,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,oGAAoG,EAAE,CAAC;GACrH,eAAe,CAkE3B","sourcesContent":["/*\n * An employee's profile - what they studied, hold, did before and worked on - written by the employee and taken by sales\n * to attach to a quotation (ADR-0169).\n *\n * Its own table beside the employee record, one per employee: the record holds contact, address and the pay account,\n * and the people who read profiles (sales) must not read those. Name, department, position and hire day are read from\n * the record, never copied here. So neither the employee nor the writers are fields of this type - only their ids -\n * and reaching a profile does not reach the record behind it.\n */\nimport { Column, CreateDateColumn, DeleteDateColumn, Entity, Index, ManyToOne, PrimaryGeneratedColumn, RelationId, UpdateDateColumn } from 'typeorm'\nimport { Field, ID, ObjectType } from 'type-graphql'\n\nimport { Domain } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\n\nimport { Employee } from '../employee/employee'\nimport { EmployeeProfileCareer, EmployeeProfileCertificate, EmployeeProfileEducation, EmployeeProfileProject } from './employee-profile-rows'\n\n@Entity()\n@Index('ix_employee_profile_0', (one: EmployeeProfile) => [one.domain, one.employee], { unique: true, where: '\"deleted_at\" IS NULL' })\n@ObjectType({ description: \"An employee's profile - summary, skills, schools, certificates, past jobs and projects (ADR-0169).\" })\nexport class EmployeeProfile {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID, { description: 'Profile id.' })\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field(type => Domain, { nullable: true, description: 'The domain the profile is in.' })\n domain?: Domain\n\n @RelationId((one: EmployeeProfile) => one.domain)\n domainId?: string\n\n @ManyToOne(type => Employee)\n employee?: Employee\n\n @RelationId((one: EmployeeProfile) => one.employee)\n @Field({ nullable: true, description: 'The employee whose profile it is.' })\n employeeId?: string\n\n @Column({ type: 'text', nullable: true })\n @Field({ nullable: true, description: 'A few lines about the employee.' })\n summary?: string\n\n @Column('simple-json', { nullable: true })\n @Field(type => [String], { nullable: true, description: 'The skills, each a word or two.' })\n skills?: string[]\n\n @Column('simple-json', { nullable: true })\n @Field(type => [EmployeeProfileEducation], { nullable: true, description: 'The schools.' })\n educations?: EmployeeProfileEducation[]\n\n @Column('simple-json', { nullable: true })\n @Field(type => [EmployeeProfileCertificate], { nullable: true, description: 'The certificates and licences.' })\n certificates?: EmployeeProfileCertificate[]\n\n @Column('simple-json', { nullable: true })\n @Field(type => [EmployeeProfileCareer], { nullable: true, description: 'The jobs held before, at other companies.' })\n careers?: EmployeeProfileCareer[]\n\n @Column('simple-json', { nullable: true })\n @Field(type => [EmployeeProfileProject], { nullable: true, description: 'The projects worked on.' })\n projects?: EmployeeProfileProject[]\n\n @ManyToOne(type => User, { nullable: true })\n creator?: User\n\n @RelationId((one: EmployeeProfile) => one.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n updater?: User\n\n @RelationId((one: EmployeeProfile) => one.updater)\n updaterId?: string\n\n @CreateDateColumn()\n @Field({ nullable: true, description: 'Creation timestamp.' })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true, description: 'Last update timestamp.' })\n updatedAt?: Date\n\n @DeleteDateColumn()\n @Field({ nullable: true, description: 'Soft delete timestamp.' })\n deletedAt?: Date\n}\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { EmployeeProfile } from './employee-profile';
|
|
2
|
+
import { EmployeeProfileMutation } from './employee-profile-mutation';
|
|
3
|
+
import { EmployeeProfileQuery } from './employee-profile-query';
|
|
4
|
+
export declare const entities: (typeof EmployeeProfile)[];
|
|
5
|
+
export declare const resolvers: (typeof EmployeeProfileMutation | typeof EmployeeProfileQuery)[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolvers = exports.entities = void 0;
|
|
4
|
+
const employee_profile_1 = require("./employee-profile");
|
|
5
|
+
const employee_profile_mutation_1 = require("./employee-profile-mutation");
|
|
6
|
+
const employee_profile_query_1 = require("./employee-profile-query");
|
|
7
|
+
exports.entities = [employee_profile_1.EmployeeProfile];
|
|
8
|
+
exports.resolvers = [employee_profile_query_1.EmployeeProfileQuery, employee_profile_mutation_1.EmployeeProfileMutation];
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/employee-profile/index.ts"],"names":[],"mappings":";;;AAAA,yDAAoD;AACpD,2EAAqE;AACrE,qEAA+D;AAElD,QAAA,QAAQ,GAAG,CAAC,kCAAe,CAAC,CAAA;AAC5B,QAAA,SAAS,GAAG,CAAC,6CAAoB,EAAE,mDAAuB,CAAC,CAAA","sourcesContent":["import { EmployeeProfile } from './employee-profile'\nimport { EmployeeProfileMutation } from './employee-profile-mutation'\nimport { EmployeeProfileQuery } from './employee-profile-query'\n\nexport const entities = [EmployeeProfile]\nexport const resolvers = [EmployeeProfileQuery, EmployeeProfileMutation]\n"]}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
export * from './approval-line/approval-line';
|
|
2
2
|
export * from './department/department';
|
|
3
3
|
export * from './employee/employee';
|
|
4
|
+
export * from './employee-profile/employee-profile';
|
|
4
5
|
export * from './audience/audience';
|
|
5
6
|
export * from './audience/audience-member';
|
|
6
|
-
export declare const entities: (typeof import("./department/department").Department | typeof import("./employee/employee").Employee | typeof import("./approval-line/approval-line").ApprovalLine | typeof import("./department/department-history").DepartmentHistory | typeof import("./employee/employee-history").EmployeeHistory)[];
|
|
7
|
+
export declare const entities: (typeof import("./department/department").Department | typeof import("./employee/employee").Employee | typeof import("./approval-line/approval-line").ApprovalLine | typeof import("./employee-profile/employee-profile").EmployeeProfile | typeof import("./department/department-history").DepartmentHistory | typeof import("./employee/employee-history").EmployeeHistory)[];
|
|
7
8
|
export declare const subscribers: (typeof import("./department/event-subscriber").DepartmentHistoryEntitySubscriber | typeof import("./employee/event-subscriber").EmployeeHistoryEntitySubscriber)[];
|
|
8
9
|
export declare const schema: {
|
|
9
|
-
resolverClasses: (typeof import("./approval-line/approval-line-query").ApprovalLineQuery | typeof import("./approval-line/approval-line-mutation").ApprovalLineMutation | typeof import("./department/department-query").DepartmentQuery | typeof import("./department/department-mutation").DepartmentMutation | typeof import("./employee/employee-query").EmployeeQuery | typeof import("./employee/employee-mutation").EmployeeMutation)[];
|
|
10
|
+
resolverClasses: (typeof import("./approval-line/approval-line-query").ApprovalLineQuery | typeof import("./approval-line/approval-line-mutation").ApprovalLineMutation | typeof import("./department/department-query").DepartmentQuery | typeof import("./department/department-mutation").DepartmentMutation | typeof import("./employee/employee-query").EmployeeQuery | typeof import("./employee/employee-mutation").EmployeeMutation | typeof import("./employee-profile/employee-profile-mutation").EmployeeProfileMutation | typeof import("./employee-profile/employee-profile-query").EmployeeProfileQuery)[];
|
|
10
11
|
};
|
|
@@ -6,17 +6,20 @@ const tslib_1 = require("tslib");
|
|
|
6
6
|
tslib_1.__exportStar(require("./approval-line/approval-line"), exports);
|
|
7
7
|
tslib_1.__exportStar(require("./department/department"), exports);
|
|
8
8
|
tslib_1.__exportStar(require("./employee/employee"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./employee-profile/employee-profile"), exports);
|
|
9
10
|
tslib_1.__exportStar(require("./audience/audience"), exports);
|
|
10
11
|
tslib_1.__exportStar(require("./audience/audience-member"), exports);
|
|
11
12
|
/* IMPORT ENTITIES AND RESOLVERS */
|
|
12
13
|
const approval_line_1 = require("./approval-line");
|
|
13
14
|
const department_1 = require("./department");
|
|
14
15
|
const employee_1 = require("./employee");
|
|
16
|
+
const employee_profile_1 = require("./employee-profile");
|
|
15
17
|
exports.entities = [
|
|
16
18
|
/* ENTITIES */
|
|
17
19
|
...approval_line_1.entities,
|
|
18
20
|
...department_1.entities,
|
|
19
|
-
...employee_1.entities
|
|
21
|
+
...employee_1.entities,
|
|
22
|
+
...employee_profile_1.entities
|
|
20
23
|
];
|
|
21
24
|
exports.subscribers = [
|
|
22
25
|
/* SUBSCRIBERS */
|
|
@@ -28,7 +31,8 @@ exports.schema = {
|
|
|
28
31
|
/* RESOLVER CLASSES */
|
|
29
32
|
...approval_line_1.resolvers,
|
|
30
33
|
...department_1.resolvers,
|
|
31
|
-
...employee_1.resolvers
|
|
34
|
+
...employee_1.resolvers,
|
|
35
|
+
...employee_profile_1.resolvers
|
|
32
36
|
]
|
|
33
37
|
};
|
|
34
38
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/service/index.ts"],"names":[],"mappings":";;;;AAAA,yBAAyB;AACzB,wEAA6C;AAC7C,kEAAuC;AACvC,8DAAmC;AACnC,8DAAmC;AACnC,qEAA0C;AAE1C,mCAAmC;AACnC,mDAAsG;AACtG,6CAIqB;AACrB,yCAImB;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/service/index.ts"],"names":[],"mappings":";;;;AAAA,yBAAyB;AACzB,wEAA6C;AAC7C,kEAAuC;AACvC,8DAAmC;AACnC,8EAAmD;AACnD,8DAAmC;AACnC,qEAA0C;AAE1C,mCAAmC;AACnC,mDAAsG;AACtG,6CAIqB;AACrB,yCAImB;AACnB,yDAA+G;AAElG,QAAA,QAAQ,GAAG;IACtB,cAAc;IACd,GAAG,wBAAoB;IACvB,GAAG,qBAAkB;IACrB,GAAG,mBAAgB;IACnB,GAAG,2BAAuB;CAC3B,CAAA;AAEY,QAAA,WAAW,GAAG;IACzB,iBAAiB;IACjB,GAAG,wBAAqB;IACxB,GAAG,sBAAmB;CACvB,CAAA;AAEY,QAAA,MAAM,GAAG;IACpB,eAAe,EAAE;QACf,sBAAsB;QACtB,GAAG,yBAAqB;QACxB,GAAG,sBAAmB;QACtB,GAAG,oBAAiB;QACpB,GAAG,4BAAwB;KAC5B;CACF,CAAA","sourcesContent":["/* EXPORT ENTITY TYPES */\nexport * from './approval-line/approval-line'\nexport * from './department/department'\nexport * from './employee/employee'\nexport * from './employee-profile/employee-profile'\nexport * from './audience/audience'\nexport * from './audience/audience-member'\n\n/* IMPORT ENTITIES AND RESOLVERS */\nimport { entities as ApprovalLineEntities, resolvers as ApprovalLineResolvers } from './approval-line'\nimport {\n entities as DepartmentEntities,\n resolvers as DepartmentResolvers,\n subscribers as DepartmentSubscribers\n} from './department'\nimport {\n entities as EmployeeEntities,\n resolvers as EmployeeResolvers,\n subscribers as EmployeeSubscribers\n} from './employee'\nimport { entities as EmployeeProfileEntities, resolvers as EmployeeProfileResolvers } from './employee-profile'\n\nexport const entities = [\n /* ENTITIES */\n ...ApprovalLineEntities,\n ...DepartmentEntities,\n ...EmployeeEntities,\n ...EmployeeProfileEntities\n]\n\nexport const subscribers = [\n /* SUBSCRIBERS */\n ...DepartmentSubscribers,\n ...EmployeeSubscribers\n]\n\nexport const schema = {\n resolverClasses: [\n /* RESOLVER CLASSES */\n ...ApprovalLineResolvers,\n ...DepartmentResolvers,\n ...EmployeeResolvers,\n ...EmployeeProfileResolvers\n ]\n}\n"]}
|