@duvdu-v1/duvdu 1.1.288 → 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,16 +37,18 @@ 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;
43
44
  desc: string;
44
45
  attachments: string[];
45
- state: {
46
- isClosed: boolean;
47
- closedBy: Types.ObjectId;
46
+ state: [{
47
+ addedBy: Types.ObjectId;
48
48
  feedback: string;
49
- };
49
+ }];
50
+ isClosed: boolean;
51
+ closedBy: Types.ObjectId;
50
52
  createdAt: Date;
51
53
  updatedAt: Date;
52
54
  }
@@ -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,21 +17,27 @@ 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,
18
24
  desc: { type: String, default: null },
19
25
  attachments: [String],
20
- state: {
21
- isClosed: {
22
- type: Boolean,
23
- default: false,
24
- },
25
- closedBy: {
26
- type: mongoose_1.Schema.Types.ObjectId,
27
- ref: model_names_1.MODELS.user,
28
- default: null,
29
- },
30
- feedback: { type: String, default: null },
26
+ state: [{
27
+ addedBy: {
28
+ type: mongoose_1.Schema.Types.ObjectId,
29
+ ref: model_names_1.MODELS.user,
30
+ default: null,
31
+ },
32
+ feedback: { type: String, default: null },
33
+ }],
34
+ isClosed: {
35
+ type: Boolean,
36
+ default: false,
37
+ },
38
+ closedBy: {
39
+ type: mongoose_1.Schema.Types.ObjectId,
40
+ ref: model_names_1.MODELS.user,
41
+ default: null,
31
42
  },
32
43
  }, { collection: model_names_1.MODELS.contractReports, timestamps: true }).index({ reporter: 1, contract: 1 }, { unique: true }));
@@ -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,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@duvdu-v1/duvdu",
3
- "version": "1.1.288",
3
+ "version": "1.1.290",
4
4
  "main": "./build/index.js",
5
5
  "types": "./build/index.d.ts",
6
6
  "files": [