@alba-cars/common-modules 1.7.2 → 1.7.4

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.
@@ -1,6 +1,14 @@
1
+ import { FaqCategory } from "../enums";
2
+ export declare class MultilingualContent {
3
+ en: string;
4
+ ar: string;
5
+ ru: string;
6
+ zh: string;
7
+ }
1
8
  export declare class CreateFaqDTO {
2
- question: string;
3
- answer: string;
9
+ question: MultilingualContent;
10
+ answer: MultilingualContent;
11
+ category: FaqCategory;
4
12
  isActive?: boolean;
5
13
  order?: number;
6
14
  static fromPlain(plain: any): CreateFaqDTO;
@@ -9,13 +9,49 @@ var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.CreateFaqDTO = void 0;
12
+ exports.CreateFaqDTO = exports.MultilingualContent = void 0;
13
+ const class_transformer_1 = require("class-transformer");
13
14
  const class_validator_1 = require("class-validator");
15
+ const enums_1 = require("../enums");
16
+ class MultilingualContent {
17
+ }
18
+ __decorate([
19
+ (0, class_validator_1.IsNotEmpty)(),
20
+ (0, class_validator_1.IsString)(),
21
+ __metadata("design:type", String)
22
+ ], MultilingualContent.prototype, "en", void 0);
23
+ __decorate([
24
+ (0, class_validator_1.IsNotEmpty)(),
25
+ (0, class_validator_1.IsString)(),
26
+ __metadata("design:type", String)
27
+ ], MultilingualContent.prototype, "ar", void 0);
28
+ __decorate([
29
+ (0, class_validator_1.IsNotEmpty)(),
30
+ (0, class_validator_1.IsString)(),
31
+ __metadata("design:type", String)
32
+ ], MultilingualContent.prototype, "ru", void 0);
33
+ __decorate([
34
+ (0, class_validator_1.IsNotEmpty)(),
35
+ (0, class_validator_1.IsString)(),
36
+ __metadata("design:type", String)
37
+ ], MultilingualContent.prototype, "zh", void 0);
38
+ exports.MultilingualContent = MultilingualContent;
14
39
  class CreateFaqDTO {
15
40
  static fromPlain(plain) {
16
41
  const dto = new CreateFaqDTO();
17
- dto.question = plain.question;
18
- dto.answer = plain.answer;
42
+ dto.question = {
43
+ en: plain.question.en,
44
+ ar: plain.question.ar,
45
+ ru: plain.question.ru,
46
+ zh: plain.question.zh
47
+ };
48
+ dto.answer = {
49
+ en: plain.answer.en,
50
+ ar: plain.answer.ar,
51
+ ru: plain.answer.ru,
52
+ zh: plain.answer.zh
53
+ };
54
+ dto.category = plain.category;
19
55
  dto.isActive = plain.isActive;
20
56
  dto.order = plain.order;
21
57
  return dto;
@@ -23,14 +59,21 @@ class CreateFaqDTO {
23
59
  }
24
60
  __decorate([
25
61
  (0, class_validator_1.IsNotEmpty)(),
26
- (0, class_validator_1.IsString)(),
27
- __metadata("design:type", String)
62
+ (0, class_validator_1.ValidateNested)(),
63
+ (0, class_transformer_1.Type)(() => MultilingualContent),
64
+ __metadata("design:type", MultilingualContent)
28
65
  ], CreateFaqDTO.prototype, "question", void 0);
29
66
  __decorate([
30
67
  (0, class_validator_1.IsNotEmpty)(),
31
- (0, class_validator_1.IsString)(),
32
- __metadata("design:type", String)
68
+ (0, class_validator_1.ValidateNested)(),
69
+ (0, class_transformer_1.Type)(() => MultilingualContent),
70
+ __metadata("design:type", MultilingualContent)
33
71
  ], CreateFaqDTO.prototype, "answer", void 0);
72
+ __decorate([
73
+ (0, class_validator_1.IsNotEmpty)(),
74
+ (0, class_validator_1.IsEnum)(enums_1.FaqCategory),
75
+ __metadata("design:type", String)
76
+ ], CreateFaqDTO.prototype, "category", void 0);
34
77
  __decorate([
35
78
  (0, class_validator_1.IsOptional)(),
36
79
  (0, class_validator_1.IsBoolean)(),
@@ -1,6 +1,14 @@
1
+ import { FaqCategory } from "../enums";
2
+ export declare class UpdateMultilingualContent {
3
+ en?: string;
4
+ ar?: string;
5
+ ru?: string;
6
+ zh?: string;
7
+ }
1
8
  export declare class UpdateFaqDTO {
2
- question?: string;
3
- answer?: string;
9
+ question?: UpdateMultilingualContent;
10
+ answer?: UpdateMultilingualContent;
11
+ category: FaqCategory;
4
12
  isActive?: boolean;
5
13
  order?: number;
6
14
  static fromPlain(plain: any): UpdateFaqDTO;
@@ -9,32 +9,75 @@ var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.UpdateFaqDTO = void 0;
12
+ exports.UpdateFaqDTO = exports.UpdateMultilingualContent = void 0;
13
+ const class_transformer_1 = require("class-transformer");
13
14
  const class_validator_1 = require("class-validator");
15
+ const enums_1 = require("../enums");
16
+ class UpdateMultilingualContent {
17
+ }
18
+ __decorate([
19
+ (0, class_validator_1.IsOptional)(),
20
+ (0, class_validator_1.IsString)(),
21
+ __metadata("design:type", String)
22
+ ], UpdateMultilingualContent.prototype, "en", void 0);
23
+ __decorate([
24
+ (0, class_validator_1.IsOptional)(),
25
+ (0, class_validator_1.IsString)(),
26
+ __metadata("design:type", String)
27
+ ], UpdateMultilingualContent.prototype, "ar", void 0);
28
+ __decorate([
29
+ (0, class_validator_1.IsOptional)(),
30
+ (0, class_validator_1.IsString)(),
31
+ __metadata("design:type", String)
32
+ ], UpdateMultilingualContent.prototype, "ru", void 0);
33
+ __decorate([
34
+ (0, class_validator_1.IsOptional)(),
35
+ (0, class_validator_1.IsString)(),
36
+ __metadata("design:type", String)
37
+ ], UpdateMultilingualContent.prototype, "zh", void 0);
38
+ exports.UpdateMultilingualContent = UpdateMultilingualContent;
14
39
  class UpdateFaqDTO {
15
40
  static fromPlain(plain) {
16
41
  const dto = new UpdateFaqDTO();
17
- if (plain.question !== undefined)
18
- dto.question = plain.question;
19
- if (plain.answer !== undefined)
20
- dto.answer = plain.answer;
21
- if (plain.isActive !== undefined)
22
- dto.isActive = plain.isActive;
23
- if (plain.order !== undefined)
24
- dto.order = plain.order;
42
+ if (plain.question) {
43
+ dto.question = {
44
+ en: plain.question.en,
45
+ ar: plain.question.ar,
46
+ ru: plain.question.ru,
47
+ zh: plain.question.zh
48
+ };
49
+ }
50
+ if (plain.answer) {
51
+ dto.answer = {
52
+ en: plain.answer.en,
53
+ ar: plain.answer.ar,
54
+ ru: plain.answer.ru,
55
+ zh: plain.answer.zh
56
+ };
57
+ }
58
+ dto.isActive = plain.isActive;
59
+ dto.order = plain.order;
25
60
  return dto;
26
61
  }
27
62
  }
28
63
  __decorate([
29
64
  (0, class_validator_1.IsOptional)(),
30
- (0, class_validator_1.IsString)(),
31
- __metadata("design:type", String)
65
+ (0, class_validator_1.ValidateNested)(),
66
+ (0, class_transformer_1.Type)(() => UpdateMultilingualContent),
67
+ __metadata("design:type", UpdateMultilingualContent)
32
68
  ], UpdateFaqDTO.prototype, "question", void 0);
33
69
  __decorate([
34
70
  (0, class_validator_1.IsOptional)(),
35
- (0, class_validator_1.IsString)(),
36
- __metadata("design:type", String)
71
+ (0, class_validator_1.ValidateNested)(),
72
+ (0, class_transformer_1.Type)(() => UpdateMultilingualContent),
73
+ __metadata("design:type", UpdateMultilingualContent)
37
74
  ], UpdateFaqDTO.prototype, "answer", void 0);
75
+ __decorate([
76
+ (0, class_validator_1.IsOptional)(),
77
+ (0, class_validator_1.ValidateNested)(),
78
+ (0, class_validator_1.IsEnum)(enums_1.FaqCategory),
79
+ __metadata("design:type", String)
80
+ ], UpdateFaqDTO.prototype, "category", void 0);
38
81
  __decorate([
39
82
  (0, class_validator_1.IsOptional)(),
40
83
  (0, class_validator_1.IsBoolean)(),
@@ -0,0 +1,8 @@
1
+ export declare enum FaqCategory {
2
+ FINANCE = "FINANCE",
3
+ BUY_CAR = "BUY_CAR",
4
+ SELL_CAR = "SELL_CAR",
5
+ MAINTENANCE = "MAINTENANCE",
6
+ INSURANCE = "INSURANCE",
7
+ GENERAL = "GENERAL"
8
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FaqCategory = void 0;
4
+ var FaqCategory;
5
+ (function (FaqCategory) {
6
+ FaqCategory["FINANCE"] = "FINANCE";
7
+ FaqCategory["BUY_CAR"] = "BUY_CAR";
8
+ FaqCategory["SELL_CAR"] = "SELL_CAR";
9
+ FaqCategory["MAINTENANCE"] = "MAINTENANCE";
10
+ FaqCategory["INSURANCE"] = "INSURANCE";
11
+ FaqCategory["GENERAL"] = "GENERAL";
12
+ })(FaqCategory = exports.FaqCategory || (exports.FaqCategory = {}));
@@ -1 +1,2 @@
1
1
  export * from "./dtos/index";
2
+ export * from "./enums/index";
@@ -15,3 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./dtos/index"), exports);
18
+ __exportStar(require("./enums/index"), exports);
@@ -4,8 +4,8 @@ export declare class CreateTicketDto {
4
4
  requestType: TicketRequestType;
5
5
  message: string;
6
6
  assignedSalesAgentId?: string;
7
- agentName: string;
8
- agentPhoneNumber: string;
7
+ agentName?: string;
8
+ agentPhoneNumber?: string;
9
9
  }
10
10
  export declare class UpdateTicketDto {
11
11
  requestType?: TicketRequestType;
@@ -34,10 +34,12 @@ __decorate([
34
34
  ], CreateTicketDto.prototype, "assignedSalesAgentId", void 0);
35
35
  __decorate([
36
36
  (0, class_validator_1.IsString)(),
37
+ (0, class_validator_1.IsOptional)(),
37
38
  __metadata("design:type", String)
38
39
  ], CreateTicketDto.prototype, "agentName", void 0);
39
40
  __decorate([
40
41
  (0, class_validator_1.IsString)(),
42
+ (0, class_validator_1.IsOptional)(),
41
43
  __metadata("design:type", String)
42
44
  ], CreateTicketDto.prototype, "agentPhoneNumber", void 0);
43
45
  exports.CreateTicketDto = CreateTicketDto;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.7.2",
6
+ "version": "1.7.4",
7
7
  "description": "A package containing DTOs, validation classes and common modules and interfaces for Alba Cars",
8
8
  "main": "dist/index.js",
9
9
  "types": "dist/index.d.ts",