@servicelabsco/slabs-access-manager 0.1.324 → 0.1.325
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/access/libraries/process.business.report.list.js +3 -2
- package/dist/access/libraries/process.business.report.list.js.map +1 -1
- package/dist/accessUtility/jobs/data.violation.job.d.ts +2 -1
- package/dist/accessUtility/jobs/data.violation.job.js +16 -1
- package/dist/accessUtility/jobs/data.violation.job.js.map +1 -1
- package/package.json +1 -1
|
@@ -8,7 +8,7 @@ class ProcessBusinessReportList extends process_common_finnoto_list_1.ProcessCom
|
|
|
8
8
|
this.business = business;
|
|
9
9
|
this.listingService = listingService;
|
|
10
10
|
this.config = {
|
|
11
|
-
sql: `bz_business_reports a left join sys_report_details b on a.sys_report_id = b.id left join sys_users c on a.created_by = c.id left join bz_business_details d on a.business_id = d.id where a.deleted_at is null and a.business_id = ${this.business.id}`,
|
|
11
|
+
sql: `bz_business_reports a left join sys_report_details b on a.sys_report_id = b.id left join sys_users c on a.created_by = c.id left join bz_business_details d on a.business_id = d.id left join sys_lookup_values e on a.type_id = e.id where a.deleted_at is null and a.business_id = ${this.business.id}`,
|
|
12
12
|
columns: [
|
|
13
13
|
'a.*',
|
|
14
14
|
'b.name report',
|
|
@@ -18,6 +18,7 @@ class ProcessBusinessReportList extends process_common_finnoto_list_1.ProcessCom
|
|
|
18
18
|
'c.email creator_email',
|
|
19
19
|
'c.image_url creator_image_url',
|
|
20
20
|
'd.name business',
|
|
21
|
+
'e.name type',
|
|
21
22
|
],
|
|
22
23
|
order: 'sq.created_at desc',
|
|
23
24
|
};
|
|
@@ -36,7 +37,7 @@ class ProcessBusinessReportList extends process_common_finnoto_list_1.ProcessCom
|
|
|
36
37
|
if (!this.filter.search)
|
|
37
38
|
return;
|
|
38
39
|
const str = this.filter.search;
|
|
39
|
-
this.restrictions.push(`a.email ilike '%${str}%'`);
|
|
40
|
+
this.restrictions.push(`a.url ilike '%${str}%' or EXISTS (SELECT 1 FROM jsonb_array_elements_text(a.emails::jsonb) AS em(email) WHERE em.email ILIKE '%${str}%') or a.comment ilike '%${str}%' or b.name ilike '%${str}%' or b.description ilike '${str}'`);
|
|
40
41
|
}
|
|
41
42
|
filterSourceType() {
|
|
42
43
|
if (!this.filter.source_type)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process.business.report.list.js","sourceRoot":"","sources":["../../../src/access/libraries/process.business.report.list.ts"],"names":[],"mappings":";;;AAIA,+EAAyE;AAEzE,MAAa,yBAA0B,SAAQ,sDAAwB;
|
|
1
|
+
{"version":3,"file":"process.business.report.list.js","sourceRoot":"","sources":["../../../src/access/libraries/process.business.report.list.ts"],"names":[],"mappings":";;;AAIA,+EAAyE;AAEzE,MAAa,yBAA0B,SAAQ,sDAAwB;IAyBnE,YACuB,QAA8B,EAC9B,cAA8B;QAEjD,KAAK,EAAE,CAAC;QAHW,aAAQ,GAAR,QAAQ,CAAsB;QAC9B,mBAAc,GAAd,cAAc,CAAgB;QAlB3C,WAAM,GAAG;YACf,GAAG,EAAE,wRAAwR,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE;YAC/S,OAAO,EAAE;gBACL,KAAK;gBACL,eAAe;gBACf,kBAAkB;gBAClB,eAAe;gBACf,gBAAgB;gBAChB,uBAAuB;gBACvB,+BAA+B;gBAC/B,iBAAiB;gBACjB,aAAa;aAChB;YACD,KAAK,EAAE,oBAAoB;SAC9B,CAAC;IAOF,CAAC;IAQD,KAAK,CAAC,OAAO,CAAC,MAAmC;QAC7C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QAGrB,IAAI,CAAC,cAAc,EAAE,CAAC;QAEtB,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC;IACzB,CAAC;IAOO,cAAc;QAClB,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,mBAAmB,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC,CAAC;QAE9D,IAAI,CAAC,MAAM,EAAE,CAAC;QACd,IAAI,CAAC,gBAAgB,EAAE,CAAC;IAC5B,CAAC;IAQO,MAAM;QACV,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM;YAAE,OAAO;QAChC,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;QAE/B,IAAI,CAAC,YAAY,CAAC,IAAI,CAClB,iBAAiB,GAAG,8GAA8G,GAAG,4BAA4B,GAAG,wBAAwB,GAAG,8BAA8B,GAAG,GAAG,CACtO,CAAC;IACN,CAAC;IAQO,gBAAgB;QACpB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW;YAAE,OAAO;QACrC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,oBAAoB,IAAI,CAAC,MAAM,CAAC,WAAW,GAAG,CAAC,CAAC;IAC3E,CAAC;CACJ;AApFD,8DAoFC"}
|
|
@@ -3,5 +3,6 @@ import { DataViolationEntity } from '../entities/data.violation.entity';
|
|
|
3
3
|
export declare class DataViolationJob extends CommonJob {
|
|
4
4
|
protected readonly queueService: QueueService;
|
|
5
5
|
constructor(queueService: QueueService);
|
|
6
|
-
handle(evt: DatabaseEventDto<DataViolationEntity>): Promise<
|
|
6
|
+
handle(evt: DatabaseEventDto<DataViolationEntity>): Promise<void>;
|
|
7
|
+
private setViolationsCount;
|
|
7
8
|
}
|
|
@@ -12,13 +12,28 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.DataViolationJob = void 0;
|
|
13
13
|
const common_1 = require("@nestjs/common");
|
|
14
14
|
const nestjs_utility_services_1 = require("@servicelabsco/nestjs-utility-services");
|
|
15
|
+
const typeorm_1 = require("typeorm");
|
|
16
|
+
const data_violation_entity_1 = require("../entities/data.violation.entity");
|
|
17
|
+
const data_violation_status_type_enum_1 = require("../enums/data.violation.status.type.enum");
|
|
15
18
|
let DataViolationJob = class DataViolationJob extends nestjs_utility_services_1.CommonJob {
|
|
16
19
|
constructor(queueService) {
|
|
17
20
|
super('bf08df269dcd9ea210fef88137011139');
|
|
18
21
|
this.queueService = queueService;
|
|
19
22
|
}
|
|
20
23
|
async handle(evt) {
|
|
21
|
-
|
|
24
|
+
await this.setViolationsCount(evt);
|
|
25
|
+
}
|
|
26
|
+
async setViolationsCount(evt) {
|
|
27
|
+
if (!this.isColumnUpdated(evt, ['status_id', 'source_type', 'source_id', 'deleted_at']))
|
|
28
|
+
return null;
|
|
29
|
+
const { source_type, source_id } = evt.entity;
|
|
30
|
+
const source = await nestjs_utility_services_1.PlatformUtility.getSourceData({ source_type, source_id });
|
|
31
|
+
if (!source)
|
|
32
|
+
return null;
|
|
33
|
+
const count = await data_violation_entity_1.DataViolationEntity.count({ where: { source_type, source_id, status_id: (0, typeorm_1.Not)(data_violation_status_type_enum_1.DataViolationStatusTypeEnum.APPROVED) } });
|
|
34
|
+
source.attributes = { ...source.attributes, violations_count: count || 0 };
|
|
35
|
+
await source.save();
|
|
36
|
+
return null;
|
|
22
37
|
}
|
|
23
38
|
};
|
|
24
39
|
exports.DataViolationJob = DataViolationJob;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data.violation.job.js","sourceRoot":"","sources":["../../../src/accessUtility/jobs/data.violation.job.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,
|
|
1
|
+
{"version":3,"file":"data.violation.job.js","sourceRoot":"","sources":["../../../src/accessUtility/jobs/data.violation.job.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,oFAAoH;AACpH,qCAA8B;AAC9B,6EAAwE;AACxE,8FAAuF;AAMhF,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,mCAAS;IAC3C,YAA+B,YAA0B;QACrD,KAAK,CAAC,kCAAkC,CAAC,CAAC;QADf,iBAAY,GAAZ,YAAY,CAAc;IAEzD,CAAC;IAOD,KAAK,CAAC,MAAM,CAAC,GAA0C;QACnD,MAAM,IAAI,CAAC,kBAAkB,CA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