@dssp/supervision 1.0.0-alpha.1 → 1.0.0-alpha.14
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/action-plan/action-plan-importer.js.map +1 -1
- package/dist-client/pages/action-plan/action-plan-list-page.js.map +1 -1
- package/dist-client/pages/building-inspection/building-inspection-detail-camera.js.map +1 -1
- package/dist-client/pages/building-inspection/building-inspection-detail-checklist.js.map +1 -1
- package/dist-client/pages/building-inspection/building-inspection-detail-drawing.d.ts +0 -1
- package/dist-client/pages/building-inspection/building-inspection-detail-drawing.js +16 -11
- package/dist-client/pages/building-inspection/building-inspection-detail-drawing.js.map +1 -1
- package/dist-client/pages/building-inspection/building-inspection-list.d.ts +2 -2
- package/dist-client/pages/building-inspection/building-inspection-list.js +2 -1
- package/dist-client/pages/building-inspection/building-inspection-list.js.map +1 -1
- package/dist-client/pages/building-inspection/component/building-inspection-detail-header.js.map +1 -1
- package/dist-client/pages/building-inspection/component/inspection-event-provider.js +3 -3
- package/dist-client/pages/building-inspection/component/inspection-event-provider.js.map +1 -1
- package/dist-client/pages/building-inspection/inspection-create-popup.js +8 -5
- package/dist-client/pages/building-inspection/inspection-create-popup.js.map +1 -1
- package/dist-client/pages/building-inspection-grid/building-inspection-grid-detail.d.ts +46 -0
- package/dist-client/pages/building-inspection-grid/building-inspection-grid-detail.js +930 -0
- package/dist-client/pages/building-inspection-grid/building-inspection-grid-detail.js.map +1 -0
- package/dist-client/pages/building-inspection-grid/component/grid-inspection-create-popup.d.ts +2 -0
- package/dist-client/pages/building-inspection-grid/component/grid-inspection-create-popup.js +736 -0
- package/dist-client/pages/building-inspection-grid/component/grid-inspection-create-popup.js.map +1 -0
- package/dist-client/pages/building-inspection-grid/component/notice-comment-popup.d.ts +1 -0
- package/dist-client/pages/building-inspection-grid/component/notice-comment-popup.js +304 -0
- package/dist-client/pages/building-inspection-grid/component/notice-comment-popup.js.map +1 -0
- package/dist-client/pages/building-inspection-grid/component/plan-preview-popup.d.ts +15 -0
- package/dist-client/pages/building-inspection-grid/component/plan-preview-popup.js +430 -0
- package/dist-client/pages/building-inspection-grid/component/plan-preview-popup.js.map +1 -0
- package/dist-client/pages/checklist/attachment-list-popup.js.map +1 -1
- package/dist-client/pages/checklist/checklist-view.d.ts +6 -0
- package/dist-client/pages/checklist/checklist-view.js +291 -185
- package/dist-client/pages/checklist/checklist-view.js.map +1 -1
- package/dist-client/pages/checklist/comment-list-popup.js.map +1 -1
- package/dist-client/pages/checklist/file-preview-popup.js.map +1 -1
- package/dist-client/pages/checklist-template/checklist-template-item.js +8 -3
- package/dist-client/pages/checklist-template/checklist-template-item.js.map +1 -1
- package/dist-client/pages/checklist-template/checklist-template-list.js +1 -1
- package/dist-client/pages/checklist-template/checklist-template-list.js.map +1 -1
- package/dist-client/pages/checklist-template/checklist-type-management.d.ts +2 -2
- package/dist-client/pages/checklist-template/checklist-type-management.js.map +1 -1
- package/dist-client/pages/issue/issue-importer.js.map +1 -1
- package/dist-client/pages/issue/issue-list-page.js.map +1 -1
- package/dist-client/pages/project-report/project-report-importer.js.map +1 -1
- package/dist-client/pages/project-report/project-report-list-page.js.map +1 -1
- package/dist-client/pages/supervisor/supervisor-importer.js.map +1 -1
- package/dist-client/pages/supervisor/supervisor-list-page.js.map +1 -1
- package/dist-client/route.d.ts +1 -1
- package/dist-client/route.js +3 -0
- package/dist-client/route.js.map +1 -1
- package/dist-client/stt/speech-to-text.d.ts +36 -0
- package/dist-client/stt/speech-to-text.js +89 -0
- package/dist-client/stt/speech-to-text.js.map +1 -0
- package/dist-client/stt/stt-utils.d.ts +28 -0
- package/dist-client/stt/stt-utils.js +146 -0
- package/dist-client/stt/stt-utils.js.map +1 -0
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/middlewares/index.js +1 -2
- package/dist-server/middlewares/index.js.map +1 -1
- package/dist-server/service/action-plan/action-plan-mutation.js +2 -2
- package/dist-server/service/action-plan/action-plan-mutation.js.map +1 -1
- package/dist-server/service/action-plan/action-plan-query.js +2 -2
- package/dist-server/service/action-plan/action-plan-query.js.map +1 -1
- package/dist-server/service/action-plan/action-plan-type.js +6 -6
- package/dist-server/service/action-plan/action-plan-type.js.map +1 -1
- package/dist-server/service/action-plan/action-plan.js +3 -3
- package/dist-server/service/action-plan/action-plan.js.map +1 -1
- package/dist-server/service/action-plan/index.d.ts +0 -1
- package/dist-server/service/action-plan/index.js +1 -2
- package/dist-server/service/action-plan/index.js.map +1 -1
- package/dist-server/service/building-inspection/building-inspection-history.js +2 -2
- package/dist-server/service/building-inspection/building-inspection-history.js.map +1 -1
- package/dist-server/service/building-inspection/building-inspection-mutation.d.ts +1 -0
- package/dist-server/service/building-inspection/building-inspection-mutation.js +91 -14
- package/dist-server/service/building-inspection/building-inspection-mutation.js.map +1 -1
- package/dist-server/service/building-inspection/building-inspection-query.d.ts +2 -1
- package/dist-server/service/building-inspection/building-inspection-query.js +33 -4
- package/dist-server/service/building-inspection/building-inspection-query.js.map +1 -1
- package/dist-server/service/building-inspection/building-inspection-type.d.ts +10 -3
- package/dist-server/service/building-inspection/building-inspection-type.js +45 -20
- package/dist-server/service/building-inspection/building-inspection-type.js.map +1 -1
- package/dist-server/service/building-inspection/building-inspection.d.ts +9 -0
- package/dist-server/service/building-inspection/building-inspection.js +43 -5
- package/dist-server/service/building-inspection/building-inspection.js.map +1 -1
- package/dist-server/service/building-inspection/index.d.ts +2 -4
- package/dist-server/service/building-inspection/index.js +2 -4
- package/dist-server/service/building-inspection/index.js.map +1 -1
- package/dist-server/service/checklist/checklist-history.d.ts +8 -0
- package/dist-server/service/checklist/checklist-history.js +38 -2
- package/dist-server/service/checklist/checklist-history.js.map +1 -1
- package/dist-server/service/checklist/checklist-mutation.js +2 -2
- package/dist-server/service/checklist/checklist-mutation.js.map +1 -1
- package/dist-server/service/checklist/checklist-query.js +2 -2
- package/dist-server/service/checklist/checklist-query.js.map +1 -1
- package/dist-server/service/checklist/checklist-type.js +6 -6
- package/dist-server/service/checklist/checklist-type.js.map +1 -1
- package/dist-server/service/checklist/checklist.d.ts +19 -1
- package/dist-server/service/checklist/checklist.js +78 -7
- package/dist-server/service/checklist/checklist.js.map +1 -1
- package/dist-server/service/checklist/index.d.ts +0 -2
- package/dist-server/service/checklist/index.js +1 -3
- package/dist-server/service/checklist/index.js.map +1 -1
- package/dist-server/service/checklist-item/checklist-item-mutation.js +2 -2
- package/dist-server/service/checklist-item/checklist-item-mutation.js.map +1 -1
- package/dist-server/service/checklist-item/checklist-item-query.js +2 -2
- package/dist-server/service/checklist-item/checklist-item-query.js.map +1 -1
- package/dist-server/service/checklist-item/checklist-item-type.js +2 -2
- package/dist-server/service/checklist-item/checklist-item-type.js.map +1 -1
- package/dist-server/service/checklist-item/checklist-item.js +3 -3
- package/dist-server/service/checklist-item/checklist-item.js.map +1 -1
- package/dist-server/service/checklist-item-comment/checklist-item-comment-history.js +2 -2
- package/dist-server/service/checklist-item-comment/checklist-item-comment-history.js.map +1 -1
- package/dist-server/service/checklist-item-comment/checklist-item-comment-mutation.js +2 -2
- package/dist-server/service/checklist-item-comment/checklist-item-comment-mutation.js.map +1 -1
- package/dist-server/service/checklist-item-comment/checklist-item-comment-query.js +2 -2
- package/dist-server/service/checklist-item-comment/checklist-item-comment-query.js.map +1 -1
- package/dist-server/service/checklist-item-comment/checklist-item-comment-type.js +6 -6
- package/dist-server/service/checklist-item-comment/checklist-item-comment-type.js.map +1 -1
- package/dist-server/service/checklist-item-comment/checklist-item-comment.js +2 -2
- package/dist-server/service/checklist-item-comment/checklist-item-comment.js.map +1 -1
- package/dist-server/service/checklist-item-comment/index.d.ts +0 -2
- package/dist-server/service/checklist-item-comment/index.js +1 -3
- package/dist-server/service/checklist-item-comment/index.js.map +1 -1
- package/dist-server/service/checklist-template/checklist-template-mutation.js +2 -2
- package/dist-server/service/checklist-template/checklist-template-mutation.js.map +1 -1
- package/dist-server/service/checklist-template/checklist-template-query.js +2 -2
- package/dist-server/service/checklist-template/checklist-template-query.js.map +1 -1
- package/dist-server/service/checklist-template/checklist-template-type.js +4 -4
- package/dist-server/service/checklist-template/checklist-template-type.js.map +1 -1
- package/dist-server/service/checklist-template/checklist-template.js +2 -2
- package/dist-server/service/checklist-template/checklist-template.js.map +1 -1
- package/dist-server/service/checklist-template-item/checklist-template-item-mutation.js +2 -2
- package/dist-server/service/checklist-template-item/checklist-template-item-mutation.js.map +1 -1
- package/dist-server/service/checklist-template-item/checklist-template-item-query.js +2 -2
- package/dist-server/service/checklist-template-item/checklist-template-item-query.js.map +1 -1
- package/dist-server/service/checklist-template-item/checklist-template-item-type.js +4 -4
- package/dist-server/service/checklist-template-item/checklist-template-item-type.js.map +1 -1
- package/dist-server/service/checklist-template-item/checklist-template-item.js +4 -6
- package/dist-server/service/checklist-template-item/checklist-template-item.js.map +1 -1
- package/dist-server/service/checklist-type/checklist-type-mutation.js +2 -2
- package/dist-server/service/checklist-type/checklist-type-mutation.js.map +1 -1
- package/dist-server/service/checklist-type/checklist-type-query.js +2 -2
- package/dist-server/service/checklist-type/checklist-type-query.js.map +1 -1
- package/dist-server/service/checklist-type/checklist-type-type.js +4 -4
- package/dist-server/service/checklist-type/checklist-type-type.js.map +1 -1
- package/dist-server/service/checklist-type/checklist-type.js +3 -3
- package/dist-server/service/checklist-type/checklist-type.js.map +1 -1
- package/dist-server/service/index.d.ts +0 -1
- package/dist-server/service/index.js +1 -11
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/service/issue/index.d.ts +0 -1
- package/dist-server/service/issue/index.js +1 -2
- package/dist-server/service/issue/index.js.map +1 -1
- package/dist-server/service/issue/issue-mutation.js +2 -2
- package/dist-server/service/issue/issue-mutation.js.map +1 -1
- package/dist-server/service/issue/issue-query.js +2 -2
- package/dist-server/service/issue/issue-query.js.map +1 -1
- package/dist-server/service/issue/issue-type.js +6 -6
- package/dist-server/service/issue/issue-type.js.map +1 -1
- package/dist-server/service/issue/issue.js +3 -3
- package/dist-server/service/issue/issue.js.map +1 -1
- package/dist-server/service/project-report/index.d.ts +0 -1
- package/dist-server/service/project-report/index.js +1 -2
- package/dist-server/service/project-report/index.js.map +1 -1
- package/dist-server/service/project-report/project-report-mutation.js +2 -2
- package/dist-server/service/project-report/project-report-mutation.js.map +1 -1
- package/dist-server/service/project-report/project-report-query.js +2 -2
- package/dist-server/service/project-report/project-report-query.js.map +1 -1
- package/dist-server/service/project-report/project-report-type.js +6 -6
- package/dist-server/service/project-report/project-report-type.js.map +1 -1
- package/dist-server/service/project-report/project-report.js +3 -3
- package/dist-server/service/project-report/project-report.js.map +1 -1
- package/dist-server/service/supervisor/index.d.ts +0 -1
- package/dist-server/service/supervisor/index.js +1 -2
- package/dist-server/service/supervisor/index.js.map +1 -1
- package/dist-server/service/supervisor/supervisor-mutation.js +2 -2
- package/dist-server/service/supervisor/supervisor-mutation.js.map +1 -1
- package/dist-server/service/supervisor/supervisor-query.js +2 -2
- package/dist-server/service/supervisor/supervisor-query.js.map +1 -1
- package/dist-server/service/supervisor/supervisor-type.js +6 -6
- package/dist-server/service/supervisor/supervisor-type.js.map +1 -1
- package/dist-server/service/supervisor/supervisor.js +3 -3
- package/dist-server/service/supervisor/supervisor.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +13 -13
- package/things-factory.config.js +3 -1
- package/dist-server/service/building-inspection/event-subscriber.d.ts +0 -7
- package/dist-server/service/building-inspection/event-subscriber.js +0 -21
- package/dist-server/service/building-inspection/event-subscriber.js.map +0 -1
- package/dist-server/service/checklist/event-subscriber.d.ts +0 -7
- package/dist-server/service/checklist/event-subscriber.js +0 -21
- package/dist-server/service/checklist/event-subscriber.js.map +0 -1
- package/dist-server/service/checklist-item-comment/event-subscriber.d.ts +0 -7
- package/dist-server/service/checklist-item-comment/event-subscriber.js +0 -21
- package/dist-server/service/checklist-item-comment/event-subscriber.js.map +0 -1
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.initMiddlewares =
|
|
3
|
+
exports.initMiddlewares = initMiddlewares;
|
|
4
4
|
function initMiddlewares(app) {
|
|
5
5
|
/* can add middlewares into app */
|
|
6
6
|
}
|
|
7
|
-
exports.initMiddlewares = initMiddlewares;
|
|
8
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/middlewares/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/middlewares/index.ts"],"names":[],"mappings":";;AAAA,0CAEC;AAFD,SAAgB,eAAe,CAAC,GAAG;IACjC,kCAAkC;AACpC,CAAC","sourcesContent":["export function initMiddlewares(app) {\n /* can add middlewares into app */\n}\n"]}
|
|
@@ -106,6 +106,7 @@ let ActionPlanMutation = class ActionPlanMutation {
|
|
|
106
106
|
return true;
|
|
107
107
|
}
|
|
108
108
|
};
|
|
109
|
+
exports.ActionPlanMutation = ActionPlanMutation;
|
|
109
110
|
tslib_1.__decorate([
|
|
110
111
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
111
112
|
(0, type_graphql_1.Mutation)(returns => action_plan_1.ActionPlan, { description: 'To create new ActionPlan' }),
|
|
@@ -161,8 +162,7 @@ tslib_1.__decorate([
|
|
|
161
162
|
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
|
162
163
|
tslib_1.__metadata("design:returntype", Promise)
|
|
163
164
|
], ActionPlanMutation.prototype, "importActionPlans", null);
|
|
164
|
-
ActionPlanMutation = tslib_1.__decorate([
|
|
165
|
+
exports.ActionPlanMutation = ActionPlanMutation = tslib_1.__decorate([
|
|
165
166
|
(0, type_graphql_1.Resolver)(action_plan_1.ActionPlan)
|
|
166
167
|
], ActionPlanMutation);
|
|
167
|
-
exports.ActionPlanMutation = ActionPlanMutation;
|
|
168
168
|
//# sourceMappingURL=action-plan-mutation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action-plan-mutation.js","sourceRoot":"","sources":["../../../server/service/action-plan/action-plan-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAE5B,qEAA0F;AAE1F,+CAA0C;AAC1C,yDAAmE;AAG5D,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAGvB,AAAN,KAAK,CAAC,gBAAgB,CAAoB,UAAyB,EAAS,OAAwB;QAClG,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,aAAa,CAAC,wBAAU,CAAC,CAAC,IAAI,iCACjD,UAAU,KACb,MAAM,EACN,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,IAAI,IACb,CAAA;QAEF,IAAI,UAAU,CAAC,SAAS,EAAE;YACxB,MAAM,IAAA,kCAAgB,EACpB,IAAI,EACJ;gBACE,UAAU,EAAE;oBACV,IAAI,EAAE,UAAU,CAAC,SAAS;oBAC1B,OAAO,EAAE,wBAAU,CAAC,IAAI;oBACxB,KAAK,EAAE,MAAM,CAAC,EAAE;iBACjB;aACF,EACD,OAAO,CACR,CAAA;SACF;QAED,OAAO,MAAM,CAAA;IACf,CAAC;IAIK,AAAN,KAAK,CAAC,gBAAgB,CACT,EAAU,EACP,KAAsB,EAC7B,OAAwB;QAE/B,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,MAAM,UAAU,GAAG,EAAE,CAAC,aAAa,CAAC,wBAAU,CAAC,CAAA;QAC/C,MAAM,UAAU,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC;YAC1C,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;SACzC,CAAC,CAAA;QAEF,MAAM,MAAM,GAAG,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sBAAsB,EAAE,CAAC;IAC9C,mBAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;IAAc,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;0DAOnD;AAIK;IAFL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,gCAAgC,EAAE,CAAC;IAE7E,mBAAA,IAAA,kBAAG,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAC5B,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;2DAYP;AAIK;IAFL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,gCAAgC,EAAE,CAAC;IAE7E,mBAAA,IAAA,kBAAG,EAAC,aAAa,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,kCAAe,CAAC,CAAC,CAAA;IAC7C,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;2DAWP;AA3LU,kBAAkB;IAD9B,IAAA,uBAAQ,EAAC,wBAAU,CAAC;GACR,kBAAkB,CA4L9B;AA5LY,gDAAkB","sourcesContent":["import { Resolver, Mutation, Arg, Ctx, Directive } from 'type-graphql'\nimport { In } from 'typeorm'\n\nimport { createAttachment, deleteAttachmentsByRef } from '@things-factory/attachment-base'\n\nimport { ActionPlan } from './action-plan'\nimport { NewActionPlan, ActionPlanPatch } from './action-plan-type'\n\n@Resolver(ActionPlan)\nexport class ActionPlanMutation {\n @Directive('@transaction')\n @Mutation(returns => ActionPlan, { description: 'To create new ActionPlan' })\n async createActionPlan(@Arg('actionPlan') actionPlan: NewActionPlan, @Ctx() context: ResolverContext): Promise<ActionPlan> {\n const { domain, user, tx } = context.state\n\n const result = await tx.getRepository(ActionPlan).save({\n ...actionPlan,\n domain,\n creator: user,\n updater: user\n })\n\n if (actionPlan.thumbnail) {\n await createAttachment(\n null,\n {\n attachment: {\n file: actionPlan.thumbnail,\n refType: ActionPlan.name,\n refBy: result.id\n }\n },\n context\n )\n }\n\n return result\n }\n\n @Directive('@transaction')\n @Mutation(returns => ActionPlan, { description: 'To modify ActionPlan information' })\n async updateActionPlan(\n @Arg('id') id: string,\n @Arg('patch') patch: ActionPlanPatch,\n @Ctx() context: ResolverContext\n ): Promise<ActionPlan> {\n const { domain, user, tx } = context.state\n\n const repository = tx.getRepository(ActionPlan)\n const actionPlan = await repository.findOne({\n where: { domain: { id: domain.id }, id }\n })\n\n const result = await repository.save({\n ...actionPlan,\n ...patch,\n updater: user\n })\n\n if (patch.thumbnail) {\n await deleteAttachmentsByRef(null, { refBys: [result.id] }, context)\n await createAttachment(\n null,\n {\n attachment: {\n file: patch.thumbnail,\n refType: ActionPlan.name,\n refBy: result.id\n }\n },\n context\n )\n }\n\n return result\n }\n\n @Directive('@transaction')\n @Mutation(returns => [ActionPlan], { description: \"To modify multiple ActionPlans' information\" })\n async updateMultipleActionPlan(\n @Arg('patches', type => [ActionPlanPatch]) patches: ActionPlanPatch[],\n @Ctx() context: ResolverContext\n ): Promise<ActionPlan[]> {\n const { domain, user, tx } = context.state\n\n let results = []\n const _createRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === '+')\n const _updateRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === 'M')\n const actionPlanRepo = tx.getRepository(ActionPlan)\n\n if (_createRecords.length > 0) {\n for (let i = 0; i < _createRecords.length; i++) {\n const newRecord = _createRecords[i]\n\n const result = await actionPlanRepo.save({\n ...newRecord,\n domain,\n creator: user,\n updater: user\n })\n\n if (newRecord.thumbnail) {\n await createAttachment(\n null,\n {\n attachment: {\n file: newRecord.thumbnail,\n refType: ActionPlan.name,\n refBy: result.id\n }\n },\n context\n )\n }\n\n results.push({ ...result, cuFlag: '+' })\n }\n }\n\n if (_updateRecords.length > 0) {\n for (let i = 0; i < _updateRecords.length; i++) {\n const updateRecord = _updateRecords[i]\n const actionPlan = await actionPlanRepo.findOneBy({ id: updateRecord.id })\n\n const result = await actionPlanRepo.save({\n ...actionPlan,\n ...updateRecord,\n updater: user\n })\n\n if (updateRecord.thumbnail) {\n await deleteAttachmentsByRef(null, { refBys: [result.id] }, context)\n await createAttachment(\n null,\n {\n attachment: {\n file: updateRecord.thumbnail,\n refType: ActionPlan.name,\n refBy: result.id\n }\n },\n context\n )\n }\n\n results.push({ ...result, cuFlag: 'M' })\n }\n }\n\n return results\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete ActionPlan' })\n async deleteActionPlan(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(ActionPlan).delete({ domain: { id: domain.id }, id })\n await deleteAttachmentsByRef(null, { refBys: [id] }, context)\n\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete multiple ActionPlans' })\n async deleteActionPlans(\n @Arg('ids', type => [String]) ids: string[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(ActionPlan).delete({\n domain: { id: domain.id },\n id: In(ids)\n })\n\n await deleteAttachmentsByRef(null, { refBys: ids }, context)\n\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To import multiple ActionPlans' })\n async importActionPlans(\n @Arg('actionPlans', type => [ActionPlanPatch]) actionPlans: ActionPlanPatch[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { domain, tx } = context.state\n\n await Promise.all(\n actionPlans.map(async (actionPlan: ActionPlanPatch) => {\n const createdActionPlan: ActionPlan = await tx.getRepository(ActionPlan).save({ domain, ...actionPlan })\n })\n )\n\n return true\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"action-plan-mutation.js","sourceRoot":"","sources":["../../../server/service/action-plan/action-plan-mutation.ts"],"names":[],"mappings":";;;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WAAW,EAAE,sBAAsB,EAAE,CAAC;IAC9C,mBAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;IAAc,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;0DAOnD;AAIK;IAFL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,gCAAgC,EAAE,CAAC;IAE7E,mBAAA,IAAA,kBAAG,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAC5B,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;2DAYP;AAIK;IAFL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,gCAAgC,EAAE,CAAC;IAE7E,mBAAA,IAAA,kBAAG,EAAC,aAAa,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,kCAAe,CAAC,CAAC,CAAA;IAC7C,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;2DAWP;6BA3LU,kBAAkB;IAD9B,IAAA,uBAAQ,EAAC,wBAAU,CAAC;GACR,kBAAkB,CA4L9B","sourcesContent":["import { Resolver, Mutation, Arg, Ctx, Directive } from 'type-graphql'\nimport { In } from 'typeorm'\n\nimport { createAttachment, deleteAttachmentsByRef } from '@things-factory/attachment-base'\n\nimport { ActionPlan } from './action-plan'\nimport { NewActionPlan, ActionPlanPatch } from './action-plan-type'\n\n@Resolver(ActionPlan)\nexport class ActionPlanMutation {\n @Directive('@transaction')\n @Mutation(returns => ActionPlan, { description: 'To create new ActionPlan' })\n async createActionPlan(@Arg('actionPlan') actionPlan: NewActionPlan, @Ctx() context: ResolverContext): Promise<ActionPlan> {\n const { domain, user, tx } = context.state\n\n const result = await tx.getRepository(ActionPlan).save({\n ...actionPlan,\n domain,\n creator: user,\n updater: user\n })\n\n if (actionPlan.thumbnail) {\n await createAttachment(\n null,\n {\n attachment: {\n file: actionPlan.thumbnail,\n refType: ActionPlan.name,\n refBy: result.id\n }\n },\n context\n )\n }\n\n return result\n }\n\n @Directive('@transaction')\n @Mutation(returns => ActionPlan, { description: 'To modify ActionPlan information' })\n async updateActionPlan(\n @Arg('id') id: string,\n @Arg('patch') patch: ActionPlanPatch,\n @Ctx() context: ResolverContext\n ): Promise<ActionPlan> {\n const { domain, user, tx } = context.state\n\n const repository = tx.getRepository(ActionPlan)\n const actionPlan = await repository.findOne({\n where: { domain: { id: domain.id }, id }\n })\n\n const result = await repository.save({\n ...actionPlan,\n ...patch,\n updater: user\n })\n\n if (patch.thumbnail) {\n await deleteAttachmentsByRef(null, { refBys: [result.id] }, context)\n await createAttachment(\n null,\n {\n attachment: {\n file: patch.thumbnail,\n refType: ActionPlan.name,\n refBy: result.id\n }\n },\n context\n )\n }\n\n return result\n }\n\n @Directive('@transaction')\n @Mutation(returns => [ActionPlan], { description: \"To modify multiple ActionPlans' information\" })\n async updateMultipleActionPlan(\n @Arg('patches', type => [ActionPlanPatch]) patches: ActionPlanPatch[],\n @Ctx() context: ResolverContext\n ): Promise<ActionPlan[]> {\n const { domain, user, tx } = context.state\n\n let results = []\n const _createRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === '+')\n const _updateRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === 'M')\n const actionPlanRepo = tx.getRepository(ActionPlan)\n\n if (_createRecords.length > 0) {\n for (let i = 0; i < _createRecords.length; i++) {\n const newRecord = _createRecords[i]\n\n const result = await actionPlanRepo.save({\n ...newRecord,\n domain,\n creator: user,\n updater: user\n })\n\n if (newRecord.thumbnail) {\n await createAttachment(\n null,\n {\n attachment: {\n file: newRecord.thumbnail,\n refType: ActionPlan.name,\n refBy: result.id\n }\n },\n context\n )\n }\n\n results.push({ ...result, cuFlag: '+' })\n }\n }\n\n if (_updateRecords.length > 0) {\n for (let i = 0; i < _updateRecords.length; i++) {\n const updateRecord = _updateRecords[i]\n const actionPlan = await actionPlanRepo.findOneBy({ id: updateRecord.id })\n\n const result = await actionPlanRepo.save({\n ...actionPlan,\n ...updateRecord,\n updater: user\n })\n\n if (updateRecord.thumbnail) {\n await deleteAttachmentsByRef(null, { refBys: [result.id] }, context)\n await createAttachment(\n null,\n {\n attachment: {\n file: updateRecord.thumbnail,\n refType: ActionPlan.name,\n refBy: result.id\n }\n },\n context\n )\n }\n\n results.push({ ...result, cuFlag: 'M' })\n }\n }\n\n return results\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete ActionPlan' })\n async deleteActionPlan(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(ActionPlan).delete({ domain: { id: domain.id }, id })\n await deleteAttachmentsByRef(null, { refBys: [id] }, context)\n\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete multiple ActionPlans' })\n async deleteActionPlans(\n @Arg('ids', type => [String]) ids: string[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(ActionPlan).delete({\n domain: { id: domain.id },\n id: In(ids)\n })\n\n await deleteAttachmentsByRef(null, { refBys: ids }, context)\n\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To import multiple ActionPlans' })\n async importActionPlans(\n @Arg('actionPlans', type => [ActionPlanPatch]) actionPlans: ActionPlanPatch[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { domain, tx } = context.state\n\n await Promise.all(\n actionPlans.map(async (actionPlan: ActionPlanPatch) => {\n const createdActionPlan: ActionPlan = await tx.getRepository(ActionPlan).save({ domain, ...actionPlan })\n })\n )\n\n return true\n }\n}\n"]}
|
|
@@ -46,6 +46,7 @@ let ActionPlanQuery = class ActionPlanQuery {
|
|
|
46
46
|
return await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: actionPlan.creatorId });
|
|
47
47
|
}
|
|
48
48
|
};
|
|
49
|
+
exports.ActionPlanQuery = ActionPlanQuery;
|
|
49
50
|
tslib_1.__decorate([
|
|
50
51
|
(0, type_graphql_1.Query)(returns => action_plan_1.ActionPlan, { nullable: true, description: 'To fetch a ActionPlan' }),
|
|
51
52
|
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
@@ -90,8 +91,7 @@ tslib_1.__decorate([
|
|
|
90
91
|
tslib_1.__metadata("design:paramtypes", [action_plan_1.ActionPlan]),
|
|
91
92
|
tslib_1.__metadata("design:returntype", Promise)
|
|
92
93
|
], ActionPlanQuery.prototype, "creator", null);
|
|
93
|
-
ActionPlanQuery = tslib_1.__decorate([
|
|
94
|
+
exports.ActionPlanQuery = ActionPlanQuery = tslib_1.__decorate([
|
|
94
95
|
(0, type_graphql_1.Resolver)(action_plan_1.ActionPlan)
|
|
95
96
|
], ActionPlanQuery);
|
|
96
|
-
exports.ActionPlanQuery = ActionPlanQuery;
|
|
97
97
|
//# sourceMappingURL=action-plan-query.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action-plan-query.js","sourceRoot":"","sources":["../../../server/service/action-plan/action-plan-query.ts"],"names":[],"mappings":";;;;AAAA,+CAA8F;AAC9F,qEAA4D;AAC5D,iDAAuG;AACvG,yDAAgD;AAChD,+CAA0C;AAC1C,yDAAmD;AAG5C,IAAM,eAAe,GAArB,MAAM,eAAe;IAEpB,AAAN,KAAK,CAAC,UAAU,CAAY,EAAU,EAAS,OAAwB;QACrE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,OAAO,MAAM,IAAA,qBAAa,EAAC,wBAAU,CAAC,CAAC,OAAO,CAAC;YAC7C,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;SACzC,CAAC,CAAA;IACJ,CAAC;IAG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AAqB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;6CAAjB,iBAAS;;kDAa1C;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAa,wBAAU;;gDAU7C;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IAChB,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAa,wBAAU;;6CAE1C;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAa,wBAAU;;8CAE3C;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAa,wBAAU;;8CAE3C;0BApDU,eAAe;IAD3B,IAAA,uBAAQ,EAAC,wBAAU,CAAC;GACR,eAAe,CAqD3B","sourcesContent":["import { Resolver, Query, FieldResolver, Root, Args, Arg, Ctx, Directive } from 'type-graphql'\nimport { Attachment } from '@things-factory/attachment-base'\nimport { Domain, getQueryBuilderFromListParams, getRepository, ListParam } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { ActionPlan } from './action-plan'\nimport { ActionPlanList } from './action-plan-type'\n\n@Resolver(ActionPlan)\nexport class ActionPlanQuery {\n @Query(returns => ActionPlan!, { nullable: true, description: 'To fetch a ActionPlan' })\n async actionPlan(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<ActionPlan> {\n const { domain } = context.state\n\n return await getRepository(ActionPlan).findOne({\n where: { domain: { id: domain.id }, id }\n })\n }\n\n @Query(returns => ActionPlanList, { description: 'To fetch multiple ActionPlans' })\n async actionPlans(@Args() params: ListParam, @Ctx() context: ResolverContext): Promise<ActionPlanList> {\n const { domain } = context.state\n\n const queryBuilder = getQueryBuilderFromListParams({\n domain,\n params,\n repository: await getRepository(ActionPlan),\n searchables: ['name', 'description']\n })\n\n const [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n\n @FieldResolver(type => String)\n async thumbnail(@Root() actionPlan: ActionPlan): Promise<string | undefined> {\n const attachment: Attachment = await getRepository(Attachment).findOne({\n where: {\n domain: { id: actionPlan.domainId },\n refType: ActionPlan.name,\n refBy: actionPlan.id\n }\n })\n\n return attachment?.fullpath\n }\n\n @FieldResolver(type => Domain)\n async domain(@Root() actionPlan: ActionPlan): Promise<Domain> {\n return await getRepository(Domain).findOneBy({ id: actionPlan.domainId })\n }\n\n @FieldResolver(type => User)\n async updater(@Root() actionPlan: ActionPlan): Promise<User> {\n return await getRepository(User).findOneBy({ id: actionPlan.updaterId })\n }\n\n @FieldResolver(type => User)\n async creator(@Root() actionPlan: ActionPlan): Promise<User> {\n return await getRepository(User).findOneBy({ id: actionPlan.creatorId })\n }\n}\n"]}
|
|
@@ -7,6 +7,7 @@ const type_graphql_1 = require("type-graphql");
|
|
|
7
7
|
const action_plan_1 = require("./action-plan");
|
|
8
8
|
let NewActionPlan = class NewActionPlan {
|
|
9
9
|
};
|
|
10
|
+
exports.NewActionPlan = NewActionPlan;
|
|
10
11
|
tslib_1.__decorate([
|
|
11
12
|
(0, type_graphql_1.Field)(),
|
|
12
13
|
tslib_1.__metadata("design:type", String)
|
|
@@ -31,12 +32,12 @@ tslib_1.__decorate([
|
|
|
31
32
|
(0, type_graphql_1.Field)(type => GraphQLUpload_js_1.default, { nullable: true }),
|
|
32
33
|
tslib_1.__metadata("design:type", Object)
|
|
33
34
|
], NewActionPlan.prototype, "thumbnail", void 0);
|
|
34
|
-
NewActionPlan = tslib_1.__decorate([
|
|
35
|
+
exports.NewActionPlan = NewActionPlan = tslib_1.__decorate([
|
|
35
36
|
(0, type_graphql_1.InputType)()
|
|
36
37
|
], NewActionPlan);
|
|
37
|
-
exports.NewActionPlan = NewActionPlan;
|
|
38
38
|
let ActionPlanPatch = class ActionPlanPatch {
|
|
39
39
|
};
|
|
40
|
+
exports.ActionPlanPatch = ActionPlanPatch;
|
|
40
41
|
tslib_1.__decorate([
|
|
41
42
|
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
|
|
42
43
|
tslib_1.__metadata("design:type", String)
|
|
@@ -65,12 +66,12 @@ tslib_1.__decorate([
|
|
|
65
66
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
66
67
|
tslib_1.__metadata("design:type", String)
|
|
67
68
|
], ActionPlanPatch.prototype, "cuFlag", void 0);
|
|
68
|
-
ActionPlanPatch = tslib_1.__decorate([
|
|
69
|
+
exports.ActionPlanPatch = ActionPlanPatch = tslib_1.__decorate([
|
|
69
70
|
(0, type_graphql_1.InputType)()
|
|
70
71
|
], ActionPlanPatch);
|
|
71
|
-
exports.ActionPlanPatch = ActionPlanPatch;
|
|
72
72
|
let ActionPlanList = class ActionPlanList {
|
|
73
73
|
};
|
|
74
|
+
exports.ActionPlanList = ActionPlanList;
|
|
74
75
|
tslib_1.__decorate([
|
|
75
76
|
(0, type_graphql_1.Field)(type => [action_plan_1.ActionPlan]),
|
|
76
77
|
tslib_1.__metadata("design:type", Array)
|
|
@@ -79,8 +80,7 @@ tslib_1.__decorate([
|
|
|
79
80
|
(0, type_graphql_1.Field)(type => type_graphql_1.Int),
|
|
80
81
|
tslib_1.__metadata("design:type", Number)
|
|
81
82
|
], ActionPlanList.prototype, "total", void 0);
|
|
82
|
-
ActionPlanList = tslib_1.__decorate([
|
|
83
|
+
exports.ActionPlanList = ActionPlanList = tslib_1.__decorate([
|
|
83
84
|
(0, type_graphql_1.ObjectType)()
|
|
84
85
|
], ActionPlanList);
|
|
85
|
-
exports.ActionPlanList = ActionPlanList;
|
|
86
86
|
//# sourceMappingURL=action-plan-type.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action-plan-type.js","sourceRoot":"","sources":["../../../server/service/action-plan/action-plan-type.ts"],"names":[],"mappings":";;;;AACA,+FAA2D;AAC3D,+CAAsF;AAItF,+CAA4D;AAGrD,IAAM,aAAa,GAAnB,MAAM,aAAa;CAkBzB,CAAA;
|
|
1
|
+
{"version":3,"file":"action-plan-type.js","sourceRoot":"","sources":["../../../server/service/action-plan/action-plan-type.ts"],"names":[],"mappings":";;;;AACA,+FAA2D;AAC3D,+CAAsF;AAItF,+CAA4D;AAGrD,IAAM,aAAa,GAAnB,MAAM,aAAa;CAkBzB,CAAA;AAlBY,sCAAa;AAExB;IADC,IAAA,oBAAK,GAAE;;2CACI;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDACN;AAGpB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,8BAAgB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CAC5B;AAGxB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACV;AAGhB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACX;AAGf;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,0BAAa,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDAC3B;wBAjBX,aAAa;IADzB,IAAA,wBAAS,GAAE;GACC,aAAa,CAkBzB;AAGM,IAAM,eAAe,GAArB,MAAM,eAAe;CAqB3B,CAAA;AArBY,0CAAe;AAE1B;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CAC3B;AAGX;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACb;AAGb;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oDACN;AAGpB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,8BAAgB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CAC5B;AAGxB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACV;AAGhB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,0BAAa,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDAC3B;AAGtB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACX;0BApBJ,eAAe;IAD3B,IAAA,wBAAS,GAAE;GACC,eAAe,CAqB3B;AAGM,IAAM,cAAc,GAApB,MAAM,cAAc;CAM1B,CAAA;AANY,wCAAc;AAEzB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,wBAAU,CAAC,CAAC;;6CACT;AAGnB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;6CACN;yBALF,cAAc;IAD1B,IAAA,yBAAU,GAAE;GACA,cAAc,CAM1B","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'\n\nimport { ObjectRef, ScalarObject } from '@things-factory/shell'\n\nimport { ActionPlan, ActionPlanStatus } from './action-plan'\n\n@InputType()\nexport class NewActionPlan {\n @Field()\n name: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field(type => ActionPlanStatus, { nullable: true })\n state?: ActionPlanStatus\n\n @Field({ nullable: true })\n active?: boolean\n\n @Field({ nullable: true })\n params?: string\n\n @Field(type => GraphQLUpload, { nullable: true })\n thumbnail?: FileUpload\n}\n\n@InputType()\nexport class ActionPlanPatch {\n @Field(type => ID, { nullable: true })\n id?: string\n\n @Field({ nullable: true })\n name?: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field(type => ActionPlanStatus, { nullable: true })\n state?: ActionPlanStatus\n\n @Field({ nullable: true })\n active?: boolean\n\n @Field(type => GraphQLUpload, { nullable: true })\n thumbnail?: FileUpload\n\n @Field({ nullable: true })\n cuFlag?: string\n}\n\n@ObjectType()\nexport class ActionPlanList {\n @Field(type => [ActionPlan])\n items: ActionPlan[]\n\n @Field(type => Int)\n total: number\n}\n"]}
|
|
@@ -11,13 +11,14 @@ var ActionPlanStatus;
|
|
|
11
11
|
(function (ActionPlanStatus) {
|
|
12
12
|
ActionPlanStatus["STATUS_A"] = "STATUS_A";
|
|
13
13
|
ActionPlanStatus["STATUS_B"] = "STATUS_B";
|
|
14
|
-
})(ActionPlanStatus
|
|
14
|
+
})(ActionPlanStatus || (exports.ActionPlanStatus = ActionPlanStatus = {}));
|
|
15
15
|
(0, type_graphql_1.registerEnumType)(ActionPlanStatus, {
|
|
16
16
|
name: 'ActionPlanStatus',
|
|
17
17
|
description: 'state enumeration of a actionPlan'
|
|
18
18
|
});
|
|
19
19
|
let ActionPlan = class ActionPlan {
|
|
20
20
|
};
|
|
21
|
+
exports.ActionPlan = ActionPlan;
|
|
21
22
|
tslib_1.__decorate([
|
|
22
23
|
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
23
24
|
(0, type_graphql_1.Field)(type => type_graphql_1.ID),
|
|
@@ -104,7 +105,7 @@ tslib_1.__decorate([
|
|
|
104
105
|
(0, type_graphql_1.Field)(type => String, { nullable: true }),
|
|
105
106
|
tslib_1.__metadata("design:type", String)
|
|
106
107
|
], ActionPlan.prototype, "thumbnail", void 0);
|
|
107
|
-
ActionPlan = tslib_1.__decorate([
|
|
108
|
+
exports.ActionPlan = ActionPlan = tslib_1.__decorate([
|
|
108
109
|
(0, typeorm_1.Entity)(),
|
|
109
110
|
(0, typeorm_1.Index)('ix_action_plan_0', (actionPlan) => [actionPlan.domain, actionPlan.name], {
|
|
110
111
|
unique: true,
|
|
@@ -112,5 +113,4 @@ ActionPlan = tslib_1.__decorate([
|
|
|
112
113
|
}),
|
|
113
114
|
(0, type_graphql_1.ObjectType)({ description: 'Entity for ActionPlan' })
|
|
114
115
|
], ActionPlan);
|
|
115
|
-
exports.ActionPlan = ActionPlan;
|
|
116
116
|
//# sourceMappingURL=action-plan.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action-plan.js","sourceRoot":"","sources":["../../../server/service/action-plan/action-plan.ts"],"names":[],"mappings":";;;;AAAA,qCAWgB;AAChB,+CAA2E;AAE3E,iDAA8C;AAC9C,yDAAgD;AAChD,0CAAsC;AAEtC,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAC1B,yCAAqB,CAAA;IACrB,yCAAqB,CAAA;AACvB,CAAC,EAHW,gBAAgB,
|
|
1
|
+
{"version":3,"file":"action-plan.js","sourceRoot":"","sources":["../../../server/service/action-plan/action-plan.ts"],"names":[],"mappings":";;;;AAAA,qCAWgB;AAChB,+CAA2E;AAE3E,iDAA8C;AAC9C,yDAAgD;AAChD,0CAAsC;AAEtC,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAC1B,yCAAqB,CAAA;IACrB,yCAAqB,CAAA;AACvB,CAAC,EAHW,gBAAgB,gCAAhB,gBAAgB,QAG3B;AAED,IAAA,+BAAgB,EAAC,gBAAgB,EAAE;IACjC,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE,mCAAmC;CACjD,CAAC,CAAA;AAQK,IAAM,UAAU,GAAhB,MAAM,UAAU;CAoEtB,CAAA;AApEY,gCAAU;AAGZ;IAFR,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;sCACC;AAInB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IACzB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACjB,cAAM;0CAAA;AAGf;IADC,IA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AAE,CAAC;GACxC,UAAU,CAoEtB","sourcesContent":["import {\n CreateDateColumn,\n UpdateDateColumn,\n DeleteDateColumn,\n Entity,\n Index,\n Column,\n RelationId,\n ManyToOne,\n PrimaryGeneratedColumn,\n VersionColumn\n} from 'typeorm'\nimport { ObjectType, Field, Int, ID, registerEnumType } from 'type-graphql'\n\nimport { Domain } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { Issue } from '../issue/issue'\n\nexport enum ActionPlanStatus {\n STATUS_A = 'STATUS_A',\n STATUS_B = 'STATUS_B'\n}\n\nregisterEnumType(ActionPlanStatus, {\n name: 'ActionPlanStatus',\n description: 'state enumeration of a actionPlan'\n})\n\n@Entity()\n@Index('ix_action_plan_0', (actionPlan: ActionPlan) => [actionPlan.domain, actionPlan.name], {\n unique: true,\n where: '\"deleted_at\" IS NULL'\n})\n@ObjectType({ description: 'Entity for ActionPlan' })\nexport class ActionPlan {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field({ nullable: true })\n domain?: Domain\n\n @RelationId((actionPlan: ActionPlan) => actionPlan.domain)\n domainId?: string\n\n @Column()\n @Field({ nullable: true })\n name?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n description?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n active?: boolean\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n state?: ActionPlanStatus\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n params?: string\n\n @Field(() => Issue)\n @ManyToOne(() => Issue, issue => issue.actionPlans)\n issue: Issue\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n content: 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((actionPlan: ActionPlan) => actionPlan.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n @RelationId((actionPlan: ActionPlan) => actionPlan.updater)\n updaterId?: string\n\n @Field(type => String, { nullable: true })\n thumbnail?: string\n}\n"]}
|
|
@@ -3,4 +3,3 @@ import { ActionPlanQuery } from './action-plan-query';
|
|
|
3
3
|
import { ActionPlanMutation } from './action-plan-mutation';
|
|
4
4
|
export declare const entities: (typeof ActionPlan)[];
|
|
5
5
|
export declare const resolvers: (typeof ActionPlanQuery | typeof ActionPlanMutation)[];
|
|
6
|
-
export declare const subscribers: any[];
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.resolvers = exports.entities = void 0;
|
|
4
4
|
const action_plan_1 = require("./action-plan");
|
|
5
5
|
const action_plan_query_1 = require("./action-plan-query");
|
|
6
6
|
const action_plan_mutation_1 = require("./action-plan-mutation");
|
|
7
7
|
exports.entities = [action_plan_1.ActionPlan];
|
|
8
8
|
exports.resolvers = [action_plan_query_1.ActionPlanQuery, action_plan_mutation_1.ActionPlanMutation];
|
|
9
|
-
exports.subscribers = [];
|
|
10
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/action-plan/index.ts"],"names":[],"mappings":";;;AAAA,+CAA0C;AAC1C,2DAAqD;AACrD,iEAA2D;AAE9C,QAAA,QAAQ,GAAG,CAAC,wBAAU,CAAC,CAAA;AACvB,QAAA,SAAS,GAAG,CAAC,mCAAe,EAAE,yCAAkB,CAAC,CAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/action-plan/index.ts"],"names":[],"mappings":";;;AAAA,+CAA0C;AAC1C,2DAAqD;AACrD,iEAA2D;AAE9C,QAAA,QAAQ,GAAG,CAAC,wBAAU,CAAC,CAAA;AACvB,QAAA,SAAS,GAAG,CAAC,mCAAe,EAAE,yCAAkB,CAAC,CAAA","sourcesContent":["import { ActionPlan } from './action-plan'\nimport { ActionPlanQuery } from './action-plan-query'\nimport { ActionPlanMutation } from './action-plan-mutation'\n\nexport const entities = [ActionPlan]\nexport const resolvers = [ActionPlanQuery, ActionPlanMutation]\n"]}
|
|
@@ -13,6 +13,7 @@ const ORMCONFIG = env_1.config.get('ormconfig', {});
|
|
|
13
13
|
const DATABASE_TYPE = ORMCONFIG.type;
|
|
14
14
|
let BuildingInspectionHistory = class BuildingInspectionHistory {
|
|
15
15
|
};
|
|
16
|
+
exports.BuildingInspectionHistory = BuildingInspectionHistory;
|
|
16
17
|
tslib_1.__decorate([
|
|
17
18
|
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
18
19
|
(0, type_graphql_1.Field)(type => type_graphql_1.ID),
|
|
@@ -75,12 +76,11 @@ tslib_1.__decorate([
|
|
|
75
76
|
}),
|
|
76
77
|
tslib_1.__metadata("design:type", String)
|
|
77
78
|
], BuildingInspectionHistory.prototype, "action", void 0);
|
|
78
|
-
BuildingInspectionHistory = tslib_1.__decorate([
|
|
79
|
+
exports.BuildingInspectionHistory = BuildingInspectionHistory = tslib_1.__decorate([
|
|
79
80
|
(0, typeorm_1.Entity)(),
|
|
80
81
|
(0, typeorm_1.Index)('ix_buildingInspection_history_0', (buildingInspectionHistory) => [
|
|
81
82
|
buildingInspectionHistory.originalId
|
|
82
83
|
]),
|
|
83
84
|
(0, type_graphql_1.ObjectType)({ description: 'History Entity of BuildingInspection' })
|
|
84
85
|
], BuildingInspectionHistory);
|
|
85
|
-
exports.BuildingInspectionHistory = BuildingInspectionHistory;
|
|
86
86
|
//# sourceMappingURL=building-inspection-history.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"building-inspection-history.js","sourceRoot":"","sources":["../../../server/service/building-inspection/building-inspection-history.ts"],"names":[],"mappings":";;;;AAAA,+CAAoD;AACpD,qCAA8F;AAC9F,8DAAkI;AAClI,yDAAgD;AAChD,6CAA4C;AAC5C,+DAAoF;AACpF,6DAAsD;AAEtD,MAAM,SAAS,GAAG,YAAM,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,CAAC,CAAA;AAC7C,MAAM,aAAa,GAAG,SAAS,CAAC,IAAI,CAAA;AAO7B,IAAM,yBAAyB,GAA/B,MAAM,yBAAyB;CAuDrC,CAAA;
|
|
1
|
+
{"version":3,"file":"building-inspection-history.js","sourceRoot":"","sources":["../../../server/service/building-inspection/building-inspection-history.ts"],"names":[],"mappings":";;;;AAAA,+CAAoD;AACpD,qCAA8F;AAC9F,8DAAkI;AAClI,yDAAgD;AAChD,6CAA4C;AAC5C,+DAAoF;AACpF,6DAAsD;AAEtD,MAAM,SAAS,GAAG,YAAM,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,CAAC,CAAA;AAC7C,MAAM,aAAa,GAAG,SAAS,CAAC,IAAI,CAAA;AAO7B,IAAM,yBAAyB,GAA/B,MAAM,yBAAyB;CAuDrC,CAAA;AAvDY,8DAAyB;AAG3B;IAFR,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;qDACC;AAGZ;IADN,IAAA,yCAAuB,GAAE;;6DACA;AAQ1B;IANC,IAAA,gBAAM,EAAC;QACN,QAAQ,EAAE,KAAK;QACf,OAAO,EACL,2GAA2G;KAC9G,CAAC;IACD,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yDACO;AAKjC;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,gCAAa,CAAC;IAChC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACV,gCAAa;gEAAA;AAG7B;IADC,IAAA,oBAAU,EAAC,CAAC,y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oCAtDtB,yBAAyB;IALrC,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,iCAAiC,EAAE,CAAC,yBAAoD,EAAE,EAAE,CAAC;QAClG,yBAAyB,CAAC,UAAU;KACrC,CAAC;IACD,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,sCAAsC,EAAE,CAAC;GACvD,yBAAyB,CAuDrC","sourcesContent":["import { Field, ID, ObjectType } from 'type-graphql'\nimport { Column, Entity, Index, ManyToOne, PrimaryGeneratedColumn, RelationId } from 'typeorm'\nimport { HistoryActionColumn, HistoryActionType, HistoryEntityInterface, HistoryOriginalIdColumn } from '@operato/typeorm-history'\nimport { User } from '@things-factory/auth-base'\nimport { config } from '@things-factory/env'\nimport { BuildingInspection, BuildingInspectionStatus } from './building-inspection'\nimport { BuildingLevel } from '@dssp/building-complex'\n\nconst ORMCONFIG = config.get('ormconfig', {})\nconst DATABASE_TYPE = ORMCONFIG.type\n\n@Entity()\n@Index('ix_buildingInspection_history_0', (buildingInspectionHistory: BuildingInspectionHistory) => [\n buildingInspectionHistory.originalId\n])\n@ObjectType({ description: 'History Entity of BuildingInspection' })\nexport class BuildingInspectionHistory implements HistoryEntityInterface<BuildingInspection> {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @HistoryOriginalIdColumn()\n public originalId!: string\n\n @Column({\n nullable: false,\n comment:\n '상태(WAIT: 검측 대기, OVERALL_WAIT: 총괄자 검측 대기, REQUEST: 검측 요청, OVERALL_REQUEST: 총괄자 검측 요청, PASS: 합격, FAIL: 불합격)'\n })\n @Field({ nullable: true })\n status?: BuildingInspectionStatus\n\n // 층 정보 (1:1 테이블 참조)\n @ManyToOne(type => BuildingLevel)\n @Field({ nullable: true })\n buildingLevel?: BuildingLevel\n\n @RelationId((buildingInspectionHistory: BuildingInspectionHistory) => buildingInspectionHistory.buildingLevel)\n buildingLevelId?: string\n\n @Column({ type: 'date', nullable: true, comment: '검측 요청일' })\n @Field(type => String, { nullable: true })\n requestDate?: string\n\n // 체크리스트 ID (1:1 테이블 참조)\n @Field({ nullable: true })\n @Column({ nullable: true, comment: '체크리스트 ID' })\n checklistId: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n createdAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n creator?: User\n\n @RelationId((buildingInspectionHistory: BuildingInspectionHistory) => buildingInspectionHistory.creator)\n creatorId?: 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 : 'smallint',\n enum: HistoryActionType\n })\n public action!: HistoryActionType\n}\n"]}
|
|
@@ -5,5 +5,6 @@ export declare class BuildingInspectionMutation {
|
|
|
5
5
|
updateBuildingInspectionChecklist(buildingInspection: UpdateBuildingInspectionSubmitType, context: ResolverContext): Promise<boolean>;
|
|
6
6
|
updateBuildingInspection(patch: UpdateBuildingInspectionDrawingMarker, context: ResolverContext): Promise<BuildingInspection>;
|
|
7
7
|
deleteBuildingInspections(ids: string[], context: ResolverContext): Promise<boolean>;
|
|
8
|
+
applyToAllBuildingInspection(buildingInspectionId: string, context: ResolverContext): Promise<boolean>;
|
|
8
9
|
getRecentDocumentNoByBuildingLevelId(buildingLevelId: string): Promise<string>;
|
|
9
10
|
}
|
|
@@ -11,33 +11,48 @@ const checklist_1 = require("../checklist/checklist");
|
|
|
11
11
|
const checklist_item_1 = require("../checklist-item/checklist-item");
|
|
12
12
|
const shell_1 = require("@things-factory/shell");
|
|
13
13
|
const building_complex_1 = require("@dssp/building-complex");
|
|
14
|
+
const env_1 = require("@things-factory/env");
|
|
15
|
+
const projectType = env_1.config.get('projectType', building_inspection_1.ProjectType.DSSP);
|
|
14
16
|
let BuildingInspectionMutation = class BuildingInspectionMutation {
|
|
15
17
|
async createBuildingInspection(patch, context) {
|
|
16
18
|
const { user, tx } = context.state;
|
|
17
|
-
const { buildingLevelId, checklist, checklistItem } = patch;
|
|
19
|
+
const { buildingLevelId, checklist, checklistItem, cellX, cellY, managerId } = patch;
|
|
18
20
|
const buildingInspectionRepository = tx.getRepository(building_inspection_1.BuildingInspection);
|
|
19
21
|
const checklistRepository = tx.getRepository(checklist_1.Checklist);
|
|
20
22
|
const checklistItemRepository = tx.getRepository(checklist_item_1.ChecklistItem);
|
|
23
|
+
const CHECKLIST_REFERENCE_TYPE = checklist.checklistReferenceType || checklist_1.ChecklistReferenceType.INSPECTION;
|
|
21
24
|
// 1. 벨리데이션
|
|
22
|
-
if (!buildingLevelId)
|
|
23
|
-
throw new Error('층 아이디가 없습니다.');
|
|
24
|
-
if (!checklist.name)
|
|
25
|
-
throw new Error('체크리스트 이름이 없습니다.');
|
|
26
25
|
if (!checklist.constructionType)
|
|
27
26
|
throw new Error('공종 타입이 없습니다.');
|
|
28
27
|
if (!checklist.constructionDetailType)
|
|
29
28
|
throw new Error('상세 공종 타입이 없습니다.');
|
|
30
|
-
if (!checklist.
|
|
31
|
-
throw new Error('
|
|
32
|
-
if (!checklist.inspectionDrawingType)
|
|
33
|
-
throw new Error('검측 도면 타입이 없습니다.');
|
|
34
|
-
if (checklist.inspectionParts.length === 0)
|
|
35
|
-
throw new Error('검측 부위가 없습니다.');
|
|
29
|
+
if (!checklist.name)
|
|
30
|
+
throw new Error('체크리스트 이름이 없습니다.');
|
|
36
31
|
if (checklistItem.length === 0)
|
|
37
32
|
throw new Error('체크리스트 아이템이 없습니다.');
|
|
33
|
+
if (CHECKLIST_REFERENCE_TYPE === checklist_1.ChecklistReferenceType.INSPECTION && projectType === building_inspection_1.ProjectType.DSSP) {
|
|
34
|
+
if (!cellX || !cellY)
|
|
35
|
+
throw new Error('셀 좌표가 없습니다.');
|
|
36
|
+
if (!managerId)
|
|
37
|
+
throw new Error('담당자가 없습니다.');
|
|
38
|
+
if (!buildingLevelId)
|
|
39
|
+
throw new Error('층 아이디가 없습니다.');
|
|
40
|
+
if (!checklist.location)
|
|
41
|
+
throw new Error('위치가 없습니다.');
|
|
42
|
+
}
|
|
43
|
+
else if (CHECKLIST_REFERENCE_TYPE === checklist_1.ChecklistReferenceType.INSPECTION && projectType === building_inspection_1.ProjectType.DCSP) {
|
|
44
|
+
if (!checklist.inspectionDrawingType)
|
|
45
|
+
throw new Error('검측 도면 타입이 없습니다.');
|
|
46
|
+
if (checklist.inspectionParts.length === 0)
|
|
47
|
+
throw new Error('검측 부위가 없습니다.');
|
|
48
|
+
if (!buildingLevelId)
|
|
49
|
+
throw new Error('층 아이디가 없습니다.');
|
|
50
|
+
if (!checklist.location)
|
|
51
|
+
throw new Error('위치가 없습니다.');
|
|
52
|
+
}
|
|
38
53
|
// 2. checklist 저장
|
|
39
54
|
const documentNo = await this.getRecentDocumentNoByBuildingLevelId(buildingLevelId);
|
|
40
|
-
const savedChecklist = await checklistRepository.save(Object.assign(Object.assign({}, checklist), { documentNo, creator: user, updater: user }));
|
|
55
|
+
const savedChecklist = await checklistRepository.save(Object.assign(Object.assign({}, checklist), { projectType, project: CHECKLIST_REFERENCE_TYPE === checklist_1.ChecklistReferenceType.SCHEDULE ? { id: checklist.projectId } : null, documentNo, creator: user, updater: user }));
|
|
41
56
|
// 3. checklistItem 저장
|
|
42
57
|
const checklistItems = checklistItem.map((item, idx) => ({
|
|
43
58
|
name: item.name,
|
|
@@ -55,6 +70,10 @@ let BuildingInspectionMutation = class BuildingInspectionMutation {
|
|
|
55
70
|
status: building_inspection_2.BuildingInspectionStatus.WAIT,
|
|
56
71
|
buildingLevel: { id: buildingLevelId },
|
|
57
72
|
checklist: savedChecklist,
|
|
73
|
+
projectType,
|
|
74
|
+
manager: managerId ? { id: managerId } : null,
|
|
75
|
+
cellX,
|
|
76
|
+
cellY,
|
|
58
77
|
creator: user,
|
|
59
78
|
updater: user
|
|
60
79
|
});
|
|
@@ -195,6 +214,55 @@ let BuildingInspectionMutation = class BuildingInspectionMutation {
|
|
|
195
214
|
.execute();
|
|
196
215
|
return true;
|
|
197
216
|
}
|
|
217
|
+
async applyToAllBuildingInspection(buildingInspectionId, context) {
|
|
218
|
+
const { user, tx } = context.state;
|
|
219
|
+
const buildingInspectionRepository = tx.getRepository(building_inspection_1.BuildingInspection);
|
|
220
|
+
const buildingInspection = await buildingInspectionRepository.findOne({
|
|
221
|
+
where: { id: buildingInspectionId },
|
|
222
|
+
relations: ['buildingLevel', 'buildingLevel.building', 'checklist', 'checklist.checklistItems']
|
|
223
|
+
});
|
|
224
|
+
const checklist = buildingInspection.checklist;
|
|
225
|
+
const checklistItems = checklist.checklistItems;
|
|
226
|
+
const buildingLevels = await (0, shell_1.getRepository)(building_complex_1.BuildingLevel).find({
|
|
227
|
+
where: { building: { id: buildingInspection.buildingLevel.building.id } }
|
|
228
|
+
});
|
|
229
|
+
// 해당 검측 정보가 속한 동의 모든 층에 같은 검측 데이터 등록
|
|
230
|
+
for (let buildingLevel of buildingLevels) {
|
|
231
|
+
// 같은 셀에 이미 검측 정보가 있으면 패스
|
|
232
|
+
const existInspection = await buildingInspectionRepository.findOneBy({
|
|
233
|
+
buildingLevel: { id: buildingLevel.id },
|
|
234
|
+
cellX: buildingInspection.cellX,
|
|
235
|
+
cellY: buildingInspection.cellY
|
|
236
|
+
});
|
|
237
|
+
if (existInspection)
|
|
238
|
+
continue;
|
|
239
|
+
// 새로운 체크리스트 데이터
|
|
240
|
+
const newChecklist = {
|
|
241
|
+
name: checklist.name,
|
|
242
|
+
location: `${buildingInspection.buildingLevel.building.name} ${buildingLevel.floor}층`,
|
|
243
|
+
constructionType: checklist.constructionType,
|
|
244
|
+
constructionDetailType: checklist.constructionDetailType,
|
|
245
|
+
inspectionDrawingType: checklist.inspectionDrawingType,
|
|
246
|
+
inspectionParts: checklist.inspectionParts
|
|
247
|
+
};
|
|
248
|
+
// 새로운 체크리스트 아이템 데이터
|
|
249
|
+
const newChecklistItems = checklistItems.map(item => ({
|
|
250
|
+
name: item.name,
|
|
251
|
+
mainType: item.mainType,
|
|
252
|
+
detailType: item.detailType,
|
|
253
|
+
inspctionCriteria: item.inspctionCriteria
|
|
254
|
+
}));
|
|
255
|
+
await this.createBuildingInspection({
|
|
256
|
+
buildingLevelId: buildingLevel.id,
|
|
257
|
+
checklist: newChecklist,
|
|
258
|
+
checklistItem: newChecklistItems,
|
|
259
|
+
cellX: buildingInspection.cellX,
|
|
260
|
+
cellY: buildingInspection.cellY,
|
|
261
|
+
managerId: buildingInspection.managerId
|
|
262
|
+
}, context);
|
|
263
|
+
}
|
|
264
|
+
return true;
|
|
265
|
+
}
|
|
198
266
|
async getRecentDocumentNoByBuildingLevelId(buildingLevelId) {
|
|
199
267
|
var _a, _b;
|
|
200
268
|
const buildingLevel = await (0, shell_1.getRepository)(building_complex_1.BuildingLevel).findOne({
|
|
@@ -216,6 +284,7 @@ let BuildingInspectionMutation = class BuildingInspectionMutation {
|
|
|
216
284
|
return `${buildingName}-${floorName}-${documentNo}`;
|
|
217
285
|
}
|
|
218
286
|
};
|
|
287
|
+
exports.BuildingInspectionMutation = BuildingInspectionMutation;
|
|
219
288
|
tslib_1.__decorate([
|
|
220
289
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
221
290
|
(0, type_graphql_1.Mutation)(returns => building_inspection_1.BuildingInspection, { description: 'To create Building Inspection information' }),
|
|
@@ -252,8 +321,16 @@ tslib_1.__decorate([
|
|
|
252
321
|
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
|
253
322
|
tslib_1.__metadata("design:returntype", Promise)
|
|
254
323
|
], BuildingInspectionMutation.prototype, "deleteBuildingInspections", null);
|
|
255
|
-
|
|
324
|
+
tslib_1.__decorate([
|
|
325
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
326
|
+
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To apply to all building inspection' }),
|
|
327
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('buildingInspectionId')),
|
|
328
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
329
|
+
tslib_1.__metadata("design:type", Function),
|
|
330
|
+
tslib_1.__metadata("design:paramtypes", [String, Object]),
|
|
331
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
332
|
+
], BuildingInspectionMutation.prototype, "applyToAllBuildingInspection", null);
|
|
333
|
+
exports.BuildingInspectionMutation = BuildingInspectionMutation = tslib_1.__decorate([
|
|
256
334
|
(0, type_graphql_1.Resolver)(building_inspection_1.BuildingInspection)
|
|
257
335
|
], BuildingInspectionMutation);
|
|
258
|
-
exports.BuildingInspectionMutation = BuildingInspectionMutation;
|
|
259
336
|
//# sourceMappingURL=building-inspection-mutation.js.map
|