@aldb2b/common 1.0.1034 → 1.0.1036

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.
@@ -51,6 +51,9 @@
51
51
  import { Schema } from 'mongoose';
52
52
  import { CustomModel } from '../../../../../db/CustomModel';
53
53
  import { EventProfileStatus } from '../../../../../enums/event-profile-status.enum';
54
+ import { ProfileItemType } from "../../../../../enums/profile-item-type.enum";
55
+ import { ProfileItemCustomType } from "../../../../../enums/profile-item-custom-type.enum";
56
+ import { CustomTypePossibleValue } from "../../../companies";
54
57
  export type CompanyProfileItemModel = CustomModel<CompanyProfileItem>;
55
58
  export declare class CompanyProfileItem {
56
59
  _id: string;
@@ -60,6 +63,9 @@ export declare class CompanyProfileItem {
60
63
  registrationStatus: EventProfileStatus;
61
64
  profileStatus: EventProfileStatus;
62
65
  filterStatus: EventProfileStatus;
66
+ profileItemType: ProfileItemType;
67
+ customType: ProfileItemCustomType;
68
+ customTypePossibleValues: CustomTypePossibleValue[];
63
69
  createdAt: Date;
64
70
  updatedAt: Date;
65
71
  }
@@ -3,9 +3,22 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CompanyProfileItemSchema = exports.CompanyProfileItem = void 0;
4
4
  const mongoose_1 = require("mongoose");
5
5
  const event_profile_status_enum_1 = require("../../../../../enums/event-profile-status.enum");
6
+ const profile_item_type_enum_1 = require("../../../../../enums/profile-item-type.enum");
7
+ const profile_item_custom_type_enum_1 = require("../../../../../enums/profile-item-custom-type.enum");
6
8
  class CompanyProfileItem {
7
9
  }
8
10
  exports.CompanyProfileItem = CompanyProfileItem;
11
+ const CustomTypePossibleValueSchema = new mongoose_1.Schema({
12
+ identifier: {
13
+ type: Number,
14
+ required: true,
15
+ },
16
+ value: {
17
+ type: String,
18
+ trim: true,
19
+ required: true,
20
+ },
21
+ }, { _id: false });
9
22
  exports.CompanyProfileItemSchema = new mongoose_1.Schema({
10
23
  name: { type: String, trim: true, required: true },
11
24
  label: { type: String, trim: true },
@@ -33,6 +46,29 @@ exports.CompanyProfileItemSchema = new mongoose_1.Schema({
33
46
  enum: Object.values(event_profile_status_enum_1.EventProfileStatus),
34
47
  default: event_profile_status_enum_1.EventProfileStatus.DISABLE,
35
48
  },
49
+ profileItemType: {
50
+ type: String,
51
+ enum: profile_item_type_enum_1.ProfileItemType,
52
+ default: profile_item_type_enum_1.ProfileItemType.MAIN,
53
+ },
54
+ customType: {
55
+ type: String,
56
+ enum: profile_item_custom_type_enum_1.ProfileItemCustomType,
57
+ required: function () {
58
+ return this.profileItemType === profile_item_type_enum_1.ProfileItemType.CUSTOM;
59
+ },
60
+ },
61
+ customTypePossibleValues: {
62
+ type: [CustomTypePossibleValueSchema],
63
+ required: function () {
64
+ return (this.profileItemType === profile_item_type_enum_1.ProfileItemType.CUSTOM &&
65
+ [
66
+ profile_item_custom_type_enum_1.ProfileItemCustomType.CHECK_BOXS,
67
+ profile_item_custom_type_enum_1.ProfileItemCustomType.RADIO_BUTTONS,
68
+ ].indexOf(this.customType) !== -1);
69
+ },
70
+ default: [],
71
+ },
36
72
  createdAt: { type: Date, required: true, default: Date.now },
37
73
  updatedAt: { type: Date, required: true, default: Date.now },
38
74
  });
@@ -1 +1 @@
1
- {"version":3,"file":"company-profile-item.entity.js","sourceRoot":"","sources":["../../../../../../src/entities/models/events/entities/eventProfile/company-profile-item.entity.ts"],"names":[],"mappings":";;;AAAA,uCAAkC;AAElC,8FAAoF;AAIpF,MAAa,kBAAkB;CAU9B;AAVD,gDAUC;AACY,QAAA,wBAAwB,GAAG,IAAI,iBAAM,CAGhD;IACA,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE;IAClD,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE;IACnC,SAAS,EAAE;QACT,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;QACd,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,8CAAkB,CAAC;QACvC,OAAO,EAAE,8CAAkB,CAAC,OAAO;KACpC;IACD,kBAAkB,EAAE;QAClB,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;QACd,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,8CAAkB,CAAC;QACvC,OAAO,EAAE,8CAAkB,CAAC,OAAO;KACpC;IACD,aAAa,EAAE;QACb,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;QACd,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,8CAAkB,CAAC;QACvC,OAAO,EAAE,8CAAkB,CAAC,OAAO;KACpC;IACD,YAAY,EAAE;QACZ,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;QACd,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,8CAAkB,CAAC;QACvC,OAAO,EAAE,8CAAkB,CAAC,OAAO;KACpC;IACD,SAAS,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,GAAG,EAAE;IAC5D,SAAS,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,GAAG,EAAE;CAC7D,CAAC,CAAC"}
1
+ {"version":3,"file":"company-profile-item.entity.js","sourceRoot":"","sources":["../../../../../../src/entities/models/events/entities/eventProfile/company-profile-item.entity.ts"],"names":[],"mappings":";;;AAAA,uCAAkC;AAElC,8FAAoF;AACpF,wFAA4E;AAC5E,sGAAyF;AAKzF,MAAa,kBAAkB;CAa9B;AAbD,gDAaC;AAED,MAAM,6BAA6B,GAAG,IAAI,iBAAM,CAI5C;IACE,UAAU,EAAE;QACV,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACf;IACD,KAAK,EAAE;QACL,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,IAAI;QACV,QA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