@duvdu-v1/duvdu 1.1.289 → 1.1.290
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.
|
@@ -37,6 +37,7 @@ export declare const Contracts: import("mongoose").Model<Icontract, {}, {}, {},
|
|
|
37
37
|
_id: Types.ObjectId;
|
|
38
38
|
}, any>;
|
|
39
39
|
export interface IcontractReport {
|
|
40
|
+
ticketNumber: string;
|
|
40
41
|
reporter: Types.ObjectId | Iuser;
|
|
41
42
|
contract: Types.ObjectId | Icontract;
|
|
42
43
|
ref: string;
|
|
@@ -3,6 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ContractReports = exports.Contracts = void 0;
|
|
4
4
|
const mongoose_1 = require("mongoose");
|
|
5
5
|
const model_names_1 = require("../types/model-names");
|
|
6
|
+
// Function to generate simple unique ticket number
|
|
7
|
+
const generateTicketNumber = () => {
|
|
8
|
+
const random = Math.floor(100000 + Math.random() * 900000); // 6-digit random number
|
|
9
|
+
return `TKT${random}`;
|
|
10
|
+
};
|
|
6
11
|
exports.Contracts = (0, mongoose_1.model)(model_names_1.MODELS.allContracts, new mongoose_1.Schema({
|
|
7
12
|
customer: { type: mongoose_1.Schema.Types.ObjectId, ref: model_names_1.MODELS.user },
|
|
8
13
|
sp: { type: mongoose_1.Schema.Types.ObjectId, ref: model_names_1.MODELS.user },
|
|
@@ -12,6 +17,7 @@ exports.Contracts = (0, mongoose_1.model)(model_names_1.MODELS.allContracts, new
|
|
|
12
17
|
coupons: [{ type: mongoose_1.Schema.Types.ObjectId, ref: model_names_1.MODELS.coupon }],
|
|
13
18
|
}, { timestamps: true, collection: model_names_1.MODELS.allContracts }));
|
|
14
19
|
exports.ContractReports = (0, mongoose_1.model)(model_names_1.MODELS.contractReports, new mongoose_1.Schema({
|
|
20
|
+
ticketNumber: { type: String, default: generateTicketNumber, unique: true },
|
|
15
21
|
reporter: { type: mongoose_1.Schema.Types.ObjectId, ref: model_names_1.MODELS.user },
|
|
16
22
|
contract: { type: mongoose_1.Schema.Types.ObjectId, refPath: 'ref' },
|
|
17
23
|
ref: String,
|
|
@@ -22,6 +22,9 @@ export declare enum PERMISSIONS {
|
|
|
22
22
|
getProjectAnalysis = "get-project-analysis",
|
|
23
23
|
listWithdrawMethods = "list-withdraw-methods",
|
|
24
24
|
updateWithdrawMethod = "update-withdraw-method",
|
|
25
|
+
listComplaints = "list-complaints",
|
|
26
|
+
updateComplaint = "update-complaint",
|
|
27
|
+
closeComplaint = "close-complaint",
|
|
25
28
|
bookmarks = "bookmarks",
|
|
26
29
|
createTicket = "create ticket",
|
|
27
30
|
getAllTickets = "get-all-tickets",
|
|
@@ -80,6 +83,7 @@ export declare const permissions: {
|
|
|
80
83
|
messages: PERMISSIONS[];
|
|
81
84
|
projects: PERMISSIONS[];
|
|
82
85
|
withdrawMethods: PERMISSIONS[];
|
|
86
|
+
complaint: PERMISSIONS[];
|
|
83
87
|
bookmarks: PERMISSIONS[];
|
|
84
88
|
ticket: PERMISSIONS[];
|
|
85
89
|
terms: PERMISSIONS[];
|
|
@@ -32,6 +32,10 @@ var PERMISSIONS;
|
|
|
32
32
|
// withdraw
|
|
33
33
|
PERMISSIONS["listWithdrawMethods"] = "list-withdraw-methods";
|
|
34
34
|
PERMISSIONS["updateWithdrawMethod"] = "update-withdraw-method";
|
|
35
|
+
// complaint
|
|
36
|
+
PERMISSIONS["listComplaints"] = "list-complaints";
|
|
37
|
+
PERMISSIONS["updateComplaint"] = "update-complaint";
|
|
38
|
+
PERMISSIONS["closeComplaint"] = "close-complaint";
|
|
35
39
|
PERMISSIONS["bookmarks"] = "bookmarks";
|
|
36
40
|
PERMISSIONS["createTicket"] = "create ticket";
|
|
37
41
|
PERMISSIONS["getAllTickets"] = "get-all-tickets";
|
|
@@ -121,6 +125,9 @@ exports.permissions = {
|
|
|
121
125
|
PERMISSIONS.updateWithdrawMethod,
|
|
122
126
|
PERMISSIONS.removeUser,
|
|
123
127
|
PERMISSIONS.sendNotificationToUsers,
|
|
128
|
+
PERMISSIONS.listComplaints,
|
|
129
|
+
PERMISSIONS.updateComplaint,
|
|
130
|
+
PERMISSIONS.closeComplaint,
|
|
124
131
|
],
|
|
125
132
|
category: [
|
|
126
133
|
PERMISSIONS.createCategory,
|
|
@@ -159,6 +166,11 @@ exports.permissions = {
|
|
|
159
166
|
PERMISSIONS.listWithdrawMethods,
|
|
160
167
|
PERMISSIONS.updateWithdrawMethod,
|
|
161
168
|
],
|
|
169
|
+
complaint: [
|
|
170
|
+
PERMISSIONS.listComplaints,
|
|
171
|
+
PERMISSIONS.updateComplaint,
|
|
172
|
+
PERMISSIONS.closeComplaint,
|
|
173
|
+
],
|
|
162
174
|
bookmarks: [PERMISSIONS.bookmarks],
|
|
163
175
|
ticket: [
|
|
164
176
|
PERMISSIONS.createTicket,
|