pristine-member-nest-api-database 1.0.71 → 1.0.73

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 CHANGED
@@ -53,7 +53,7 @@ __exportStar(require("./models/Editor.BPCompany.Types"), exports);
53
53
  __exportStar(require("./models/Editor.Category.Field.Mapping"), exports);
54
54
  // export * from "./models/Editor.StaticVariable.Category.Field.Mapping";
55
55
  __exportStar(require("./models/Editor.Container.Category.mapping"), exports);
56
- __exportStar(require("./models/Editor.BPcompanyTpes.Branch.Field.Category.Mapping"), exports);
56
+ __exportStar(require("./models/Editor.BPcompanyTypes.Branch.Field.Mapping"), exports);
57
57
  __exportStar(require("./models/Editor.SLIITO.Category.Field.Mapping"), exports);
58
58
  __exportStar(require("./models/Editor.Application.model"), exports);
59
59
  __exportStar(require("./src/dbConnect"), exports);
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.mongoBpCompanyBranchFieldMapping = void 0;
27
+ // Editor.BPcompanyTpes.Branch.Field.Category.Mapping.ts
28
+ const mongoose_1 = __importStar(require("mongoose"));
29
+ const BpCompanyBranchFieldMappingSchema = new mongoose_1.Schema({
30
+ BranchId: { type: mongoose_1.Schema.Types.ObjectId, ref: "Branch" },
31
+ companyTypeId: {
32
+ type: mongoose_1.Schema.Types.ObjectId,
33
+ ref: "Editor.BPCompany.Types",
34
+ },
35
+ fieldId: { type: mongoose_1.Schema.Types.ObjectId, ref: "Editor.Fields.Master" },
36
+ isSystemDefined: { type: Boolean, default: false },
37
+ isActive: { type: Boolean, default: true },
38
+ audit: [
39
+ {
40
+ userId: { type: String },
41
+ auditedOn: { type: Date, default: null },
42
+ actionType: { type: String },
43
+ },
44
+ ],
45
+ });
46
+ // (composite unique key)
47
+ BpCompanyBranchFieldMappingSchema.index({ BranchId: 1, companyTypeId: 1, fieldId: 1 }, { unique: true });
48
+ const mongoBpCompanyBranchFieldMapping = mongoose_1.default.model("Editor.Branch.CompanyTypes.Field.Mapping", BpCompanyBranchFieldMappingSchema);
49
+ exports.mongoBpCompanyBranchFieldMapping = mongoBpCompanyBranchFieldMapping;
package/index.ts CHANGED
@@ -40,7 +40,7 @@ export * from "./models/Editor.BPCompany.Types";
40
40
  export * from "./models/Editor.Category.Field.Mapping";
41
41
  // export * from "./models/Editor.StaticVariable.Category.Field.Mapping";
42
42
  export * from "./models/Editor.Container.Category.mapping";
43
- export * from "./models/Editor.BPcompanyTpes.Branch.Field.Category.Mapping";
43
+ export * from "./models/Editor.BPcompanyTypes.Branch.Field.Mapping";
44
44
  export * from "./models/Editor.SLIITO.Category.Field.Mapping";
45
45
 
46
46
  export * from "./models/Editor.Application.model";
@@ -2,7 +2,7 @@
2
2
  import mongoose, { Document, Schema } from "mongoose";
3
3
  import { Audit } from "../interface/Audit.interface";
4
4
 
5
- interface BranchCompanyTypesMapping extends Document {
5
+ interface BPCompanyBranchFieldMapping extends Document {
6
6
  BranchId: mongoose.Types.ObjectId;
7
7
  companyTypeId: mongoose.Types.ObjectId;
8
8
  fieldId: mongoose.Types.ObjectId;
@@ -11,8 +11,8 @@ interface BranchCompanyTypesMapping extends Document {
11
11
  audit: Audit[];
12
12
  }
13
13
 
14
- const BranchCompanyTypesFieldMappingSchema =
15
- new Schema<BranchCompanyTypesMapping>({
14
+ const BpCompanyBranchFieldMappingSchema =
15
+ new Schema<BPCompanyBranchFieldMapping>({
16
16
  BranchId: { type: Schema.Types.ObjectId, ref: "Branch" },
17
17
  companyTypeId: {
18
18
  type: Schema.Types.ObjectId,
@@ -29,14 +29,15 @@ const BranchCompanyTypesFieldMappingSchema =
29
29
  },
30
30
  ],
31
31
  });
32
-
33
- const mongoBranchBpCompanyTypesFieldMappingSchema =
34
- mongoose.model<BranchCompanyTypesMapping>(
32
+ // (composite unique key)
33
+ BpCompanyBranchFieldMappingSchema.index(
34
+ { BranchId: 1, companyTypeId: 1, fieldId: 1 },
35
+ { unique: true },
36
+ );
37
+ const mongoBpCompanyBranchFieldMapping =
38
+ mongoose.model<BPCompanyBranchFieldMapping>(
35
39
  "Editor.Branch.CompanyTypes.Field.Mapping",
36
- BranchCompanyTypesFieldMappingSchema,
40
+ BpCompanyBranchFieldMappingSchema,
37
41
  );
38
42
 
39
- export {
40
- BranchCompanyTypesMapping,
41
- mongoBranchBpCompanyTypesFieldMappingSchema,
42
- };
43
+ export { BPCompanyBranchFieldMapping, mongoBpCompanyBranchFieldMapping };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pristine-member-nest-api-database",
3
- "version": "1.0.71",
3
+ "version": "1.0.73",
4
4
  "description": "application verification database changes with gs1 branch. not tested. ",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {