@bharatbxhipment/xhipment-models-v2 1.0.0 → 1.0.5

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 CHANGED
@@ -1 +1,39 @@
1
- # xhipment-models-v2
1
+ # @bharatbxhipment/xhipment-models-v2
2
+
3
+ Mongoose schemas and TypeScript types for Xhipment application.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @bharatbxhipment/xhipment-models-v2
9
+ ```
10
+
11
+
12
+ ## Features
13
+
14
+ - ✅ Full TypeScript support with `.d.ts` files
15
+ - ✅ Mongoose schemas ready to use
16
+ - ✅ Type-safe interfaces
17
+ - ✅ Source maps for debugging
18
+ - ✅ Automatic publishing via GitHub Actions
19
+
20
+ ## Requirements
21
+
22
+ - Node.js >= 14
23
+ - mongoose >= 8.0.0
24
+
25
+ ## Development
26
+
27
+ ### Build
28
+ ```bash
29
+ npm run build
30
+ ```
31
+
32
+ ### Publish
33
+ The package automatically publishes to npm when:
34
+ - Version changes in `package.json` and pushed to `main` branch
35
+ - Manually triggered via GitHub Actions
36
+
37
+ ## License
38
+
39
+ ISC
package/dist/index.d.ts CHANGED
@@ -1,3 +1,7 @@
1
1
  export * from "./schemas/container-meta-data/container-meta-data.model";
2
+ export * from "./schemas/billing-entities/billing-entities.model";
3
+ export * from "./schemas/countries/countries.model";
2
4
  export * from "./schemas/container-meta-data/container-meta-data.type";
5
+ export * from "./schemas/countries/countries.interface";
6
+ export * from "./schemas/billing-entities/billing-entities.interface";
3
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,yDAAyD,CAAC;AAGxE,cAAc,wDAAwD,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,yDAAyD,CAAC;AACxE,cAAc,mDAAmD,CAAC;AAClE,cAAc,qCAAqC,CAAC;AAEpD,cAAc,wDAAwD,CAAC;AACvE,cAAc,yCAAyC,CAAC;AACxD,cAAc,uDAAuD,CAAC"}
package/dist/index.js CHANGED
@@ -16,6 +16,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  // Schemas
18
18
  __exportStar(require("./schemas/container-meta-data/container-meta-data.model"), exports);
19
+ __exportStar(require("./schemas/billing-entities/billing-entities.model"), exports);
20
+ __exportStar(require("./schemas/countries/countries.model"), exports);
19
21
  // Types
20
22
  __exportStar(require("./schemas/container-meta-data/container-meta-data.type"), exports);
23
+ __exportStar(require("./schemas/countries/countries.interface"), exports);
24
+ __exportStar(require("./schemas/billing-entities/billing-entities.interface"), exports);
21
25
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,UAAU;AACV,0FAAwE;AAExE,QAAQ;AACR,yFAAuE"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,UAAU;AACV,0FAAwE;AACxE,oFAAkE;AAClE,sEAAoD;AACpD,QAAQ;AACR,yFAAuE;AACvE,0EAAwD;AACxD,wFAAsE"}
@@ -0,0 +1,54 @@
1
+ import mongoose from "mongoose";
2
+ export interface IBillingEntities {
3
+ _id?: mongoose.Types.ObjectId;
4
+ organizationId: mongoose.Types.ObjectId;
5
+ entityName: string;
6
+ country: string;
7
+ currency: string;
8
+ billingAddress: {
9
+ addressLineOne: string;
10
+ addressLineTwo: string;
11
+ city: string;
12
+ state: string;
13
+ pincode: string;
14
+ country: string;
15
+ };
16
+ shippingAddress: {
17
+ addressLineOne: string;
18
+ addressLineTwo: string;
19
+ city: string;
20
+ state: string;
21
+ pincode: string;
22
+ country: string;
23
+ };
24
+ isShippingAddressSameAsBillingAddress: boolean;
25
+ gstInfo?: {
26
+ gstinNo: string;
27
+ gstTreatment: string;
28
+ };
29
+ zohoEmail: string;
30
+ zohoContactIdIndia: {
31
+ zohoId: string;
32
+ currencyPreference: string;
33
+ }[];
34
+ zohoContactIdUs: {
35
+ zohoId: string;
36
+ currencyPreference: string;
37
+ }[];
38
+ isEntityCreatedOnZoho: boolean;
39
+ alsoForZohoUs?: boolean;
40
+ entityApproval: 'PENDING' | 'APPROVED' | 'REJECTED';
41
+ verificationDocuments: {
42
+ documentName: string;
43
+ documentUrl: string;
44
+ }[];
45
+ isVerified: boolean;
46
+ status: 'ACTIVE' | 'INACTIVE';
47
+ createdAt: Date;
48
+ updatedAt: Date;
49
+ createdBy: string;
50
+ updatedBy: string;
51
+ lastUpdatedAt: Date;
52
+ lastUpdatedBy: string;
53
+ }
54
+ //# sourceMappingURL=billing-entities.interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"billing-entities.interface.d.ts","sourceRoot":"","sources":["../../../src/schemas/billing-entities/billing-entities.interface.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,MAAM,WAAW,gBAAgB;IAC/B,GAAG,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC;IAC9B,cAAc,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC;IACxC,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE;QACd,cAAc,EAAE,MAAM,CAAC;QACvB,cAAc,EAAE,MAAM,CAAC;QACvB,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,eAAe,EAAE;QACf,cAAc,EAAE,MAAM,CAAC;QACvB,cAAc,EAAE,MAAM,CAAC;QACvB,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,qCAAqC,EAAE,OAAO,CAAC;IAC/C,OAAO,CAAC,EAAE;QACR,OAAO,EAAE,MAAM,CAAC;QAChB,YAAY,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,SAAS,EAAE,MAAM,CAAC;IAClB,kBAAkB,EAAE;QAClB,MAAM,EAAE,MAAM,CAAC;QACf,kBAAkB,EAAE,MAAM,CAAC;KAC5B,EAAE,CAAC;IACJ,eAAe,EAAE;QACf,MAAM,EAAE,MAAM,CAAC;QACf,kBAAkB,EAAE,MAAM,CAAC;KAC5B,EAAE,CAAC;IACJ,qBAAqB,EAAE,OAAO,CAAC;IAC/B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,cAAc,EAAE,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;IACpD,qBAAqB,EAAE;QACrB,YAAY,EAAE,MAAM,CAAC;QACrB,WAAW,EAAE,MAAM,CAAC;KACrB,EAAE,CAAC;IACJ,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE,QAAQ,GAAG,UAAU,CAAC;IAC9B,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,IAAI,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;CACvB"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=billing-entities.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"billing-entities.interface.js","sourceRoot":"","sources":["../../../src/schemas/billing-entities/billing-entities.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,12 @@
1
+ import { Schema } from 'mongoose';
2
+ import { IBillingEntities } from './billing-entities.interface';
3
+ export declare const billingEntitySchema: Schema<IBillingEntities, import("mongoose").Model<IBillingEntities, any, any, any, import("mongoose").Document<unknown, any, IBillingEntities, any, {}> & IBillingEntities & Required<{
4
+ _id: import("mongoose").Types.ObjectId;
5
+ }> & {
6
+ __v: number;
7
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, IBillingEntities, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<IBillingEntities>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<IBillingEntities> & Required<{
8
+ _id: import("mongoose").Types.ObjectId;
9
+ }> & {
10
+ __v: number;
11
+ }>;
12
+ //# sourceMappingURL=billing-entities.model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"billing-entities.model.d.ts","sourceRoot":"","sources":["../../../src/schemas/billing-entities/billing-entities.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAEhE,eAAO,MAAM,mBAAmB;;;;;;;;EA8M9B,CAAC"}
@@ -0,0 +1,213 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.billingEntitySchema = void 0;
4
+ const mongoose_1 = require("mongoose");
5
+ exports.billingEntitySchema = new mongoose_1.Schema({
6
+ organizationId: {
7
+ type: mongoose_1.Schema.Types.ObjectId,
8
+ ref: 'Organization',
9
+ required: true
10
+ },
11
+ entityName: {
12
+ type: String,
13
+ required: true
14
+ },
15
+ country: {
16
+ type: String,
17
+ required: true
18
+ },
19
+ currency: {
20
+ type: String,
21
+ required: false
22
+ },
23
+ billingAddress: {
24
+ _id: false,
25
+ addressLineOne: {
26
+ type: String,
27
+ required: true
28
+ },
29
+ addressLineTwo: {
30
+ type: String,
31
+ required: true
32
+ },
33
+ city: {
34
+ type: String,
35
+ required: true
36
+ },
37
+ state: {
38
+ type: String,
39
+ required: true
40
+ },
41
+ pincode: {
42
+ type: String,
43
+ required: true
44
+ },
45
+ country: {
46
+ type: String,
47
+ required: true
48
+ }
49
+ },
50
+ shippingAddress: {
51
+ _id: false,
52
+ addressLineOne: {
53
+ type: String,
54
+ required: true
55
+ },
56
+ addressLineTwo: {
57
+ type: String,
58
+ required: true
59
+ },
60
+ city: {
61
+ type: String,
62
+ required: true
63
+ },
64
+ state: {
65
+ type: String,
66
+ required: true
67
+ },
68
+ pincode: {
69
+ type: String,
70
+ required: true
71
+ },
72
+ country: {
73
+ type: String,
74
+ required: true
75
+ }
76
+ },
77
+ isShippingAddressSameAsBillingAddress: {
78
+ type: Boolean,
79
+ required: true,
80
+ default: false
81
+ },
82
+ gstInfo: {
83
+ _id: false,
84
+ gstinNo: {
85
+ type: String,
86
+ required: false,
87
+ validate: {
88
+ validator: function (value) {
89
+ if (!value)
90
+ return true; // Allow empty if not required
91
+ const gstregex = /^[0-9]{2}[A-Z]{3}[ABCFGHLJPTF][A-Z][0-9]{4}[A-Z][1-9A-Z]Z[0-9A-Z]$/;
92
+ return gstregex.test(value);
93
+ },
94
+ message: 'Invalid GST Number'
95
+ }
96
+ },
97
+ gstTreatment: {
98
+ type: String,
99
+ required: false
100
+ }
101
+ },
102
+ zohoEmail: {
103
+ type: String,
104
+ required: false,
105
+ default: ''
106
+ },
107
+ zohoContactIdIndia: {
108
+ type: [{
109
+ _id: false,
110
+ zohoId: {
111
+ type: String,
112
+ required: true
113
+ },
114
+ currencyPreference: {
115
+ type: String,
116
+ required: true
117
+ }
118
+ }],
119
+ required: true,
120
+ validate: {
121
+ validator: function (arr) {
122
+ const combinations = new Set();
123
+ for (const item of arr) {
124
+ const combination = `${item.zohoId}-${item.currencyPreference}`;
125
+ if (combinations.has(combination)) {
126
+ return false;
127
+ }
128
+ combinations.add(combination);
129
+ }
130
+ return true;
131
+ },
132
+ message: 'The combination of zohoId and currencyPreference must be unique within zohoContactIdIndia array'
133
+ }
134
+ },
135
+ zohoContactIdUs: {
136
+ type: [{
137
+ _id: false,
138
+ zohoId: {
139
+ type: String,
140
+ required: true
141
+ },
142
+ currencyPreference: {
143
+ type: String,
144
+ required: true
145
+ }
146
+ }],
147
+ required: true,
148
+ validate: {
149
+ validator: function (arr) {
150
+ const combinations = new Set();
151
+ for (const item of arr) {
152
+ const combination = `${item.zohoId}-${item.currencyPreference}`;
153
+ if (combinations.has(combination)) {
154
+ return false;
155
+ }
156
+ combinations.add(combination);
157
+ }
158
+ return true;
159
+ },
160
+ message: 'The combination of zohoId and currencyPreference must be unique within zohoContactIdUs array'
161
+ }
162
+ },
163
+ isEntityCreatedOnZoho: {
164
+ type: Boolean,
165
+ required: [true, 'isEntityCreatedOnZoho is required'],
166
+ default: false
167
+ },
168
+ entityApproval: {
169
+ type: String,
170
+ enum: ['PENDING', 'APPROVED', 'REJECTED'],
171
+ required: true,
172
+ default: 'PENDING'
173
+ },
174
+ verificationDocuments: {
175
+ type: [{
176
+ _id: false,
177
+ documentName: {
178
+ type: String,
179
+ required: true
180
+ },
181
+ documentUrl: {
182
+ type: String,
183
+ required: true
184
+ }
185
+ }],
186
+ required: false,
187
+ default: []
188
+ },
189
+ isVerified: {
190
+ type: Boolean,
191
+ required: true,
192
+ default: false
193
+ },
194
+ status: {
195
+ type: String,
196
+ enum: ['ACTIVE', 'INACTIVE'],
197
+ required: true,
198
+ default: 'ACTIVE'
199
+ },
200
+ lastUpdatedAt: {
201
+ type: Date,
202
+ required: true,
203
+ default: Date.now
204
+ },
205
+ lastUpdatedBy: {
206
+ type: String,
207
+ required: true,
208
+ default: 'system'
209
+ }
210
+ }, {
211
+ timestamps: true
212
+ });
213
+ //# sourceMappingURL=billing-entities.model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"billing-entities.model.js","sourceRoot":"","sources":["../../../src/schemas/billing-entities/billing-entities.model.ts"],"names":[],"mappings":";;;AAAA,uCAAkC;AAG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EAAE,CAAC;gBACL,GAAG,EAAE,KAAK;gBACV,YAAY,EAAE;oBACZ,IAAI,EAAE,MAAM;oBACZ,QAAQ,EAAE,IAAI;iBACf;gBACD,WAAW,EAAE;oBACX,IAAI,EAAE,MAAM;oBACZ,QAAQ,EAAE,IAAI;iBACf;aACF,CAAC;QACF,QAAQ,EAAE,KAAK;QACf,OAAO,EAAE,EAAE;KACZ;IACD,UAAU,EAAE;QACV,IAAI,EAAE,OAAO;QACb,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,KAAK;KACf;IACD,MAAM,EAAE;QACN,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,CAAC,QAAQ,EAAE,UAAU,CAAC;QAC5B,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,QAAQ;KAClB;IACD,aAAa,EAAE;QACb,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,IAAI,CAAC,GAAG;KAClB;IACD,aAAa,EAAE;QACb,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,QAAQ;KAClB;CACF,EAAE;IACD,UAAU,EAAE,IAAI;CACjB,CAAC,CAAC"}
@@ -0,0 +1,25 @@
1
+ export interface ICountry {
2
+ countryName: string;
3
+ iso2Code: string;
4
+ iso3Code?: string;
5
+ numericCode?: string;
6
+ currency: string;
7
+ currencySymbol?: string;
8
+ currencyISOCode: string;
9
+ taxIdFormat?: string;
10
+ taxIdRegex?: string;
11
+ pincodeRegex: string;
12
+ postalCodeExample?: string;
13
+ phoneCode?: string;
14
+ phoneNumberRegex?: string;
15
+ timeZones?: string[];
16
+ primaryTimeZone?: string;
17
+ weekStartDay?: "SUNDAY" | "MONDAY";
18
+ locale?: string;
19
+ timezoneOffsetHours?: number;
20
+ displayOnCustomerPortal?: boolean;
21
+ displayOnAdminPortal?: boolean;
22
+ validForProducts?: ["fcl", "lcl", 'air_freight', 'dd', 'bonds', 'trucking', 'warehousing', 'fcl-transloading', 'lcl-transloading', 'dd-transloading'];
23
+ isActive: boolean;
24
+ }
25
+ //# sourceMappingURL=countries.interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"countries.interface.d.ts","sourceRoot":"","sources":["../../../src/schemas/countries/countries.interface.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,QAAQ;IAErB,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,WAAW,CAAC,EAAE,MAAM,CAAA;IAGpB,QAAQ,EAAE,MAAM,CAAA;IAChB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,eAAe,EAAE,MAAM,CAAA;IACvB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,UAAU,CAAC,EAAE,MAAM,CAAA;IAEnB,YAAY,EAAE,MAAM,CAAA;IACpB,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IAGzB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;IACpB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,YAAY,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAA;IAClC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,uBAAuB,CAAC,EAAE,OAAO,CAAA;IACjC,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,iBAAiB,CAAC,CAAA;IACrJ,QAAQ,EAAE,OAAO,CAAA;CAClB"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=countries.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"countries.interface.js","sourceRoot":"","sources":["../../../src/schemas/countries/countries.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,12 @@
1
+ import { Schema } from 'mongoose';
2
+ import { ICountry } from './countries.interface';
3
+ export declare const countrySchema: Schema<ICountry, import("mongoose").Model<ICountry, any, any, any, import("mongoose").Document<unknown, any, ICountry, any, {}> & ICountry & {
4
+ _id: import("mongoose").Types.ObjectId;
5
+ } & {
6
+ __v: number;
7
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, ICountry, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<ICountry>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<ICountry> & {
8
+ _id: import("mongoose").Types.ObjectId;
9
+ } & {
10
+ __v: number;
11
+ }>;
12
+ //# sourceMappingURL=countries.model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"countries.model.d.ts","sourceRoot":"","sources":["../../../src/schemas/countries/countries.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAEhD,eAAO,MAAM,aAAa;;;;;;;;EAuFxB,CAAA"}
@@ -0,0 +1,90 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.countrySchema = void 0;
4
+ const mongoose_1 = require("mongoose");
5
+ exports.countrySchema = new mongoose_1.Schema({
6
+ // 🏷 Basic Identification
7
+ countryName: {
8
+ type: String,
9
+ required: true
10
+ },
11
+ iso2Code: {
12
+ type: String,
13
+ required: true,
14
+ unique: true
15
+ },
16
+ iso3Code: {
17
+ type: String,
18
+ unique: true
19
+ },
20
+ numericCode: {
21
+ type: String
22
+ },
23
+ // 💰 Currency & Finance
24
+ currency: {
25
+ type: String,
26
+ required: true
27
+ },
28
+ currencySymbol: {
29
+ type: String
30
+ },
31
+ currencyISOCode: {
32
+ type: String,
33
+ required: true
34
+ },
35
+ taxIdFormat: {
36
+ type: String
37
+ },
38
+ taxIdRegex: {
39
+ type: String
40
+ },
41
+ // 📦 Postal & Addressing
42
+ pincodeRegex: {
43
+ type: String,
44
+ required: true
45
+ },
46
+ postalCodeExample: {
47
+ type: String
48
+ },
49
+ phoneCode: {
50
+ type: String
51
+ },
52
+ phoneNumberRegex: {
53
+ type: String
54
+ },
55
+ // 🕐 Time & Locale
56
+ timeZones: [{
57
+ type: String
58
+ }],
59
+ primaryTimeZone: {
60
+ type: String
61
+ },
62
+ weekStartDay: {
63
+ type: String,
64
+ enum: ["SUNDAY", "MONDAY"],
65
+ default: "MONDAY"
66
+ },
67
+ locale: {
68
+ type: String
69
+ },
70
+ timezoneOffsetHours: {
71
+ type: Number
72
+ },
73
+ displayOnCustomerPortal: {
74
+ type: Boolean,
75
+ default: true
76
+ },
77
+ displayOnAdminPortal: {
78
+ type: Boolean,
79
+ default: true
80
+ },
81
+ validForProducts: [{
82
+ type: String,
83
+ enum: ["fcl", "lcl", 'air_freight', 'dd', 'bonds', 'trucking', 'warehousing', 'fcl-transloading', 'lcl-transloading', 'dd-transloading']
84
+ }],
85
+ isActive: {
86
+ type: Boolean,
87
+ default: true
88
+ }
89
+ });
90
+ //# sourceMappingURL=countries.model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"countries.model.js","sourceRoot":"","sources":["../../../src/schemas/countries/countries.model.ts"],"names":[],"mappings":";;;AAAA,uCAAiC;AAGpB,QAAA,aAAa,GAAG,IAAI,iBAAM,CAAW;IAC9C,0BAA0B;IAC1B,WAAW,EAAE;QACT,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACjB;IACD,QAAQ,EAAE;QACN,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;QACd,MAAM,EAAE,IAAI;KACf;IACD,QAAQ,EAAE;QACN,IA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EAAE,kBAAkB,EAAE,kBAAkB,EAAE,iBAAiB,CAAC;SAC3I,CAAC;IACF,QAAQ,EAAE;QACN,IAAI,EAAE,OAAO;QACb,OAAO,EAAE,IAAI;KAChB;CACJ,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,21 +1,33 @@
1
1
  {
2
2
  "name": "@bharatbxhipment/xhipment-models-v2",
3
- "version": "1.0.0",
3
+ "version": "1.0.5",
4
4
  "description": "Mongoose schemas and TypeScript types for Xhipment application",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
- "files": ["dist"],
7
+ "files": [
8
+ "dist"
9
+ ],
8
10
  "scripts": {
9
11
  "test": "echo \"Error: no test specified\" && exit 1",
10
12
  "build": "tsc",
11
- "prepublishOnly": "npm run build"
13
+ "prepublishOnly": "npm run build",
14
+ "version:patch": "npm version patch -m 'chore: bump version to %s' && git push --follow-tags",
15
+ "version:minor": "npm version minor -m 'chore: bump version to %s' && git push --follow-tags",
16
+ "version:major": "npm version major -m 'chore: bump version to %s' && git push --follow-tags",
17
+ "release": "npm run build && npm run version:patch"
12
18
  },
13
- "keywords": ["mongoose", "schemas", "typescript", "xhipment", "models"],
19
+ "keywords": [
20
+ "mongoose",
21
+ "schemas",
22
+ "typescript",
23
+ "xhipment",
24
+ "models"
25
+ ],
14
26
  "author": "",
15
27
  "license": "ISC",
16
28
  "repository": {
17
29
  "type": "git",
18
- "url": "https://github.com/your-username/xhipment-models-v2.git"
30
+ "url": "https://github.com/Xhipment/xhipment-models-v2.git"
19
31
  },
20
32
  "devDependencies": {
21
33
  "typescript": "^5.9.3"