@simitgroup/simpleapp-generator 1.6.7-o-alpha → 2.0.0-a-alpha
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/ReleaseNote.md +4 -0
- package/dist/buildinschemas/autoincreament.js +1 -1
- package/dist/buildinschemas/branch.d.ts.map +1 -1
- package/dist/buildinschemas/branch.js +2 -0
- package/dist/buildinschemas/branch.js.map +1 -1
- package/dist/buildinschemas/docnoformat.js +1 -1
- package/dist/buildinschemas/docnoformat.js.map +1 -1
- package/dist/buildinschemas/documentevent.js +1 -1
- package/dist/buildinschemas/documentnoformat.d.ts +3 -0
- package/dist/buildinschemas/documentnoformat.d.ts.map +1 -0
- package/dist/buildinschemas/documentnoformat.js +58 -0
- package/dist/buildinschemas/documentnoformat.js.map +1 -0
- package/dist/buildinschemas/index.d.ts +0 -5
- package/dist/buildinschemas/index.d.ts.map +1 -1
- package/dist/buildinschemas/index.js +5 -11
- package/dist/buildinschemas/index.js.map +1 -1
- package/dist/buildinschemas/organization.d.ts.map +1 -1
- package/dist/buildinschemas/organization.js +3 -19
- package/dist/buildinschemas/organization.js.map +1 -1
- package/dist/buildinschemas/user.d.ts.map +1 -1
- package/dist/buildinschemas/user.js +5 -2
- package/dist/buildinschemas/user.js.map +1 -1
- package/dist/generate.d.ts.map +1 -1
- package/dist/generate.js +118 -23
- package/dist/generate.js.map +1 -1
- package/dist/type.d.ts +6 -0
- package/dist/type.d.ts.map +1 -1
- package/dist/type.js.map +1 -1
- package/package.json +1 -1
- package/src/buildinschemas/{autoincreament.ts → autoincreament.ts.backup} +1 -1
- package/src/buildinschemas/branch.ts +2 -0
- package/src/buildinschemas/{documentevent.ts → documentevent.ts.backup} +1 -1
- package/src/buildinschemas/{docnoformat.ts → documentnoformat.ts.backup} +3 -3
- package/src/buildinschemas/index.ts +4 -5
- package/src/buildinschemas/organization.ts +3 -19
- package/src/buildinschemas/user.ts +5 -2
- package/src/generate.ts +128 -28
- package/src/type.ts +6 -1
- package/templates/basic/nest/api.controller.ts.eta +153 -0
- package/templates/basic/nest/api.module.ts.eta +32 -0
- package/templates/basic/nest/api.resolver.ts.eta +94 -0
- package/templates/basic/nest/api.schema.ts.eta +20 -0
- package/templates/basic/nest/api.service.ts.eta +85 -0
- package/templates/basic/nest/controller.ts.eta +18 -119
- package/templates/basic/nest/default.ts.eta +16 -10
- package/templates/basic/nest/enum.ts.eta +16 -0
- package/templates/basic/nest/model.ts.eta +6 -28
- package/templates/basic/nest/module.ts.eta +25 -0
- package/templates/basic/nest/resolver.ts.eta +12 -56
- package/templates/basic/nest/schema.ts.eta +133 -0
- package/templates/basic/nest/service.ts.eta +82 -73
- package/templates/basic/nest/service.ts.eta-backup +50 -0
- package/templates/basic/nuxt/default.ts.eta +10 -8
- package/templates/basic/nuxt/pages.[id].vue.eta +2 -2
- package/templates/basic/nuxt/pages.form.vue.eta +2 -2
- package/templates/basic/nuxt/pages.viewer.vue.eta +2 -2
- package/templates/basic/nuxt/simpleapp.doc.ts.eta +1 -1
- package/templates/basic/nuxt/simpleapp.generate.client.ts.eta +7 -5
- package/templates/nest/src/app.module.ts._eta +53 -69
- package/templates/nest/src/main.ts._eta +1 -1
- package/templates/nest/src/simple-app/.core/features/auth/api-key/api-key.service.ts.eta +29 -0
- package/templates/nest/src/simple-app/.core/features/auth/api-key/api-key.type.ts.eta +5 -0
- package/templates/nest/src/simple-app/.core/features/auth/api-key/validators/interface.ts.eta +7 -0
- package/templates/nest/src/simple-app/.core/features/auth/api-key/validators/mini-api-key.validator.ts.eta +30 -0
- package/templates/nest/src/simple-app/.core/features/auth/api-key/validators/static-api-key.validator.ts.eta +27 -0
- package/templates/nest/src/simple-app/.core/features/auth/auth.module.ts.eta +9 -0
- package/templates/nest/src/{simpleapp/generate/commons/roles → simple-app/.core/features/auth/role-guard}/roles.enum.ts.eta +7 -7
- package/templates/nest/src/{simpleapp/generate/commons/roles → simple-app/.core/features/auth/role-guard}/roles.guard.ts.eta +1 -1
- package/templates/nest/src/simple-app/.core/features/auto-increament/auto-increament.model.ts.eta +10 -0
- package/templates/nest/src/simple-app/.core/features/auto-increament/auto-increament.module.ts.eta +18 -0
- package/templates/nest/src/simple-app/.core/features/auto-increament/auto-increament.schema.ts.eta +119 -0
- package/templates/nest/src/simple-app/.core/features/auto-increament/auto-increament.service.ts.eta +65 -0
- package/templates/nest/src/simple-app/.core/features/cron/base/cron.base.ts.eta +13 -0
- package/templates/nest/src/simple-app/.core/features/cron/cron-system/cron-system.module.ts.eta +17 -0
- package/templates/nest/src/simple-app/.core/features/cron/cron-system/cron-system.service.ts.eta +37 -0
- package/templates/nest/src/simple-app/.core/features/cron/cron-system/schemas/index.ts.eta +2 -0
- package/templates/nest/src/simple-app/.core/features/cron/cron.module.ts.eta +10 -0
- package/templates/nest/src/simple-app/.core/features/document-no-format/document-no-format.controller.ts.eta +31 -0
- package/templates/nest/src/simple-app/.core/features/document-no-format/document-no-format.model.ts.eta +15 -0
- package/templates/nest/src/simple-app/.core/features/document-no-format/document-no-format.module.ts.eta +12 -0
- package/templates/nest/src/simple-app/.core/features/document-no-format/document-no-format.schema.ts.eta +162 -0
- package/templates/nest/src/simple-app/.core/features/document-no-format/document-no-format.service.ts.eta +189 -0
- package/templates/nest/src/simple-app/.core/features/event/event.module.ts.eta +9 -0
- package/templates/nest/src/simple-app/.core/features/event/event.type.ts.eta +23 -0
- package/templates/nest/src/simple-app/.core/features/event/interface/event-after-create.interface.ts.eta +5 -0
- package/templates/nest/src/simple-app/.core/features/event/interface/event-after-delete.interface.ts.eta +5 -0
- package/templates/nest/src/simple-app/.core/features/event/interface/event-after-set-status.interface.ts.eta +5 -0
- package/templates/nest/src/simple-app/.core/features/event/interface/event-after-update.interface.ts.eta +5 -0
- package/templates/nest/src/simple-app/.core/features/event/interface/event-before-create.interface.ts.eta +5 -0
- package/templates/nest/src/simple-app/.core/features/event/interface/event-before-delete.interface.ts.eta +5 -0
- package/templates/nest/src/simple-app/.core/features/event/interface/event-before-set-status.interface.ts.eta +5 -0
- package/templates/nest/src/simple-app/.core/features/event/interface/event-before-update.interface.ts.eta +5 -0
- package/templates/nest/src/simple-app/.core/features/event/interface/index.ts.eta +8 -0
- package/templates/nest/src/simple-app/.core/features/foreign-key/foreign-key.module.ts.eta +16 -0
- package/templates/nest/src/simple-app/.core/features/log/log.module.ts.eta +20 -0
- package/templates/nest/src/simple-app/.core/features/log/log.service.ts.eta +68 -0
- package/templates/nest/src/simple-app/.core/features/log/schemas/api-event.schema.ts.eta +57 -0
- package/templates/nest/src/simple-app/.core/features/log/schemas/document-event.schema.ts.eta +87 -0
- package/templates/nest/src/simple-app/.core/features/log/schemas/index.ts.eta +2 -0
- package/templates/nest/src/simple-app/.core/features/maintenance/maintenance.controller.ts.eta +84 -0
- package/templates/nest/src/simple-app/.core/features/maintenance/maintenance.module.ts.eta +19 -0
- package/templates/nest/src/simple-app/.core/features/maintenance/maintenance.service.ts.eta +86 -0
- package/templates/nest/src/simple-app/.core/features/maintenance/schemas/environment.ts.eta +23 -0
- package/templates/nest/src/{simpleapp/maintenance/apischemas → simple-app/.core/features/maintenance/schemas}/index.ts.eta +1 -1
- package/templates/nest/src/simple-app/.core/features/mini-app/developer-portal/developer-portal-bridge.service.ts.eta.eta +31 -0
- package/templates/nest/src/simple-app/.core/features/mini-app/developer-portal/developer-portal-env-development.service.ts.eta +124 -0
- package/templates/nest/src/simple-app/.core/features/mini-app/developer-portal/developer-portal-env-production.service.ts.eta +50 -0
- package/templates/nest/src/simple-app/.core/features/mini-app/developer-portal/developer-portal.controller.ts.eta +41 -0
- package/templates/nest/src/simple-app/.core/features/mini-app/developer-portal/developer-portal.schema.ts.eta +18 -0
- package/templates/nest/src/simple-app/.core/features/mini-app/developer-portal/developer-portal.service.ts.eta +94 -0
- package/templates/nest/src/simple-app/.core/features/mini-app/developer-portal/dto/developer-portal-create-app.dto.ts.eta +22 -0
- package/templates/nest/src/simple-app/.core/features/mini-app/developer-portal/dto/developer-portal-publish-app.dto.ts.eta +0 -0
- package/templates/nest/src/simple-app/.core/features/mini-app/dto/imports.ts.eta +2 -0
- package/templates/nest/src/simple-app/.core/features/mini-app/dto/index.ts.eta +2 -0
- package/templates/nest/src/simple-app/.core/features/mini-app/dto/mini-app.ts.eta +55 -0
- package/templates/nest/src/simple-app/.core/features/mini-app/mini-app-manager/mini-app-manager-bridge.service.ts.eta +162 -0
- package/templates/nest/src/simple-app/.core/features/mini-app/mini-app-manager/mini-app-manager-env-development.service.ts.eta +140 -0
- package/templates/nest/src/simple-app/.core/features/mini-app/mini-app-manager/mini-app-manager-env-production.service.ts.eta +125 -0
- package/templates/nest/src/simple-app/.core/features/mini-app/mini-app-manager/mini-app-manager-policy.service.ts.eta +43 -0
- package/templates/nest/src/simple-app/.core/features/mini-app/mini-app-manager/mini-app-manager.controller.ts.eta +81 -0
- package/templates/nest/src/simple-app/.core/features/mini-app/mini-app-manager/mini-app-manager.enum.ts.eta +5 -0
- package/templates/nest/src/simple-app/.core/features/mini-app/mini-app-manager/mini-app-manager.error.ts.eta +24 -0
- package/templates/nest/src/simple-app/.core/features/mini-app/mini-app-manager/mini-app-manager.processor.ts.eta +309 -0
- package/templates/nest/src/simple-app/.core/features/mini-app/mini-app-manager/mini-app-manager.service.ts.eta +346 -0
- package/templates/nest/src/simple-app/.core/features/mini-app/mini-app-scope/mini-app-scope.decorator.ts.eta +5 -0
- package/templates/nest/src/simple-app/.core/features/mini-app/mini-app-scope/mini-app-scope.guard.ts.eta +43 -0
- package/templates/nest/src/simple-app/.core/features/mini-app/mini-app-scope/mini-app-scope.service.ts.eta +101 -0
- package/templates/nest/src/simple-app/.core/features/mini-app/mini-app.module.ts.eta +24 -0
- package/templates/nest/src/simple-app/.core/features/mini-app/types/miniApp.ts.eta +23 -0
- package/templates/nest/src/simple-app/.core/features/mini-app/utils/mini-app.util.ts.eta +26 -0
- package/templates/nest/src/simple-app/.core/features/policy/policy.module.ts.eta +12 -0
- package/templates/nest/src/simple-app/.core/features/policy/policy.service.ts.eta +45 -0
- package/templates/nest/src/{simpleapp/profile/profile.controller.ts._eta → simple-app/.core/features/profile/profile.controller.ts.eta} +37 -83
- package/templates/nest/src/simple-app/.core/features/profile/profile.module.ts.eta +22 -0
- package/templates/nest/src/simple-app/.core/features/profile/profile.schema.ts.eta +165 -0
- package/templates/nest/src/{simpleapp/profile/profile.service.ts._eta → simple-app/.core/features/profile/profile.service.ts.eta} +36 -48
- package/templates/nest/src/simple-app/.core/features/queue/queue-base/queue-base.consumer.ts.eta +196 -0
- package/templates/nest/src/simple-app/.core/features/queue/queue-base/queue-base.producer.ts.eta +147 -0
- package/templates/nest/src/simple-app/.core/features/queue/queue-user-context/queue-user-context.service.ts.eta +35 -0
- package/templates/nest/src/simple-app/.core/features/queue/queue.module.ts.eta +24 -0
- package/templates/nest/src/simple-app/.core/features/queue/queue.type.ts.eta +75 -0
- package/templates/nest/src/simple-app/.core/features/simple-app-core-features.module.ts.eta +51 -0
- package/templates/nest/src/{simpleapp/generate/commons/robotuser.service.ts.eta → simple-app/.core/features/user-context/robot-user.service.ts.eta} +27 -16
- package/templates/nest/src/simple-app/.core/features/user-context/user-context.module.ts.eta +24 -0
- package/templates/nest/src/simple-app/.core/features/user-context/user-context.type.ts.eta +15 -0
- package/templates/nest/src/{simpleapp/generate/commons → simple-app/.core/features/user-context}/user.context.ts.eta +469 -449
- package/templates/nest/src/{simpleapp/generate/commons/runwebhook.service.ts.eta → simple-app/.core/features/webhook/run-webhook.service.ts.eta} +7 -11
- package/templates/nest/src/simple-app/.core/features/webhook/schemas/index.ts.eta +2 -0
- package/templates/nest/src/simple-app/.core/features/webhook/schemas/webhook-log.schema.ts.eta +116 -0
- package/templates/nest/src/simple-app/.core/features/webhook/schemas/webhook.schema.ts.eta +177 -0
- package/templates/nest/src/simple-app/.core/features/webhook/webhook.module.ts.eta +20 -0
- package/templates/nest/src/{simpleapp/generate/controllers/simpleapp.controller.ts.eta → simple-app/.core/framework/base/simple-app.controller.ts.eta} +13 -35
- package/templates/nest/src/{simpleapp/generate/processors/simpleapp.processor.ts.eta → simple-app/.core/framework/base/simple-app.service.ts.eta} +239 -139
- package/templates/nest/src/simple-app/.core/framework/custom-exception.ts.eta +26 -0
- package/templates/nest/src/simple-app/.core/framework/framework.module.ts.eta +12 -0
- package/templates/nest/src/simple-app/.core/framework/schemas/index.ts.eta +3 -0
- package/templates/nest/src/simple-app/.core/framework/schemas/others.schema.ts.eta +153 -0
- package/templates/nest/src/simple-app/.core/framework/schemas/simple-app.schema.ts.eta +172 -0
- package/templates/nest/src/{simpleapp/generate/commons/interceptors/response.interceptor.ts.eta → simple-app/.core/framework/simple-app.interceptor.ts.eta} +12 -22
- package/templates/nest/src/{simpleapp/generate/commons/middlewares/tenant.middleware.ts.eta → simple-app/.core/framework/simple-app.middleware.ts.eta} +28 -26
- package/templates/nest/src/simple-app/.core/readme.md.eta +3 -0
- package/templates/nest/src/simple-app/.core/resources/core-resources.module.ts.eta +38 -0
- package/templates/nest/src/simple-app/.core/simple-app-core.module.ts.eta +18 -0
- package/templates/nest/src/simple-app/.core/utils/dayjs.ts.eta +47 -0
- package/templates/nest/src/simple-app/.core/utils/locale-tool.ts.eta +11 -0
- package/templates/nest/src/simple-app/.core/utils/string-utils.ts.eta +1 -0
- package/templates/nest/src/simple-app/.resources/readme.md.eta +3 -0
- package/templates/nest/src/simple-app/.resources/resources.module.ts.eta +36 -0
- package/templates/nest/src/simple-app/apis/readme.md.eta +9 -0
- package/templates/nest/src/simple-app/apis/resource-api.module.ts.eta +37 -0
- package/templates/nest/src/simple-app/events/branch-event/branch-event.module.ts._eta +20 -0
- package/templates/nest/src/simple-app/events/branch-event/branch-event.service.ts._eta +43 -0
- package/templates/nest/src/simple-app/events/branch-event/branch-event.type.ts._eta +7 -0
- package/templates/nest/src/simple-app/events/events.module.ts._eta +17 -0
- package/templates/nest/src/simple-app/events/organization-event/organization-event.module.ts._eta +13 -0
- package/templates/nest/src/simple-app/events/organization-event/organization-event.service.ts._eta +52 -0
- package/templates/nest/src/simple-app/events/organization-event/organization-event.type.ts._eta +1 -0
- package/templates/nest/src/simple-app/events/permission-event/permission-event.module.ts.eta +11 -0
- package/templates/nest/src/simple-app/events/permission-event/permission-event.service.ts.eta +33 -0
- package/templates/nest/src/simple-app/events/permission-event/permission-event.type.ts.eta +1 -0
- package/templates/nest/src/simple-app/events/readme.md.eta +76 -0
- package/templates/nest/src/simple-app/events/tenant-event/tenant-event.module.ts_eta +12 -0
- package/templates/nest/src/simple-app/events/tenant-event/tenant-event.service.ts_eta +30 -0
- package/templates/nest/src/simple-app/events/tenant-event/tenant-event.type.ts_eta +1 -0
- package/templates/nest/src/{simpleapp/additional.module.ts._eta → simple-app/features/features.module.ts._eta} +8 -7
- package/templates/nest/src/{printapi/printapi.module.ts.eta → simple-app/features/print/print.module.ts.eta} +4 -4
- package/templates/nest/src/{printapi/printapi.service.ts.eta → simple-app/features/print/print.service.ts.eta} +7 -7
- package/templates/nest/src/simple-app/features/readme.md._eta +6 -0
- package/templates/nest/src/simple-app/simple-app.module.ts.eta +32 -0
- package/templates/nuxt/.env._eta +2 -0
- package/templates/nuxt/app.vue.eta +15 -7
- package/templates/nuxt/components/header/HeaderSelectBranch.vue.eta +2 -1
- package/templates/nuxt/components/image/ImageAvatar.vue._eta +63 -0
- package/templates/nuxt/components/image/ImageOrganization.vue._eta +77 -0
- package/templates/nuxt/components/simpleApp/SimpleAppForm.vue.eta +1 -1
- package/templates/nuxt/components/simpleApp/SimpleAppFormToolBar.vue._eta +95 -20
- package/templates/nuxt/components/user/UserButtonCreateTenant.vue._eta +20 -21
- package/templates/nuxt/components/user/UserTenantPicker.vue._eta +1 -1
- package/templates/nuxt/composables/docformat.generate.ts.eta +4 -2
- package/templates/nuxt/enums/enums.generate.ts.eta +1 -1
- package/templates/nuxt/middleware/30.acl.global.ts.eta +6 -6
- package/templates/nuxt/nuxt.config.ts._eta +1 -0
- package/templates/nuxt/pages/login.vue._eta +21 -15
- package/templates/nuxt/pages/profile.vue._eta +24 -32
- package/templates/nuxt/plugins/20.simpleapp-userstore.ts.eta +31 -24
- package/templates/nuxt/plugins/50.simpleapp-client.ts.eta +2 -2
- package/templates/nuxt/providers/my-provider.ts.eta +5 -6
- package/templates/nuxt/simpleapp/generate/clients/SimpleAppClient.ts.eta +1 -0
- package/templates/nuxt/simpleapp/generate/defaults/index.ts.eta +1 -1
- package/templates/nuxt/simpleapp/generate/types/index.ts.eta +1 -1
- package/templates/nuxt/types/schema.ts.eta +1 -0
- package/templates/nuxt/types/user.ts.eta +39 -38
- package/templates/project/build.sh.eta +2 -2
- package/templates/basic/nest/apischema.ts.eta +0 -96
- package/templates/basic/nest/processor.ts.eta +0 -86
- package/templates/nest/src/cloudapi/cloudapi.module.ts._eta +0 -15
- package/templates/nest/src/cloudapi/cloudapi.service.ts._eta +0 -15
- package/templates/nest/src/enums/enums.generate.ts.eta +0 -23
- package/templates/nest/src/simpleapp/apischemas/index.ts._eta +0 -85
- package/templates/nest/src/simpleapp/generate/apischemas/index.ts.eta +0 -15
- package/templates/nest/src/simpleapp/generate/apischemas/simpleapp.apischema.ts.eta +0 -62
- package/templates/nest/src/simpleapp/generate/commons/audittrail.service.ts.eta +0 -52
- package/templates/nest/src/simpleapp/generate/commons/customkeycloa.guard.ts.eta +0 -45
- package/templates/nest/src/simpleapp/generate/commons/docnogenerator.service.ts.eta +0 -129
- package/templates/nest/src/simpleapp/generate/commons/providers/workflow.provider.ts.etax +0 -87
- package/templates/nest/src/simpleapp/generate/jsonschemas/index.ts.eta +0 -11
- package/templates/nest/src/simpleapp/generate/models/apievent.model.ts.eta +0 -27
- package/templates/nest/src/simpleapp/generate/processors/autoinc.processor.ts.eta +0 -88
- package/templates/nest/src/simpleapp/generate/processors/branch.processor.ts.eta +0 -110
- package/templates/nest/src/simpleapp/generate/processors/docno.processor.ts.eta +0 -77
- package/templates/nest/src/simpleapp/generate/processors/org.processor.ts.eta +0 -110
- package/templates/nest/src/simpleapp/generate/processors/perm.processor.ts.eta +0 -71
- package/templates/nest/src/simpleapp/generate/processors/sysmsg.processor.ts.eta +0 -49
- package/templates/nest/src/simpleapp/generate/processors/tenant.processor.ts.eta +0 -52
- package/templates/nest/src/simpleapp/generate/processors/webhooklog.processor.ts.eta +0 -45
- package/templates/nest/src/simpleapp/generate/types/index.ts.eta +0 -7
- package/templates/nest/src/simpleapp/generate/types/schema.type.ts.eta +0 -193
- package/templates/nest/src/simpleapp/generate/types/simpleapp.type.ts.eta +0 -299
- package/templates/nest/src/simpleapp/generate/types/workflow.type.ts.eta +0 -15
- package/templates/nest/src/simpleapp/generate/workflow/formschema/SimpleApproveReject.ts.eta +0 -8
- package/templates/nest/src/simpleapp/generate/workflow/formschema/index.ts.eta +0 -7
- package/templates/nest/src/simpleapp/generate/workflow/workflow.apischema.ts.eta +0 -136
- package/templates/nest/src/simpleapp/generate/workflow/workflow.config.ts.eta +0 -79
- package/templates/nest/src/simpleapp/generate/workflow/workflow.controller.ts.eta +0 -414
- package/templates/nest/src/simpleapp/generate/workflow/workflow.delegate.ts.eta +0 -201
- package/templates/nest/src/simpleapp/generate/workflow/workflow.service.ts.eta +0 -641
- package/templates/nest/src/simpleapp/generate/workflow/workflow.type.ts.eta +0 -98
- package/templates/nest/src/simpleapp/generate/workflow/workflow.userservice.ts.eta +0 -83
- package/templates/nest/src/simpleapp/maintenance/apischemas/environment.ts.eta +0 -11
- package/templates/nest/src/simpleapp/maintenance/maintenance.controller.ts.eta +0 -72
- package/templates/nest/src/simpleapp/maintenance/maintenance.service.ts.eta +0 -88
- package/templates/nest/src/simpleapp/maintenance/models/environment.model.ts.eta +0 -16
- package/templates/nest/src/simpleapp/profile/profile.apischema.ts._eta +0 -95
- package/templates/nest/src/simpleapp/resolvers/readme.md.eta +0 -1
- package/templates/nest/src/simpleapp/services/autoinc.service.ts.etaxx +0 -59
- package/templates/nest/src/simpleapp/services/branch.service.ts.etaxxx +0 -83
- package/templates/nest/src/simpleapp/services/docno.service.ts.etaxxx +0 -59
- package/templates/nest/src/simpleapp/services/org.service.ts.etaxxx +0 -37
- package/templates/nest/src/simpleapp/services/perm.service.ts.etaxxx +0 -56
- package/templates/nest/src/simpleapp/services/sysmsg.service.ts._etaxxx +0 -43
- package/templates/nest/src/simpleapp/services/tenant.service.ts.etaxxx +0 -38
- package/templates/nest/src/simpleapp/services/user.service.ts.eta.old +0 -118
- package/templates/nest/src/simpleapp/services/userresolver.service.ts._eta +0 -67
- package/templates/nest/src/simpleapp/services/webhook.service.ts._eta +0 -37
- package/templates/nest/src/simpleapp/simpleapp.module.ts.eta +0 -85
- package/templates/nest/src/simpleapp/types/index.ts._eta +0 -45
- package/templates/nest/src/simpleapp/webhooks/branch.ts._eta +0 -44
- package/templates/nest/src/simpleapp/webhooks/index.ts._eta +0 -21
- package/templates/nest/src/simpleapp/workflows/bpmn/readme.md._eta +0 -1
- package/templates/nest/src/simpleapp/workflows/listeners/simpleapp.listener.ts.eta +0 -31
- package/templates/nest/src/simpleapp/workflows/readme.md._eta +0 -1
- package/templates/nuxt/components/image/ImageAvatar.vue.eta +0 -56
- package/templates/nuxt/components/image/ImageOrganization.vue.eta +0 -66
- /package/src/buildinschemas/{webhook.ts → webhook.ts.backup} +0 -0
- /package/src/buildinschemas/{webhooklog.ts → webhooklog.ts.backup} +0 -0
- /package/templates/basic/nest/{type.ts.eta → type.ts.eta-backup} +0 -0
- /package/templates/nest/src/{simpleapp/generate/commons/customkeycloak.guard.ts.eta → simple-app/.core/features/auth/keycloak/keycloak.guard.ts.eta} +0 -0
- /package/templates/nest/src/{simpleapp/generate/commons/roles → simple-app/.core/features/auth/role-guard}/roles.decorator.ts.eta +0 -0
- /package/templates/nest/src/{simpleapp/generate/commons/roles → simple-app/.core/features/auth/role-guard}/roles.group.ts.eta +0 -0
- /package/templates/nest/src/{simpleapp/generate/commons/dicts/documents.ts.eta → simple-app/.core/features/document-no-format/document.dict.ts.eta} +0 -0
- /package/templates/nest/src/{simpleapp/generate/commons/dicts/foreignkeys.ts.eta → simple-app/.core/features/foreign-key/foreignkeys.dict.ts.eta} +0 -0
- /package/templates/nest/src/{simpleapp/maintenance/dbupdate → simple-app/.core/features/maintenance/db-update}/1.00.00/index.ts._eta +0 -0
- /package/templates/nest/src/{simpleapp/maintenance/dbupdate → simple-app/.core/features/maintenance/db-update}/index.ts._eta +0 -0
- /package/templates/nest/src/{simpleapp/maintenance/apischemas/dbupdate.ts.eta → simple-app/.core/features/maintenance/schemas/db-update.ts.eta} +0 -0
- /package/templates/nest/src/{simpleapp/profile/profile.types.ts.eta → simple-app/.core/features/profile/profile.types.ts.eta-backup} +0 -0
- /package/templates/nest/src/{simpleapp/generate/commons/decorators → simple-app/.core/features/user-context}/appuser.decorator.ts.eta +0 -0
- /package/templates/nest/src/{simpleapp/generate/commons/exceptions/SimpleAppExceptionFilter.ts.eta → simple-app/.core/framework/exception-filter.ts.eta} +0 -0
- /package/templates/nest/src/{simpleapp/generate/commons → simple-app/.core/utils}/encryption.static.ts.eta +0 -0
- /package/templates/nest/src/{simpleapp → simple-app}/.gitignore.eta +0 -0
- /package/templates/nest/src/{printapi → simple-app/features/print}/api/.gitignore.eta +0 -0
- /package/templates/nest/src/{printapi → simple-app/features/print}/api/.npmignore.eta +0 -0
- /package/templates/nest/src/{printapi → simple-app/features/print}/api/.openapi-generator/FILES.eta +0 -0
- /package/templates/nest/src/{printapi → simple-app/features/print}/api/.openapi-generator/VERSION.eta +0 -0
- /package/templates/nest/src/{printapi → simple-app/features/print}/api/.openapi-generator-ignore.eta +0 -0
- /package/templates/nest/src/{printapi → simple-app/features/print}/api/api.ts.eta +0 -0
- /package/templates/nest/src/{printapi → simple-app/features/print}/api/base.ts.eta +0 -0
- /package/templates/nest/src/{printapi → simple-app/features/print}/api/common.ts.eta +0 -0
- /package/templates/nest/src/{printapi → simple-app/features/print}/api/configuration.ts.eta +0 -0
- /package/templates/nest/src/{printapi → simple-app/features/print}/api/git_push.sh.eta +0 -0
- /package/templates/nest/src/{printapi → simple-app/features/print}/api/index.ts.eta +0 -0
- /package/templates/nest/src/{printapi → simple-app/features/print}/api/openapitools.json.eta +0 -0
- /package/templates/project/{sharelibs → share-libs}/hello.ts._eta +0 -0
- /package/templates/project/{sharelibs → share-libs}/index.ts.eta +0 -0
- /package/templates/project/{sharelibs → share-libs}/money.ts.eta +0 -0
- /package/templates/project/{sharelibs → share-libs}/validate.ts.eta +0 -0
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file was automatically generated by simpleapp generator. Every
|
|
3
|
-
* MODIFICATION OVERRIDE BY GENERATEOR
|
|
4
|
-
* last change 2024-02-23
|
|
5
|
-
* Author: Ks Tan
|
|
6
|
-
*/
|
|
7
|
-
import { UserContext } from '../commons/user.context';
|
|
8
|
-
|
|
9
|
-
export type WorkflowSettingApiSchema = {
|
|
10
|
-
userServiceUrl: string;
|
|
11
|
-
callBackUrl?: string;
|
|
12
|
-
assignee?: string|string[];
|
|
13
|
-
candidateGroups?: string | string[];
|
|
14
|
-
candidateUsers?: string | string[];
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export type WorkflowDataApiSchema = {
|
|
18
|
-
data: any;
|
|
19
|
-
workflowSetting: WorkflowSettingApiSchema;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export type WorkflowTask = {
|
|
23
|
-
id: string;
|
|
24
|
-
name: string;
|
|
25
|
-
assignee: string;
|
|
26
|
-
candidateUsers: string[];
|
|
27
|
-
candidateGroups: string[];
|
|
28
|
-
type: string;
|
|
29
|
-
};
|
|
30
|
-
export type WorkflowProcess = {
|
|
31
|
-
id: string;
|
|
32
|
-
name: string;
|
|
33
|
-
status: string;
|
|
34
|
-
startedAt: string;
|
|
35
|
-
items: WorkflowTask[];
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export type UserTaskActors = {
|
|
39
|
-
assignee: string;
|
|
40
|
-
candidateUsers: string[];
|
|
41
|
-
candidateGroups: string[];
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
export type UserTaskType = {
|
|
45
|
-
id: string;
|
|
46
|
-
taskId: string;
|
|
47
|
-
elementId: string;
|
|
48
|
-
name: string;
|
|
49
|
-
processName: string;
|
|
50
|
-
assignee: string;
|
|
51
|
-
candidateUsers: string[];
|
|
52
|
-
candidateGroups: string[];
|
|
53
|
-
data: any;
|
|
54
|
-
vars: any;
|
|
55
|
-
startedAt: string;
|
|
56
|
-
followUpDate: string;
|
|
57
|
-
dueDate: string;
|
|
58
|
-
priority: string;
|
|
59
|
-
type: string;
|
|
60
|
-
userId: string;
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
export type UserTaskEventType = 'start' | 'wait' | 'invoked' | 'end' | 'assign';
|
|
64
|
-
export type UserTaskData = {
|
|
65
|
-
workflowName: string;
|
|
66
|
-
eventType: UserTaskEventType //assign = modify properties but not change state
|
|
67
|
-
elementType: 'bpmn:UserTask';
|
|
68
|
-
elementId: string;
|
|
69
|
-
elementName: string;
|
|
70
|
-
vars:any
|
|
71
|
-
elementProps: {
|
|
72
|
-
startedAt: string;
|
|
73
|
-
assignee?: string|string[];
|
|
74
|
-
candidateGroups?: string | string[];
|
|
75
|
-
candidateUsers?: string | string[];
|
|
76
|
-
dueDate?: string;
|
|
77
|
-
followUpDate?: string;
|
|
78
|
-
priority?: string;
|
|
79
|
-
formKey?: string;
|
|
80
|
-
};
|
|
81
|
-
data: any;
|
|
82
|
-
options: WorkflowOptions;
|
|
83
|
-
};
|
|
84
|
-
export type ServiceTaskEventType = 'start' | 'end';
|
|
85
|
-
export type WorkflowOptions = {
|
|
86
|
-
appuser: UserContext;
|
|
87
|
-
[key: string]: any;
|
|
88
|
-
};
|
|
89
|
-
export type ServiceTaskData = {
|
|
90
|
-
workflowName: string;
|
|
91
|
-
eventType: 'start' | 'end';
|
|
92
|
-
elementType: 'bpmn:ServiceTask';
|
|
93
|
-
elementId: string;
|
|
94
|
-
elementName: string;
|
|
95
|
-
data: any;
|
|
96
|
-
vars:any
|
|
97
|
-
options: WorkflowOptions;
|
|
98
|
-
};
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file was automatically generated by simpleapp generator. Every
|
|
3
|
-
* MODIFICATION OVERRIDE BY GENERATEOR
|
|
4
|
-
* last change 2024-02-23
|
|
5
|
-
* Author: Ks Tan
|
|
6
|
-
*/
|
|
7
|
-
import { Inject, Injectable } from '@nestjs/common';
|
|
8
|
-
import { IUserService, BPMNServer } from 'bpmn-server';
|
|
9
|
-
const mongoose = require('mongoose');
|
|
10
|
-
|
|
11
|
-
let myuserservice;
|
|
12
|
-
@Injectable()
|
|
13
|
-
export class WorkflowUserService implements IUserService {
|
|
14
|
-
static initialized = false;
|
|
15
|
-
server: BPMNServer;
|
|
16
|
-
constructor() {
|
|
17
|
-
// if (UserService.initialized)
|
|
18
|
-
// return;
|
|
19
|
-
|
|
20
|
-
// UserService.initialized = true;
|
|
21
|
-
setImmediate(() => {
|
|
22
|
-
this.init();
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
setServer(server: BPMNServer) {
|
|
26
|
-
this.server = server;
|
|
27
|
-
myuserservice = this;
|
|
28
|
-
return myuserservice;
|
|
29
|
-
// this.server =server
|
|
30
|
-
}
|
|
31
|
-
async findUsers(query) {
|
|
32
|
-
// return await User.find(query);
|
|
33
|
-
}
|
|
34
|
-
async findUser(query) {
|
|
35
|
-
// return await User.findOne(query);
|
|
36
|
-
}
|
|
37
|
-
async addUser(userName, email, password, userGroups) {
|
|
38
|
-
// let exist = await User.findOne({ userName: userName });
|
|
39
|
-
// if (exist) {
|
|
40
|
-
// console.log(`user '${userName}' already exists`);
|
|
41
|
-
// return exist;
|
|
42
|
-
}
|
|
43
|
-
// exist = await User.findOne({ email: email });
|
|
44
|
-
// if (exist) {
|
|
45
|
-
// console.log("user already exists with this email", email);
|
|
46
|
-
// return exist;
|
|
47
|
-
// }
|
|
48
|
-
|
|
49
|
-
// const user = new User({
|
|
50
|
-
// userName, email, password, userGroups
|
|
51
|
-
// });
|
|
52
|
-
|
|
53
|
-
// await user.save();
|
|
54
|
-
// return user;
|
|
55
|
-
// }
|
|
56
|
-
async setPassword(userName, password) {
|
|
57
|
-
// let user = await User.findOne({ userName });
|
|
58
|
-
// if (!user) {
|
|
59
|
-
// console.log("User does not exist")
|
|
60
|
-
// return;
|
|
61
|
-
// }
|
|
62
|
-
// user.password = password;
|
|
63
|
-
// await user.save();
|
|
64
|
-
}
|
|
65
|
-
async install() {
|
|
66
|
-
// console.log(` adding new User for 'admin' password: 'admin'`);
|
|
67
|
-
// //await this.init();
|
|
68
|
-
// await this.addUser('admin', 'admin@mySite.com', 'admin', ['ADMIN']);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
init() {
|
|
72
|
-
console.log('UserService.init()');
|
|
73
|
-
// dotenv.config();
|
|
74
|
-
// console.log("MongoDB URL", process.env.MONGO_DB_URL)
|
|
75
|
-
// mongoose.set('strictQuery', false);
|
|
76
|
-
// mongoose.connect(process.env.MONGO_DB_URL);
|
|
77
|
-
// mongoose.connection.on('error', (err) => {
|
|
78
|
-
// console.error(err);
|
|
79
|
-
// console.log('%s MongoDB connection error. Please make sure MongoDB is running.');
|
|
80
|
-
// process.exit();
|
|
81
|
-
// });
|
|
82
|
-
}
|
|
83
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file was automatically generated by simpleapp generator. Every
|
|
3
|
-
* MODIFICATION OVERRIDE BY GENERATEOR
|
|
4
|
-
* last change 2025-08-27
|
|
5
|
-
* Author: Ks Tan
|
|
6
|
-
*/
|
|
7
|
-
export class Environment {
|
|
8
|
-
systemEnable: boolean
|
|
9
|
-
stopUntil: string
|
|
10
|
-
maintenanceMessage: string
|
|
11
|
-
};
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file was automatically generated by simpleapp generator. Every
|
|
3
|
-
* MODIFICATION OVERRIDE BY GENERATEOR
|
|
4
|
-
* last change 2025-08-27
|
|
5
|
-
* Author: Ks Tan
|
|
6
|
-
*/
|
|
7
|
-
import { Controller, Get, Post, Param,Logger,HttpCode } from '@nestjs/common';
|
|
8
|
-
import { MaintenanceService } from './maintenance.service';
|
|
9
|
-
import { ApiTags, ApiBody, ApiResponse, ApiOperation, ApiQuery } from '@nestjs/swagger';
|
|
10
|
-
import { Roles } from 'src/simpleapp/generate/commons/roles/roles.decorator';
|
|
11
|
-
import { Role } from 'src/simpleapp/generate/commons/roles/roles.enum';
|
|
12
|
-
import * as schemas from './apischemas'
|
|
13
|
-
|
|
14
|
-
@ApiTags('maintenance')
|
|
15
|
-
@Controller('maintenance')
|
|
16
|
-
@Roles(Role.SuperAdmin)
|
|
17
|
-
export class MaintenanceController {
|
|
18
|
-
private logger = new Logger();
|
|
19
|
-
constructor(private readonly maintenanceSvc: MaintenanceService) {}
|
|
20
|
-
|
|
21
|
-
@Get('/get-updates')
|
|
22
|
-
@Roles(Role.SuperAdmin)
|
|
23
|
-
@ApiResponse({
|
|
24
|
-
status: 200,
|
|
25
|
-
description: 'Sample 200 response',
|
|
26
|
-
type: [schemas.UpgradeScript],
|
|
27
|
-
})
|
|
28
|
-
async getUpdate() {
|
|
29
|
-
const result = await this.maintenanceSvc.getUpdates();
|
|
30
|
-
return result
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
@Post('/run-updates/:id')
|
|
34
|
-
@HttpCode(200)
|
|
35
|
-
@Roles(Role.SuperAdmin)
|
|
36
|
-
@ApiResponse({
|
|
37
|
-
status: 200,
|
|
38
|
-
description: 'Sample 200 response',
|
|
39
|
-
type: [String],
|
|
40
|
-
})
|
|
41
|
-
async runUpdate(@Param('id') id:string) {
|
|
42
|
-
const result:string = await this.maintenanceSvc.runUpdates(id);
|
|
43
|
-
return result
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
@Post('/stop-service')
|
|
47
|
-
@HttpCode(200)
|
|
48
|
-
@Roles(Role.SuperAdmin)
|
|
49
|
-
@ApiResponse({
|
|
50
|
-
status: 200,
|
|
51
|
-
description: 'Sample 200 response',
|
|
52
|
-
type: [String],
|
|
53
|
-
})
|
|
54
|
-
async runStopService() {
|
|
55
|
-
const result:string = await this.maintenanceSvc.runStopService();
|
|
56
|
-
return result
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
@Post('/start-service')
|
|
60
|
-
@HttpCode(200)
|
|
61
|
-
@Roles(Role.SuperAdmin)
|
|
62
|
-
@ApiResponse({
|
|
63
|
-
status: 200,
|
|
64
|
-
description: 'Sample 200 response',
|
|
65
|
-
type: [String],
|
|
66
|
-
})
|
|
67
|
-
async runStartService() {
|
|
68
|
-
const result:string = await this.maintenanceSvc.runStartService();
|
|
69
|
-
return result
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file was automatically generated by simpleapp generator. Every
|
|
3
|
-
* MODIFICATION OVERRIDE BY GENERATEOR
|
|
4
|
-
* last change 2025-08-27
|
|
5
|
-
* Author: Ks Tan
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import { BadRequestException, Injectable, InternalServerErrorException } from '@nestjs/common';
|
|
9
|
-
import { Model } from 'mongoose';
|
|
10
|
-
import { InjectModel } from '@nestjs/mongoose';
|
|
11
|
-
import * as dbupdate from './dbupdate'
|
|
12
|
-
import * as schemas from './apischemas'
|
|
13
|
-
@Injectable()
|
|
14
|
-
export class MaintenanceService {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
constructor(@InjectModel('Environment') private sysEnvdoc: Model<schemas.Environment>) {
|
|
18
|
-
|
|
19
|
-
this.initEnv()
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
async initEnv(){
|
|
23
|
-
const res = await this.sysEnvdoc.find()
|
|
24
|
-
if(res.length==0){
|
|
25
|
-
const newdoc = new this.sysEnvdoc({
|
|
26
|
-
systemEnable:true
|
|
27
|
-
});
|
|
28
|
-
await newdoc.save()
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
async getUpdates() {
|
|
35
|
-
const keys = Object.keys(dbupdate)
|
|
36
|
-
const updatescripts:schemas.UpgradeScript[] = []
|
|
37
|
-
const key =keys[0]
|
|
38
|
-
// console.log(dbupdate[key]())
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
keys.forEach((k)=>{
|
|
42
|
-
const item = dbupdate[k]()
|
|
43
|
-
if(item.execute && item.subject){
|
|
44
|
-
updatescripts.push({
|
|
45
|
-
id: k,
|
|
46
|
-
subject:item.subject,
|
|
47
|
-
description: item.description
|
|
48
|
-
})
|
|
49
|
-
}
|
|
50
|
-
})
|
|
51
|
-
|
|
52
|
-
return Promise.resolve(updatescripts);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
async runUpdates(versionId:string) {
|
|
56
|
-
try{
|
|
57
|
-
if(dbupdate[versionId]){
|
|
58
|
-
const result = await dbupdate[versionId]().execute()
|
|
59
|
-
return Promise.resolve(result);
|
|
60
|
-
}else{
|
|
61
|
-
|
|
62
|
-
throw new BadRequestException(`invalid update script ${versionId}`)
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
}catch(e){
|
|
66
|
-
throw new InternalServerErrorException(`Error db update (${versionId}): ${e.message}`)
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
async runStopService(){
|
|
73
|
-
const res = await this.sysEnvdoc.find()
|
|
74
|
-
if(res.length>0){
|
|
75
|
-
res[0].systemEnable=false
|
|
76
|
-
res[0].save()
|
|
77
|
-
}
|
|
78
|
-
return Promise.resolve(`status: ${res[0].systemEnable}`)
|
|
79
|
-
}
|
|
80
|
-
async runStartService(){
|
|
81
|
-
const res = await this.sysEnvdoc.find()
|
|
82
|
-
if(res.length>0){
|
|
83
|
-
res[0].systemEnable=true
|
|
84
|
-
res[0].save()
|
|
85
|
-
}
|
|
86
|
-
return Promise.resolve(`status: ${res[0].systemEnable}`)
|
|
87
|
-
}
|
|
88
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file was automatically generated by simpleapp generator. Every
|
|
3
|
-
* MODIFICATION OVERRIDE BY GENERATEOR
|
|
4
|
-
* last change 2025-08-27
|
|
5
|
-
* Author: Ks Tan
|
|
6
|
-
*/
|
|
7
|
-
import { Schema } from 'mongoose';
|
|
8
|
-
// import { TenantClientSetting, TenantOwner, TenantOutstandingReminder, Tenant } from '../types/tenant.type';
|
|
9
|
-
const schemasetting = {
|
|
10
|
-
systemEnable: { type: Boolean},
|
|
11
|
-
stopUntil: { type: String },
|
|
12
|
-
maintenanceMessage: { type: String},
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export const EnvironmentMongoSchema = new Schema(schemasetting, { collection: 'environment' })
|
|
16
|
-
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file was automatically generated by simpleapp generator. Every
|
|
3
|
-
* --remove-this-line-to-prevent-override--
|
|
4
|
-
* last change 2024-02-23
|
|
5
|
-
* Author: Ks Tan
|
|
6
|
-
*/
|
|
7
|
-
import { ApiProperty } from '@nestjs/swagger';
|
|
8
|
-
import {ProfileUserInvites,ProfileUserBranch} from './profile.types'
|
|
9
|
-
export class RegTenantApiSchema {
|
|
10
|
-
@ApiProperty({
|
|
11
|
-
type: 'string',
|
|
12
|
-
required: true,
|
|
13
|
-
examples: ['my company 1'],
|
|
14
|
-
default: '',
|
|
15
|
-
})
|
|
16
|
-
tenantName: string;
|
|
17
|
-
@ApiProperty({
|
|
18
|
-
type: 'string',
|
|
19
|
-
required: true,
|
|
20
|
-
examples: ['Asia/Kuala_Lumpur'],
|
|
21
|
-
default: '',
|
|
22
|
-
})
|
|
23
|
-
timeZone: string;
|
|
24
|
-
@ApiProperty({
|
|
25
|
-
type: Number,
|
|
26
|
-
required: true,
|
|
27
|
-
examples: [0,-460],
|
|
28
|
-
|
|
29
|
-
})
|
|
30
|
-
utcOffset: number;
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
export class MyProfileApiSchemaBranches{
|
|
34
|
-
@ApiProperty({type: 'string'})
|
|
35
|
-
_id: '1231231';
|
|
36
|
-
@ApiProperty({type: 'number'})
|
|
37
|
-
tenantId: 2;
|
|
38
|
-
@ApiProperty({type: 'number'})
|
|
39
|
-
orgId: 1;
|
|
40
|
-
@ApiProperty({type: 'number'})
|
|
41
|
-
branchId: 1;
|
|
42
|
-
@ApiProperty({type: 'string'})
|
|
43
|
-
group: 'cashier';
|
|
44
|
-
@ApiProperty({type: 'string'})
|
|
45
|
-
xOrg: 'Mi0xLTE';
|
|
46
|
-
}
|
|
47
|
-
export class MyProfileApiSchemaInvites{
|
|
48
|
-
@ApiProperty({type: 'string'})
|
|
49
|
-
_id: string;
|
|
50
|
-
@ApiProperty({type: 'string'})
|
|
51
|
-
email: string;
|
|
52
|
-
@ApiProperty({type: 'string'})
|
|
53
|
-
created: string;
|
|
54
|
-
permission: any[];
|
|
55
|
-
// @ApiProperty({type: 'string'})
|
|
56
|
-
// _id: '6527e3eff96dd5156e267bab';
|
|
57
|
-
// @ApiProperty({type: 'number'})
|
|
58
|
-
// tenantId: 2;
|
|
59
|
-
// @ApiProperty({type: 'number'})
|
|
60
|
-
// orgId: 1;
|
|
61
|
-
// @ApiProperty({type: 'number'})
|
|
62
|
-
// branchId: 1;
|
|
63
|
-
// @ApiProperty({type: 'string'})
|
|
64
|
-
// group: 'cashier';
|
|
65
|
-
// @ApiProperty({type: 'string'})
|
|
66
|
-
// xOrg: 'Mi0xLTE';
|
|
67
|
-
}
|
|
68
|
-
export class MyProfileApiSchema {
|
|
69
|
-
@ApiProperty({type: 'string'})
|
|
70
|
-
_id: string;
|
|
71
|
-
@ApiProperty({type: 'number'})
|
|
72
|
-
tenantId: number;
|
|
73
|
-
@ApiProperty({type: 'number'})
|
|
74
|
-
'orgId': number;
|
|
75
|
-
@ApiProperty({type: 'number'})
|
|
76
|
-
'branchId': number;
|
|
77
|
-
@ApiProperty({type: 'string'})
|
|
78
|
-
'email': string;
|
|
79
|
-
@ApiProperty({type: 'number'})
|
|
80
|
-
'uid': string;
|
|
81
|
-
@ApiProperty({type: 'number'})
|
|
82
|
-
'fullName': string;
|
|
83
|
-
@ApiProperty({type: 'number'})
|
|
84
|
-
'group': string;
|
|
85
|
-
@ApiProperty({type: ()=>['string']})
|
|
86
|
-
'roles': string[];
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
@ApiProperty({type: ()=>[MyProfileApiSchemaBranches]})
|
|
90
|
-
'branches': ProfileUserBranch[]
|
|
91
|
-
@ApiProperty({type:()=> [MyProfileApiSchemaInvites]})
|
|
92
|
-
'invites': ProfileUserInvites[];
|
|
93
|
-
@ApiProperty({type: 'string'})
|
|
94
|
-
'time': string;
|
|
95
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
graphql resolver
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file was automatically generated by simpleapp generator. Every
|
|
3
|
-
* MODIFICATION OVERRIDE BY GENERATEOR
|
|
4
|
-
* last change 2024-02-23
|
|
5
|
-
* Author: Ks Tan
|
|
6
|
-
*/
|
|
7
|
-
import { InjectModel } from '@nestjs/mongoose';
|
|
8
|
-
import { Model } from 'mongoose';
|
|
9
|
-
import { Injectable } from '@nestjs/common';
|
|
10
|
-
import { AutoincreamentProcessor } from '../generate/processors/autoinc.processor';
|
|
11
|
-
|
|
12
|
-
import { Autoincreament,AutoincreamentHooks } from '../generate/types';
|
|
13
|
-
import { UserContext } from '../generate/commons/user.context';
|
|
14
|
-
export { Autoincreament } from '../generate/types';
|
|
15
|
-
|
|
16
|
-
@Injectable()
|
|
17
|
-
export class AutoincreamentService extends AutoincreamentProcessor {
|
|
18
|
-
hooks: AutoincreamentHooks = {};
|
|
19
|
-
constructor(@InjectModel('Autoincreament') mydoc: Model<Autoincreament>) {
|
|
20
|
-
super(mydoc);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
async runGenerateNextNo(
|
|
25
|
-
appuser: UserContext,
|
|
26
|
-
collection: string,
|
|
27
|
-
field: string,
|
|
28
|
-
) {
|
|
29
|
-
const res = await this.search(appuser, {
|
|
30
|
-
collectionName: collection,
|
|
31
|
-
fieldName: field,
|
|
32
|
-
});
|
|
33
|
-
// console.log(res)
|
|
34
|
-
let data;
|
|
35
|
-
if (res.length > 0) {
|
|
36
|
-
// console.log("FOUND RESULT------")
|
|
37
|
-
const tmp = res[0];
|
|
38
|
-
const nextno = tmp.nextNo;
|
|
39
|
-
data = { collectionName: collection, fieldName: field, nextno: nextno };
|
|
40
|
-
this.findIdThenUpdate(appuser, tmp._id, {
|
|
41
|
-
collectionName: collection,
|
|
42
|
-
fieldName: field,
|
|
43
|
-
nextNo: tmp.nextNo + 1,
|
|
44
|
-
});
|
|
45
|
-
} else {
|
|
46
|
-
// console.log("CREATE ROW------")
|
|
47
|
-
this.data = { collectionName: collection, fieldName: field, nextNo: 2 };
|
|
48
|
-
const createResult = await this.create(appuser, this.data);
|
|
49
|
-
data = {
|
|
50
|
-
_id: crypto.randomUUID(),
|
|
51
|
-
collectionName: collection,
|
|
52
|
-
fieldName: field,
|
|
53
|
-
nextno: 1,
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
return data;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file was automatically generated by simpleapp generator. Every
|
|
3
|
-
* MODIFICATION OVERRIDE BY GENERATEOR
|
|
4
|
-
* last change 2024-02-23
|
|
5
|
-
* Author: Ks Tan
|
|
6
|
-
*/
|
|
7
|
-
import { InjectModel } from '@nestjs/mongoose';
|
|
8
|
-
import { Model } from 'mongoose';
|
|
9
|
-
import { Injectable, InternalServerErrorException } from '@nestjs/common';
|
|
10
|
-
import { BranchProcessor } from '../generate/processors/branch.processor';
|
|
11
|
-
import { Branch, BranchHooks } from '../generate/types';
|
|
12
|
-
import { alldocuments } from '../generate/commons/dicts/documents';
|
|
13
|
-
|
|
14
|
-
import { AutoincreamentService } from './autoinc.service';
|
|
15
|
-
import { UserContext } from '../generate/commons/user.context';
|
|
16
|
-
import { Docnoformat, DocnoformatService } from './docno.service';
|
|
17
|
-
|
|
18
|
-
export { Branch } from '../generate/types';
|
|
19
|
-
// import { Docnoformat } from '../generate/types/docno.type';
|
|
20
|
-
@Injectable()
|
|
21
|
-
export class BranchService extends BranchProcessor {
|
|
22
|
-
protected strictIsolation = false;
|
|
23
|
-
protected hooks: BranchHooks = {
|
|
24
|
-
beforeCreate: async (appuser: UserContext, data: Branch) => await this.branchBeforeCreate(appuser,data),
|
|
25
|
-
afterCreate: async (appuser: UserContext, data: Branch) => await this.branchAfterCreate(appuser,data),
|
|
26
|
-
};
|
|
27
|
-
constructor(
|
|
28
|
-
@InjectModel('Branch') mydoc: Model<Branch>,
|
|
29
|
-
private increament: AutoincreamentService,
|
|
30
|
-
private docnoservice: DocnoformatService,
|
|
31
|
-
) {
|
|
32
|
-
super(mydoc);
|
|
33
|
-
}
|
|
34
|
-
async branchBeforeCreate(appuser: UserContext, data: Branch) {
|
|
35
|
-
const searchresult = await this.increament.runGenerateNextNo(
|
|
36
|
-
appuser,
|
|
37
|
-
'branch',
|
|
38
|
-
'branchId',
|
|
39
|
-
);
|
|
40
|
-
data.branchId = searchresult.nextno;
|
|
41
|
-
}
|
|
42
|
-
async branchAfterCreate(appuser: UserContext, data: Branch) {
|
|
43
|
-
await this.generateDefaultDocNumbers(appuser, data);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
generateDefaultDocNumbers = async (appuser, data) => {
|
|
47
|
-
const branchName = data.branchName;
|
|
48
|
-
const branchCode = data.branchCode;
|
|
49
|
-
const recordId = data._id;
|
|
50
|
-
const branchId = data.branchId;
|
|
51
|
-
const orgId = data.orgId;
|
|
52
|
-
const tenantId = data.tenantId;
|
|
53
|
-
const docformats = alldocuments.filter((item) => item.docNumber);
|
|
54
|
-
for (let i = 0; i < docformats.length; i++) {
|
|
55
|
-
const doc = docformats[i];
|
|
56
|
-
const pattern = `${doc.docType}-${branchCode}-[00000]`;
|
|
57
|
-
const formatdata: Docnoformat = {
|
|
58
|
-
_id: crypto.randomUUID(),
|
|
59
|
-
docNoFormatNo: `${doc.docType}-${branchCode}`,
|
|
60
|
-
docNoFormatName: `Default ${doc.docType} - ${branchCode}`,
|
|
61
|
-
docNoType: doc.docType,
|
|
62
|
-
docNoPattern: pattern,
|
|
63
|
-
branch: { _id: recordId, branchId: branchId, label: branchName },
|
|
64
|
-
branchId: branchId,
|
|
65
|
-
orgId: orgId,
|
|
66
|
-
tenantId: tenantId,
|
|
67
|
-
nextNumber: 1,
|
|
68
|
-
} as Docnoformat;
|
|
69
|
-
try {
|
|
70
|
-
const result = await this.docnoservice.create(appuser, formatdata);
|
|
71
|
-
if (!result) {
|
|
72
|
-
throw new InternalServerErrorException(
|
|
73
|
-
`Generate default document number for "${branchCode}" failed. Pattern: ${pattern}`,
|
|
74
|
-
'generateDefaultDocNumbers',
|
|
75
|
-
);
|
|
76
|
-
}
|
|
77
|
-
} catch (err) {
|
|
78
|
-
this.logger.error(err);
|
|
79
|
-
throw new InternalServerErrorException(err);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file was automatically generated by simpleapp generator. Every
|
|
3
|
-
* MODIFICATION OVERRIDE BY GENERATEOR
|
|
4
|
-
* last change 2024-02-23
|
|
5
|
-
* Author: Ks Tan
|
|
6
|
-
*/
|
|
7
|
-
import { InjectModel } from '@nestjs/mongoose';
|
|
8
|
-
import { Model } from 'mongoose';
|
|
9
|
-
import { Injectable, InternalServerErrorException } from '@nestjs/common';
|
|
10
|
-
import { DocnoformatProcessor } from '../generate/processors/docno.processor';
|
|
11
|
-
import { Docnoformat,DocnoformatHooks } from '../generate/types';
|
|
12
|
-
import { UserContext } from '../generate/commons/user.context';
|
|
13
|
-
import * as moment from 'moment';
|
|
14
|
-
import { DocNumberFormatGenerator } from '../generate/commons/docnogenerator.service';
|
|
15
|
-
export { Docnoformat } from '../generate/types';
|
|
16
|
-
|
|
17
|
-
@Injectable()
|
|
18
|
-
export class DocnoformatService extends DocnoformatProcessor {
|
|
19
|
-
protected strictIsolation = false;
|
|
20
|
-
hooks: DocnoformatHooks = {};
|
|
21
|
-
constructor(
|
|
22
|
-
@InjectModel('Docnoformat') mydoc: Model<Docnoformat>,
|
|
23
|
-
) {
|
|
24
|
-
super(mydoc);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* list document number format and prepare sample of docformat
|
|
29
|
-
* @param appuser
|
|
30
|
-
* @param doctype
|
|
31
|
-
* @returns
|
|
32
|
-
*/
|
|
33
|
-
async runListDocFormats(appuser: UserContext, doctype: string) {
|
|
34
|
-
doctype = doctype.toUpperCase();
|
|
35
|
-
const searchresult = await this.search(
|
|
36
|
-
appuser,
|
|
37
|
-
{ docNoType: doctype,'branch.branchId':appuser.getBranchId() },
|
|
38
|
-
undefined,
|
|
39
|
-
{default:'desc'}
|
|
40
|
-
);
|
|
41
|
-
//console.log('searchresult',searchresult);
|
|
42
|
-
let data: any = [];
|
|
43
|
-
for (let i = 0; i < searchresult.length; i++) {
|
|
44
|
-
const s = searchresult[i];
|
|
45
|
-
if (s.active && s.docNoPattern) {
|
|
46
|
-
data.push({
|
|
47
|
-
_id: s._id,
|
|
48
|
-
docNoFormatNo: s.docNoFormatNo,
|
|
49
|
-
docNoFormatName: s.docNoFormatName,
|
|
50
|
-
docNoPattern: s.docNoPattern,
|
|
51
|
-
nextNumber: s.nextNumber,
|
|
52
|
-
default: s.default,
|
|
53
|
-
sample: DocNumberFormatGenerator.previewDocNo(s),
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
return data;
|
|
58
|
-
}
|
|
59
|
-
}
|