@kipicore/dbcore 1.1.634 → 1.1.635
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.
|
@@ -2,33 +2,42 @@ import { Document } from 'mongoose';
|
|
|
2
2
|
import { IDefaultAttributes } from './commonInterface';
|
|
3
3
|
import { VENDOR_COMPANY_META_STATUS } from '../constants/app';
|
|
4
4
|
export interface IBankDetails {
|
|
5
|
-
accountHolderName
|
|
6
|
-
accountNumber
|
|
7
|
-
ifscCode
|
|
8
|
-
bankName
|
|
9
|
-
branchName
|
|
5
|
+
accountHolderName: string;
|
|
6
|
+
accountNumber: string;
|
|
7
|
+
ifscCode: string;
|
|
8
|
+
bankName: string;
|
|
9
|
+
branchName: string;
|
|
10
|
+
}
|
|
11
|
+
export interface ICompanyDocument {
|
|
12
|
+
documentType: string;
|
|
13
|
+
fileStorageId: string;
|
|
14
|
+
isVerified?: boolean;
|
|
15
|
+
verifiedAt?: Date;
|
|
16
|
+
uploadedAt?: Date;
|
|
10
17
|
}
|
|
11
18
|
export interface IVendorCompanyMetaAttributes extends IDefaultAttributes, Document {
|
|
12
19
|
id: string;
|
|
13
20
|
vendorId: string;
|
|
14
21
|
companyName: string;
|
|
15
22
|
companyCode: string;
|
|
16
|
-
email
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
panNumber?: string;
|
|
23
|
+
email: string;
|
|
24
|
+
mobile?: string;
|
|
25
|
+
gstNumber: string;
|
|
26
|
+
panNumber: string;
|
|
21
27
|
website?: string;
|
|
22
28
|
logo?: string;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
29
|
+
banner?: string;
|
|
30
|
+
address1: string;
|
|
31
|
+
address2: string;
|
|
32
|
+
area: string;
|
|
26
33
|
district?: string;
|
|
27
|
-
pinCode
|
|
34
|
+
pinCode: string;
|
|
28
35
|
taluka?: string;
|
|
29
|
-
country
|
|
30
|
-
state
|
|
31
|
-
city
|
|
32
|
-
bankDetails?: IBankDetails;
|
|
36
|
+
country: number;
|
|
37
|
+
state: number;
|
|
38
|
+
city: number;
|
|
33
39
|
status: VENDOR_COMPANY_META_STATUS;
|
|
40
|
+
description?: string;
|
|
41
|
+
documents: ICompanyDocument[];
|
|
42
|
+
bankDetails: IBankDetails;
|
|
34
43
|
}
|
|
@@ -34,14 +34,54 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
const mongoose_1 = __importStar(require("mongoose"));
|
|
37
|
-
const
|
|
37
|
+
const constants_1 = require("../../constants");
|
|
38
38
|
const bankDetailsSchema = new mongoose_1.Schema({
|
|
39
|
-
accountHolderName: {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
39
|
+
accountHolderName: {
|
|
40
|
+
type: String,
|
|
41
|
+
required: true,
|
|
42
|
+
},
|
|
43
|
+
accountNumber: {
|
|
44
|
+
type: String,
|
|
45
|
+
required: true,
|
|
46
|
+
},
|
|
47
|
+
ifscCode: {
|
|
48
|
+
type: String,
|
|
49
|
+
required: true,
|
|
50
|
+
},
|
|
51
|
+
bankName: {
|
|
52
|
+
type: String,
|
|
53
|
+
required: true,
|
|
54
|
+
},
|
|
55
|
+
branchName: {
|
|
56
|
+
type: String,
|
|
57
|
+
required: true,
|
|
58
|
+
},
|
|
59
|
+
}, {
|
|
60
|
+
_id: false,
|
|
61
|
+
});
|
|
62
|
+
const companyDocumentSchema = new mongoose_1.Schema({
|
|
63
|
+
documentType: {
|
|
64
|
+
type: String,
|
|
65
|
+
required: true,
|
|
66
|
+
},
|
|
67
|
+
fileStorageId: {
|
|
68
|
+
type: String,
|
|
69
|
+
required: true,
|
|
70
|
+
},
|
|
71
|
+
isVerified: {
|
|
72
|
+
type: Boolean,
|
|
73
|
+
default: false,
|
|
74
|
+
},
|
|
75
|
+
verifiedAt: {
|
|
76
|
+
type: Date,
|
|
77
|
+
},
|
|
78
|
+
uploadedAt: {
|
|
79
|
+
type: Date,
|
|
80
|
+
default: Date.now,
|
|
81
|
+
},
|
|
82
|
+
}, {
|
|
83
|
+
_id: false,
|
|
84
|
+
});
|
|
45
85
|
const vendorCompanyMetaSchema = new mongoose_1.Schema({
|
|
46
86
|
vendorId: {
|
|
47
87
|
type: String,
|
|
@@ -50,30 +90,34 @@ const vendorCompanyMetaSchema = new mongoose_1.Schema({
|
|
|
50
90
|
companyName: {
|
|
51
91
|
type: String,
|
|
52
92
|
required: true,
|
|
93
|
+
trim: true,
|
|
53
94
|
},
|
|
54
95
|
companyCode: {
|
|
55
96
|
type: String,
|
|
56
97
|
required: true,
|
|
98
|
+
trim: true,
|
|
57
99
|
},
|
|
58
|
-
|
|
59
|
-
type: String,
|
|
60
|
-
required: false,
|
|
61
|
-
},
|
|
62
|
-
mobile: {
|
|
100
|
+
email: {
|
|
63
101
|
type: String,
|
|
64
102
|
required: true,
|
|
103
|
+
trim: true,
|
|
104
|
+
lowercase: true,
|
|
65
105
|
},
|
|
66
|
-
|
|
106
|
+
mobile: {
|
|
67
107
|
type: String,
|
|
68
108
|
required: false,
|
|
69
109
|
},
|
|
70
110
|
gstNumber: {
|
|
71
111
|
type: String,
|
|
72
|
-
required:
|
|
112
|
+
required: true,
|
|
113
|
+
trim: true,
|
|
114
|
+
uppercase: true,
|
|
73
115
|
},
|
|
74
116
|
panNumber: {
|
|
75
117
|
type: String,
|
|
76
|
-
required:
|
|
118
|
+
required: true,
|
|
119
|
+
trim: true,
|
|
120
|
+
uppercase: true,
|
|
77
121
|
},
|
|
78
122
|
website: {
|
|
79
123
|
type: String,
|
|
@@ -83,17 +127,21 @@ const vendorCompanyMetaSchema = new mongoose_1.Schema({
|
|
|
83
127
|
type: String,
|
|
84
128
|
required: false,
|
|
85
129
|
},
|
|
86
|
-
|
|
130
|
+
banner: {
|
|
87
131
|
type: String,
|
|
88
132
|
required: false,
|
|
89
133
|
},
|
|
134
|
+
address1: {
|
|
135
|
+
type: String,
|
|
136
|
+
required: true,
|
|
137
|
+
},
|
|
90
138
|
address2: {
|
|
91
139
|
type: String,
|
|
92
|
-
required:
|
|
140
|
+
required: true,
|
|
93
141
|
},
|
|
94
142
|
area: {
|
|
95
143
|
type: String,
|
|
96
|
-
required:
|
|
144
|
+
required: true,
|
|
97
145
|
},
|
|
98
146
|
district: {
|
|
99
147
|
type: String,
|
|
@@ -101,7 +149,7 @@ const vendorCompanyMetaSchema = new mongoose_1.Schema({
|
|
|
101
149
|
},
|
|
102
150
|
pinCode: {
|
|
103
151
|
type: String,
|
|
104
|
-
required:
|
|
152
|
+
required: true,
|
|
105
153
|
},
|
|
106
154
|
taluka: {
|
|
107
155
|
type: String,
|
|
@@ -109,24 +157,33 @@ const vendorCompanyMetaSchema = new mongoose_1.Schema({
|
|
|
109
157
|
},
|
|
110
158
|
country: {
|
|
111
159
|
type: Number,
|
|
112
|
-
required:
|
|
160
|
+
required: true,
|
|
113
161
|
},
|
|
114
162
|
state: {
|
|
115
163
|
type: Number,
|
|
116
|
-
required:
|
|
164
|
+
required: true,
|
|
117
165
|
},
|
|
118
166
|
city: {
|
|
119
167
|
type: Number,
|
|
168
|
+
required: true,
|
|
169
|
+
},
|
|
170
|
+
description: {
|
|
171
|
+
type: String,
|
|
120
172
|
required: false,
|
|
173
|
+
default: '',
|
|
174
|
+
},
|
|
175
|
+
documents: {
|
|
176
|
+
type: [companyDocumentSchema],
|
|
177
|
+
default: [],
|
|
121
178
|
},
|
|
122
179
|
bankDetails: {
|
|
123
180
|
type: bankDetailsSchema,
|
|
124
|
-
required:
|
|
181
|
+
required: true,
|
|
125
182
|
},
|
|
126
183
|
status: {
|
|
127
184
|
type: String,
|
|
128
|
-
enum: Object.values(
|
|
129
|
-
default:
|
|
185
|
+
enum: Object.values(constants_1.VENDOR_COMPANY_META_STATUS),
|
|
186
|
+
default: constants_1.VENDOR_COMPANY_META_STATUS.PENDING,
|
|
130
187
|
},
|
|
131
188
|
createdBy: {
|
|
132
189
|
type: String,
|
package/package.json
CHANGED