rez_core 2.1.34 → 2.1.35
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/app.controller.d.ts +6 -0
- package/dist/app.controller.js +34 -0
- package/dist/app.controller.js.map +1 -0
- package/dist/app.module.d.ts +2 -0
- package/dist/app.module.js +48 -0
- package/dist/app.module.js.map +1 -0
- package/dist/app.service.d.ts +3 -0
- package/dist/app.service.js +20 -0
- package/dist/app.service.js.map +1 -0
- package/dist/config/config.module.d.ts +2 -0
- package/dist/config/config.module.js +29 -0
- package/dist/config/config.module.js.map +1 -0
- package/dist/config/database.config.d.ts +7 -0
- package/dist/config/database.config.js +39 -0
- package/dist/config/database.config.js.map +1 -0
- package/dist/constant/global.constant.d.ts +26 -0
- package/dist/constant/global.constant.js +30 -0
- package/dist/constant/global.constant.js.map +1 -0
- package/dist/core.module.d.ts +4 -0
- package/dist/core.module.js +70 -0
- package/dist/core.module.js.map +1 -0
- package/dist/decorators/roles.decorator.d.ts +1 -0
- package/dist/decorators/roles.decorator.js +7 -0
- package/dist/decorators/roles.decorator.js.map +1 -0
- package/dist/dtos/response.d.ts +5 -0
- package/dist/dtos/response.dto.d.ts +5 -0
- package/dist/dtos/response.dto.js +3 -0
- package/dist/dtos/response.dto.js.map +1 -0
- package/dist/dtos/response.js +3 -0
- package/dist/dtos/response.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/dist/main.d.ts +1 -0
- package/dist/main.js +25 -0
- package/dist/main.js.map +1 -0
- package/dist/module/auth/auth.module.d.ts +2 -0
- package/dist/module/auth/auth.module.js +53 -0
- package/dist/module/auth/auth.module.js.map +1 -0
- package/dist/module/auth/guards/google-auth.guard.d.ts +6 -0
- package/dist/module/auth/guards/google-auth.guard.js +21 -0
- package/dist/module/auth/guards/google-auth.guard.js.map +1 -0
- package/dist/module/auth/guards/jwt.guard.d.ts +10 -0
- package/dist/module/auth/guards/jwt.guard.js +36 -0
- package/dist/module/auth/guards/jwt.guard.js.map +1 -0
- package/dist/module/auth/guards/role.guard.d.ts +9 -0
- package/dist/module/auth/guards/role.guard.js +59 -0
- package/dist/module/auth/guards/role.guard.js.map +1 -0
- package/dist/module/auth/services/auth.service.d.ts +12 -0
- package/dist/module/auth/services/auth.service.js +43 -0
- package/dist/module/auth/services/auth.service.js.map +1 -0
- package/dist/module/auth/services/jwt.service.d.ts +6 -0
- package/dist/module/auth/services/jwt.service.js +28 -0
- package/dist/module/auth/services/jwt.service.js.map +1 -0
- package/dist/module/auth/strategies/google.strategy.d.ts +8 -0
- package/dist/module/auth/strategies/google.strategy.js +45 -0
- package/dist/module/auth/strategies/google.strategy.js.map +1 -0
- package/dist/module/auth/strategies/jwt.strategy.d.ts +19 -0
- package/dist/module/auth/strategies/jwt.strategy.js +46 -0
- package/dist/module/auth/strategies/jwt.strategy.js.map +1 -0
- package/dist/module/auth/strategies/local.strategy.d.ts +7 -0
- package/dist/module/auth/strategies/local.strategy.js +30 -0
- package/dist/module/auth/strategies/local.strategy.js.map +1 -0
- package/dist/module/dev/dev.module.d.ts +2 -0
- package/dist/module/dev/dev.module.js +25 -0
- package/dist/module/dev/dev.module.js.map +1 -0
- package/dist/module/dev/service/dev.service.d.ts +5 -0
- package/dist/module/dev/service/dev.service.js +25 -0
- package/dist/module/dev/service/dev.service.js.map +1 -0
- package/dist/module/enterprise/controller/organization.controller.d.ts +14 -0
- package/dist/module/enterprise/controller/organization.controller.js +58 -0
- package/dist/module/enterprise/controller/organization.controller.js.map +1 -0
- package/dist/module/enterprise/enterprise.module.d.ts +2 -0
- package/dist/module/enterprise/enterprise.module.js +62 -0
- package/dist/module/enterprise/enterprise.module.js.map +1 -0
- package/dist/module/enterprise/entity/brand.entity.d.ts +4 -0
- package/dist/module/enterprise/entity/brand.entity.js +25 -0
- package/dist/module/enterprise/entity/brand.entity.js.map +1 -0
- package/dist/module/enterprise/entity/enterprise.entity.d.ts +13 -0
- package/dist/module/enterprise/entity/enterprise.entity.js +64 -0
- package/dist/module/enterprise/entity/enterprise.entity.js.map +1 -0
- package/dist/module/enterprise/entity/organization-app-mapping.entity.d.ts +5 -0
- package/dist/module/enterprise/entity/organization-app-mapping.entity.js +32 -0
- package/dist/module/enterprise/entity/organization-app-mapping.entity.js.map +1 -0
- package/dist/module/enterprise/entity/organization.entity.d.ts +28 -0
- package/dist/module/enterprise/entity/organization.entity.js +128 -0
- package/dist/module/enterprise/entity/organization.entity.js.map +1 -0
- package/dist/module/enterprise/entity/school.entity.d.ts +7 -0
- package/dist/module/enterprise/entity/school.entity.js +37 -0
- package/dist/module/enterprise/entity/school.entity.js.map +1 -0
- package/dist/module/enterprise/repository/brand.repository.d.ts +8 -0
- package/dist/module/enterprise/repository/brand.repository.js +39 -0
- package/dist/module/enterprise/repository/brand.repository.js.map +1 -0
- package/dist/module/enterprise/repository/enterprise.repository.d.ts +8 -0
- package/dist/module/enterprise/repository/enterprise.repository.js +48 -0
- package/dist/module/enterprise/repository/enterprise.repository.js.map +1 -0
- package/dist/module/enterprise/repository/organization.repository.d.ts +7 -0
- package/dist/module/enterprise/repository/organization.repository.js +36 -0
- package/dist/module/enterprise/repository/organization.repository.js.map +1 -0
- package/dist/module/enterprise/repository/school.repository.d.ts +10 -0
- package/dist/module/enterprise/repository/school.repository.js +172 -0
- package/dist/module/enterprise/repository/school.repository.js.map +1 -0
- package/dist/module/enterprise/service/brand.service.d.ts +2 -0
- package/dist/module/enterprise/service/brand.service.js +17 -0
- package/dist/module/enterprise/service/brand.service.js.map +1 -0
- package/dist/module/enterprise/service/enterprise.service.d.ts +8 -0
- package/dist/module/enterprise/service/enterprise.service.js +31 -0
- package/dist/module/enterprise/service/enterprise.service.js.map +1 -0
- package/dist/module/enterprise/service/organization-app-mapping.service.d.ts +2 -0
- package/dist/module/enterprise/service/organization-app-mapping.service.js +17 -0
- package/dist/module/enterprise/service/organization-app-mapping.service.js.map +1 -0
- package/dist/module/enterprise/service/organization.service.d.ts +21 -0
- package/dist/module/enterprise/service/organization.service.js +85 -0
- package/dist/module/enterprise/service/organization.service.js.map +1 -0
- package/dist/module/enterprise/service/school.service.d.ts +3 -0
- package/dist/module/enterprise/service/school.service.js +18 -0
- package/dist/module/enterprise/service/school.service.js.map +1 -0
- package/dist/module/filter/controller/filter.controller.d.ts +29 -0
- package/dist/module/filter/controller/filter.controller.js +72 -0
- package/dist/module/filter/controller/filter.controller.js.map +1 -0
- package/dist/module/filter/dto/filter-request.dto.d.ts +28 -0
- package/dist/module/filter/dto/filter-request.dto.js +3 -0
- package/dist/module/filter/dto/filter-request.dto.js.map +1 -0
- package/dist/module/filter/entity/saved-filter-detail.entity.d.ts +8 -0
- package/dist/module/filter/entity/saved-filter-detail.entity.js +43 -0
- package/dist/module/filter/entity/saved-filter-detail.entity.js.map +1 -0
- package/dist/module/filter/entity/saved-filter-master.entity.d.ts +7 -0
- package/dist/module/filter/entity/saved-filter-master.entity.js +39 -0
- package/dist/module/filter/entity/saved-filter-master.entity.js.map +1 -0
- package/dist/module/filter/filter.module.d.ts +2 -0
- package/dist/module/filter/filter.module.js +37 -0
- package/dist/module/filter/filter.module.js.map +1 -0
- package/dist/module/filter/repository/saved-filter.repository.d.ts +26 -0
- package/dist/module/filter/repository/saved-filter.repository.js +103 -0
- package/dist/module/filter/repository/saved-filter.repository.js.map +1 -0
- package/dist/module/filter/service/filter.service.d.ts +43 -0
- package/dist/module/filter/service/filter.service.js +423 -0
- package/dist/module/filter/service/filter.service.js.map +1 -0
- package/dist/module/filter/service/saved-filter.service.d.ts +17 -0
- package/dist/module/filter/service/saved-filter.service.js +88 -0
- package/dist/module/filter/service/saved-filter.service.js.map +1 -0
- package/dist/module/layout/controller/layout.controller.d.ts +11 -0
- package/dist/module/layout/controller/layout.controller.js +59 -0
- package/dist/module/layout/controller/layout.controller.js.map +1 -0
- package/dist/module/layout/dto/header.dto.d.ts +0 -0
- package/dist/module/layout/dto/header.dto.js +1 -0
- package/dist/module/layout/dto/header.dto.js.map +1 -0
- package/dist/module/layout/entity/header-items.entity.d.ts +10 -0
- package/dist/module/layout/entity/header-items.entity.js +52 -0
- package/dist/module/layout/entity/header-items.entity.js.map +1 -0
- package/dist/module/layout/entity/header-section.entity.d.ts +7 -0
- package/dist/module/layout/entity/header-section.entity.js +40 -0
- package/dist/module/layout/entity/header-section.entity.js.map +1 -0
- package/dist/module/layout/layout.module.d.ts +2 -0
- package/dist/module/layout/layout.module.js +34 -0
- package/dist/module/layout/layout.module.js.map +1 -0
- package/dist/module/layout/repository/header-items.repository.d.ts +7 -0
- package/dist/module/layout/repository/header-items.repository.js +36 -0
- package/dist/module/layout/repository/header-items.repository.js.map +1 -0
- package/dist/module/layout/repository/header-section.repository.d.ts +8 -0
- package/dist/module/layout/repository/header-section.repository.js +39 -0
- package/dist/module/layout/repository/header-section.repository.js.map +1 -0
- package/dist/module/layout/service/header-section.service.d.ts +8 -0
- package/dist/module/layout/service/header-section.service.js +37 -0
- package/dist/module/layout/service/header-section.service.js.map +1 -0
- package/dist/module/layout_preference/controller/layout_preference.controller.d.ts +11 -0
- package/dist/module/layout_preference/controller/layout_preference.controller.js +58 -0
- package/dist/module/layout_preference/controller/layout_preference.controller.js.map +1 -0
- package/dist/module/layout_preference/dto/layout_preference.dto.d.ts +0 -0
- package/dist/module/layout_preference/dto/layout_preference.dto.js +1 -0
- package/dist/module/layout_preference/dto/layout_preference.dto.js.map +1 -0
- package/dist/module/layout_preference/entity/layout_preference.entity.d.ts +6 -0
- package/dist/module/layout_preference/entity/layout_preference.entity.js +33 -0
- package/dist/module/layout_preference/entity/layout_preference.entity.js.map +1 -0
- package/dist/module/layout_preference/layout_preference.module.d.ts +2 -0
- package/dist/module/layout_preference/layout_preference.module.js +31 -0
- package/dist/module/layout_preference/layout_preference.module.js.map +1 -0
- package/dist/module/layout_preference/repository/layout_preference.repository.d.ts +7 -0
- package/dist/module/layout_preference/repository/layout_preference.repository.js +39 -0
- package/dist/module/layout_preference/repository/layout_preference.repository.js.map +1 -0
- package/dist/module/layout_preference/service/layout_preference.service.d.ts +13 -0
- package/dist/module/layout_preference/service/layout_preference.service.js +80 -0
- package/dist/module/layout_preference/service/layout_preference.service.js.map +1 -0
- package/dist/module/lead/controller/lead.controller.d.ts +20 -0
- package/dist/module/lead/controller/lead.controller.js +58 -0
- package/dist/module/lead/controller/lead.controller.js.map +1 -0
- package/dist/module/lead/lead.module.d.ts +2 -0
- package/dist/module/lead/lead.module.js +30 -0
- package/dist/module/lead/lead.module.js.map +1 -0
- package/dist/module/lead/repository/lead.repository.d.ts +13 -0
- package/dist/module/lead/repository/lead.repository.js +52 -0
- package/dist/module/lead/repository/lead.repository.js.map +1 -0
- package/dist/module/lead/service/lead.service.d.ts +20 -0
- package/dist/module/lead/service/lead.service.js +55 -0
- package/dist/module/lead/service/lead.service.js.map +1 -0
- package/dist/module/listmaster/controller/list-master.controller.d.ts +9 -0
- package/dist/module/listmaster/controller/list-master.controller.js +48 -0
- package/dist/module/listmaster/controller/list-master.controller.js.map +1 -0
- package/dist/module/listmaster/entity/list-master-items.entity.d.ts +12 -0
- package/dist/module/listmaster/entity/list-master-items.entity.js +59 -0
- package/dist/module/listmaster/entity/list-master-items.entity.js.map +1 -0
- package/dist/module/listmaster/entity/list-master.entity.d.ts +10 -0
- package/dist/module/listmaster/entity/list-master.entity.js +51 -0
- package/dist/module/listmaster/entity/list-master.entity.js.map +1 -0
- package/dist/module/listmaster/listmaster.module.d.ts +2 -0
- package/dist/module/listmaster/listmaster.module.js +32 -0
- package/dist/module/listmaster/listmaster.module.js.map +1 -0
- package/dist/module/listmaster/repository/list-master-items.repository.d.ts +10 -0
- package/dist/module/listmaster/repository/list-master-items.repository.js +38 -0
- package/dist/module/listmaster/repository/list-master-items.repository.js.map +1 -0
- package/dist/module/listmaster/repository/list-master.repository.d.ts +7 -0
- package/dist/module/listmaster/repository/list-master.repository.js +34 -0
- package/dist/module/listmaster/repository/list-master.repository.js.map +1 -0
- package/dist/module/listmaster/service/list-master.service.d.ts +25 -0
- package/dist/module/listmaster/service/list-master.service.js +162 -0
- package/dist/module/listmaster/service/list-master.service.js.map +1 -0
- package/dist/module/master/controller/master.controller.d.ts +18 -0
- package/dist/module/master/controller/master.controller.js +80 -0
- package/dist/module/master/controller/master.controller.js.map +1 -0
- package/dist/module/master/service/master.service.d.ts +32 -0
- package/dist/module/master/service/master.service.js +342 -0
- package/dist/module/master/service/master.service.js.map +1 -0
- package/dist/module/meta/controller/app-master.controller.d.ts +9 -0
- package/dist/module/meta/controller/app-master.controller.js +51 -0
- package/dist/module/meta/controller/app-master.controller.js.map +1 -0
- package/dist/module/meta/controller/entity.controller.d.ts +23 -0
- package/dist/module/meta/controller/entity.controller.js +167 -0
- package/dist/module/meta/controller/entity.controller.js.map +1 -0
- package/dist/module/meta/controller/media.controller.d.ts +13 -0
- package/dist/module/meta/controller/media.controller.js +73 -0
- package/dist/module/meta/controller/media.controller.js.map +1 -0
- package/dist/module/meta/controller/meta.controller.d.ts +9 -0
- package/dist/module/meta/controller/meta.controller.js +49 -0
- package/dist/module/meta/controller/meta.controller.js.map +1 -0
- package/dist/module/meta/controller/view-master.controller.d.ts +7 -0
- package/dist/module/meta/controller/view-master.controller.js +62 -0
- package/dist/module/meta/controller/view-master.controller.js.map +1 -0
- package/dist/module/meta/dto/entity-list-data.dto.d.ts +5 -0
- package/dist/module/meta/dto/entity-list-data.dto.js +7 -0
- package/dist/module/meta/dto/entity-list-data.dto.js.map +1 -0
- package/dist/module/meta/dto/entity-tab.dto.d.ts +4 -0
- package/dist/module/meta/dto/entity-tab.dto.js +7 -0
- package/dist/module/meta/dto/entity-tab.dto.js.map +1 -0
- package/dist/module/meta/dto/entity-table.dto.d.ts +11 -0
- package/dist/module/meta/dto/entity-table.dto.js +8 -0
- package/dist/module/meta/dto/entity-table.dto.js.map +1 -0
- package/dist/module/meta/entity/app-master.entity.d.ts +11 -0
- package/dist/module/meta/entity/app-master.entity.js +54 -0
- package/dist/module/meta/entity/app-master.entity.js.map +1 -0
- package/dist/module/meta/entity/attribute-master.entity.d.ts +19 -0
- package/dist/module/meta/entity/attribute-master.entity.js +105 -0
- package/dist/module/meta/entity/attribute-master.entity.js.map +1 -0
- package/dist/module/meta/entity/base-entity.entity.d.ts +19 -0
- package/dist/module/meta/entity/base-entity.entity.js +104 -0
- package/dist/module/meta/entity/base-entity.entity.js.map +1 -0
- package/dist/module/meta/entity/entity-master.entity.d.ts +13 -0
- package/dist/module/meta/entity/entity-master.entity.js +88 -0
- package/dist/module/meta/entity/entity-master.entity.js.map +1 -0
- package/dist/module/meta/entity/entity-table-column.entity.d.ts +16 -0
- package/dist/module/meta/entity/entity-table-column.entity.js +80 -0
- package/dist/module/meta/entity/entity-table-column.entity.js.map +1 -0
- package/dist/module/meta/entity/entity-table.entity.d.ts +17 -0
- package/dist/module/meta/entity/entity-table.entity.js +79 -0
- package/dist/module/meta/entity/entity-table.entity.js.map +1 -0
- package/dist/module/meta/entity/field-group.entity.d.ts +9 -0
- package/dist/module/meta/entity/field-group.entity.js +47 -0
- package/dist/module/meta/entity/field-group.entity.js.map +1 -0
- package/dist/module/meta/entity/media-data.entity.d.ts +11 -0
- package/dist/module/meta/entity/media-data.entity.js +55 -0
- package/dist/module/meta/entity/media-data.entity.js.map +1 -0
- package/dist/module/meta/entity/preference.entity.d.ts +11 -0
- package/dist/module/meta/entity/preference.entity.js +85 -0
- package/dist/module/meta/entity/preference.entity.js.map +1 -0
- package/dist/module/meta/entity/school.entity.d.ts +8 -0
- package/dist/module/meta/entity/school.entity.js +44 -0
- package/dist/module/meta/entity/school.entity.js.map +1 -0
- package/dist/module/meta/entity/schoolAddress.entity.d.ts +9 -0
- package/dist/module/meta/entity/schoolAddress.entity.js +48 -0
- package/dist/module/meta/entity/schoolAddress.entity.js.map +1 -0
- package/dist/module/meta/entity/section-master.entity.d.ts +10 -0
- package/dist/module/meta/entity/section-master.entity.js +51 -0
- package/dist/module/meta/entity/section-master.entity.js.map +1 -0
- package/dist/module/meta/entity/user-app-mapping.entity.d.ts +7 -0
- package/dist/module/meta/entity/user-app-mapping.entity.js +41 -0
- package/dist/module/meta/entity/user-app-mapping.entity.js.map +1 -0
- package/dist/module/meta/entity/view-master.entity.d.ts +12 -0
- package/dist/module/meta/entity/view-master.entity.js +59 -0
- package/dist/module/meta/entity/view-master.entity.js.map +1 -0
- package/dist/module/meta/entity.module.d.ts +2 -0
- package/dist/module/meta/entity.module.js +139 -0
- package/dist/module/meta/entity.module.js.map +1 -0
- package/dist/module/meta/repository/app-master.repository.d.ts +7 -0
- package/dist/module/meta/repository/app-master.repository.js +36 -0
- package/dist/module/meta/repository/app-master.repository.js.map +1 -0
- package/dist/module/meta/repository/attribute-master.repository.d.ts +8 -0
- package/dist/module/meta/repository/attribute-master.repository.js +48 -0
- package/dist/module/meta/repository/attribute-master.repository.js.map +1 -0
- package/dist/module/meta/repository/entity-table-column.repository.d.ts +7 -0
- package/dist/module/meta/repository/entity-table-column.repository.js +50 -0
- package/dist/module/meta/repository/entity-table-column.repository.js.map +1 -0
- package/dist/module/meta/repository/entity-table.repository.d.ts +9 -0
- package/dist/module/meta/repository/entity-table.repository.js +51 -0
- package/dist/module/meta/repository/entity-table.repository.js.map +1 -0
- package/dist/module/meta/repository/media-data.repository.d.ts +9 -0
- package/dist/module/meta/repository/media-data.repository.js +55 -0
- package/dist/module/meta/repository/media-data.repository.js.map +1 -0
- package/dist/module/meta/repository/preference.repository.d.ts +7 -0
- package/dist/module/meta/repository/preference.repository.js +36 -0
- package/dist/module/meta/repository/preference.repository.js.map +1 -0
- package/dist/module/meta/repository/user-app-mapping.repository.d.ts +8 -0
- package/dist/module/meta/repository/user-app-mapping.repository.js +43 -0
- package/dist/module/meta/repository/user-app-mapping.repository.js.map +1 -0
- package/dist/module/meta/repository/view-master.repository.d.ts +7 -0
- package/dist/module/meta/repository/view-master.repository.js +38 -0
- package/dist/module/meta/repository/view-master.repository.js.map +1 -0
- package/dist/module/meta/service/app-master.service.d.ts +8 -0
- package/dist/module/meta/service/app-master.service.js +45 -0
- package/dist/module/meta/service/app-master.service.js.map +1 -0
- package/dist/module/meta/service/attribute-master.service.d.ts +6 -0
- package/dist/module/meta/service/attribute-master.service.js +28 -0
- package/dist/module/meta/service/attribute-master.service.js.map +1 -0
- package/dist/module/meta/service/entity-list.service.d.ts +17 -0
- package/dist/module/meta/service/entity-list.service.js +141 -0
- package/dist/module/meta/service/entity-list.service.js.map +1 -0
- package/dist/module/meta/service/entity-master.service.d.ts +11 -0
- package/dist/module/meta/service/entity-master.service.js +62 -0
- package/dist/module/meta/service/entity-master.service.js.map +1 -0
- package/dist/module/meta/service/entity-service-impl.service.d.ts +32 -0
- package/dist/module/meta/service/entity-service-impl.service.js +208 -0
- package/dist/module/meta/service/entity-service-impl.service.js.map +1 -0
- package/dist/module/meta/service/entity-table-column.service.d.ts +7 -0
- package/dist/module/meta/service/entity-table-column.service.js +37 -0
- package/dist/module/meta/service/entity-table-column.service.js.map +1 -0
- package/dist/module/meta/service/entity-table.service.d.ts +17 -0
- package/dist/module/meta/service/entity-table.service.js +83 -0
- package/dist/module/meta/service/entity-table.service.js.map +1 -0
- package/dist/module/meta/service/entity-validation.service.d.ts +21 -0
- package/dist/module/meta/service/entity-validation.service.js +113 -0
- package/dist/module/meta/service/entity-validation.service.js.map +1 -0
- package/dist/module/meta/service/entity.service.d.ts +14 -0
- package/dist/module/meta/service/entity.service.js +3 -0
- package/dist/module/meta/service/entity.service.js.map +1 -0
- package/dist/module/meta/service/field-group.service.d.ts +26 -0
- package/dist/module/meta/service/field-group.service.js +78 -0
- package/dist/module/meta/service/field-group.service.js.map +1 -0
- package/dist/module/meta/service/media-data.service.d.ts +29 -0
- package/dist/module/meta/service/media-data.service.js +108 -0
- package/dist/module/meta/service/media-data.service.js.map +1 -0
- package/dist/module/meta/service/preference.service.d.ts +7 -0
- package/dist/module/meta/service/preference.service.js +31 -0
- package/dist/module/meta/service/preference.service.js.map +1 -0
- package/dist/module/meta/service/section-master.service.d.ts +26 -0
- package/dist/module/meta/service/section-master.service.js +77 -0
- package/dist/module/meta/service/section-master.service.js.map +1 -0
- package/dist/module/meta/service/update-form-json.service.d.ts +9 -0
- package/dist/module/meta/service/update-form-json.service.js +39 -0
- package/dist/module/meta/service/update-form-json.service.js.map +1 -0
- package/dist/module/meta/service/user-app-mapping.service.d.ts +7 -0
- package/dist/module/meta/service/user-app-mapping.service.js +31 -0
- package/dist/module/meta/service/user-app-mapping.service.js.map +1 -0
- package/dist/module/meta/service/view-master.service.d.ts +25 -0
- package/dist/module/meta/service/view-master.service.js +83 -0
- package/dist/module/meta/service/view-master.service.js.map +1 -0
- package/dist/module/module/controller/menu.controller.d.ts +8 -0
- package/dist/module/module/controller/menu.controller.js +41 -0
- package/dist/module/module/controller/menu.controller.js.map +1 -0
- package/dist/module/module/controller/module-access.controller.d.ts +35 -0
- package/dist/module/module/controller/module-access.controller.js +140 -0
- package/dist/module/module/controller/module-access.controller.js.map +1 -0
- package/dist/module/module/entity/menu.entity.d.ts +15 -0
- package/dist/module/module/entity/menu.entity.js +72 -0
- package/dist/module/module/entity/menu.entity.js.map +1 -0
- package/dist/module/module/entity/module-access.entity.d.ts +9 -0
- package/dist/module/module/entity/module-access.entity.js +48 -0
- package/dist/module/module/entity/module-access.entity.js.map +1 -0
- package/dist/module/module/entity/module-action.entity.d.ts +6 -0
- package/dist/module/module/entity/module-action.entity.js +37 -0
- package/dist/module/module/entity/module-action.entity.js.map +1 -0
- package/dist/module/module/entity/module.entity.d.ts +18 -0
- package/dist/module/module/entity/module.entity.js +84 -0
- package/dist/module/module/entity/module.entity.js.map +1 -0
- package/dist/module/module/module.module.d.ts +2 -0
- package/dist/module/module/module.module.js +53 -0
- package/dist/module/module/module.module.js.map +1 -0
- package/dist/module/module/repository/menu.repository.d.ts +11 -0
- package/dist/module/module/repository/menu.repository.js +139 -0
- package/dist/module/module/repository/menu.repository.js.map +1 -0
- package/dist/module/module/repository/module-access.repository.d.ts +51 -0
- package/dist/module/module/repository/module-access.repository.js +263 -0
- package/dist/module/module/repository/module-access.repository.js.map +1 -0
- package/dist/module/module/service/menu.service.d.ts +12 -0
- package/dist/module/module/service/menu.service.js +59 -0
- package/dist/module/module/service/menu.service.js.map +1 -0
- package/dist/module/module/service/module-access.service.d.ts +55 -0
- package/dist/module/module/service/module-access.service.js +95 -0
- package/dist/module/module/service/module-access.service.js.map +1 -0
- package/dist/module/notification/controller/otp.controller.d.ts +17 -0
- package/dist/module/notification/controller/otp.controller.js +67 -0
- package/dist/module/notification/controller/otp.controller.js.map +1 -0
- package/dist/module/notification/entity/otp.entity.d.ts +10 -0
- package/dist/module/notification/entity/otp.entity.js +52 -0
- package/dist/module/notification/entity/otp.entity.js.map +1 -0
- package/dist/module/notification/notification.module.d.ts +2 -0
- package/dist/module/notification/notification.module.js +27 -0
- package/dist/module/notification/notification.module.js.map +1 -0
- package/dist/module/notification/repository/otp.repository.d.ts +9 -0
- package/dist/module/notification/repository/otp.repository.js +44 -0
- package/dist/module/notification/repository/otp.repository.js.map +1 -0
- package/dist/module/notification/service/otp.service.d.ts +16 -0
- package/dist/module/notification/service/otp.service.js +66 -0
- package/dist/module/notification/service/otp.service.js.map +1 -0
- package/dist/module/third-party-module/entity/third-party-api-registry.entity.d.ts +18 -0
- package/dist/module/third-party-module/entity/third-party-api-registry.entity.js +84 -0
- package/dist/module/third-party-module/entity/third-party-api-registry.entity.js.map +1 -0
- package/dist/module/third-party-module/repository/third-party-api-registry.repository.d.ts +7 -0
- package/dist/module/third-party-module/repository/third-party-api-registry.repository.js +38 -0
- package/dist/module/third-party-module/repository/third-party-api-registry.repository.js.map +1 -0
- package/dist/module/third-party-module/service/api-registry.service.d.ts +6 -0
- package/dist/module/third-party-module/service/api-registry.service.js +28 -0
- package/dist/module/third-party-module/service/api-registry.service.js.map +1 -0
- package/dist/module/third-party-module/third-party.module.d.ts +2 -0
- package/dist/module/third-party-module/third-party.module.js +25 -0
- package/dist/module/third-party-module/third-party.module.js.map +1 -0
- package/dist/module/user/controller/login.controller.d.ts +21 -0
- package/dist/module/user/controller/login.controller.js +107 -0
- package/dist/module/user/controller/login.controller.js.map +1 -0
- package/dist/module/user/controller/user.controller.d.ts +8 -0
- package/dist/module/user/controller/user.controller.js +42 -0
- package/dist/module/user/controller/user.controller.js.map +1 -0
- package/dist/module/user/dto/create-user.dto.d.ts +17 -0
- package/dist/module/user/dto/create-user.dto.js +64 -0
- package/dist/module/user/dto/create-user.dto.js.map +1 -0
- package/dist/module/user/dto/update-user.dto.d.ts +5 -0
- package/dist/module/user/dto/update-user.dto.js +9 -0
- package/dist/module/user/dto/update-user.dto.js.map +1 -0
- package/dist/module/user/entity/role.entity.d.ts +9 -0
- package/dist/module/user/entity/role.entity.js +48 -0
- package/dist/module/user/entity/role.entity.js.map +1 -0
- package/dist/module/user/entity/user-role-mapping.entity.d.ts +12 -0
- package/dist/module/user/entity/user-role-mapping.entity.js +63 -0
- package/dist/module/user/entity/user-role-mapping.entity.js.map +1 -0
- package/dist/module/user/entity/user-session.entity.d.ts +11 -0
- package/dist/module/user/entity/user-session.entity.js +86 -0
- package/dist/module/user/entity/user-session.entity.js.map +1 -0
- package/dist/module/user/entity/user.entity.d.ts +18 -0
- package/dist/module/user/entity/user.entity.js +83 -0
- package/dist/module/user/entity/user.entity.js.map +1 -0
- package/dist/module/user/repository/role.repository.d.ts +18 -0
- package/dist/module/user/repository/role.repository.js +87 -0
- package/dist/module/user/repository/role.repository.js.map +1 -0
- package/dist/module/user/repository/user-role-mapping.repository.d.ts +19 -0
- package/dist/module/user/repository/user-role-mapping.repository.js +102 -0
- package/dist/module/user/repository/user-role-mapping.repository.js.map +1 -0
- package/dist/module/user/repository/user.repository.d.ts +10 -0
- package/dist/module/user/repository/user.repository.js +61 -0
- package/dist/module/user/repository/user.repository.js.map +1 -0
- package/dist/module/user/repository/userSession.repository.d.ts +10 -0
- package/dist/module/user/repository/userSession.repository.js +45 -0
- package/dist/module/user/repository/userSession.repository.js.map +1 -0
- package/dist/module/user/service/login.service.d.ts +41 -0
- package/dist/module/user/service/login.service.js +160 -0
- package/dist/module/user/service/login.service.js.map +1 -0
- package/dist/module/user/service/role.service.d.ts +21 -0
- package/dist/module/user/service/role.service.js +141 -0
- package/dist/module/user/service/role.service.js.map +1 -0
- package/dist/module/user/service/user-role-mapping.service.d.ts +12 -0
- package/dist/module/user/service/user-role-mapping.service.js +60 -0
- package/dist/module/user/service/user-role-mapping.service.js.map +1 -0
- package/dist/module/user/service/user-session.service.d.ts +29 -0
- package/dist/module/user/service/user-session.service.js +111 -0
- package/dist/module/user/service/user-session.service.js.map +1 -0
- package/dist/module/user/service/user.service.d.ts +29 -0
- package/dist/module/user/service/user.service.js +187 -0
- package/dist/module/user/service/user.service.js.map +1 -0
- package/dist/module/user/user.module.d.ts +2 -0
- package/dist/module/user/user.module.js +74 -0
- package/dist/module/user/user.module.js.map +1 -0
- package/dist/resources/properties.module.d.ts +2 -0
- package/dist/resources/properties.module.js +25 -0
- package/dist/resources/properties.module.js.map +1 -0
- package/dist/resources/properties.yaml.d.ts +2 -0
- package/dist/resources/properties.yaml.js +10 -0
- package/dist/resources/properties.yaml.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/dist/utils/dto/excel-data.dto.d.ts +7 -0
- package/dist/utils/dto/excel-data.dto.js +16 -0
- package/dist/utils/dto/excel-data.dto.js.map +1 -0
- package/dist/utils/dto/excelsheet-data.dto.d.ts +5 -0
- package/dist/utils/dto/excelsheet-data.dto.js +3 -0
- package/dist/utils/dto/excelsheet-data.dto.js.map +1 -0
- package/dist/utils/service/base64util.service.d.ts +4 -0
- package/dist/utils/service/base64util.service.js +21 -0
- package/dist/utils/service/base64util.service.js.map +1 -0
- package/dist/utils/service/clockIDGenUtil.service.d.ts +8 -0
- package/dist/utils/service/clockIDGenUtil.service.js +32 -0
- package/dist/utils/service/clockIDGenUtil.service.js.map +1 -0
- package/dist/utils/service/dateUtil.service.d.ts +3 -0
- package/dist/utils/service/dateUtil.service.js +28 -0
- package/dist/utils/service/dateUtil.service.js.map +1 -0
- package/dist/utils/service/encryptUtil.service.d.ts +9 -0
- package/dist/utils/service/encryptUtil.service.js +112 -0
- package/dist/utils/service/encryptUtil.service.js.map +1 -0
- package/dist/utils/service/excel-helper.service.d.ts +9 -0
- package/dist/utils/service/excel-helper.service.js +53 -0
- package/dist/utils/service/excel-helper.service.js.map +1 -0
- package/dist/utils/service/excelUtil.service.d.ts +3 -0
- package/dist/utils/service/excelUtil.service.js +17 -0
- package/dist/utils/service/excelUtil.service.js.map +1 -0
- package/dist/utils/service/file-util.service.d.ts +3 -0
- package/dist/utils/service/file-util.service.js +15 -0
- package/dist/utils/service/file-util.service.js.map +1 -0
- package/dist/utils/service/json-util.service.d.ts +3 -0
- package/dist/utils/service/json-util.service.js +24 -0
- package/dist/utils/service/json-util.service.js.map +1 -0
- package/dist/utils/service/loggingUtil.service.d.ts +4 -0
- package/dist/utils/service/loggingUtil.service.js +49 -0
- package/dist/utils/service/loggingUtil.service.js.map +1 -0
- package/dist/utils/service/reflection-helper.service.d.ts +9 -0
- package/dist/utils/service/reflection-helper.service.js +60 -0
- package/dist/utils/service/reflection-helper.service.js.map +1 -0
- package/dist/utils/utils.module.d.ts +2 -0
- package/dist/utils/utils.module.js +25 -0
- package/dist/utils/utils.module.js.map +1 -0
- package/package.json +1 -1
- package/src/module/enterprise/enterprise.module.ts +12 -3
- package/src/module/enterprise/repository/organization.repository.ts +18 -0
- package/src/module/enterprise/service/school.service.ts +5 -0
- package/src/module/meta/service/entity-service-impl.service.ts +5 -3
- package/src/module/user/service/login.service.ts +44 -32
- package/src/module/user/user.module.ts +4 -2
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.EntityMasterService = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const typeorm_1 = require("typeorm");
|
|
18
|
+
const typeorm_2 = require("@nestjs/typeorm");
|
|
19
|
+
const entity_master_entity_1 = require("../entity/entity-master.entity");
|
|
20
|
+
let EntityMasterService = class EntityMasterService {
|
|
21
|
+
constructor(entityMasterRepository) {
|
|
22
|
+
this.entityMasterRepository = entityMasterRepository;
|
|
23
|
+
}
|
|
24
|
+
async getEntityData(mappedEntityType) {
|
|
25
|
+
if (mappedEntityType) {
|
|
26
|
+
const entityMaster = await this.entityMasterRepository.findOne({
|
|
27
|
+
where: { mapped_entity_type: mappedEntityType },
|
|
28
|
+
});
|
|
29
|
+
if (!entityMaster) {
|
|
30
|
+
throw new Error(`Entity with mappedEntityType "${mappedEntityType}" not found.`);
|
|
31
|
+
}
|
|
32
|
+
return entityMaster;
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
throw new Error();
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
async getEntityByTableName(tableName) {
|
|
39
|
+
const entityMaster = await this.entityMasterRepository.findOne({
|
|
40
|
+
where: { db_table_name: tableName },
|
|
41
|
+
});
|
|
42
|
+
return entityMaster;
|
|
43
|
+
}
|
|
44
|
+
async save(entityMaster) {
|
|
45
|
+
return await this.entityMasterRepository.save(entityMaster);
|
|
46
|
+
}
|
|
47
|
+
async update(id, entityMaster) {
|
|
48
|
+
return await this.entityMasterRepository.update(id, entityMaster);
|
|
49
|
+
}
|
|
50
|
+
async findByMappedEntityType(mappedEntityType) {
|
|
51
|
+
return await this.entityMasterRepository.findOne({
|
|
52
|
+
where: { mapped_entity_type: mappedEntityType },
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
exports.EntityMasterService = EntityMasterService;
|
|
57
|
+
exports.EntityMasterService = EntityMasterService = __decorate([
|
|
58
|
+
(0, common_1.Injectable)(),
|
|
59
|
+
__param(0, (0, typeorm_2.InjectRepository)(entity_master_entity_1.EntityMaster)),
|
|
60
|
+
__metadata("design:paramtypes", [typeorm_1.Repository])
|
|
61
|
+
], EntityMasterService);
|
|
62
|
+
//# sourceMappingURL=entity-master.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity-master.service.js","sourceRoot":"","sources":["../../../../src/module/meta/service/entity-master.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA4C;AAC5C,qCAAqC;AACrC,6CAAmD;AACnD,yEAA8D;AAGvD,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAC9B,YAEU,sBAAgD;QAAhD,2BAAsB,GAAtB,sBAAsB,CAA0B;IACvD,CAAC;IAEJ,KAAK,CAAC,aAAa,CAAC,gBAA6B;QAC/C,IAAI,gBAAgB,EAAE,CAAC;YACrB,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,sBAAsB,CAAC,OAAO,CAAC;gBAC7D,KAAK,EAAE,EAAE,kBAAkB,EAAE,gBAAgB,EAAE;aAChD,CAAC,CAAC;YAEH,IAAI,CAAC,YAAY,EAAE,CAAC;gBAClB,MAAM,IAAI,KAAK,CACb,iCAAiC,gBAAgB,cAAc,CAChE,CAAC;YACJ,CAAC;YAED,OAAO,YAAY,CAAC;QACtB,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,KAAK,EAAE,CAAC;QACpB,CAAC;IACH,CAAC;IAED,KAAK,CAAC,oBAAoB,CAAC,SAAiB;QAC1C,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,sBAAsB,CAAC,OAAO,CAAC;YAC7D,KAAK,EAAE,EAAE,aAAa,EAAE,SAAS,EAAE;SACpC,CAAC,CAAC;QACH,OAAO,YAAY,CAAC;IACtB,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,YAA0B;QACnC,OAAO,MAAM,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAC9D,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,EAAU,EAAE,YAA0B;QACjD,OAAO,MAAM,IAAI,CAAC,sBAAsB,CAAC,MAAM,CAAC,EAAE,EAAE,YAAY,CAAC,CAAC;IACpE,CAAC;IAED,KAAK,CAAC,sBAAsB,CAAC,gBAAwB;QACnD,OAAO,MAAM,IAAI,CAAC,sBAAsB,CAAC,OAAO,CAAC;YAC/C,KAAK,EAAE,EAAE,kBAAkB,EAAE,gBAAgB,EAAE;SAChD,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AA5CY,kDAAmB;8BAAnB,mBAAmB;IAD/B,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,0BAAgB,EAAC,mCAAY,CAAC,CAAA;qCACC,oBAAU;GAHjC,mBAAmB,CA4C/B"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { EntityService } from './entity.service';
|
|
2
|
+
import { UserData } from '../../user/entity/user.entity';
|
|
3
|
+
import { EntityMasterService } from './entity-master.service';
|
|
4
|
+
import { ReflectionHelper } from '../../../utils/service/reflection-helper.service';
|
|
5
|
+
import { BaseEntity } from '../entity/base-entity.entity';
|
|
6
|
+
import { LoggingService } from '../../../utils/service/loggingUtil.service';
|
|
7
|
+
import { EntityListData } from '../dto/entity-list-data.dto';
|
|
8
|
+
import { EntityListService } from './entity-list.service';
|
|
9
|
+
import { EntityManager } from 'typeorm';
|
|
10
|
+
import { EntityTableService } from './entity-table.service';
|
|
11
|
+
import { EntityTableColumnService } from './entity-table-column.service';
|
|
12
|
+
import { EntityValidationService } from './entity-validation.service';
|
|
13
|
+
export declare class EntityServiceImpl implements EntityService<BaseEntity> {
|
|
14
|
+
protected readonly entityMasterService: EntityMasterService;
|
|
15
|
+
protected readonly entityTableColumnService: EntityTableColumnService;
|
|
16
|
+
protected readonly entityTableService: EntityTableService;
|
|
17
|
+
protected readonly reflectionHelper: ReflectionHelper;
|
|
18
|
+
protected readonly entityListService: EntityListService;
|
|
19
|
+
protected readonly loggingService: LoggingService;
|
|
20
|
+
protected readonly entityValidationService: EntityValidationService;
|
|
21
|
+
createEntity(entityData: BaseEntity, loggedInUser: UserData | null, manager?: EntityManager | null, appcode?: string): Promise<any>;
|
|
22
|
+
deleteEntity(entityType: string, entityId: number, loggedInUserData: UserData): void;
|
|
23
|
+
findByCode(entityType: string, code: string): Promise<BaseEntity>;
|
|
24
|
+
getEntityData(entityType: string, id: number): Promise<BaseEntity | null>;
|
|
25
|
+
getEntityDataAll(entityType: string, type: {}): Promise<BaseEntity[] | null>;
|
|
26
|
+
getEntityList(entityType: string, filters?: Record<string, any>): Promise<BaseEntity[]>;
|
|
27
|
+
updateEntity(entityData: BaseEntity, loggedInUser: UserData | null, appcode?: string): Promise<any>;
|
|
28
|
+
getFilterDataWithTabs(entityType: string, listType: string, filters: Record<string, any>, sortColumn: string | undefined, sortOrder: string | undefined, pageNumber: number, pageSize: number, tabColumn?: string, tabValue?: string, appcode?: string): Promise<EntityListData>;
|
|
29
|
+
generateExcelReport(entityType: string, filterCriteria: Record<string, any>, listEntityType: string, displayType: string, sampleExport: boolean): Promise<string | null>;
|
|
30
|
+
private populateExcelData;
|
|
31
|
+
private getMaxSequenceNumber;
|
|
32
|
+
}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.EntityServiceImpl = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const entity_master_service_1 = require("./entity-master.service");
|
|
15
|
+
const reflection_helper_service_1 = require("../../../utils/service/reflection-helper.service");
|
|
16
|
+
const loggingUtil_service_1 = require("../../../utils/service/loggingUtil.service");
|
|
17
|
+
const entity_list_service_1 = require("./entity-list.service");
|
|
18
|
+
const excel_data_dto_1 = require("../../../utils/dto/excel-data.dto");
|
|
19
|
+
const fs = require("fs");
|
|
20
|
+
const path = require("path");
|
|
21
|
+
const excel_helper_service_1 = require("../../../utils/service/excel-helper.service");
|
|
22
|
+
const entity_table_service_1 = require("./entity-table.service");
|
|
23
|
+
const entity_table_column_service_1 = require("./entity-table-column.service");
|
|
24
|
+
const global_constant_1 = require("../../../constant/global.constant");
|
|
25
|
+
const entity_validation_service_1 = require("./entity-validation.service");
|
|
26
|
+
let EntityServiceImpl = class EntityServiceImpl {
|
|
27
|
+
async createEntity(entityData, loggedInUser, manager, appcode) {
|
|
28
|
+
if (!entityData.entity_type) {
|
|
29
|
+
throw new common_1.BadRequestException(`EntityType is missing`);
|
|
30
|
+
}
|
|
31
|
+
const entityMaster = await this.entityMasterService.getEntityData(entityData.entity_type);
|
|
32
|
+
const validationErrors = await this.entityValidationService.validateEntityData(entityData, entityMaster, loggedInUser);
|
|
33
|
+
console.log('Validation Errors:', validationErrors);
|
|
34
|
+
if (validationErrors && validationErrors.length > 0) {
|
|
35
|
+
return {
|
|
36
|
+
success: false,
|
|
37
|
+
message: 'Validation failed',
|
|
38
|
+
errors: validationErrors,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
const repo = manager
|
|
42
|
+
? manager.getRepository(entityMaster.entity_data_class)
|
|
43
|
+
: this.reflectionHelper.getRepoService(entityMaster.entity_data_class);
|
|
44
|
+
if (!repo) {
|
|
45
|
+
throw new Error(`Repository service not found for entityType: ${entityData.entity_type}`);
|
|
46
|
+
}
|
|
47
|
+
if (!entityData.code) {
|
|
48
|
+
let maxSeqNo = await this.getMaxSequenceNumber(entityData.entity_type, entityData.parent_id, entityData.parent_type);
|
|
49
|
+
maxSeqNo = Number(maxSeqNo) + 1;
|
|
50
|
+
entityData.code = entityData.entity_type + maxSeqNo;
|
|
51
|
+
}
|
|
52
|
+
entityData.created_date = new Date();
|
|
53
|
+
if (loggedInUser) {
|
|
54
|
+
entityData.created_by = loggedInUser.id;
|
|
55
|
+
if (!entityData.organization_id)
|
|
56
|
+
entityData.organization_id = loggedInUser.organization_id;
|
|
57
|
+
if (!entityData.enterprise_id)
|
|
58
|
+
entityData.enterprise_id = loggedInUser.enterprise_id;
|
|
59
|
+
if (!entityData.level_type)
|
|
60
|
+
entityData.level_type = loggedInUser.level_type;
|
|
61
|
+
if (!entityData.level_id)
|
|
62
|
+
entityData.level_id = loggedInUser.level_id;
|
|
63
|
+
}
|
|
64
|
+
return repo.save(entityData);
|
|
65
|
+
}
|
|
66
|
+
deleteEntity(entityType, entityId, loggedInUserData) { }
|
|
67
|
+
async findByCode(entityType, code) {
|
|
68
|
+
const entityData = await this.entityMasterService.getEntityData(entityType);
|
|
69
|
+
const repoService = this.reflectionHelper.getRepoService(entityData.entity_data_class);
|
|
70
|
+
if (!repoService) {
|
|
71
|
+
throw new Error(`Repository service not found for entityType: ${entityType}`);
|
|
72
|
+
}
|
|
73
|
+
const result = await repoService?.findOne({ where: { code: code } });
|
|
74
|
+
if (!result) {
|
|
75
|
+
throw new Error(`Entity not found for entityType: ${entityType}`);
|
|
76
|
+
}
|
|
77
|
+
return result;
|
|
78
|
+
}
|
|
79
|
+
async getEntityData(entityType, id) {
|
|
80
|
+
const entityData = await this.entityMasterService.getEntityData(entityType);
|
|
81
|
+
const repoService = this.reflectionHelper.getRepoService(entityData.entity_data_class);
|
|
82
|
+
if (!repoService) {
|
|
83
|
+
throw new Error(`Repository service not found for entityType: ${entityType}`);
|
|
84
|
+
}
|
|
85
|
+
return await repoService.findOne({ where: { id: id } });
|
|
86
|
+
}
|
|
87
|
+
async getEntityDataAll(entityType, type) {
|
|
88
|
+
const entityData = await this.entityMasterService.getEntityData(entityType);
|
|
89
|
+
const repoService = this.reflectionHelper.getRepoService(entityData.entity_data_class);
|
|
90
|
+
if (!repoService) {
|
|
91
|
+
throw new Error(`Repository service not found for entityType: ${entityType}`);
|
|
92
|
+
}
|
|
93
|
+
return await repoService.find({ where: type });
|
|
94
|
+
}
|
|
95
|
+
async getEntityList(entityType, filters = {}) {
|
|
96
|
+
const entityData = await this.entityMasterService.getEntityData(entityType);
|
|
97
|
+
const repoService = this.reflectionHelper.getRepoService(entityData.entity_data_class);
|
|
98
|
+
if (!repoService) {
|
|
99
|
+
throw new Error(`Repository service not found for entityType: ${entityType}`);
|
|
100
|
+
}
|
|
101
|
+
const result = await repoService.find({
|
|
102
|
+
where: filters,
|
|
103
|
+
});
|
|
104
|
+
return result;
|
|
105
|
+
}
|
|
106
|
+
async updateEntity(entityData, loggedInUser, appcode) {
|
|
107
|
+
const entityMaster = await this.entityMasterService.getEntityData(entityData.entity_type);
|
|
108
|
+
const repoService = this.reflectionHelper.getRepoService(entityMaster.entity_data_class);
|
|
109
|
+
if (!repoService) {
|
|
110
|
+
throw new Error(`Repository service not found for entityType: ${entityData.entity_type}`);
|
|
111
|
+
}
|
|
112
|
+
entityData.modified_date = new Date();
|
|
113
|
+
if (loggedInUser) {
|
|
114
|
+
entityData.modified_by = loggedInUser.id;
|
|
115
|
+
if (!entityData.organization_id && entityData.entity_type !== 'ORG')
|
|
116
|
+
entityData.organization_id = loggedInUser.organization_id;
|
|
117
|
+
if (!entityData.enterprise_id)
|
|
118
|
+
entityData.enterprise_id = loggedInUser.enterprise_id;
|
|
119
|
+
}
|
|
120
|
+
await repoService.update(entityData.id, entityData);
|
|
121
|
+
return await repoService.findOne({ where: { id: entityData.id } });
|
|
122
|
+
}
|
|
123
|
+
async getFilterDataWithTabs(entityType, listType, filters, sortColumn, sortOrder, pageNumber, pageSize, tabColumn, tabValue, appcode) {
|
|
124
|
+
return await this.entityListService.getFilterDataWithTabs(entityType, listType, filters, sortColumn, sortOrder, pageNumber, pageSize, tabColumn, tabValue, appcode);
|
|
125
|
+
}
|
|
126
|
+
async generateExcelReport(entityType, filterCriteria, listEntityType, displayType, sampleExport) {
|
|
127
|
+
let fileName;
|
|
128
|
+
try {
|
|
129
|
+
const excelData = new excel_data_dto_1.ExcelData();
|
|
130
|
+
await this.populateExcelData(excelData, entityType, filterCriteria, listEntityType, displayType, sampleExport);
|
|
131
|
+
const modifiedDate = new Date().toISOString().replace(/[-T:.Z]/g, '');
|
|
132
|
+
const tempDir = path.join(__dirname, '../../temp');
|
|
133
|
+
if (!fs.existsSync(tempDir)) {
|
|
134
|
+
fs.mkdirSync(tempDir, { recursive: true });
|
|
135
|
+
}
|
|
136
|
+
fileName = path.join(tempDir, `export_${modifiedDate}.xlsx`);
|
|
137
|
+
excelData.filePath = fileName;
|
|
138
|
+
excel_helper_service_1.ExcelHelper.writeExcel(excelData);
|
|
139
|
+
}
|
|
140
|
+
catch (error) {
|
|
141
|
+
throw error;
|
|
142
|
+
}
|
|
143
|
+
return fileName;
|
|
144
|
+
}
|
|
145
|
+
async populateExcelData(excelData, entityType, filterCriteria, listEntityType, displayType, sampleExport) {
|
|
146
|
+
const entityTable = await this.entityTableService.findByEntityTypeAndListTypeAndDisplayType(entityType, listEntityType, displayType);
|
|
147
|
+
const sheet = {
|
|
148
|
+
sheetName: entityTable?.data_source || 'sheet',
|
|
149
|
+
headers: [],
|
|
150
|
+
rowList: [],
|
|
151
|
+
};
|
|
152
|
+
if (entityTable) {
|
|
153
|
+
const entityTableColumnList = await this.entityTableColumnService.findByParentIdAndParentType(entityTable.id, entityTable.entity_type);
|
|
154
|
+
sheet.headers = entityTableColumnList.map((col) => col.name);
|
|
155
|
+
const attributeList = entityTableColumnList.map((col) => col.attribute_key);
|
|
156
|
+
let filteredList = [];
|
|
157
|
+
if (!sampleExport) {
|
|
158
|
+
filteredList = await this.entityListService.getFilteredList(entityTable, filterCriteria, undefined, undefined, undefined, undefined);
|
|
159
|
+
}
|
|
160
|
+
sheet.rowList = filteredList.map((item) => attributeList.map((attr) => item[attr] !== undefined ? item[attr] : null));
|
|
161
|
+
excelData.addSheet(sheet);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
async getMaxSequenceNumber(entityType, parentId, parentType) {
|
|
165
|
+
let tableName;
|
|
166
|
+
if (global_constant_1.ENTITYTYPE_ENTITYMASTER === entityType) {
|
|
167
|
+
tableName = 'cr_entity_master';
|
|
168
|
+
}
|
|
169
|
+
else {
|
|
170
|
+
let entityMaster = await this.entityMasterService.getEntityData(entityType);
|
|
171
|
+
tableName = entityMaster.db_table_name;
|
|
172
|
+
}
|
|
173
|
+
return await this.entityListService.getMaxSequenceNumber(tableName, parentType, parentId);
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
exports.EntityServiceImpl = EntityServiceImpl;
|
|
177
|
+
__decorate([
|
|
178
|
+
(0, common_1.Inject)(),
|
|
179
|
+
__metadata("design:type", entity_master_service_1.EntityMasterService)
|
|
180
|
+
], EntityServiceImpl.prototype, "entityMasterService", void 0);
|
|
181
|
+
__decorate([
|
|
182
|
+
(0, common_1.Inject)(),
|
|
183
|
+
__metadata("design:type", entity_table_column_service_1.EntityTableColumnService)
|
|
184
|
+
], EntityServiceImpl.prototype, "entityTableColumnService", void 0);
|
|
185
|
+
__decorate([
|
|
186
|
+
(0, common_1.Inject)(),
|
|
187
|
+
__metadata("design:type", entity_table_service_1.EntityTableService)
|
|
188
|
+
], EntityServiceImpl.prototype, "entityTableService", void 0);
|
|
189
|
+
__decorate([
|
|
190
|
+
(0, common_1.Inject)(),
|
|
191
|
+
__metadata("design:type", reflection_helper_service_1.ReflectionHelper)
|
|
192
|
+
], EntityServiceImpl.prototype, "reflectionHelper", void 0);
|
|
193
|
+
__decorate([
|
|
194
|
+
(0, common_1.Inject)(),
|
|
195
|
+
__metadata("design:type", entity_list_service_1.EntityListService)
|
|
196
|
+
], EntityServiceImpl.prototype, "entityListService", void 0);
|
|
197
|
+
__decorate([
|
|
198
|
+
(0, common_1.Inject)(),
|
|
199
|
+
__metadata("design:type", loggingUtil_service_1.LoggingService)
|
|
200
|
+
], EntityServiceImpl.prototype, "loggingService", void 0);
|
|
201
|
+
__decorate([
|
|
202
|
+
(0, common_1.Inject)(),
|
|
203
|
+
__metadata("design:type", entity_validation_service_1.EntityValidationService)
|
|
204
|
+
], EntityServiceImpl.prototype, "entityValidationService", void 0);
|
|
205
|
+
exports.EntityServiceImpl = EntityServiceImpl = __decorate([
|
|
206
|
+
(0, common_1.Injectable)()
|
|
207
|
+
], EntityServiceImpl);
|
|
208
|
+
//# sourceMappingURL=entity-service-impl.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity-service-impl.service.js","sourceRoot":"","sources":["../../../../src/module/meta/service/entity-service-impl.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,2CAAyE;AAEzE,mEAA8D;AAC9D,gGAAoF;AAEpF,oFAA4E;A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ColumnRepository } from '../repository/entity-table-column.repository';
|
|
2
|
+
export declare class EntityTableColumnService {
|
|
3
|
+
private entityTableColumnRepository;
|
|
4
|
+
constructor(entityTableColumnRepository: EntityTableColumnRepository);
|
|
5
|
+
getAttributeJson(parentId: number, parentType: string): Promise<{}>;
|
|
6
|
+
findByParentIdAndParentType(parentId: number, parentType: string, isVisible?: boolean): Promise<import("../entity/entity-table-column.entity").EntityTableColumn[]>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.EntityTableColumnService = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const entity_table_column_repository_1 = require("../repository/entity-table-column.repository");
|
|
15
|
+
let EntityTableColumnService = class EntityTableColumnService {
|
|
16
|
+
constructor(entityTableColumnRepository) {
|
|
17
|
+
this.entityTableColumnRepository = entityTableColumnRepository;
|
|
18
|
+
}
|
|
19
|
+
async getAttributeJson(parentId, parentType) {
|
|
20
|
+
let entityTableColumns = await this.entityTableColumnRepository.findByParentIdAndParentType(parentId, parentType, true);
|
|
21
|
+
let attributeJson = {};
|
|
22
|
+
entityTableColumns.forEach((value) => {
|
|
23
|
+
attributeJson[value.attribute_key] = value.data_type;
|
|
24
|
+
});
|
|
25
|
+
return attributeJson;
|
|
26
|
+
}
|
|
27
|
+
async findByParentIdAndParentType(parentId, parentType, isVisible) {
|
|
28
|
+
let entityTableColumns = await this.entityTableColumnRepository.findByParentIdAndParentType(parentId, parentType, isVisible);
|
|
29
|
+
return entityTableColumns;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
exports.EntityTableColumnService = EntityTableColumnService;
|
|
33
|
+
exports.EntityTableColumnService = EntityTableColumnService = __decorate([
|
|
34
|
+
(0, common_1.Injectable)(),
|
|
35
|
+
__metadata("design:paramtypes", [entity_table_column_repository_1.EntityTableColumnRepository])
|
|
36
|
+
], EntityTableColumnService);
|
|
37
|
+
//# sourceMappingURL=entity-table-column.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity-table-column.service.js","sourceRoot":"","sources":["../../../../src/module/meta/service/entity-table-column.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,iGAA2F;AAGpF,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;IACnC,YACU,2BAAwD;QAAxD,gCAA2B,GAA3B,2BAA2B,CAA6B;IAC/D,CAAC;IAEJ,KAAK,CAAC,gBAAgB,CAAC,QAAgB,EAAE,UAAkB;QACzD,IAAI,kBAAkB,GACpB,MAAM,IAAI,CAAC,2BAA2B,CAAC,2BAA2B,CAChE,QAAQ,EACR,UAAU,EACV,IAAI,CACL,CAAC;QACJ,IAAI,aAAa,GAAG,EAAE,CAAC;QACvB,kBAAkB,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;YACnC,aAAa,CAAC,KAAK,CAAC,aAAa,CAAC,GAAG,KAAK,CAAC,SAAS,CAAC;QACvD,CAAC,CAAC,CAAC;QACH,OAAO,aAAa,CAAC;IACvB,CAAC;IAED,KAAK,CAAC,2BAA2B,CAC/B,QAAgB,EAChB,UAAkB,EAClB,SAAmB;QAEnB,IAAI,kBAAkB,GACpB,MAAM,IAAI,CAAC,2BAA2B,CAAC,2BAA2B,CAChE,QAAQ,EACR,UAAU,EACV,SAAS,CACV,CAAC;QACJ,OAAO,kBAAkB,CAAC;IAC5B,CAAC;CACF,CAAA;AAhCY,4DAAwB;mCAAxB,wBAAwB;IADpC,IAAA,mBAAU,GAAE;qCAG4B,4DAA2B;GAFvD,wBAAwB,CAgCpC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { EntityTableRepository } from '../repository/entity-table.repository';
|
|
2
|
+
import { EntityTableColumnRepository } from '../repository/entity-table-column.repository';
|
|
3
|
+
import { EntityTableDto } from '../dto/entity-table.dto';
|
|
4
|
+
import { ListMasterService } from 'src/module/listmaster/service/list-master.service';
|
|
5
|
+
import { SavedFilterRepositoryService } from 'src/module/filter/repository/saved-filter.repository';
|
|
6
|
+
export declare class EntityTableService {
|
|
7
|
+
private entityTableRepository;
|
|
8
|
+
private readonly entityTableColumnRepository;
|
|
9
|
+
private readonly listMasterService;
|
|
10
|
+
private readonly savedFilterRepoService;
|
|
11
|
+
constructor(entityTableRepository: EntityTableRepository, entityTableColumnRepository: EntityTableColumnRepository, listMasterService: ListMasterService, savedFilterRepoService: SavedFilterRepositoryService);
|
|
12
|
+
getEntityData(mappedEntityType: string | null): Promise<import("../entity/entity-table.entity").EntityTable>;
|
|
13
|
+
findByEntityTypeAndListType(entityType: string, listType: string): Promise<import("../entity/entity-table.entity").EntityTable | null>;
|
|
14
|
+
findByEntityTypeAndListTypeAndDisplayType(entityType: string, listType: string, displayType: string): Promise<import("../entity/entity-table.entity").EntityTable | null>;
|
|
15
|
+
getTableMetaDataForListing(entityType: string, listType: string, userId?: number): Promise<EntityTableDto>;
|
|
16
|
+
getTableMetaData(entityType: string, listType: string, displayType: string, userId?: number): Promise<EntityTableDto>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.EntityTableService = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const entity_table_repository_1 = require("../repository/entity-table.repository");
|
|
18
|
+
const entity_table_column_repository_1 = require("../repository/entity-table-column.repository");
|
|
19
|
+
const global_constant_1 = require("../../../constant/global.constant");
|
|
20
|
+
const list_master_service_1 = require("../../listmaster/service/list-master.service");
|
|
21
|
+
const saved_filter_repository_1 = require("../../filter/repository/saved-filter.repository");
|
|
22
|
+
let EntityTableService = class EntityTableService {
|
|
23
|
+
constructor(entityTableRepository, entityTableColumnRepository, listMasterService, savedFilterRepoService) {
|
|
24
|
+
this.entityTableRepository = entityTableRepository;
|
|
25
|
+
this.entityTableColumnRepository = entityTableColumnRepository;
|
|
26
|
+
this.listMasterService = listMasterService;
|
|
27
|
+
this.savedFilterRepoService = savedFilterRepoService;
|
|
28
|
+
}
|
|
29
|
+
async getEntityData(mappedEntityType) {
|
|
30
|
+
if (mappedEntityType) {
|
|
31
|
+
const tableMaster = await this.entityTableRepository.findByMappedEntityType(mappedEntityType);
|
|
32
|
+
if (!tableMaster) {
|
|
33
|
+
throw new Error(`Entity with mappedEntityType "${mappedEntityType}" not found.`);
|
|
34
|
+
}
|
|
35
|
+
return tableMaster;
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
throw new Error();
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
async findByEntityTypeAndListType(entityType, listType) {
|
|
42
|
+
return await this.entityTableRepository.findByEntityTypeAndListType(entityType, listType);
|
|
43
|
+
}
|
|
44
|
+
async findByEntityTypeAndListTypeAndDisplayType(entityType, listType, displayType) {
|
|
45
|
+
return await this.entityTableRepository.findByEntityTypeAndListTypeAndDisplayType(entityType, listType, displayType);
|
|
46
|
+
}
|
|
47
|
+
async getTableMetaDataForListing(entityType, listType, userId) {
|
|
48
|
+
return await this.getTableMetaData(entityType, listType, global_constant_1.DISPLAY_LIST, userId);
|
|
49
|
+
}
|
|
50
|
+
async getTableMetaData(entityType, listType, displayType, userId) {
|
|
51
|
+
let entityTable = await this.findByEntityTypeAndListTypeAndDisplayType(entityType, listType, displayType);
|
|
52
|
+
let entityTableDto = entityTable;
|
|
53
|
+
if (entityTable) {
|
|
54
|
+
entityTableDto.column_list =
|
|
55
|
+
await this.entityTableColumnRepository.findByParentIdAndParentType(entityTable.id, entityTable.entity_type);
|
|
56
|
+
entityTableDto.operation_list = {
|
|
57
|
+
text: await this.listMasterService.getDropdownOptions('OPT', {}),
|
|
58
|
+
number: await this.listMasterService.getDropdownOptions('OPN', {}),
|
|
59
|
+
date: await this.listMasterService.getDropdownOptions('OPD', {}),
|
|
60
|
+
select: await this.listMasterService.getDropdownOptions('OPS', {}),
|
|
61
|
+
multiselect: await this.listMasterService.getDropdownOptions('OPM', {}),
|
|
62
|
+
year: await this.listMasterService.getDropdownOptions('OPY', {}),
|
|
63
|
+
};
|
|
64
|
+
entityTableDto.default_filter =
|
|
65
|
+
await this.savedFilterRepoService.getDefaultFilterByEntityType(entityTable.list_type);
|
|
66
|
+
if (userId) {
|
|
67
|
+
entityTableDto.saved_filter =
|
|
68
|
+
await this.savedFilterRepoService.getSavedFiltersByUserIdAndEntityType(userId, entityTable.list_type);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return entityTableDto;
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
exports.EntityTableService = EntityTableService;
|
|
75
|
+
exports.EntityTableService = EntityTableService = __decorate([
|
|
76
|
+
(0, common_1.Injectable)(),
|
|
77
|
+
__param(2, (0, common_1.Inject)((0, common_1.forwardRef)(() => list_master_service_1.ListMasterService))),
|
|
78
|
+
__metadata("design:paramtypes", [entity_table_repository_1.EntityTableRepository,
|
|
79
|
+
entity_table_column_repository_1.EntityTableColumnRepository,
|
|
80
|
+
list_master_service_1.ListMasterService,
|
|
81
|
+
saved_filter_repository_1.SavedFilterRepositoryService])
|
|
82
|
+
], EntityTableService);
|
|
83
|
+
//# sourceMappingURL=entity-table.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity-table.service.js","sourceRoot":"","sources":["../../../../src/module/meta/service/entity-table.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAgE;AAChE,mFAA8E;AAC9E,iGAA2F;AAE3F,uEAAiE;AACjE,sFAAsF;AAEtF,6FAAoG;AAG7F,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAC7B,YACU,qBAA4C,EACnC,2BAAwD,EAExD,iBAAoC,EAEpC,sBAAoD;QAL7D,0BAAqB,GAArB,qBAAqB,CAAuB;QACnC,gCAA2B,GAA3B,2BAA2B,CAA6B;QAExD,sBAAiB,GAAjB,iBAAiB,CAAmB;QAEpC,2BAAsB,GAAtB,sBAAsB,CAA8B;IACpE,CAAC;IAEJ,KAAK,CAAC,aAAa,CAAC,gBAA+B;QACjD,IAAI,gBAAgB,EAAE,CAAC;YACrB,MAA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AM,IAAI,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,KAAK,EAAE,EAAE,CAAC;gBAChE,MAAM,EAAE,MAAM,IAAI,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,KAAK,EAAE,EAAE,CAAC;gBAClE,IAAI,EAAE,MAAM,IAAI,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,KAAK,EAAE,EAAE,CAAC;gBAChE,MAAM,EAAE,MAAM,IAAI,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,KAAK,EAAE,EAAE,CAAC;gBAClE,WAAW,EAAE,MAAM,IAAI,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,KAAK,EAAE,EAAE,CAAC;gBACvE,IAAI,EAAE,MAAM,IAAI,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,KAAK,EAAE,EAAE,CAAC;aAEjE,CAAC;YACF,cAAc,CAAC,cAAc;gBAC3B,MAAM,IAAI,CAAC,sBAAsB,CAAC,4BAA4B,CAC5D,WAAW,CAAC,SAAS,CACtB,CAAC;YACJ,IAAI,MAAM,EAAE,CAAC;gBACX,cAAc,CAAC,YAAY;oBACzB,MAAM,IAAI,CAAC,sBAAsB,CAAC,oCAAoC,CACpE,MAAM,EACN,WAAW,CAAC,SAAS,CACtB,CAAC;YACN,CAAC;QACH,CAAC;QAED,OAAO,cAAc,CAAC;IACxB,CAAC;CACF,CAAA;AAxGY,gDAAkB;6BAAlB,kBAAkB;IAD9B,IAAA,mBAAU,GAAE;IAKR,WAAA,IAAA,eAAM,EAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,uCAAiB,CAAC,CAAC,CAAA;qCAFb,+CAAqB;QACN,4DAA2B;QAErC,uCAAiB;QAEZ,sDAA4B;GAP5D,kBAAkB,CAwG9B"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { AttributeMasterService } from 'src/module/meta/service/attribute-master.service';
|
|
2
|
+
import { AttributeMaster } from '../entity/attribute-master.entity';
|
|
3
|
+
import { ReflectionHelper } from 'src/utils/service/reflection-helper.service';
|
|
4
|
+
import { DataSource } from 'typeorm';
|
|
5
|
+
interface ValidationError {
|
|
6
|
+
field: string;
|
|
7
|
+
message: string;
|
|
8
|
+
}
|
|
9
|
+
export declare class EntityValidationService {
|
|
10
|
+
private readonly attributeMasterService;
|
|
11
|
+
private readonly reflectionHelper;
|
|
12
|
+
private dataSource;
|
|
13
|
+
constructor(attributeMasterService: AttributeMasterService, reflectionHelper: ReflectionHelper, dataSource: DataSource);
|
|
14
|
+
validateRequiredFields(entityData: Record<string, any>, attributeData: AttributeMaster[]): ValidationError[];
|
|
15
|
+
validateUniqueFields(entityData: Record<string, any>, attributeData: AttributeMaster[], entityType: string, db_table_name: string, loggedInUser: any): Promise<ValidationError[]>;
|
|
16
|
+
validateRegexFields(entityData: Record<string, any>, attributeData: AttributeMaster[]): Promise<ValidationError[]>;
|
|
17
|
+
validateEntityData(entityData: Record<string, any>, entityMaster: any, loggedInUser: any): Promise<ValidationError[]>;
|
|
18
|
+
validateExcelEntityData(entityData: Record<string, any>, entityMaster: any): Promise<ValidationError[]>;
|
|
19
|
+
private hasValidValue;
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.EntityValidationService = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const attribute_master_service_1 = require("./attribute-master.service");
|
|
15
|
+
const reflection_helper_service_1 = require("../../../utils/service/reflection-helper.service");
|
|
16
|
+
const typeorm_1 = require("typeorm");
|
|
17
|
+
let EntityValidationService = class EntityValidationService {
|
|
18
|
+
constructor(attributeMasterService, reflectionHelper, dataSource) {
|
|
19
|
+
this.attributeMasterService = attributeMasterService;
|
|
20
|
+
this.reflectionHelper = reflectionHelper;
|
|
21
|
+
this.dataSource = dataSource;
|
|
22
|
+
}
|
|
23
|
+
validateRequiredFields(entityData, attributeData) {
|
|
24
|
+
const errors = [];
|
|
25
|
+
attributeData
|
|
26
|
+
.filter((attr) => attr.required)
|
|
27
|
+
.forEach((attr) => {
|
|
28
|
+
const value = entityData[attr.attribute_key];
|
|
29
|
+
if (!this.hasValidValue(value)) {
|
|
30
|
+
errors.push({
|
|
31
|
+
field: attr.name,
|
|
32
|
+
message: `Field ${attr.name} is required.`,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
return errors;
|
|
37
|
+
}
|
|
38
|
+
async validateUniqueFields(entityData, attributeData, entityType, db_table_name, loggedInUser) {
|
|
39
|
+
const errors = [];
|
|
40
|
+
for (const attr of attributeData.filter((a) => a.is_unique)) {
|
|
41
|
+
const value = entityData[attr.attribute_key];
|
|
42
|
+
if (this.hasValidValue(value)) {
|
|
43
|
+
let qb = this.dataSource
|
|
44
|
+
.createQueryBuilder()
|
|
45
|
+
.select('*')
|
|
46
|
+
.from(db_table_name, db_table_name)
|
|
47
|
+
.where(`${db_table_name}.${attr.attribute_key} = :value`, { value });
|
|
48
|
+
const orgId = entityData.organization_id;
|
|
49
|
+
const level_type = loggedInUser.level_type;
|
|
50
|
+
const level_id = loggedInUser.level_id;
|
|
51
|
+
if (orgId !== undefined && orgId !== null) {
|
|
52
|
+
qb = qb.andWhere(`${db_table_name}.organization_id = :organization_id AND ${db_table_name}.level_type = :level_type AND ${db_table_name}.level_id = :level_id`, {
|
|
53
|
+
organization_id: orgId,
|
|
54
|
+
level_type: level_type,
|
|
55
|
+
level_id: level_id,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
const existing = await qb.limit(1).getRawOne();
|
|
59
|
+
if (existing) {
|
|
60
|
+
errors.push({
|
|
61
|
+
field: attr.name,
|
|
62
|
+
message: `Field ${attr.name} must be unique. Value ${value} already exists.`,
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return errors;
|
|
68
|
+
}
|
|
69
|
+
async validateRegexFields(entityData, attributeData) {
|
|
70
|
+
const errors = [];
|
|
71
|
+
for (const attr of attributeData.filter((a) => a.regex)) {
|
|
72
|
+
const value = entityData[attr.attribute_key];
|
|
73
|
+
if (this.hasValidValue(value)) {
|
|
74
|
+
const regex = new RegExp(attr.regex);
|
|
75
|
+
if (!regex.test(value)) {
|
|
76
|
+
errors.push({
|
|
77
|
+
field: attr.name,
|
|
78
|
+
message: `Field ${attr.name} does not match the required pattern.`,
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return errors;
|
|
84
|
+
}
|
|
85
|
+
async validateEntityData(entityData, entityMaster, loggedInUser) {
|
|
86
|
+
const attributes = await this.attributeMasterService.findAttributesByMappedEntityType(entityData.entity_type);
|
|
87
|
+
const requiredErrors = this.validateRequiredFields(entityData, attributes);
|
|
88
|
+
const uniqueErrors = await this.validateUniqueFields(entityData, attributes, entityData.entity_type, entityMaster.db_table_name, loggedInUser);
|
|
89
|
+
const regexErros = await this.validateRegexFields(entityData, attributes);
|
|
90
|
+
return [...requiredErrors, ...uniqueErrors, ...regexErros];
|
|
91
|
+
}
|
|
92
|
+
async validateExcelEntityData(entityData, entityMaster) {
|
|
93
|
+
const attributes = await this.attributeMasterService.findAttributesByMappedEntityType(entityData.entity_type);
|
|
94
|
+
const requiredErrors = this.validateRequiredFields(entityData, attributes);
|
|
95
|
+
const regexErros = await this.validateRegexFields(entityData, attributes);
|
|
96
|
+
return [...requiredErrors, ...regexErros];
|
|
97
|
+
}
|
|
98
|
+
hasValidValue(value) {
|
|
99
|
+
if (value === null || value === undefined)
|
|
100
|
+
return false;
|
|
101
|
+
if (typeof value === 'string' && value.trim() === '')
|
|
102
|
+
return false;
|
|
103
|
+
return true;
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
exports.EntityValidationService = EntityValidationService;
|
|
107
|
+
exports.EntityValidationService = EntityValidationService = __decorate([
|
|
108
|
+
(0, common_1.Injectable)(),
|
|
109
|
+
__metadata("design:paramtypes", [attribute_master_service_1.AttributeMasterService,
|
|
110
|
+
reflection_helper_service_1.ReflectionHelper,
|
|
111
|
+
typeorm_1.DataSource])
|
|
112
|
+
], EntityValidationService);
|
|
113
|
+
//# sourceMappingURL=entity-validation.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity-validation.service.js","sourceRoot":"","sources":["../../../../src/module/meta/service/entity-validation.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,yEAA0F;AAE1F,gGAA+E;AAC/E,qCAAqC;AAQ9B,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAClC,YACmB,sBAA8C,EAC9C,gBAAkC,EAC3C,UAAsB;QAFb,2BAAsB,GAAtB,sBAAsB,CAAwB;QAC9C,qBAAgB,GAAhB,gBAAgB,CAAkB;QAC3C,eAAU,GAAV,UAAU,CAAY;IAC7B,CAAC;IAKJ,sBAAsB,CACpB,UAA+B,EAC/B,aAAgC;QAEhC,MAAM,MAAM,GAAsB,EAAE,CAAC;QAErC,aAAa;aACV,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CA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