pristine-member-nest-api-database 1.0.74 → 1.0.75
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.
|
@@ -26,7 +26,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
26
26
|
exports.mongoSLITOBranchMembershipTypeFieldMapping = void 0;
|
|
27
27
|
const mongoose_1 = __importStar(require("mongoose"));
|
|
28
28
|
const SLITOCategoryFieldMappingSchema = new mongoose_1.Schema({
|
|
29
|
-
|
|
29
|
+
branchId: { type: mongoose_1.Schema.Types.ObjectId, ref: "Editor.Fields.Master" },
|
|
30
|
+
fieldId: { type: mongoose_1.Schema.Types.ObjectId, ref: "Branches" },
|
|
30
31
|
membershipTypeId: {
|
|
31
32
|
type: mongoose_1.Schema.Types.ObjectId,
|
|
32
33
|
ref: "Membership.Types",
|
|
@@ -41,5 +42,7 @@ const SLITOCategoryFieldMappingSchema = new mongoose_1.Schema({
|
|
|
41
42
|
},
|
|
42
43
|
],
|
|
43
44
|
});
|
|
45
|
+
//(composite unique key)
|
|
46
|
+
SLITOCategoryFieldMappingSchema.index({ branchId: 1, membershipTypeId: 1, fieldId: 1 }, { unique: true });
|
|
44
47
|
const mongoSLITOBranchMembershipTypeFieldMapping = mongoose_1.default.model("Editor.SLITO.Branch.Membership.Field.Mapping", SLITOCategoryFieldMappingSchema);
|
|
45
48
|
exports.mongoSLITOBranchMembershipTypeFieldMapping = mongoSLITOBranchMembershipTypeFieldMapping;
|
|
@@ -2,6 +2,7 @@ import mongoose, { Document, Schema } from "mongoose";
|
|
|
2
2
|
import { Audit } from "../interface/Audit.interface";
|
|
3
3
|
|
|
4
4
|
interface SLITOBranchMembershipTypeFieldMapping extends Document {
|
|
5
|
+
branchId: mongoose.Types.ObjectId;
|
|
5
6
|
fieldId: mongoose.Types.ObjectId;
|
|
6
7
|
membershipTypeId: mongoose.Types.ObjectId;
|
|
7
8
|
isSystemDefined: boolean;
|
|
@@ -11,7 +12,8 @@ interface SLITOBranchMembershipTypeFieldMapping extends Document {
|
|
|
11
12
|
|
|
12
13
|
const SLITOCategoryFieldMappingSchema =
|
|
13
14
|
new Schema<SLITOBranchMembershipTypeFieldMapping>({
|
|
14
|
-
|
|
15
|
+
branchId: { type: Schema.Types.ObjectId, ref: "Editor.Fields.Master" },
|
|
16
|
+
fieldId: { type: Schema.Types.ObjectId, ref: "Branches" },
|
|
15
17
|
membershipTypeId: {
|
|
16
18
|
type: Schema.Types.ObjectId,
|
|
17
19
|
ref: "Membership.Types",
|
|
@@ -27,6 +29,11 @@ const SLITOCategoryFieldMappingSchema =
|
|
|
27
29
|
],
|
|
28
30
|
});
|
|
29
31
|
|
|
32
|
+
//(composite unique key)
|
|
33
|
+
SLITOCategoryFieldMappingSchema.index(
|
|
34
|
+
{ branchId: 1, membershipTypeId: 1, fieldId: 1 },
|
|
35
|
+
{ unique: true },
|
|
36
|
+
);
|
|
30
37
|
const mongoSLITOBranchMembershipTypeFieldMapping =
|
|
31
38
|
mongoose.model<SLITOBranchMembershipTypeFieldMapping>(
|
|
32
39
|
"Editor.SLITO.Branch.Membership.Field.Mapping",
|