@uniorganization/uni-lib 4.0.40 → 4.0.41

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.
@@ -4,6 +4,7 @@ import { ServiceCenterPhoneEntity } from './service-center-phone.entity';
4
4
  import { ServiceCenterRankingEntity } from './service-center-ranking.entity';
5
5
  import { ServiceCenterUnsupportedModelEntity } from './service-center-unsupported-model.entity';
6
6
  import { ServiceCenterStatus } from '../enums/service-center-status.enum';
7
+ export type ServiceCenterDeactivationSource = 'MANUAL' | 'ASC_UPLOAD';
7
8
  export declare class ServiceCenterEntity {
8
9
  id: number;
9
10
  servicerAccount: string;
@@ -20,6 +21,7 @@ export declare class ServiceCenterEntity {
20
21
  servicerType: string;
21
22
  status: ServiceCenterStatus;
22
23
  statusReason: string;
24
+ deactivationSource: ServiceCenterDeactivationSource | null;
23
25
  eligible: boolean;
24
26
  locatingFlag: boolean;
25
27
  autoAcceptanceFlag: boolean;
@@ -80,6 +80,10 @@ __decorate([
80
80
  (0, typeorm_1.Column)({ name: 'status_reason', type: 'varchar', nullable: true }),
81
81
  __metadata("design:type", String)
82
82
  ], ServiceCenterEntity.prototype, "statusReason", void 0);
83
+ __decorate([
84
+ (0, typeorm_1.Column)({ name: 'deactivation_source', type: 'varchar', nullable: true }),
85
+ __metadata("design:type", String)
86
+ ], ServiceCenterEntity.prototype, "deactivationSource", void 0);
83
87
  __decorate([
84
88
  (0, typeorm_1.Column)({ name: 'eligible', type: 'boolean', nullable: true, select: false }),
85
89
  __metadata("design:type", Boolean)
@@ -16,6 +16,8 @@ export declare class TicketServiceCenterMatchProcessEntity {
16
16
  sourceFileId: number | null;
17
17
  outputFile?: FileEntity | null;
18
18
  outputFileId: number | null;
19
+ excelOutputFile?: FileEntity | null;
20
+ excelOutputFileId: number | null;
19
21
  createdDate: Date;
20
22
  updatedDate: Date;
21
23
  deletedDate: Date | null;
@@ -76,6 +76,15 @@ __decorate([
76
76
  (0, typeorm_1.Column)({ name: 'output_file_id', type: 'integer', nullable: true }),
77
77
  __metadata("design:type", Number)
78
78
  ], TicketServiceCenterMatchProcessEntity.prototype, "outputFileId", void 0);
79
+ __decorate([
80
+ (0, typeorm_1.ManyToOne)(() => file_entity_1.FileEntity),
81
+ (0, typeorm_1.JoinColumn)({ name: 'excel_output_file_id' }),
82
+ __metadata("design:type", file_entity_1.FileEntity)
83
+ ], TicketServiceCenterMatchProcessEntity.prototype, "excelOutputFile", void 0);
84
+ __decorate([
85
+ (0, typeorm_1.Column)({ name: 'excel_output_file_id', type: 'integer', nullable: true }),
86
+ __metadata("design:type", Number)
87
+ ], TicketServiceCenterMatchProcessEntity.prototype, "excelOutputFileId", void 0);
79
88
  __decorate([
80
89
  (0, typeorm_1.CreateDateColumn)({ name: 'created_date', type: 'timestamp' }),
81
90
  __metadata("design:type", Date)
@@ -1,4 +1,5 @@
1
1
  export * from './feedback-role.enum';
2
2
  export * from './service-center-status.enum';
3
3
  export * from './ticket-service-center-match-process-status.enum';
4
+ export * from './ticket-service-center-match-progress-phase.enum';
4
5
  export * from './inbox';
@@ -17,4 +17,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./feedback-role.enum"), exports);
18
18
  __exportStar(require("./service-center-status.enum"), exports);
19
19
  __exportStar(require("./ticket-service-center-match-process-status.enum"), exports);
20
+ __exportStar(require("./ticket-service-center-match-progress-phase.enum"), exports);
20
21
  __exportStar(require("./inbox"), exports);
@@ -8,6 +8,7 @@ export declare const FILE_STORAGE_BUCKET_ENV_KEYS: readonly ["BUCKET_NAME", "BUC
8
8
  export declare const FILE_TYPE_CODES: {
9
9
  readonly SERVICE_CENTER_TICKET_MATCH_SOURCE: "SERVICE_CENTER_TICKET_MATCH_SOURCE";
10
10
  readonly SERVICE_CENTER_TICKET_MATCH_OUTPUT: "SERVICE_CENTER_TICKET_MATCH_OUTPUT";
11
+ readonly SERVICE_CENTER_TICKET_MATCH_EXCEL_OUTPUT: "SERVICE_CENTER_TICKET_MATCH_EXCEL_OUTPUT";
11
12
  };
12
13
  export declare const FILE_STORAGE_DEFAULT_BUCKET_PREFIX = "";
13
14
  export declare const FILE_STORAGE_ALLOWED_PATH_SEPARATOR = "/";
@@ -18,6 +18,7 @@ exports.FILE_STORAGE_BUCKET_ENV_KEYS = [
18
18
  exports.FILE_TYPE_CODES = {
19
19
  SERVICE_CENTER_TICKET_MATCH_SOURCE: 'SERVICE_CENTER_TICKET_MATCH_SOURCE',
20
20
  SERVICE_CENTER_TICKET_MATCH_OUTPUT: 'SERVICE_CENTER_TICKET_MATCH_OUTPUT',
21
+ SERVICE_CENTER_TICKET_MATCH_EXCEL_OUTPUT: 'SERVICE_CENTER_TICKET_MATCH_EXCEL_OUTPUT',
21
22
  };
22
23
  exports.FILE_STORAGE_DEFAULT_BUCKET_PREFIX = '';
23
24
  exports.FILE_STORAGE_ALLOWED_PATH_SEPARATOR = '/';
@@ -20,6 +20,7 @@ export declare class FileStorageService {
20
20
  private readonly s3Client;
21
21
  constructor(fileRepository: Repository<FileEntity>, fileTypeRepository: Repository<FileTypeEntity>);
22
22
  uploadDocument(file: FileStorageUploadFile, options: FileStorageUploadOptions): Promise<FileEntity>;
23
+ deleteDocument(file: Pick<FileEntity, 'id' | 'path'>): Promise<void>;
23
24
  downloadDocument(bucketPath: string): Promise<Buffer>;
24
25
  resolveFileType(fileTypeCode?: string, fileTypeId?: number): Promise<FileTypeEntity>;
25
26
  private createS3Client;
@@ -74,11 +74,18 @@ let FileStorageService = FileStorageService_1 = class FileStorageService {
74
74
  return yield this.fileRepository.save(fileRecord);
75
75
  }
76
76
  catch (error) {
77
- yield this.deleteObject(bucketName, bucketPath);
77
+ yield this.deleteObject(bucketName, bucketPath, true);
78
78
  throw error;
79
79
  }
80
80
  });
81
81
  }
82
+ deleteDocument(file) {
83
+ return __awaiter(this, void 0, void 0, function* () {
84
+ const bucketName = this.getRequiredEnv(constants_1.FILE_STORAGE_BUCKET_NAME_ENV);
85
+ yield this.deleteObject(bucketName, file.path);
86
+ yield this.fileRepository.softDelete(file.id);
87
+ });
88
+ }
82
89
  downloadDocument(bucketPath) {
83
90
  return __awaiter(this, void 0, void 0, function* () {
84
91
  const bucketName = this.getRequiredEnv(constants_1.FILE_STORAGE_BUCKET_NAME_ENV);
@@ -169,8 +176,8 @@ let FileStorageService = FileStorageService_1 = class FileStorageService {
169
176
  }
170
177
  });
171
178
  }
172
- deleteObject(bucketName, bucketPath) {
173
- return __awaiter(this, void 0, void 0, function* () {
179
+ deleteObject(bucketName_1, bucketPath_1) {
180
+ return __awaiter(this, arguments, void 0, function* (bucketName, bucketPath, suppressError = false) {
174
181
  try {
175
182
  yield this.s3Client.send(new client_s3_1.DeleteObjectCommand({
176
183
  Bucket: bucketName,
@@ -179,7 +186,10 @@ let FileStorageService = FileStorageService_1 = class FileStorageService {
179
186
  }
180
187
  catch (error) {
181
188
  const errorMessage = error instanceof Error ? error.message : String(error);
182
- this.logger.warn(`Uploaded object "${bucketPath}" could not be deleted after DB save failure: ${errorMessage}`);
189
+ this.logger.warn(`Object "${bucketPath}" could not be deleted: ${errorMessage}`);
190
+ if (!suppressError) {
191
+ throw error;
192
+ }
183
193
  }
184
194
  });
185
195
  }
@@ -1,3 +1,4 @@
1
1
  export * from './object.utils';
2
2
  export * from './string.utils';
3
3
  export * from './parse.util';
4
+ export * from './ticket-service-center-match-progress.util';
@@ -17,3 +17,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./object.utils"), exports);
18
18
  __exportStar(require("./string.utils"), exports);
19
19
  __exportStar(require("./parse.util"), exports);
20
+ __exportStar(require("./ticket-service-center-match-progress.util"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniorganization/uni-lib",
3
- "version": "4.0.40",
3
+ "version": "4.0.41",
4
4
  "description": "UNI Library",
5
5
  "author": "Jhomiguel",
6
6
  "main": "dist/index.js",