@things-factory/organization 8.0.0-beta.8 → 8.0.0
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/client/bootstrap.ts +23 -0
- package/client/component/approval-line-brief.ts +119 -0
- package/client/component/approval-line-items-editor-popup.ts +91 -0
- package/client/component/approval-line-items-editor.ts +325 -0
- package/client/component/approval-line-selector.ts +235 -0
- package/client/component/approval-line-templates-manager.ts +229 -0
- package/client/component/approval-line-view.ts +122 -0
- package/client/component/assignees-editor-popup.ts +79 -0
- package/client/component/assignees-editor.ts +217 -0
- package/client/component/assignees-view.ts +55 -0
- package/client/component/department-selector.ts +151 -0
- package/client/component/department-view.ts +107 -0
- package/client/component/index.ts +16 -0
- package/client/component/recipients-editor-popup.ts +79 -0
- package/client/component/recipients-editor.ts +212 -0
- package/client/component/recipients-view.ts +55 -0
- package/client/grist-editor/grist-editor-approval-line.ts +70 -0
- package/client/grist-editor/grist-editor-assignees.ts +69 -0
- package/client/grist-editor/grist-editor-department-object.ts +78 -0
- package/client/grist-editor/grist-editor-recipients.ts +69 -0
- package/client/grist-editor/grist-renderer-approval-line.ts +13 -0
- package/client/grist-editor/grist-renderer-assignees.ts +13 -0
- package/client/grist-editor/grist-renderer-department-object.ts +13 -0
- package/client/grist-editor/grist-renderer-recipients.ts +13 -0
- package/client/index.ts +2 -0
- package/client/pages/approval-line/common-approval-line-templates-page.ts +382 -0
- package/client/pages/approval-line/my-approval-line-templates-page.ts +385 -0
- package/client/pages/department/department-importer.ts +87 -0
- package/client/pages/department/department-list-page.ts +450 -0
- package/client/pages/department/department-tree-page.ts +379 -0
- package/client/pages/employee/employee-importer.ts +87 -0
- package/client/pages/employee/employee-list-page.ts +772 -0
- package/client/pages/employee/employees-by-department.ts +519 -0
- package/client/route.ts +27 -0
- package/client/tsconfig.json +13 -0
- package/client/types/approval-line.ts +52 -0
- package/client/types/contact.ts +51 -0
- package/client/types/department.ts +29 -0
- package/client/types/employee.ts +50 -0
- package/client/types/index.ts +5 -0
- package/client/types/org-member.ts +27 -0
- package/dist-client/bootstrap.js +1 -8
- package/dist-client/bootstrap.js.map +1 -1
- package/dist-client/pages/employee/employee-list-page.js +3 -3
- package/dist-client/pages/employee/employee-list-page.js.map +1 -1
- package/dist-client/pages/employee/employees-by-department.js +2 -2
- package/dist-client/pages/employee/employees-by-department.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/service/employee/employee-history.d.ts +2 -6
- package/dist-server/service/employee/employee-history.js +3 -23
- package/dist-server/service/employee/employee-history.js.map +1 -1
- package/dist-server/service/employee/employee-query.js +1 -1
- package/dist-server/service/employee/employee-query.js.map +1 -1
- package/dist-server/service/employee/employee-type.d.ts +5 -13
- package/dist-server/service/employee/employee-type.js +7 -39
- package/dist-server/service/employee/employee-type.js.map +1 -1
- package/dist-server/service/employee/employee.d.ts +2 -6
- package/dist-server/service/employee/employee.js +3 -23
- package/dist-server/service/employee/employee.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +12 -12
- package/server/controllers/register-employee-as-system-user.ts +136 -0
- package/server/index.ts +3 -0
- package/server/migrations/1723861013111-seed-organization-codes.ts +127 -0
- package/server/migrations/index.ts +9 -0
- package/server/routes.ts +26 -0
- package/server/service/approval-line/approval-line-item.ts +42 -0
- package/server/service/approval-line/approval-line-mutation.ts +394 -0
- package/server/service/approval-line/approval-line-query.ts +208 -0
- package/server/service/approval-line/approval-line-type.ts +63 -0
- package/server/service/approval-line/approval-line.ts +123 -0
- package/server/service/approval-line/index.ts +7 -0
- package/server/service/department/department-history.ts +141 -0
- package/server/service/department/department-mutation.ts +231 -0
- package/server/service/department/department-query.ts +131 -0
- package/server/service/department/department-type.ts +74 -0
- package/server/service/department/department.ts +116 -0
- package/server/service/department/event-subscriber.ts +17 -0
- package/server/service/department/index.ts +9 -0
- package/server/service/employee/employee-history.ts +173 -0
- package/server/service/employee/employee-mutation.ts +386 -0
- package/server/service/employee/employee-query.ts +172 -0
- package/server/service/employee/employee-type.ts +176 -0
- package/server/service/employee/employee.ts +177 -0
- package/server/service/employee/event-subscriber.ts +17 -0
- package/server/service/employee/index.ts +9 -0
- package/server/service/index.ts +39 -0
- package/server/tsconfig.json +10 -0
- package/dist-client/filters-form/filter-department-object.d.ts +0 -3
- package/dist-client/filters-form/filter-department-object.js +0 -8
- package/dist-client/filters-form/filter-department-object.js.map +0 -1
- package/dist-client/filters-form/ox-filter-department-object.d.ts +0 -15
- package/dist-client/filters-form/ox-filter-department-object.js +0 -130
- package/dist-client/filters-form/ox-filter-department-object.js.map +0 -1
|
@@ -21,13 +21,9 @@ export declare class EmployeeHistory implements HistoryEntityInterface<Employee>
|
|
|
21
21
|
manages?: Department[];
|
|
22
22
|
active?: boolean;
|
|
23
23
|
type?: EmployeeType;
|
|
24
|
-
hiredOn?:
|
|
25
|
-
|
|
24
|
+
hiredOn?: string;
|
|
25
|
+
retiredAt?: string;
|
|
26
26
|
extension?: string;
|
|
27
|
-
emergencyContact?: string;
|
|
28
|
-
emergencyContactPhone?: string;
|
|
29
|
-
bankAccount?: string;
|
|
30
|
-
bankName?: string;
|
|
31
27
|
createdAt?: Date;
|
|
32
28
|
updatedAt?: Date;
|
|
33
29
|
deletedAt?: Date;
|
|
@@ -97,41 +97,21 @@ tslib_1.__decorate([
|
|
|
97
97
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
98
98
|
tslib_1.__metadata("design:type", String)
|
|
99
99
|
], EmployeeHistory.prototype, "type", void 0);
|
|
100
|
-
tslib_1.__decorate([
|
|
101
|
-
(0, typeorm_1.Column)({ nullable: true }),
|
|
102
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
103
|
-
tslib_1.__metadata("design:type", Date)
|
|
104
|
-
], EmployeeHistory.prototype, "hiredOn", void 0);
|
|
105
|
-
tslib_1.__decorate([
|
|
106
|
-
(0, typeorm_1.Column)({ nullable: true }),
|
|
107
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
108
|
-
tslib_1.__metadata("design:type", Date)
|
|
109
|
-
], EmployeeHistory.prototype, "retiredOn", void 0);
|
|
110
|
-
tslib_1.__decorate([
|
|
111
|
-
(0, typeorm_1.Column)({ nullable: true }),
|
|
112
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
113
|
-
tslib_1.__metadata("design:type", String)
|
|
114
|
-
], EmployeeHistory.prototype, "extension", void 0);
|
|
115
|
-
tslib_1.__decorate([
|
|
116
|
-
(0, typeorm_1.Column)({ nullable: true }),
|
|
117
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
118
|
-
tslib_1.__metadata("design:type", String)
|
|
119
|
-
], EmployeeHistory.prototype, "emergencyContact", void 0);
|
|
120
100
|
tslib_1.__decorate([
|
|
121
101
|
(0, typeorm_1.Column)({ nullable: true }),
|
|
122
102
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
123
103
|
tslib_1.__metadata("design:type", String)
|
|
124
|
-
], EmployeeHistory.prototype, "
|
|
104
|
+
], EmployeeHistory.prototype, "hiredOn", void 0);
|
|
125
105
|
tslib_1.__decorate([
|
|
126
106
|
(0, typeorm_1.Column)({ nullable: true }),
|
|
127
107
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
128
108
|
tslib_1.__metadata("design:type", String)
|
|
129
|
-
], EmployeeHistory.prototype, "
|
|
109
|
+
], EmployeeHistory.prototype, "retiredAt", void 0);
|
|
130
110
|
tslib_1.__decorate([
|
|
131
111
|
(0, typeorm_1.Column)({ nullable: true }),
|
|
132
112
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
133
113
|
tslib_1.__metadata("design:type", String)
|
|
134
|
-
], EmployeeHistory.prototype, "
|
|
114
|
+
], EmployeeHistory.prototype, "extension", void 0);
|
|
135
115
|
tslib_1.__decorate([
|
|
136
116
|
(0, typeorm_1.Column)({ nullable: true }),
|
|
137
117
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
@@ -1 +1 @@
|
|
|
1
|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CAAC;;+CAC+B;0BAzJtB,eAAe;IAZ3B,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EACJ,uBAAuB,EACvB,CAAC,eAAgC,EAAE,EAAE,CAAC,CAAC,eAAe,CAAC,UAAU,EAAE,eAAe,CAAC,OAAO,CAAC,EAC3F,EAAE,MAAM,EAAE,IAAI,EAAE,CACjB;IACA,IAAA,eAAK,EACJ,uBAAuB,EACvB,CAAC,eAAgC,EAAE,EAAE,CAAC,CAAC,eAAe,CAAC,MAAM,EAAE,eAAe,CAAC,UAAU,EAAE,eAAe,CAAC,OAAO,CAAC,EACnH,EAAE,MAAM,EAAE,IAAI,EAAE,CACjB;IACA,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,4BAA4B,EAAE,CAAC;GAC7C,eAAe,CA0J3B","sourcesContent":["import { Field, ID, ObjectType } from 'type-graphql'\nimport { Column, Entity, Index, ManyToOne, OneToMany, PrimaryGeneratedColumn, RelationId } from 'typeorm'\n\nimport {\n HistoryActionColumn,\n HistoryActionType,\n HistoryEntityInterface,\n HistoryOriginalIdColumn\n} from '@operato/typeorm-history'\n\nimport { User } from '@things-factory/auth-base'\nimport { Contact } from '@things-factory/contact'\n\nimport { config } from '@things-factory/env'\nimport { Domain } from '@things-factory/shell'\n\nimport { Employee, EmployeeType } from './employee'\nimport { Department } from '../department/department'\n\nconst ORMCONFIG = config.get('ormconfig', {})\nconst DATABASE_TYPE = ORMCONFIG.type\n\n@Entity()\n@Index(\n 'ix_employee_history_0',\n (employeeHistory: EmployeeHistory) => [employeeHistory.originalId, employeeHistory.version],\n { unique: true }\n)\n@Index(\n 'ix_employee_history_1',\n (employeeHistory: EmployeeHistory) => [employeeHistory.domain, employeeHistory.originalId, employeeHistory.version],\n { unique: true }\n)\n@ObjectType({ description: 'History Entity of Employee' })\nexport class EmployeeHistory implements HistoryEntityInterface<Employee> {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @Column({ nullable: true, default: 1 })\n @Field({ nullable: true })\n version?: number = 1\n\n @ManyToOne(type => Domain)\n @Field(type => Domain)\n domain?: Domain\n\n @RelationId((employee: Employee) => employee.domain)\n domainId?: string\n\n @Column()\n @Field()\n controlNo: string\n\n @Column()\n @Field({ nullable: true })\n name?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n alias?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n jobResponsibility?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n jobPosition?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n note?: string\n\n @ManyToOne(type => Employee, supervisor => supervisor.supervises, { nullable: true })\n @Field({ nullable: true })\n supervisor?: Employee\n\n @RelationId((employee: Employee) => employee.supervisor)\n supervisorId?: string\n\n @OneToMany(type => Employee, employee => employee.supervisor)\n @Field(type => [Employee])\n supervises?: Employee[]\n\n @OneToMany(type => Department, department => department.manager)\n @Field(type => [Department])\n manages?: Department[]\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n active?: boolean\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n type?: EmployeeType\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n hiredOn?: Date\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n retiredOn?: Date\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n extension?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n emergencyContact?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n emergencyContactPhone?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n bankAccount?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n bankName?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n createdAt?: Date\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n updatedAt?: Date\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n deletedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n creator?: User\n\n @RelationId((employee: Employee) => employee.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n @RelationId((employee: Employee) => employee.updater)\n updaterId?: string\n\n @Field(type => String, { nullable: true })\n photo?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field({ nullable: true })\n user?: User\n\n @RelationId((employee: Employee) => employee.user)\n userId?: string\n\n @ManyToOne(type => Contact, { nullable: true })\n @Field({ nullable: true })\n contact?: Contact\n\n @RelationId((employee: Employee) => employee.contact)\n contactId?: string\n\n @HistoryOriginalIdColumn()\n public originalId!: string\n\n @HistoryActionColumn({\n nullable: false,\n type:\n DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'\n ? 'enum'\n : DATABASE_TYPE == 'oracle'\n ? 'varchar2'\n : DATABASE_TYPE == 'mssql'\n ? 'nvarchar'\n : 'varchar',\n enum:\n DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'\n ? HistoryActionType\n : undefined,\n length: DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb' ? undefined : 10\n })\n public action!: HistoryActionType\n}\n"]}
|
|
1
|
+
{"version":3,"file":"employee-history.js","sourceRoot":"","sources":["../../../server/service/employee/employee-history.ts"],"names":[],"mappings":";;;;AAAA,+CAAoD;AACpD,qCAAyG;AAEzG,8DAKiC;AAEjC,yDAAgD;AAChD,qDAAiD;AAEjD,6CAA4C;AAC5C,iDAA8C;AAE9C,yCAAmD;AACnD,yDAAqD;AAErD,MAAM,SAAS,GAAG,YAAM,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,CAAC,CAAA;AAC7C,MAAM,aAAa,GAAG,SAAS,CAAC,IAAI,CAAA;AAc7B,IAAM,eAAe,GAArB,MAAM,eAAe;IAArB;QAOL,YAAO,GAAY,CAAC,CAAA;IAmItB,CAAC;CAAA,CAAA;AA1IY,0CAAe;AAGjB;IAFR,IAAA,gCA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iB;YACnB,CAAC,CAAC,SAAS;QACf,MAAM,EAAE,aAAa,IAAI,UAAU,IAAI,aAAa,IAAI,OAAO,IAAI,aAAa,IAAI,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE;KAC/G,CAAC;;+CAC+B;0BAzItB,eAAe;IAZ3B,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EACJ,uBAAuB,EACvB,CAAC,eAAgC,EAAE,EAAE,CAAC,CAAC,eAAe,CAAC,UAAU,EAAE,eAAe,CAAC,OAAO,CAAC,EAC3F,EAAE,MAAM,EAAE,IAAI,EAAE,CACjB;IACA,IAAA,eAAK,EACJ,uBAAuB,EACvB,CAAC,eAAgC,EAAE,EAAE,CAAC,CAAC,eAAe,CAAC,MAAM,EAAE,eAAe,CAAC,UAAU,EAAE,eAAe,CAAC,OAAO,CAAC,EACnH,EAAE,MAAM,EAAE,IAAI,EAAE,CACjB;IACA,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,4BAA4B,EAAE,CAAC;GAC7C,eAAe,CA0I3B","sourcesContent":["import { Field, ID, ObjectType } from 'type-graphql'\nimport { Column, Entity, Index, ManyToOne, OneToMany, PrimaryGeneratedColumn, RelationId } from 'typeorm'\n\nimport {\n HistoryActionColumn,\n HistoryActionType,\n HistoryEntityInterface,\n HistoryOriginalIdColumn\n} from '@operato/typeorm-history'\n\nimport { User } from '@things-factory/auth-base'\nimport { Contact } from '@things-factory/contact'\n\nimport { config } from '@things-factory/env'\nimport { Domain } from '@things-factory/shell'\n\nimport { Employee, EmployeeType } from './employee'\nimport { Department } from '../department/department'\n\nconst ORMCONFIG = config.get('ormconfig', {})\nconst DATABASE_TYPE = ORMCONFIG.type\n\n@Entity()\n@Index(\n 'ix_employee_history_0',\n (employeeHistory: EmployeeHistory) => [employeeHistory.originalId, employeeHistory.version],\n { unique: true }\n)\n@Index(\n 'ix_employee_history_1',\n (employeeHistory: EmployeeHistory) => [employeeHistory.domain, employeeHistory.originalId, employeeHistory.version],\n { unique: true }\n)\n@ObjectType({ description: 'History Entity of Employee' })\nexport class EmployeeHistory implements HistoryEntityInterface<Employee> {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @Column({ nullable: true, default: 1 })\n @Field({ nullable: true })\n version?: number = 1\n\n @ManyToOne(type => Domain)\n @Field(type => Domain)\n domain?: Domain\n\n @RelationId((employee: Employee) => employee.domain)\n domainId?: string\n\n @Column()\n @Field()\n controlNo: string\n\n @Column()\n @Field({ nullable: true })\n name?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n alias?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n jobResponsibility?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n jobPosition?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n note?: string\n\n @ManyToOne(type => Employee, supervisor => supervisor.supervises, { nullable: true })\n @Field({ nullable: true })\n supervisor?: Employee\n\n @RelationId((employee: Employee) => employee.supervisor)\n supervisorId?: string\n\n @OneToMany(type => Employee, employee => employee.supervisor)\n @Field(type => [Employee])\n supervises?: Employee[]\n\n @OneToMany(type => Department, department => department.manager)\n @Field(type => [Department])\n manages?: Department[]\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n active?: boolean\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n type?: EmployeeType\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n hiredOn?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n retiredAt?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n extension?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n createdAt?: Date\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n updatedAt?: Date\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n deletedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n creator?: User\n\n @RelationId((employee: Employee) => employee.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n @RelationId((employee: Employee) => employee.updater)\n updaterId?: string\n\n @Field(type => String, { nullable: true })\n photo?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field({ nullable: true })\n user?: User\n\n @RelationId((employee: Employee) => employee.user)\n userId?: string\n\n @ManyToOne(type => Contact, { nullable: true })\n @Field({ nullable: true })\n contact?: Contact\n\n @RelationId((employee: Employee) => employee.contact)\n contactId?: string\n\n @HistoryOriginalIdColumn()\n public originalId!: string\n\n @HistoryActionColumn({\n nullable: false,\n type:\n DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'\n ? 'enum'\n : DATABASE_TYPE == 'oracle'\n ? 'varchar2'\n : DATABASE_TYPE == 'mssql'\n ? 'nvarchar'\n : 'varchar',\n enum:\n DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'\n ? HistoryActionType\n : undefined,\n length: DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb' ? undefined : 10\n })\n public action!: HistoryActionType\n}\n"]}
|
|
@@ -34,7 +34,7 @@ let EmployeeQuery = class EmployeeQuery {
|
|
|
34
34
|
domain,
|
|
35
35
|
params,
|
|
36
36
|
repository: await (0, shell_1.getRepository)(employee_1.Employee),
|
|
37
|
-
searchables: ['name', 'controlNo', 'alias'
|
|
37
|
+
searchables: ['name', 'controlNo', 'alias']
|
|
38
38
|
});
|
|
39
39
|
const [items, total] = await queryBuilder.getManyAndCount();
|
|
40
40
|
return { items, total };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"employee-query.js","sourceRoot":"","sources":["../../../server/service/employee/employee-query.ts"],"names":[],"mappings":";;;;AAAA,+CAA8F;AAC9F,qDAAqD;AACrD,qEAA4D;AAC5D,iDAAuG;AACvG,yDAAgD;AAChD,qDAAqF;AACrF,yCAAqC;AACrC,mDAA8C;AAC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AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAW,mBAAQ;;4CAEvC;wBAnJU,aAAa;IADzB,IAAA,uBAAQ,EAAC,mBAAQ,CAAC;GACN,aAAa,CAoJzB","sourcesContent":["import { Resolver, Query, FieldResolver, Root, Args, Arg, Ctx, Directive } from 'type-graphql'\nimport { GraphQLEmailAddress } from 'graphql-scalars'\nimport { Attachment } from '@things-factory/attachment-base'\nimport { Domain, getQueryBuilderFromListParams, getRepository, ListParam } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { Contact, ContactItem, ContactField, Profile } from '@things-factory/contact'\nimport { Employee } from './employee'\nimport { EmployeeList } from './employee-type'\nimport { Department } from '../department/department'\n\nasync function getContactItem(contactId: string, type: string, label: string, context: ResolverContext) {\n const { domain } = context.state\n const contact: Contact = await getRepository(Contact).findOne({ where: { domain: { id: domain.id }, id: contactId } })\n const { items } = contact\n\n if (!items || !(items instanceof Array)) {\n return\n }\n\n return items?.find(item => item.type === type && item.label === label)?.value\n}\n\n@Resolver(Employee)\nexport class EmployeeQuery {\n @Directive('@privilege(category: \"employee\", privilege: \"query\", domainOwnerGranted: true)')\n @Query(returns => Employee!, {\n nullable: true,\n description:\n 'Fetches a specific employee by their unique ID. Returns the employee object if found, or null if not found.'\n })\n async employee(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<Employee> {\n const { domain } = context.state\n\n return await getRepository(Employee).findOne({\n where: { domain: { id: domain.id }, id }\n })\n }\n\n @Directive('@privilege(category: \"employee\", privilege: \"query\", domainOwnerGranted: true)')\n @Query(returns => EmployeeList, {\n description:\n 'Fetches a list of employees based on provided query parameters. Supports searching by name, control number, and alias.'\n })\n async employees(@Args(type => ListParam) params: ListParam, @Ctx() context: ResolverContext): Promise<EmployeeList> {\n const { domain } = context.state\n\n const queryBuilder = getQueryBuilderFromListParams({\n domain,\n params,\n repository: await getRepository(Employee),\n searchables: ['name', 'controlNo', 'alias', 'active', 'userId']\n })\n\n const [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n\n @FieldResolver(type => String, { nullable: true })\n async photo(@Root() employee: Employee): Promise<string | undefined> {\n const attachment: Attachment = await getRepository(Attachment).findOne({\n where: {\n domain: { id: employee.domainId },\n refType: Employee.name,\n refBy: employee.id\n }\n })\n\n return attachment?.fullpath\n }\n\n @FieldResolver(type => String, { nullable: true })\n async phone(@Root() employee: Employee, @Ctx() context: ResolverContext): Promise<string> {\n if (!employee.contactId) {\n return\n }\n\n return await getContactItem(employee.contactId, ContactField.Phone, 'work', context)\n }\n\n @FieldResolver(type => String, { nullable: true })\n async address(@Root() employee: Employee, @Ctx() context: ResolverContext): Promise<string | undefined> {\n if (!employee.contactId) {\n return\n }\n\n return await getContactItem(employee.contactId, ContactField.Address, 'work', context)\n }\n\n @FieldResolver(type => GraphQLEmailAddress, { nullable: true })\n async email(@Root() employee: Employee, @Ctx() context: ResolverContext): Promise<string | undefined> {\n if (!employee.contactId) {\n return\n }\n\n return await getContactItem(employee.contactId, ContactField.Email, 'work', context)\n }\n\n @FieldResolver(type => Profile)\n async profile(@Root() employee: Employee): Promise<Profile> {\n if (!employee.contactId) {\n return\n }\n\n let contact: Contact = employee.contact\n if (!contact) {\n contact = await getRepository(Contact).findOneBy({\n id: employee.contactId\n })\n\n if (!contact) {\n return\n }\n }\n\n const { id: refBy } = contact\n const { left, top, zoom } = contact.profile || {}\n\n const attachment: Attachment = await getRepository(Attachment).findOne({\n where: {\n domain: { id: contact.domainId },\n refType: Contact.name,\n refBy\n }\n })\n\n return { left, top, zoom, picture: attachment?.fullpath }\n }\n\n @FieldResolver(type => Department)\n async department(@Root() employee: Employee): Promise<Department> {\n if (employee.departmentId) {\n return await getRepository(Department).findOneBy({ id: employee.departmentId })\n }\n }\n\n @FieldResolver(type => User)\n async user(@Root() employee: Employee): Promise<User> {\n if (employee.userId) {\n return await getRepository(User).findOneBy({ id: employee.userId })\n }\n }\n\n @FieldResolver(type => Employee)\n async supervisor(@Root() employee: Employee): Promise<Employee> {\n if (employee.supervisorId) {\n return await getRepository(Employee).findOneBy({ id: employee.supervisorId })\n }\n }\n\n @FieldResolver(type => Contact)\n async contact(@Root() employee: Employee): Promise<Contact> {\n if (employee.contactId) {\n return await getRepository(Contact).findOneBy({ id: employee.contactId })\n }\n }\n\n @FieldResolver(type => Domain)\n async domain(@Root() employee: Employee): Promise<Domain> {\n return await getRepository(Domain).findOneBy({ id: employee.domainId })\n }\n\n @FieldResolver(type => User)\n async updater(@Root() employee: Employee): Promise<User> {\n return await getRepository(User).findOneBy({ id: employee.updaterId })\n }\n\n @FieldResolver(type => User)\n async creator(@Root() employee: Employee): Promise<User> {\n return await getRepository(User).findOneBy({ id: employee.creatorId })\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"employee-query.js","sourceRoot":"","sources":["../../../server/service/employee/employee-query.ts"],"names":[],"mappings":";;;;AAAA,+CAA8F;AAC9F,qDAAqD;AACrD,qEAA4D;AAC5D,iDAAuG;AACvG,yDAAgD;AAChD,qDAAqF;AACrF,yCAAqC;AACrC,mDAA8C;AAC9C,yDAAqD;AAErD,KAAK,UAAU,cAAc,CAAC,SAAiB,EAAE,IAAY,EAAE,KAAa,EAAE,OAAwB;;IACpG,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;IAChC,MAAM,OAAO,GAAY,MAAM,IAAA,qBAAa,EAAC,iBAAO,CAAC,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,CAAC,CAAA;IACtH,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAA;IAEzB,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC,KAAK,YAAY,KAAK,CAAC,EAAE,CAAC;QACxC,OAAM;IAC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AAA,mBAAI,GAAE,CAAA;;6CAAW,mBAAQ;;+CAI1C;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IAChB,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAW,mBAAQ;;yCAIpC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,mBAAQ,CAAC;IACd,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAW,mBAAQ;;+CAI1C;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAO,CAAC;IAChB,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAW,mBAAQ;;4CAIvC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IAChB,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAW,mBAAQ;;2CAEtC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAW,mBAAQ;;4CAEvC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAW,mBAAQ;;4CAEvC;wBAnJU,aAAa;IADzB,IAAA,uBAAQ,EAAC,mBAAQ,CAAC;GACN,aAAa,CAoJzB","sourcesContent":["import { Resolver, Query, FieldResolver, Root, Args, Arg, Ctx, Directive } from 'type-graphql'\nimport { GraphQLEmailAddress } from 'graphql-scalars'\nimport { Attachment } from '@things-factory/attachment-base'\nimport { Domain, getQueryBuilderFromListParams, getRepository, ListParam } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { Contact, ContactItem, ContactField, Profile } from '@things-factory/contact'\nimport { Employee } from './employee'\nimport { EmployeeList } from './employee-type'\nimport { Department } from '../department/department'\n\nasync function getContactItem(contactId: string, type: string, label: string, context: ResolverContext) {\n const { domain } = context.state\n const contact: Contact = await getRepository(Contact).findOne({ where: { domain: { id: domain.id }, id: contactId } })\n const { items } = contact\n\n if (!items || !(items instanceof Array)) {\n return\n }\n\n return items?.find(item => item.type === type && item.label === label)?.value\n}\n\n@Resolver(Employee)\nexport class EmployeeQuery {\n @Directive('@privilege(category: \"employee\", privilege: \"query\", domainOwnerGranted: true)')\n @Query(returns => Employee!, {\n nullable: true,\n description:\n 'Fetches a specific employee by their unique ID. Returns the employee object if found, or null if not found.'\n })\n async employee(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<Employee> {\n const { domain } = context.state\n\n return await getRepository(Employee).findOne({\n where: { domain: { id: domain.id }, id }\n })\n }\n\n @Directive('@privilege(category: \"employee\", privilege: \"query\", domainOwnerGranted: true)')\n @Query(returns => EmployeeList, {\n description:\n 'Fetches a list of employees based on provided query parameters. Supports searching by name, control number, and alias.'\n })\n async employees(@Args(type => ListParam) params: ListParam, @Ctx() context: ResolverContext): Promise<EmployeeList> {\n const { domain } = context.state\n\n const queryBuilder = getQueryBuilderFromListParams({\n domain,\n params,\n repository: await getRepository(Employee),\n searchables: ['name', 'controlNo', 'alias']\n })\n\n const [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n\n @FieldResolver(type => String, { nullable: true })\n async photo(@Root() employee: Employee): Promise<string | undefined> {\n const attachment: Attachment = await getRepository(Attachment).findOne({\n where: {\n domain: { id: employee.domainId },\n refType: Employee.name,\n refBy: employee.id\n }\n })\n\n return attachment?.fullpath\n }\n\n @FieldResolver(type => String, { nullable: true })\n async phone(@Root() employee: Employee, @Ctx() context: ResolverContext): Promise<string> {\n if (!employee.contactId) {\n return\n }\n\n return await getContactItem(employee.contactId, ContactField.Phone, 'work', context)\n }\n\n @FieldResolver(type => String, { nullable: true })\n async address(@Root() employee: Employee, @Ctx() context: ResolverContext): Promise<string | undefined> {\n if (!employee.contactId) {\n return\n }\n\n return await getContactItem(employee.contactId, ContactField.Address, 'work', context)\n }\n\n @FieldResolver(type => GraphQLEmailAddress, { nullable: true })\n async email(@Root() employee: Employee, @Ctx() context: ResolverContext): Promise<string | undefined> {\n if (!employee.contactId) {\n return\n }\n\n return await getContactItem(employee.contactId, ContactField.Email, 'work', context)\n }\n\n @FieldResolver(type => Profile)\n async profile(@Root() employee: Employee): Promise<Profile> {\n if (!employee.contactId) {\n return\n }\n\n let contact: Contact = employee.contact\n if (!contact) {\n contact = await getRepository(Contact).findOneBy({\n id: employee.contactId\n })\n\n if (!contact) {\n return\n }\n }\n\n const { id: refBy } = contact\n const { left, top, zoom } = contact.profile || {}\n\n const attachment: Attachment = await getRepository(Attachment).findOne({\n where: {\n domain: { id: contact.domainId },\n refType: Contact.name,\n refBy\n }\n })\n\n return { left, top, zoom, picture: attachment?.fullpath }\n }\n\n @FieldResolver(type => Department)\n async department(@Root() employee: Employee): Promise<Department> {\n if (employee.departmentId) {\n return await getRepository(Department).findOneBy({ id: employee.departmentId })\n }\n }\n\n @FieldResolver(type => User)\n async user(@Root() employee: Employee): Promise<User> {\n if (employee.userId) {\n return await getRepository(User).findOneBy({ id: employee.userId })\n }\n }\n\n @FieldResolver(type => Employee)\n async supervisor(@Root() employee: Employee): Promise<Employee> {\n if (employee.supervisorId) {\n return await getRepository(Employee).findOneBy({ id: employee.supervisorId })\n }\n }\n\n @FieldResolver(type => Contact)\n async contact(@Root() employee: Employee): Promise<Contact> {\n if (employee.contactId) {\n return await getRepository(Contact).findOneBy({ id: employee.contactId })\n }\n }\n\n @FieldResolver(type => Domain)\n async domain(@Root() employee: Employee): Promise<Domain> {\n return await getRepository(Domain).findOneBy({ id: employee.domainId })\n }\n\n @FieldResolver(type => User)\n async updater(@Root() employee: Employee): Promise<User> {\n return await getRepository(User).findOneBy({ id: employee.updaterId })\n }\n\n @FieldResolver(type => User)\n async creator(@Root() employee: Employee): Promise<User> {\n return await getRepository(User).findOneBy({ id: employee.creatorId })\n }\n}\n"]}
|
|
@@ -9,7 +9,7 @@ export declare class ObjectRefForEmployee extends ObjectRef {
|
|
|
9
9
|
email?: string;
|
|
10
10
|
jobPosition?: string;
|
|
11
11
|
jobResponsibility?: string;
|
|
12
|
-
hiredOn?:
|
|
12
|
+
hiredOn?: string;
|
|
13
13
|
active?: boolean;
|
|
14
14
|
}
|
|
15
15
|
export declare class ObjectRefForContact extends ObjectRef {
|
|
@@ -32,13 +32,9 @@ export declare class NewEmployee {
|
|
|
32
32
|
type?: EmployeeType;
|
|
33
33
|
active?: boolean;
|
|
34
34
|
extension?: string;
|
|
35
|
-
hiredOn?:
|
|
36
|
-
|
|
35
|
+
hiredOn?: string;
|
|
36
|
+
retiredAt?: string;
|
|
37
37
|
photo?: FileUpload;
|
|
38
|
-
emergencyContact?: string;
|
|
39
|
-
emergencyContactPhone?: string;
|
|
40
|
-
bankAccount?: string;
|
|
41
|
-
bankName?: string;
|
|
42
38
|
note?: string;
|
|
43
39
|
supervisor?: ObjectRefForEmployee;
|
|
44
40
|
department?: ObjectRefForDepartment;
|
|
@@ -54,13 +50,9 @@ export declare class EmployeePatch {
|
|
|
54
50
|
jobPosition?: string;
|
|
55
51
|
type?: EmployeeType;
|
|
56
52
|
active?: boolean;
|
|
57
|
-
hiredOn?:
|
|
58
|
-
|
|
53
|
+
hiredOn?: string;
|
|
54
|
+
retiredAt?: string;
|
|
59
55
|
photo?: FileUpload;
|
|
60
|
-
emergencyContact?: string;
|
|
61
|
-
emergencyContactPhone?: string;
|
|
62
|
-
bankAccount?: string;
|
|
63
|
-
bankName?: string;
|
|
64
56
|
note?: string;
|
|
65
57
|
supervisor?: ObjectRefForEmployee;
|
|
66
58
|
department?: ObjectRefForDepartment;
|
|
@@ -40,7 +40,7 @@ tslib_1.__decorate([
|
|
|
40
40
|
], ObjectRefForEmployee.prototype, "jobResponsibility", void 0);
|
|
41
41
|
tslib_1.__decorate([
|
|
42
42
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
43
|
-
tslib_1.__metadata("design:type",
|
|
43
|
+
tslib_1.__metadata("design:type", String)
|
|
44
44
|
], ObjectRefForEmployee.prototype, "hiredOn", void 0);
|
|
45
45
|
tslib_1.__decorate([
|
|
46
46
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
@@ -124,32 +124,16 @@ tslib_1.__decorate([
|
|
|
124
124
|
], NewEmployee.prototype, "extension", void 0);
|
|
125
125
|
tslib_1.__decorate([
|
|
126
126
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
127
|
-
tslib_1.__metadata("design:type",
|
|
127
|
+
tslib_1.__metadata("design:type", String)
|
|
128
128
|
], NewEmployee.prototype, "hiredOn", void 0);
|
|
129
129
|
tslib_1.__decorate([
|
|
130
130
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
131
|
-
tslib_1.__metadata("design:type",
|
|
132
|
-
], NewEmployee.prototype, "
|
|
131
|
+
tslib_1.__metadata("design:type", String)
|
|
132
|
+
], NewEmployee.prototype, "retiredAt", void 0);
|
|
133
133
|
tslib_1.__decorate([
|
|
134
134
|
(0, type_graphql_1.Field)(type => GraphQLUpload_js_1.default, { nullable: true }),
|
|
135
135
|
tslib_1.__metadata("design:type", Object)
|
|
136
136
|
], NewEmployee.prototype, "photo", void 0);
|
|
137
|
-
tslib_1.__decorate([
|
|
138
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
139
|
-
tslib_1.__metadata("design:type", String)
|
|
140
|
-
], NewEmployee.prototype, "emergencyContact", void 0);
|
|
141
|
-
tslib_1.__decorate([
|
|
142
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
143
|
-
tslib_1.__metadata("design:type", String)
|
|
144
|
-
], NewEmployee.prototype, "emergencyContactPhone", void 0);
|
|
145
|
-
tslib_1.__decorate([
|
|
146
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
147
|
-
tslib_1.__metadata("design:type", String)
|
|
148
|
-
], NewEmployee.prototype, "bankAccount", void 0);
|
|
149
|
-
tslib_1.__decorate([
|
|
150
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
151
|
-
tslib_1.__metadata("design:type", String)
|
|
152
|
-
], NewEmployee.prototype, "bankName", void 0);
|
|
153
137
|
tslib_1.__decorate([
|
|
154
138
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
155
139
|
tslib_1.__metadata("design:type", String)
|
|
@@ -210,32 +194,16 @@ tslib_1.__decorate([
|
|
|
210
194
|
], EmployeePatch.prototype, "active", void 0);
|
|
211
195
|
tslib_1.__decorate([
|
|
212
196
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
213
|
-
tslib_1.__metadata("design:type",
|
|
197
|
+
tslib_1.__metadata("design:type", String)
|
|
214
198
|
], EmployeePatch.prototype, "hiredOn", void 0);
|
|
215
199
|
tslib_1.__decorate([
|
|
216
200
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
217
|
-
tslib_1.__metadata("design:type",
|
|
218
|
-
], EmployeePatch.prototype, "
|
|
201
|
+
tslib_1.__metadata("design:type", String)
|
|
202
|
+
], EmployeePatch.prototype, "retiredAt", void 0);
|
|
219
203
|
tslib_1.__decorate([
|
|
220
204
|
(0, type_graphql_1.Field)(type => GraphQLUpload_js_1.default, { nullable: true }),
|
|
221
205
|
tslib_1.__metadata("design:type", Object)
|
|
222
206
|
], EmployeePatch.prototype, "photo", void 0);
|
|
223
|
-
tslib_1.__decorate([
|
|
224
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
225
|
-
tslib_1.__metadata("design:type", String)
|
|
226
|
-
], EmployeePatch.prototype, "emergencyContact", void 0);
|
|
227
|
-
tslib_1.__decorate([
|
|
228
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
229
|
-
tslib_1.__metadata("design:type", String)
|
|
230
|
-
], EmployeePatch.prototype, "emergencyContactPhone", void 0);
|
|
231
|
-
tslib_1.__decorate([
|
|
232
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
233
|
-
tslib_1.__metadata("design:type", String)
|
|
234
|
-
], EmployeePatch.prototype, "bankAccount", void 0);
|
|
235
|
-
tslib_1.__decorate([
|
|
236
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
237
|
-
tslib_1.__metadata("design:type", String)
|
|
238
|
-
], EmployeePatch.prototype, "bankName", void 0);
|
|
239
207
|
tslib_1.__decorate([
|
|
240
208
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
241
209
|
tslib_1.__metadata("design:type", String)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"employee-type.js","sourceRoot":"","sources":["../../../server/service/employee/employee-type.ts"],"names":[],"mappings":";;;;AACA,+FAA2D;AAC3D,+CAAsF;AACtF,qDAAqD;AAErD,iDAA+D;AAE/D,yCAAmD;AAG5C,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,iBAAS;CA2BlD,CAAA;AA3BY,oDAAoB;AAE/B;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uDACR;AAGlB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,uBAAY,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDAC7B;AAGnB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mDACZ;AAGd;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mDACZ;AAGd;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,qCAAmB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mDACzC;AAGd;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yDACN;AAGpB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+DACA;AAG1B;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;
|
|
1
|
+
{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AmB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCAC7C,mBAAmB;8CAAA;AAG7B;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAgB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCAC7C,gBAAgB;2CAAA;AAGvB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACX;wBAlDJ,aAAa;IADzB,IAAA,wBAAS,GAAE;GACC,aAAa,CAmDzB;AAGM,IAAM,YAAY,GAAlB,MAAM,YAAY;CAMxB,CAAA;AANY,oCAAY;AAEvB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,mBAAQ,CAAC,CAAC;;2CACT;AAGjB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;2CACN;uBALF,YAAY;IADxB,IAAA,yBAAU,GAAE;GACA,YAAY,CAMxB","sourcesContent":["import type { FileUpload } from 'graphql-upload/GraphQLUpload.js'\nimport GraphQLUpload from 'graphql-upload/GraphQLUpload.js'\nimport { ObjectType, Field, InputType, Int, ID, registerEnumType } from 'type-graphql'\nimport { GraphQLEmailAddress } from 'graphql-scalars'\n\nimport { ObjectRef, ScalarObject } from '@things-factory/shell'\n\nimport { Employee, EmployeeType } from './employee'\n\n@InputType()\nexport class ObjectRefForEmployee extends ObjectRef {\n @Field({ nullable: true })\n controlNo?: string\n\n @Field(type => EmployeeType, { nullable: true })\n type?: EmployeeType\n\n @Field({ nullable: true })\n alias?: string\n\n @Field({ nullable: true })\n photo?: string\n\n @Field(type => GraphQLEmailAddress, { nullable: true })\n email?: string\n\n @Field({ nullable: true })\n jobPosition?: string\n\n @Field({ nullable: true })\n jobResponsibility?: string\n\n @Field({ nullable: true })\n hiredOn?: string\n\n @Field({ nullable: true })\n active?: boolean\n}\n\n@InputType()\nexport class ObjectRefForContact extends ObjectRef {\n @Field(type => GraphQLEmailAddress, { nullable: true })\n email?: string\n\n @Field({ nullable: true })\n phone?: string\n\n @Field({ nullable: true })\n address?: string\n}\n\n@InputType()\nexport class ObjectRefForDepartment extends ObjectRef {\n @Field({ nullable: true })\n controlNo?: string\n}\n\n@InputType()\nexport class ObjectRefForUser extends ObjectRef {\n @Field(type => GraphQLEmailAddress, { nullable: true })\n email?: string\n}\n\n@InputType()\nexport class NewEmployee {\n @Field()\n controlNo: string\n\n @Field()\n name: string\n\n @Field({ nullable: true })\n alias?: string\n\n @Field({ nullable: true })\n jobResponsibility?: string\n\n @Field({ nullable: true })\n jobPosition?: string\n\n @Field(type => EmployeeType, { nullable: true })\n type?: EmployeeType\n\n @Field({ nullable: true })\n active?: boolean\n\n @Field({ nullable: true })\n extension?: string\n\n @Field({ nullable: true })\n hiredOn?: string\n\n @Field({ nullable: true })\n retiredAt?: string\n\n @Field(type => GraphQLUpload, { nullable: true })\n photo?: FileUpload\n\n @Field({ nullable: true })\n note?: string\n\n @Field(type => ObjectRefForEmployee, { nullable: true })\n supervisor?: ObjectRefForEmployee\n\n @Field(type => ObjectRefForDepartment, { nullable: true })\n department?: ObjectRefForDepartment\n\n @Field(type => ObjectRefForContact, { nullable: true })\n contact?: ObjectRefForContact\n\n @Field(type => ObjectRefForUser, { nullable: true })\n user?: ObjectRefForUser\n}\n\n@InputType()\nexport class EmployeePatch {\n @Field(type => ID, { nullable: true })\n id?: string\n\n @Field({ nullable: true })\n controlNo?: string\n\n @Field({ nullable: true })\n name?: string\n\n @Field({ nullable: true })\n alias?: string\n\n @Field({ nullable: true })\n jobResponsibility?: string\n\n @Field({ nullable: true })\n jobPosition?: string\n\n @Field(type => EmployeeType, { nullable: true })\n type?: EmployeeType\n\n @Field({ nullable: true })\n active?: boolean\n\n @Field({ nullable: true })\n hiredOn?: string\n\n @Field({ nullable: true })\n retiredAt?: string\n\n @Field(type => GraphQLUpload, { nullable: true })\n photo?: FileUpload\n\n @Field({ nullable: true })\n note?: string\n\n @Field(type => ObjectRefForEmployee, { nullable: true })\n supervisor?: ObjectRefForEmployee\n\n @Field(type => ObjectRefForDepartment, { nullable: true })\n department?: ObjectRefForDepartment\n\n @Field(type => ObjectRefForContact, { nullable: true })\n contact?: ObjectRefForContact\n\n @Field(type => ObjectRefForUser, { nullable: true })\n user?: ObjectRefForUser\n\n @Field({ nullable: true })\n cuFlag?: string\n}\n\n@ObjectType()\nexport class EmployeeList {\n @Field(type => [Employee])\n items: Employee[]\n\n @Field(type => Int)\n total: number\n}\n"]}
|
|
@@ -36,13 +36,9 @@ export declare class Employee {
|
|
|
36
36
|
email?: string;
|
|
37
37
|
phone?: string;
|
|
38
38
|
profile?: Profile;
|
|
39
|
-
emergencyContact?: string;
|
|
40
|
-
emergencyContactPhone?: string;
|
|
41
|
-
bankAccount?: string;
|
|
42
|
-
bankName?: string;
|
|
43
39
|
note?: string;
|
|
44
|
-
hiredOn?:
|
|
45
|
-
|
|
40
|
+
hiredOn?: string;
|
|
41
|
+
retiredAt?: string;
|
|
46
42
|
createdAt?: Date;
|
|
47
43
|
updatedAt?: Date;
|
|
48
44
|
deletedAt?: Date;
|
|
@@ -152,26 +152,6 @@ tslib_1.__decorate([
|
|
|
152
152
|
(0, type_graphql_1.Field)(type => contact_1.Profile, { nullable: true }),
|
|
153
153
|
tslib_1.__metadata("design:type", contact_1.Profile)
|
|
154
154
|
], Employee.prototype, "profile", void 0);
|
|
155
|
-
tslib_1.__decorate([
|
|
156
|
-
(0, typeorm_1.Column)({ nullable: true }),
|
|
157
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
158
|
-
tslib_1.__metadata("design:type", String)
|
|
159
|
-
], Employee.prototype, "emergencyContact", void 0);
|
|
160
|
-
tslib_1.__decorate([
|
|
161
|
-
(0, typeorm_1.Column)({ nullable: true }),
|
|
162
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
163
|
-
tslib_1.__metadata("design:type", String)
|
|
164
|
-
], Employee.prototype, "emergencyContactPhone", void 0);
|
|
165
|
-
tslib_1.__decorate([
|
|
166
|
-
(0, typeorm_1.Column)({ nullable: true }),
|
|
167
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
168
|
-
tslib_1.__metadata("design:type", String)
|
|
169
|
-
], Employee.prototype, "bankAccount", void 0);
|
|
170
|
-
tslib_1.__decorate([
|
|
171
|
-
(0, typeorm_1.Column)({ nullable: true }),
|
|
172
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
173
|
-
tslib_1.__metadata("design:type", String)
|
|
174
|
-
], Employee.prototype, "bankName", void 0);
|
|
175
155
|
tslib_1.__decorate([
|
|
176
156
|
(0, typeorm_1.Column)({ nullable: true }),
|
|
177
157
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
@@ -180,13 +160,13 @@ tslib_1.__decorate([
|
|
|
180
160
|
tslib_1.__decorate([
|
|
181
161
|
(0, typeorm_1.Column)({ nullable: true }),
|
|
182
162
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
183
|
-
tslib_1.__metadata("design:type",
|
|
163
|
+
tslib_1.__metadata("design:type", String)
|
|
184
164
|
], Employee.prototype, "hiredOn", void 0);
|
|
185
165
|
tslib_1.__decorate([
|
|
186
166
|
(0, typeorm_1.Column)({ nullable: true }),
|
|
187
167
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
188
|
-
tslib_1.__metadata("design:type",
|
|
189
|
-
], Employee.prototype, "
|
|
168
|
+
tslib_1.__metadata("design:type", String)
|
|
169
|
+
], Employee.prototype, "retiredAt", void 0);
|
|
190
170
|
tslib_1.__decorate([
|
|
191
171
|
(0, typeorm_1.CreateDateColumn)(),
|
|
192
172
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"employee.js","sourceRoot":"","sources":["../../../server/service/employee/employee.ts"],"names":[],"mappings":";;;;AAAA,qCAYgB;AAChB,+CAA2E;AAC3E,qDAAqD;AAErD,iDAA8C;AAC9C,yDAAgD;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;sCAC9B,gBAAI;yCAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,QAAkB,EAAE,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC;;2CACnC;mBAxJP,QAAQ;IALpB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,eAAe,EAAE,CAAC,QAAkB,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,SAAS,CAAC,EAAE;QACzG,MAAM,EAAE,IAAI;KACb,CAAC;IACD,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,qBAAqB,EAAE,CAAC;GACtC,QAAQ,CAyJpB","sourcesContent":["import {\n CreateDateColumn,\n UpdateDateColumn,\n DeleteDateColumn,\n Entity,\n Index,\n Column,\n OneToMany,\n RelationId,\n ManyToOne,\n PrimaryGeneratedColumn,\n VersionColumn\n} from 'typeorm'\nimport { ObjectType, Field, Int, ID, registerEnumType } from 'type-graphql'\nimport { GraphQLEmailAddress } from 'graphql-scalars'\n\nimport { Domain } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { Contact, Profile } from '@things-factory/contact'\n\nimport { Department } from '../department/department'\nimport { ApprovalLine } from '../approval-line/approval-line'\n\nexport enum EmployeeType {\n FULLTIME = 'FULLTIME',\n PARTTIME = 'PARTTIME',\n TEMPORARY = 'TEMPORARY'\n}\n\nregisterEnumType(EmployeeType, {\n name: 'EmployeeType',\n description: 'type enumeration of a employee'\n})\n\n@Entity()\n@Index('ix_employee_0', (employee: Employee) => [employee.domain, employee.controlNo, employee.deletedAt], {\n unique: true\n})\n@ObjectType({ description: 'Entity for Employee' })\nexport class Employee {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @VersionColumn()\n @Field({ nullable: true })\n version?: number = 1\n\n @ManyToOne(type => Domain)\n @Field(type => Domain)\n domain?: Domain\n\n @RelationId((employee: Employee) => employee.domain)\n domainId?: string\n\n @Column()\n @Field({ nullable: false })\n controlNo: string\n\n @Column()\n @Field({ nullable: true })\n name?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n alias?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n jobResponsibility?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n jobPosition?: string\n\n @ManyToOne(type => Employee, supervisor => supervisor.supervises, { nullable: true })\n @Field(type => Employee, { nullable: true })\n supervisor?: Employee\n\n @RelationId((employee: Employee) => employee.supervisor)\n supervisorId?: string\n\n @OneToMany(type => Employee, employee => employee.supervisor)\n @Field(type => [Employee])\n supervises?: Employee[]\n\n @ManyToOne(type => Department, department => department.members, { nullable: true })\n @Field(type => Department, { nullable: true })\n department?: Department\n\n @RelationId((employee: Employee) => employee.department)\n departmentId?: string\n\n @OneToMany(type => Department, department => department.manager)\n @Field(type => [Department])\n manages?: Department[]\n\n @OneToMany(type => ApprovalLine, employee => employee.ownerEmployee)\n @Field(type => [ApprovalLine])\n approvalLines?: ApprovalLine[]\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n active?: boolean\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n type?: EmployeeType\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n extension?: string\n\n @Field(type => String, { nullable: true })\n photo?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field({ nullable: true })\n user?: User\n\n @RelationId((employee: Employee) => employee.user)\n userId?: string\n\n @ManyToOne(type => Contact, { nullable: true })\n @Field({ nullable: true })\n contact?: Contact\n\n @RelationId((employee: Employee) => employee.contact)\n contactId?: string\n\n @Field(type => GraphQLEmailAddress, { nullable: true })\n email?: string\n\n @Field({ nullable: true })\n phone?: string\n\n @Field(type => Profile, { nullable: true })\n profile?: Profile\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n emergencyContact?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n emergencyContactPhone?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n bankAccount?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n bankName?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n note?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n hiredOn?: Date\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n retiredOn?: Date\n\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt?: Date\n\n @DeleteDateColumn()\n @Field({ nullable: true })\n deletedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n creator?: User\n\n @RelationId((employee: Employee) => employee.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n @RelationId((employee: Employee) => employee.updater)\n updaterId?: string\n}\n"]}
|
|
1
|
+
{"version":3,"file":"employee.js","sourceRoot":"","sources":["../../../server/service/employee/employee.ts"],"names":[],"mappings":";;;;AAAA,qCAYgB;AAChB,+CAA2E;AAC3E,qDAAqD;AAErD,iDAA8C;AAC9C,yDAAgD;AAChD,qDAA0D;AAE1D,yDAAqD;AACrD,kEAA6D;AAE7D,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,qCAAqB,CAAA;IACrB,qCAAqB,CAAA;IACrB,uCAAuB,CAAA;AACzB,CAAC,EAJW,YAAY,4BAAZ,YAAY,QAIvB;AAED,IAAA,+BAAgB,EAAC,YAAY,EAAE;IAC7B,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,gCAAgC;CAC9C,CAAC,CAAA;AAOK,IAAM,QAAQ,GAAd,MAAM,QAAQ;IAAd;QAOL,YAAO,GAAY,CAAC,CAAA;IAkItB,CAAC;CAAA,CAAA;AAzIY,4BAAQ;AAGV;IAFR,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;oCACC;AAInB;IAFC,IAAA,uBAAa,GAAE;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BAAK,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCAC9B,gBAAI;yCAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,QAAkB,EAAE,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC;;2CACnC;mBAxIP,QAAQ;IALpB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,eAAe,EAAE,CAAC,QAAkB,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,SAAS,CAAC,EAAE;QACzG,MAAM,EAAE,IAAI;KACb,CAAC;IACD,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,qBAAqB,EAAE,CAAC;GACtC,QAAQ,CAyIpB","sourcesContent":["import {\n CreateDateColumn,\n UpdateDateColumn,\n DeleteDateColumn,\n Entity,\n Index,\n Column,\n OneToMany,\n RelationId,\n ManyToOne,\n PrimaryGeneratedColumn,\n VersionColumn\n} from 'typeorm'\nimport { ObjectType, Field, Int, ID, registerEnumType } from 'type-graphql'\nimport { GraphQLEmailAddress } from 'graphql-scalars'\n\nimport { Domain } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { Contact, Profile } from '@things-factory/contact'\n\nimport { Department } from '../department/department'\nimport { ApprovalLine } from '../approval-line/approval-line'\n\nexport enum EmployeeType {\n FULLTIME = 'FULLTIME',\n PARTTIME = 'PARTTIME',\n TEMPORARY = 'TEMPORARY'\n}\n\nregisterEnumType(EmployeeType, {\n name: 'EmployeeType',\n description: 'type enumeration of a employee'\n})\n\n@Entity()\n@Index('ix_employee_0', (employee: Employee) => [employee.domain, employee.controlNo, employee.deletedAt], {\n unique: true\n})\n@ObjectType({ description: 'Entity for Employee' })\nexport class Employee {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @VersionColumn()\n @Field({ nullable: true })\n version?: number = 1\n\n @ManyToOne(type => Domain)\n @Field(type => Domain)\n domain?: Domain\n\n @RelationId((employee: Employee) => employee.domain)\n domainId?: string\n\n @Column()\n @Field({ nullable: false })\n controlNo: string\n\n @Column()\n @Field({ nullable: true })\n name?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n alias?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n jobResponsibility?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n jobPosition?: string\n\n @ManyToOne(type => Employee, supervisor => supervisor.supervises, { nullable: true })\n @Field(type => Employee, { nullable: true })\n supervisor?: Employee\n\n @RelationId((employee: Employee) => employee.supervisor)\n supervisorId?: string\n\n @OneToMany(type => Employee, employee => employee.supervisor)\n @Field(type => [Employee])\n supervises?: Employee[]\n\n @ManyToOne(type => Department, department => department.members, { nullable: true })\n @Field(type => Department, { nullable: true })\n department?: Department\n\n @RelationId((employee: Employee) => employee.department)\n departmentId?: string\n\n @OneToMany(type => Department, department => department.manager)\n @Field(type => [Department])\n manages?: Department[]\n\n @OneToMany(type => ApprovalLine, employee => employee.ownerEmployee)\n @Field(type => [ApprovalLine])\n approvalLines?: ApprovalLine[]\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n active?: boolean\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n type?: EmployeeType\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n extension?: string\n\n @Field(type => String, { nullable: true })\n photo?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field({ nullable: true })\n user?: User\n\n @RelationId((employee: Employee) => employee.user)\n userId?: string\n\n @ManyToOne(type => Contact, { nullable: true })\n @Field({ nullable: true })\n contact?: Contact\n\n @RelationId((employee: Employee) => employee.contact)\n contactId?: string\n\n @Field(type => GraphQLEmailAddress, { nullable: true })\n email?: string\n\n @Field({ nullable: true })\n phone?: string\n\n @Field(type => Profile, { nullable: true })\n profile?: Profile\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n note?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n hiredOn?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n retiredAt?: string\n\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt?: Date\n\n @DeleteDateColumn()\n @Field({ nullable: true })\n deletedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n creator?: User\n\n @RelationId((employee: Employee) => employee.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n @RelationId((employee: Employee) => employee.updater)\n updaterId?: string\n}\n"]}
|