@bharatbxhipment/xhipment-models-v2 1.0.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/README.md ADDED
@@ -0,0 +1 @@
1
+ # xhipment-models-v2
@@ -0,0 +1,3 @@
1
+ export * from "./schemas/container-meta-data/container-meta-data.model";
2
+ export * from "./schemas/container-meta-data/container-meta-data.type";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,yDAAyD,CAAC;AAGxE,cAAc,wDAAwD,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,21 @@
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ // Schemas
18
+ __exportStar(require("./schemas/container-meta-data/container-meta-data.model"), exports);
19
+ // Types
20
+ __exportStar(require("./schemas/container-meta-data/container-meta-data.type"), exports);
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,UAAU;AACV,0FAAwE;AAExE,QAAQ;AACR,yFAAuE"}
@@ -0,0 +1,21 @@
1
+ import { Schema } from 'mongoose';
2
+ import { IContainerMetadata, IRolledOverHistory } from './container-meta-data.type';
3
+ export declare const rolledOverHistorySchema: Schema<IRolledOverHistory, import("mongoose").Model<IRolledOverHistory, any, any, any, import("mongoose").Document<unknown, any, IRolledOverHistory, any, {}> & IRolledOverHistory & {
4
+ _id: import("mongoose").Types.ObjectId;
5
+ } & {
6
+ __v: number;
7
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, IRolledOverHistory, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<IRolledOverHistory>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<IRolledOverHistory> & {
8
+ _id: import("mongoose").Types.ObjectId;
9
+ } & {
10
+ __v: number;
11
+ }>;
12
+ export declare const containerMetadataSchema: Schema<IContainerMetadata, import("mongoose").Model<IContainerMetadata, any, any, any, import("mongoose").Document<unknown, any, IContainerMetadata, any, {}> & IContainerMetadata & {
13
+ _id: import("mongoose").Types.ObjectId;
14
+ } & {
15
+ __v: number;
16
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, IContainerMetadata, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<IContainerMetadata>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<IContainerMetadata> & {
17
+ _id: import("mongoose").Types.ObjectId;
18
+ } & {
19
+ __v: number;
20
+ }>;
21
+ //# sourceMappingURL=container-meta-data.model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"container-meta-data.model.d.ts","sourceRoot":"","sources":["../../../src/schemas/container-meta-data/container-meta-data.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAIpF,eAAO,MAAM,uBAAuB;;;;;;;;EAclB,CAAC;AAEnB,eAAO,MAAM,uBAAuB;;;;;;;;EAkJlC,CAAC"}
@@ -0,0 +1,167 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.containerMetadataSchema = exports.rolledOverHistorySchema = void 0;
4
+ const mongoose_1 = require("mongoose");
5
+ const nanoid_1 = require("nanoid");
6
+ // Define sub-schema for rolledOverHistory
7
+ exports.rolledOverHistorySchema = new mongoose_1.Schema({
8
+ rolledOverUpdatedDate: {
9
+ type: Date,
10
+ },
11
+ rolledOverReason: {
12
+ type: String,
13
+ },
14
+ rolledOverAt: {
15
+ type: String,
16
+ },
17
+ rolledOverUpdatedBy: {
18
+ type: mongoose_1.Schema.Types.ObjectId,
19
+ ref: 'User',
20
+ },
21
+ }, { _id: false });
22
+ exports.containerMetadataSchema = new mongoose_1.Schema({
23
+ loadId: {
24
+ type: mongoose_1.Schema.Types.ObjectId,
25
+ ref: 'Loads',
26
+ },
27
+ bookingId: {
28
+ type: mongoose_1.Schema.Types.ObjectId,
29
+ ref: 'Bookings',
30
+ },
31
+ proposalId: {
32
+ type: mongoose_1.Schema.Types.ObjectId,
33
+ ref: 'Proposals',
34
+ },
35
+ bookingIdentity: {
36
+ type: String,
37
+ },
38
+ quoteIdentity: {
39
+ type: String,
40
+ },
41
+ loadIdentity: {
42
+ type: String,
43
+ },
44
+ consolId: {
45
+ type: mongoose_1.Schema.Types.ObjectId,
46
+ ref: 'Consols',
47
+ },
48
+ containerCode: {
49
+ type: String,
50
+ },
51
+ sealNumber: {
52
+ type: String,
53
+ },
54
+ mblNumber: {
55
+ type: String,
56
+ },
57
+ containerIdentifier: {
58
+ type: String,
59
+ default: () => (0, nanoid_1.nanoid)(10).toUpperCase()
60
+ },
61
+ linerName: {
62
+ type: String,
63
+ },
64
+ originPort: {
65
+ type: String,
66
+ },
67
+ portOfLoading: {
68
+ type: String,
69
+ },
70
+ originTerminal: {
71
+ type: String,
72
+ },
73
+ destinationPort: {
74
+ type: String,
75
+ },
76
+ vesselName: {
77
+ type: String,
78
+ },
79
+ exportCountry: {
80
+ type: String,
81
+ },
82
+ voyage: {
83
+ type: String,
84
+ },
85
+ destinationTerminal: {
86
+ type: String,
87
+ },
88
+ vesselFlag: {
89
+ type: String,
90
+ minlength: [3, 'Vessel Flag must be at least 3 characters long (This is a ISO 3166-1 alpha-3 code for the country of the vessel)'],
91
+ maxlength: [3, 'Vessel Flag must be at most 3 characters long (This is a ISO 3166-1 alpha-3 code for the country of the vessel)'],
92
+ trim: true,
93
+ uppercase: true,
94
+ },
95
+ sailingDate: {
96
+ type: Date,
97
+ },
98
+ landingDate: {
99
+ type: Date,
100
+ },
101
+ siCutOff: {
102
+ type: Date,
103
+ },
104
+ amsCutOff: {
105
+ type: Date,
106
+ },
107
+ isfCutOff: {
108
+ type: Date,
109
+ },
110
+ forwardingNoteCutOff: {
111
+ type: Date,
112
+ },
113
+ vgmCutOff: {
114
+ type: Date,
115
+ },
116
+ aesCutOff: {
117
+ type: Date,
118
+ },
119
+ form13CutOff: {
120
+ type: Date,
121
+ },
122
+ gateInCutOff: {
123
+ type: Date,
124
+ },
125
+ containerPickupCutOff: {
126
+ type: Date,
127
+ },
128
+ isContainerRolledOver: {
129
+ type: Boolean,
130
+ default: false
131
+ },
132
+ rolledOverUpdatedDate: {
133
+ type: Date,
134
+ },
135
+ rolledOverReason: {
136
+ type: String,
137
+ },
138
+ bookingReferenceNumber: {
139
+ type: String,
140
+ },
141
+ rolledOverAt: {
142
+ type: String,
143
+ // enum: ['sailout', 'containerStuffing']
144
+ },
145
+ rolledOverUpdatedBy: {
146
+ type: mongoose_1.Schema.Types.ObjectId,
147
+ ref: 'User',
148
+ },
149
+ rolledOverHistory: [exports.rolledOverHistorySchema],
150
+ registerdOnVizion: {
151
+ type: Boolean,
152
+ default: false
153
+ },
154
+ vizionReferenceId: {
155
+ type: mongoose_1.Schema.Types.ObjectId,
156
+ ref: 'VizionRequest',
157
+ },
158
+ vizionLogStatus: {
159
+ type: String,
160
+ },
161
+ vizionLastLogStatusUpdatedAt: {
162
+ type: Date,
163
+ },
164
+ }, {
165
+ timestamps: true
166
+ });
167
+ //# sourceMappingURL=container-meta-data.model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"container-meta-data.model.js","sourceRoot":"","sources":["../../../src/schemas/container-meta-data/container-meta-data.model.ts"],"names":[],"mappings":";;;AAAA,uCAAkC;AAElC,mCAAgC;AAEhC,0CAA0C;AAC7B,QAAA,uBAAuB,GAAG,IAAI,iBAAM,CAAqB;IACpE,qBAAqB,EAAE;QACrB,IAAI,EAAE,IAAI;KACX;IACD,gBAAgB,EAAE;QAChB,IAAI,EAAE,MAAM;KACb;IACD,YAAY,EAAE;QACZ,IAAI,EAAE,MAAM;KACb;IACD,mBAAmB,EAAE;QACnB,IAAI,EAAE,iBAAM,CAAC,KAAK,CAAC,QAAQ;QAC3B,GAAG,EAAE,MAAM;KACZ;CACF,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC;AAEN,QAAA,uBAAuB,GAAG,IAAI,iBAAM,CAAqB;IACpE,MAAM,EAAE;QACN,IAAI,EAAE,iBAAM,CAAC,KAAK,CAAC,QAAQ;QAC3B,GAAG,EAAE,OAAO;KACb;IACD,SAAS,EAAE;QACT,IAAI,EAAE,iBAAM,CAAC,KAAK,CAAC,QAAQ;QAC3B,GAAG,EAAE,UAAU;KAChB;IACD,UAAU,EAAE;QACV,IAAI,EAAE,iBAAM,CAAC,KAAK,CAAC,QAAQ;QAC3B,GAAG,EAAE,WAAW;KACjB;IACD,eAAe,EAAE;QACf,IAAI,EAAE,MAAM;KACb;IACD,aAAa,EAAE;QACb,IAAI,EAAE,MAAM;KACb;IACD,YAAY,EAAE;QACZ,IAAI,EAAE,MAAM;KACb;IACD,QAAQ,EAAE;QACR,IAAI,EAAE,iBAAM,CAAC,KAAK,CAAC,QAAQ;QAC3B,GAAG,EAAE,SAAS;KACf;IACD,aAAa,EAAE;QACb,IAAI,EAAE,MA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KACX;IACD,YAAY,EAAE;QACZ,IAAI,EAAE,IAAI;KACX;IACD,qBAAqB,EAAE;QACrB,IAAI,EAAE,IAAI;KACX;IACD,qBAAqB,EAAE;QACrB,IAAI,EAAE,OAAO;QACb,OAAO,EAAE,KAAK;KACf;IACD,qBAAqB,EAAE;QACrB,IAAI,EAAE,IAAI;KACX;IACD,gBAAgB,EAAE;QAChB,IAAI,EAAE,MAAM;KACb;IACD,sBAAsB,EAAE;QACtB,IAAI,EAAE,MAAM;KACb;IACD,YAAY,EAAE;QACZ,IAAI,EAAE,MAAM;QACZ,yCAAyC;KAC1C;IACD,mBAAmB,EAAE;QACnB,IAAI,EAAE,iBAAM,CAAC,KAAK,CAAC,QAAQ;QAC3B,GAAG,EAAE,MAAM;KACZ;IACD,iBAAiB,EAAE,CAAC,+BAAuB,CAAC;IAC5C,iBAAiB,EAAE;QACjB,IAAI,EAAE,OAAO;QACb,OAAO,EAAE,KAAK;KACf;IACD,iBAAiB,EAAE;QACjB,IAAI,EAAE,iBAAM,CAAC,KAAK,CAAC,QAAQ;QAC3B,GAAG,EAAE,eAAe;KACrB;IACD,eAAe,EAAE;QACf,IAAI,EAAE,MAAM;KACb;IACD,4BAA4B,EAAE;QAC5B,IAAI,EAAE,IAAI;KACX;CAEF,EAAE;IACD,UAAU,EAAE,IAAI;CACjB,CAAC,CAAC"}
@@ -0,0 +1,53 @@
1
+ import { Types } from 'mongoose';
2
+ export interface IContainerMetadata {
3
+ loadId: Types.ObjectId;
4
+ bookingId: Types.ObjectId;
5
+ proposalId: Types.ObjectId;
6
+ bookingIdentity: string;
7
+ quoteIdentity: string;
8
+ loadIdentity: string;
9
+ consolId: Types.ObjectId;
10
+ containerCode: string;
11
+ sealNumber: string;
12
+ mblNumber: string;
13
+ containerIdentifier: string;
14
+ linerName: string;
15
+ originPort: string;
16
+ portOfLoading: string;
17
+ originTerminal: string;
18
+ destinationPort: string;
19
+ vesselName: string;
20
+ exportCountry: string;
21
+ voyage: string;
22
+ destinationTerminal: string;
23
+ vesselFlag: string;
24
+ sailingDate: Date;
25
+ landingDate: Date;
26
+ siCutOff: Date;
27
+ amsCutOff: Date;
28
+ isfCutOff: Date;
29
+ forwardingNoteCutOff: Date;
30
+ vgmCutOff: Date;
31
+ aesCutOff: Date;
32
+ form13CutOff: Date;
33
+ gateInCutOff: Date;
34
+ containerPickupCutOff: Date;
35
+ isContainerRolledOver: boolean;
36
+ rolledOverUpdatedDate: Date;
37
+ rolledOverReason: string;
38
+ bookingReferenceNumber: string;
39
+ rolledOverAt: string;
40
+ rolledOverUpdatedBy: Types.ObjectId;
41
+ rolledOverHistory: IRolledOverHistory[];
42
+ registerdOnVizion: boolean;
43
+ vizionReferenceId: Types.ObjectId;
44
+ vizionLogStatus: string;
45
+ vizionLastLogStatusUpdatedAt: Date;
46
+ }
47
+ export interface IRolledOverHistory {
48
+ rolledOverUpdatedDate: Date;
49
+ rolledOverReason: string;
50
+ rolledOverAt: string;
51
+ rolledOverUpdatedBy: Types.ObjectId;
52
+ }
53
+ //# sourceMappingURL=container-meta-data.type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"container-meta-data.type.d.ts","sourceRoot":"","sources":["../../../src/schemas/container-meta-data/container-meta-data.type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,MAAM,WAAW,kBAAkB;IAEjC,MAAM,EAAE,KAAK,CAAC,QAAQ,CAAC;IACvB,SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC;IAC1B,UAAU,EAAE,KAAK,CAAC,QAAQ,CAAC;IAC3B,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,mBAAmB,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}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=container-meta-data.type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"container-meta-data.type.js","sourceRoot":"","sources":["../../../src/schemas/container-meta-data/container-meta-data.type.ts"],"names":[],"mappings":""}
package/package.json ADDED
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "@bharatbxhipment/xhipment-models-v2",
3
+ "version": "1.0.0",
4
+ "description": "Mongoose schemas and TypeScript types for Xhipment application",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "files": ["dist"],
8
+ "scripts": {
9
+ "test": "echo \"Error: no test specified\" && exit 1",
10
+ "build": "tsc",
11
+ "prepublishOnly": "npm run build"
12
+ },
13
+ "keywords": ["mongoose", "schemas", "typescript", "xhipment", "models"],
14
+ "author": "",
15
+ "license": "ISC",
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "https://github.com/your-username/xhipment-models-v2.git"
19
+ },
20
+ "devDependencies": {
21
+ "typescript": "^5.9.3"
22
+ },
23
+ "dependencies": {
24
+ "mongoose": "^8.20.0",
25
+ "nanoid": "^5.1.6"
26
+ }
27
+ }