@alba-cars/common-modules 2.0.0 → 2.1.0
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/index.js +1 -21
- package/package.json +10 -6
- package/dist/core/enums/HttpMethods.js +0 -14
- package/dist/core/enums/HttpStatusCodes.js +0 -19
- package/dist/core/enums/index.js +0 -18
- package/dist/core/error-handling/AppError.js +0 -48
- package/dist/core/error-handling/index.js +0 -17
- package/dist/core/index.js +0 -21
- package/dist/core/models/index.js +0 -19
- package/dist/core/models/media/index.js +0 -17
- package/dist/core/models/media/media_data.js +0 -2
- package/dist/core/models/pagination/index.js +0 -17
- package/dist/core/models/pagination/paginated_data.js +0 -21
- package/dist/core/models/range.js +0 -26
- package/dist/core/network/api-client.d.ts +0 -1
- package/dist/core/network/api-client.js +0 -22
- package/dist/core/network/endpoint-config.js +0 -260
- package/dist/core/network/fetch-api.js +0 -206
- package/dist/core/network/index.js +0 -18
- package/dist/core/utils/formatCurrency.js +0 -39
- package/dist/core/utils/global-constants.js +0 -9
- package/dist/core/utils/global-utils.js +0 -190
- package/dist/core/utils/global_validators.js +0 -20
- package/dist/core/utils/index.js +0 -20
- package/dist/core/utils/query_flatten.js +0 -15
- package/dist/features/auth/data/dto/AuthDTO.js +0 -106
- package/dist/features/auth/data/dto/RoleDTO.js +0 -132
- package/dist/features/auth/data/dto/UserDTO.js +0 -222
- package/dist/features/auth/data/index.js +0 -19
- package/dist/features/auth/index.js +0 -17
- package/dist/features/bank-valuation-request/data/dto/BankValuationRequestDTO.js +0 -132
- package/dist/features/bank-valuation-request/index.js +0 -17
- package/dist/features/blog/data/dto/BlogDTO.js +0 -176
- package/dist/features/blog/index.js +0 -17
- package/dist/features/callback-request/data/dto/CallBackRequestDTO.js +0 -110
- package/dist/features/callback-request/index.js +0 -17
- package/dist/features/deposits/data/dto/DepositDTOs.js +0 -303
- package/dist/features/deposits/data/index.js +0 -17
- package/dist/features/deposits/index.js +0 -17
- package/dist/features/faq/data/dtos/CreateFaqDTO.js +0 -87
- package/dist/features/faq/data/dtos/FaqFetchDTO.js +0 -349
- package/dist/features/faq/data/dtos/UpdateFaqDTO.js +0 -91
- package/dist/features/faq/data/dtos/index.js +0 -19
- package/dist/features/faq/data/enums/index.js +0 -10
- package/dist/features/faq/data/index.js +0 -18
- package/dist/features/faq/index.js +0 -17
- package/dist/features/finance-eligibilty-request/data/dto/FinanceEligibilityRequestDTO.js +0 -429
- package/dist/features/finance-eligibilty-request/data/index.js +0 -17
- package/dist/features/finance-eligibilty-request/index.js +0 -17
- package/dist/features/google-review/data/dto/google_review_dto.js +0 -466
- package/dist/features/google-review/data/dto/index.js +0 -17
- package/dist/features/google-review/data/enums/index.js +0 -8
- package/dist/features/google-review/data/index.js +0 -18
- package/dist/features/google-review/index.js +0 -17
- package/dist/features/index.js +0 -34
- package/dist/features/lead/data/dto/index.js +0 -20
- package/dist/features/lead/data/dto/lead_documents_dto.js +0 -73
- package/dist/features/lead/data/dto/lead_dto.js +0 -435
- package/dist/features/lead/data/dto/lead_preference_history_dto.js +0 -321
- package/dist/features/lead/data/dto/lead_prefernce_dto.js +0 -308
- package/dist/features/lead/data/enum/index.js +0 -18
- package/dist/features/lead/data/enum/lead_source_status_types.js +0 -19
- package/dist/features/lead/data/enum/lead_status_type.js +0 -12
- package/dist/features/lead/index.js +0 -18
- package/dist/features/models/BankValuationRequest.js +0 -6
- package/dist/features/models/Base.js +0 -6
- package/dist/features/models/Deposit.js +0 -6
- package/dist/features/models/Lead.js +0 -6
- package/dist/features/models/Payment.js +0 -7
- package/dist/features/models/Roles.js +0 -2
- package/dist/features/models/Ticket.js +0 -12
- package/dist/features/models/User.js +0 -2
- package/dist/features/models/UserFavoriteVehicle.js +0 -6
- package/dist/features/models/Vehicle.js +0 -17
- package/dist/features/models/VehicleBodyType.js +0 -7
- package/dist/features/models/VehicleCategory.js +0 -7
- package/dist/features/models/VehicleFeature.js +0 -7
- package/dist/features/models/VehicleFeatureCategory.js +0 -7
- package/dist/features/models/VehicleFinance.js +0 -7
- package/dist/features/models/VehicleMake.js +0 -7
- package/dist/features/models/VehicleMedia.js +0 -7
- package/dist/features/models/VehicleMetaData.js +0 -7
- package/dist/features/models/VehicleModel.js +0 -7
- package/dist/features/models/VehicleOrder.js +0 -7
- package/dist/features/models/_index.js +0 -30
- package/dist/features/models/index.js +0 -37
- package/dist/features/newsletter/data/dto/NewsletterDTO.js +0 -79
- package/dist/features/newsletter/index.js +0 -17
- package/dist/features/sales-team/data/dto/LanguageDTO.js +0 -89
- package/dist/features/sales-team/data/dto/SalesAgentDTO.js +0 -613
- package/dist/features/sales-team/data/index.js +0 -18
- package/dist/features/sales-team/index.js +0 -17
- package/dist/features/sell-car-request/data/dto/SellCarRequestDTO.js +0 -672
- package/dist/features/sell-car-request/data/index.js +0 -17
- package/dist/features/sell-car-request/index.js +0 -17
- package/dist/features/showroom-visit/data/dto/ShowroomVisit.js +0 -237
- package/dist/features/showroom-visit/data/enums/index.js +0 -17
- package/dist/features/showroom-visit/data/index.js +0 -18
- package/dist/features/showroom-visit/index.js +0 -17
- package/dist/features/test-drive-request/api/GetTestDriveVehicles.js +0 -8
- package/dist/features/test-drive-request/api/index.js +0 -17
- package/dist/features/test-drive-request/data/dto/TestDriveRequestDTO.js +0 -179
- package/dist/features/test-drive-request/data/enums/index.js +0 -29
- package/dist/features/test-drive-request/data/index.js +0 -20
- package/dist/features/test-drive-request/data/models/TestDriveRequest.js +0 -7
- package/dist/features/test-drive-request/data/models/index.js +0 -5
- package/dist/features/test-drive-request/data/utilities.js +0 -100
- package/dist/features/test-drive-request/index.js +0 -18
- package/dist/features/tickets/data/dto/TicketDto.js +0 -293
- package/dist/features/tickets/data/enums/index.js +0 -18
- package/dist/features/tickets/index.js +0 -18
- package/dist/features/vehicle/data/dto/BaseDTO.js +0 -34
- package/dist/features/vehicle/data/dto/MediaDTO.js +0 -2
- package/dist/features/vehicle/data/dto/PaymentDTO.js +0 -161
- package/dist/features/vehicle/data/dto/SimilarVehicleDTO.js +0 -38
- package/dist/features/vehicle/data/dto/VehicleCategoryDTO.js +0 -114
- package/dist/features/vehicle/data/dto/VehicleDTO.js +0 -587
- package/dist/features/vehicle/data/dto/VehicleFavoritesDTO.js +0 -60
- package/dist/features/vehicle/data/dto/VehicleFeatureCategoriesDTO.js +0 -114
- package/dist/features/vehicle/data/dto/VehicleFeatureDTO.js +0 -125
- package/dist/features/vehicle/data/dto/VehicleFilterDTO.js +0 -771
- package/dist/features/vehicle/data/dto/VehicleFinanceDTO.js +0 -183
- package/dist/features/vehicle/data/dto/VehicleInspectionDTO.js +0 -765
- package/dist/features/vehicle/data/dto/VehicleMakeDTO.js +0 -189
- package/dist/features/vehicle/data/dto/VehicleMedia.js +0 -152
- package/dist/features/vehicle/data/dto/VehicleModelDTO.js +0 -182
- package/dist/features/vehicle/data/dto/VehicleOrderDTO.js +0 -139
- package/dist/features/vehicle/data/dto/VehicleTypeDTO.js +0 -102
- package/dist/features/vehicle/data/dto/VehicleWarrantyDTO.js +0 -47
- package/dist/features/vehicle/data/dto/index.js +0 -35
- package/dist/features/vehicle/data/enums/index.js +0 -46
- package/dist/features/vehicle/data/index.js +0 -20
- package/dist/features/vehicle/data/utilities.js +0 -520
- package/dist/features/vehicle/index.js +0 -17
- package/dist/features/vehicle-reservations/data/dto/VehicleReservationDTO.js +0 -346
- package/dist/features/vehicle-reservations/data/dto/index.js +0 -17
- package/dist/features/vehicle-reservations/data/enums/finance-type.js +0 -9
- package/dist/features/vehicle-reservations/data/enums/index.js +0 -19
- package/dist/features/vehicle-reservations/data/enums/reservation-type.js +0 -13
- package/dist/features/vehicle-reservations/data/enums/vehicle-reservation-type.js +0 -8
- package/dist/features/vehicle-reservations/index.js +0 -18
- package/dist/global/dto/BaseGetDTO.js +0 -18
- package/dist/global/dto/index.js +0 -17
- package/dist/global/index.js +0 -18
- package/dist/global/utilities.js +0 -173
- package/dist/models.js +0 -17
|
@@ -1,114 +0,0 @@
|
|
|
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.DynamicVehicleFeatureCategoryDTO = exports.VehicleFeatureCategoryUpdateDTO = exports.VehicleFeatureCategoryCreateDTO = exports.VehicleFeatureCategoryGetUniqueDTO = exports.VehicleFeatureCategoryGetDTO = void 0;
|
|
13
|
-
const class_validator_1 = require("class-validator");
|
|
14
|
-
const class_transformer_1 = require("class-transformer");
|
|
15
|
-
const BaseDTO_1 = require("./BaseDTO");
|
|
16
|
-
class VehicleFeatureCategoryGetDTO {
|
|
17
|
-
validate() {
|
|
18
|
-
const errors = (0, class_validator_1.validateSync)(this);
|
|
19
|
-
return errors.map(error => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
20
|
-
}
|
|
21
|
-
static fromPlain(plain) {
|
|
22
|
-
return (0, class_transformer_1.plainToClass)(VehicleFeatureCategoryGetDTO, plain);
|
|
23
|
-
}
|
|
24
|
-
static toPlain(entity) {
|
|
25
|
-
return (0, class_transformer_1.instanceToPlain)(entity);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
exports.VehicleFeatureCategoryGetDTO = VehicleFeatureCategoryGetDTO;
|
|
29
|
-
// Use this to get a unique vehicle make by unique fields
|
|
30
|
-
class VehicleFeatureCategoryGetUniqueDTO {
|
|
31
|
-
validate() {
|
|
32
|
-
const errors = (0, class_validator_1.validateSync)(this);
|
|
33
|
-
return errors.map(error => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
34
|
-
}
|
|
35
|
-
static fromPlain(plain) {
|
|
36
|
-
return (0, class_transformer_1.plainToClass)(VehicleFeatureCategoryGetUniqueDTO, plain);
|
|
37
|
-
}
|
|
38
|
-
static toPlain(entity) {
|
|
39
|
-
return (0, class_transformer_1.instanceToPlain)(entity);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
exports.VehicleFeatureCategoryGetUniqueDTO = VehicleFeatureCategoryGetUniqueDTO;
|
|
43
|
-
class VehicleFeatureCategoryCreateDTO extends BaseDTO_1.BaseCreateDTO {
|
|
44
|
-
validate() {
|
|
45
|
-
const errors = (0, class_validator_1.validateSync)(this);
|
|
46
|
-
return errors.map(error => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
47
|
-
}
|
|
48
|
-
static fromPlain(plain) {
|
|
49
|
-
return (0, class_transformer_1.plainToClass)(VehicleFeatureCategoryCreateDTO, plain);
|
|
50
|
-
}
|
|
51
|
-
static toPlain(entity) {
|
|
52
|
-
return (0, class_transformer_1.instanceToPlain)(entity);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
__decorate([
|
|
56
|
-
(0, class_validator_1.IsString)(),
|
|
57
|
-
(0, class_validator_1.IsNotEmpty)(),
|
|
58
|
-
(0, class_validator_1.IsDefined)(),
|
|
59
|
-
(0, class_validator_1.Matches)(/^[a-zA-Z0-9\s\-\_]*$/, {
|
|
60
|
-
message: 'Name can only contain letters, numbers, spaces, hyphens, and underscores.',
|
|
61
|
-
}),
|
|
62
|
-
__metadata("design:type", String)
|
|
63
|
-
], VehicleFeatureCategoryCreateDTO.prototype, "name", void 0);
|
|
64
|
-
exports.VehicleFeatureCategoryCreateDTO = VehicleFeatureCategoryCreateDTO;
|
|
65
|
-
class VehicleFeatureCategoryUpdateDTO extends BaseDTO_1.BaseUpdateDTO {
|
|
66
|
-
validate() {
|
|
67
|
-
const errors = (0, class_validator_1.validateSync)(this);
|
|
68
|
-
return errors.map(error => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
69
|
-
}
|
|
70
|
-
static fromPlain(plain) {
|
|
71
|
-
return (0, class_transformer_1.plainToClass)(VehicleFeatureCategoryUpdateDTO, plain);
|
|
72
|
-
}
|
|
73
|
-
static toPlain(entity) {
|
|
74
|
-
return (0, class_transformer_1.instanceToPlain)(entity);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
__decorate([
|
|
78
|
-
(0, class_validator_1.IsString)(),
|
|
79
|
-
(0, class_validator_1.IsOptional)(),
|
|
80
|
-
(0, class_validator_1.Matches)(/^[a-zA-Z0-9\s\-\_]*$/, {
|
|
81
|
-
message: 'Name can only contain letters, numbers, spaces, hyphens, and underscores.',
|
|
82
|
-
}),
|
|
83
|
-
__metadata("design:type", String)
|
|
84
|
-
], VehicleFeatureCategoryUpdateDTO.prototype, "name", void 0);
|
|
85
|
-
exports.VehicleFeatureCategoryUpdateDTO = VehicleFeatureCategoryUpdateDTO;
|
|
86
|
-
class DynamicVehicleFeatureCategoryDTO {
|
|
87
|
-
constructor(payload) {
|
|
88
|
-
this.existingId = payload.existingId;
|
|
89
|
-
this.new = payload.new;
|
|
90
|
-
}
|
|
91
|
-
validate() {
|
|
92
|
-
if (!this.existingId && !this.new) {
|
|
93
|
-
throw new Error('Either existingId or new details must be provided.');
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
static fromPlain(plain) {
|
|
97
|
-
return (0, class_transformer_1.plainToClass)(DynamicVehicleFeatureCategoryDTO, plain);
|
|
98
|
-
}
|
|
99
|
-
static toPlain(entity) {
|
|
100
|
-
return (0, class_transformer_1.instanceToPlain)(entity);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
__decorate([
|
|
104
|
-
(0, class_validator_1.IsString)(),
|
|
105
|
-
(0, class_validator_1.IsOptional)(),
|
|
106
|
-
__metadata("design:type", String)
|
|
107
|
-
], DynamicVehicleFeatureCategoryDTO.prototype, "existingId", void 0);
|
|
108
|
-
__decorate([
|
|
109
|
-
(0, class_validator_1.ValidateNested)(),
|
|
110
|
-
(0, class_transformer_1.Type)(() => VehicleFeatureCategoryCreateDTO),
|
|
111
|
-
(0, class_validator_1.IsOptional)(),
|
|
112
|
-
__metadata("design:type", VehicleFeatureCategoryCreateDTO)
|
|
113
|
-
], DynamicVehicleFeatureCategoryDTO.prototype, "new", void 0);
|
|
114
|
-
exports.DynamicVehicleFeatureCategoryDTO = DynamicVehicleFeatureCategoryDTO;
|
|
@@ -1,125 +0,0 @@
|
|
|
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.DynamicVehicleFeatureDTO = exports.VehicleFeaturedUpdateDTO = exports.VehicleFeaturedCreateDTO = exports.VehicleFeaturedGetUniqueDTO = exports.VehicleFeaturedGetDTO = void 0;
|
|
13
|
-
const class_validator_1 = require("class-validator");
|
|
14
|
-
const class_transformer_1 = require("class-transformer");
|
|
15
|
-
const BaseDTO_1 = require("./BaseDTO");
|
|
16
|
-
class VehicleFeaturedGetDTO {
|
|
17
|
-
validate() {
|
|
18
|
-
const errors = (0, class_validator_1.validateSync)(this);
|
|
19
|
-
return errors.map(error => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
20
|
-
}
|
|
21
|
-
static fromPlain(plain) {
|
|
22
|
-
return (0, class_transformer_1.plainToClass)(VehicleFeaturedGetDTO, plain);
|
|
23
|
-
}
|
|
24
|
-
static toPlain(instance) {
|
|
25
|
-
return (0, class_transformer_1.instanceToPlain)(instance);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
exports.VehicleFeaturedGetDTO = VehicleFeaturedGetDTO;
|
|
29
|
-
// Use this to get a unique vehicle make by unique fields
|
|
30
|
-
class VehicleFeaturedGetUniqueDTO {
|
|
31
|
-
validate() {
|
|
32
|
-
const errors = (0, class_validator_1.validateSync)(this);
|
|
33
|
-
return errors.map(error => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
34
|
-
}
|
|
35
|
-
static fromPlain(plain) {
|
|
36
|
-
return (0, class_transformer_1.plainToClass)(VehicleFeaturedGetUniqueDTO, plain);
|
|
37
|
-
}
|
|
38
|
-
static toPlain(entity) {
|
|
39
|
-
return (0, class_transformer_1.instanceToPlain)(entity);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
exports.VehicleFeaturedGetUniqueDTO = VehicleFeaturedGetUniqueDTO;
|
|
43
|
-
class VehicleFeaturedCreateDTO extends BaseDTO_1.BaseCreateDTO {
|
|
44
|
-
validate() {
|
|
45
|
-
const errors = (0, class_validator_1.validateSync)(this);
|
|
46
|
-
return errors.map(error => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
47
|
-
}
|
|
48
|
-
static fromPlain(plain) {
|
|
49
|
-
return (0, class_transformer_1.plainToClass)(VehicleFeaturedCreateDTO, plain);
|
|
50
|
-
}
|
|
51
|
-
static toPlain(entity) {
|
|
52
|
-
return (0, class_transformer_1.instanceToPlain)(entity);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
__decorate([
|
|
56
|
-
(0, class_validator_1.IsString)(),
|
|
57
|
-
(0, class_validator_1.IsNotEmpty)(),
|
|
58
|
-
(0, class_validator_1.IsDefined)(),
|
|
59
|
-
(0, class_validator_1.Matches)(/^[a-zA-Z0-9\s\-\_]*$/, {
|
|
60
|
-
message: 'Name can only contain letters, numbers, spaces, hyphens, and underscores.',
|
|
61
|
-
}),
|
|
62
|
-
__metadata("design:type", String)
|
|
63
|
-
], VehicleFeaturedCreateDTO.prototype, "name", void 0);
|
|
64
|
-
__decorate([
|
|
65
|
-
(0, class_validator_1.IsString)(),
|
|
66
|
-
(0, class_validator_1.IsOptional)(),
|
|
67
|
-
__metadata("design:type", String)
|
|
68
|
-
], VehicleFeaturedCreateDTO.prototype, "icon", void 0);
|
|
69
|
-
exports.VehicleFeaturedCreateDTO = VehicleFeaturedCreateDTO;
|
|
70
|
-
class VehicleFeaturedUpdateDTO extends BaseDTO_1.BaseUpdateDTO {
|
|
71
|
-
validate() {
|
|
72
|
-
const errors = (0, class_validator_1.validateSync)(this);
|
|
73
|
-
return errors.map(error => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
74
|
-
}
|
|
75
|
-
static fromPlain(plain) {
|
|
76
|
-
return (0, class_transformer_1.plainToClass)(VehicleFeaturedUpdateDTO, plain);
|
|
77
|
-
}
|
|
78
|
-
static toPlain(entity) {
|
|
79
|
-
return (0, class_transformer_1.instanceToPlain)(entity);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
__decorate([
|
|
83
|
-
(0, class_validator_1.IsString)(),
|
|
84
|
-
(0, class_validator_1.IsOptional)(),
|
|
85
|
-
(0, class_validator_1.Matches)(/^[a-zA-Z0-9\s\-\_]*$/, {
|
|
86
|
-
message: 'Name can only contain letters, numbers, spaces, hyphens, and underscores.',
|
|
87
|
-
}),
|
|
88
|
-
__metadata("design:type", String)
|
|
89
|
-
], VehicleFeaturedUpdateDTO.prototype, "name", void 0);
|
|
90
|
-
__decorate([
|
|
91
|
-
(0, class_validator_1.IsString)(),
|
|
92
|
-
(0, class_validator_1.IsOptional)(),
|
|
93
|
-
__metadata("design:type", String)
|
|
94
|
-
], VehicleFeaturedUpdateDTO.prototype, "icon", void 0);
|
|
95
|
-
__decorate([
|
|
96
|
-
(0, class_validator_1.IsString)(),
|
|
97
|
-
(0, class_validator_1.IsOptional)(),
|
|
98
|
-
__metadata("design:type", String)
|
|
99
|
-
], VehicleFeaturedUpdateDTO.prototype, "slug", void 0);
|
|
100
|
-
exports.VehicleFeaturedUpdateDTO = VehicleFeaturedUpdateDTO;
|
|
101
|
-
class DynamicVehicleFeatureDTO {
|
|
102
|
-
validate() {
|
|
103
|
-
if (!this.existingId && !this.new) {
|
|
104
|
-
throw new Error('Either existingId or new details must be provided.');
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
static fromPlain(plain) {
|
|
108
|
-
return (0, class_transformer_1.plainToClass)(DynamicVehicleFeatureDTO, plain);
|
|
109
|
-
}
|
|
110
|
-
static toPlain(entity) {
|
|
111
|
-
return (0, class_transformer_1.instanceToPlain)(entity);
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
__decorate([
|
|
115
|
-
(0, class_validator_1.IsString)(),
|
|
116
|
-
(0, class_validator_1.IsOptional)(),
|
|
117
|
-
__metadata("design:type", String)
|
|
118
|
-
], DynamicVehicleFeatureDTO.prototype, "existingId", void 0);
|
|
119
|
-
__decorate([
|
|
120
|
-
(0, class_validator_1.ValidateNested)(),
|
|
121
|
-
(0, class_transformer_1.Type)(() => VehicleFeaturedCreateDTO),
|
|
122
|
-
(0, class_validator_1.IsOptional)(),
|
|
123
|
-
__metadata("design:type", VehicleFeaturedCreateDTO)
|
|
124
|
-
], DynamicVehicleFeatureDTO.prototype, "new", void 0);
|
|
125
|
-
exports.DynamicVehicleFeatureDTO = DynamicVehicleFeatureDTO;
|