@duvdu-v1/duvdu 1.1.252 → 1.1.254
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/build/middlewares/auth.middleware.js +2 -0
- package/build/middlewares/optional-auth.middleware.js +2 -0
- package/build/models/User.model.js +1 -0
- package/build/models/copyright-contract.model.d.ts +10 -0
- package/build/models/copyright-contract.model.js +12 -1
- package/build/models/projectContract.model.d.ts +6 -1
- package/build/models/projectContract.model.js +5 -0
- package/build/models/teamProject.model.d.ts +6 -1
- package/build/models/teamProject.model.js +5 -0
- package/build/types/User.d.ts +1 -0
- package/package.json +1 -1
|
@@ -72,6 +72,8 @@ const isauthenticated = (req, res, next) => __awaiter(void 0, void 0, void 0, fu
|
|
|
72
72
|
en: `Forbidden: User is blocked ${req.loggedUser.isBlocked.reason}`,
|
|
73
73
|
ar: ` ممنوع: المستخدم محظور ${req.loggedUser.isBlocked.reason}`,
|
|
74
74
|
}, req.lang));
|
|
75
|
+
if (user.isDeleted)
|
|
76
|
+
return next(new unauthorized_error_1.UnauthorizedError({ en: 'user not found', ar: 'لا يوجد مستخدم' }, req.lang));
|
|
75
77
|
const role = yield Role_model_1.Roles.findById(user.role);
|
|
76
78
|
if (!role)
|
|
77
79
|
return res.status(423).json({ message: 'invalid role' });
|
|
@@ -24,6 +24,8 @@ const optionalAuthenticated = (req, res, next) => __awaiter(void 0, void 0, void
|
|
|
24
24
|
en: `Forbidden: User is blocked ${req.loggedUser.isBlocked.reason}`,
|
|
25
25
|
ar: ` ممنوع: المستخدم محظور ${req.loggedUser.isBlocked.reason}`,
|
|
26
26
|
}, req.lang));
|
|
27
|
+
if (req.loggedUser.isDeleted)
|
|
28
|
+
return next(new unauthorized_error_1.UnauthorizedError({ en: 'user not found', ar: 'لا يوجد مستخدم' }, req.lang));
|
|
27
29
|
}
|
|
28
30
|
catch (error) {
|
|
29
31
|
return next();
|
|
@@ -18,6 +18,7 @@ const userSchema = new mongoose_1.Schema({
|
|
|
18
18
|
appleId: { type: String, default: null },
|
|
19
19
|
email: { type: String, unique: true, sparse: true },
|
|
20
20
|
name: { type: String, default: null },
|
|
21
|
+
isDeleted: { type: Boolean, default: false },
|
|
21
22
|
phoneNumber: {
|
|
22
23
|
key: { type: String, default: null },
|
|
23
24
|
number: { type: String, unique: true, sparse: true },
|
|
@@ -41,6 +41,11 @@ export declare enum SubmitFilesStatus {
|
|
|
41
41
|
approved = "approved",
|
|
42
42
|
rejected = "rejected"
|
|
43
43
|
}
|
|
44
|
+
export declare enum RequestedDeadlineStatus {
|
|
45
|
+
pending = "pending",
|
|
46
|
+
approved = "approved",
|
|
47
|
+
rejected = "rejected"
|
|
48
|
+
}
|
|
44
49
|
export interface IcopyrightContract {
|
|
45
50
|
id: string;
|
|
46
51
|
customer: Types.ObjectId | Iuser;
|
|
@@ -79,6 +84,11 @@ export interface IcopyrightContract {
|
|
|
79
84
|
}[];
|
|
80
85
|
createdAt: Date;
|
|
81
86
|
updatedAt: Date;
|
|
87
|
+
requestedDeadline: {
|
|
88
|
+
deadline: Date;
|
|
89
|
+
status: RequestedDeadlineStatus;
|
|
90
|
+
user: Types.ObjectId | Iuser;
|
|
91
|
+
};
|
|
82
92
|
}
|
|
83
93
|
export declare const CopyrightContracts: import("mongoose").Model<IcopyrightContract, {}, {}, {}, import("mongoose").Document<unknown, {}, IcopyrightContract> & IcopyrightContract & {
|
|
84
94
|
_id: Types.ObjectId;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CopyrightContracts = exports.SubmitFilesStatus = exports.CopyrightContractStatus = void 0;
|
|
3
|
+
exports.CopyrightContracts = exports.RequestedDeadlineStatus = exports.SubmitFilesStatus = exports.CopyrightContractStatus = void 0;
|
|
4
4
|
const mongoose_1 = require("mongoose");
|
|
5
5
|
const model_names_1 = require("../types/model-names");
|
|
6
6
|
var CopyrightContractStatus;
|
|
@@ -21,6 +21,12 @@ var SubmitFilesStatus;
|
|
|
21
21
|
SubmitFilesStatus["approved"] = "approved";
|
|
22
22
|
SubmitFilesStatus["rejected"] = "rejected";
|
|
23
23
|
})(SubmitFilesStatus || (exports.SubmitFilesStatus = SubmitFilesStatus = {}));
|
|
24
|
+
var RequestedDeadlineStatus;
|
|
25
|
+
(function (RequestedDeadlineStatus) {
|
|
26
|
+
RequestedDeadlineStatus["pending"] = "pending";
|
|
27
|
+
RequestedDeadlineStatus["approved"] = "approved";
|
|
28
|
+
RequestedDeadlineStatus["rejected"] = "rejected";
|
|
29
|
+
})(RequestedDeadlineStatus || (exports.RequestedDeadlineStatus = RequestedDeadlineStatus = {}));
|
|
24
30
|
exports.CopyrightContracts = (0, mongoose_1.model)(model_names_1.MODELS.copyrightContract, new mongoose_1.Schema({
|
|
25
31
|
customer: { type: mongoose_1.Schema.Types.ObjectId, ref: model_names_1.MODELS.user },
|
|
26
32
|
sp: { type: mongoose_1.Schema.Types.ObjectId, ref: model_names_1.MODELS.user },
|
|
@@ -52,4 +58,9 @@ exports.CopyrightContracts = (0, mongoose_1.model)(model_names_1.MODELS.copyrigh
|
|
|
52
58
|
],
|
|
53
59
|
rejectedBy: { type: String, enum: ['sp', 'customer'], default: null },
|
|
54
60
|
paymentLink: { type: String, default: null },
|
|
61
|
+
requestedDeadline: {
|
|
62
|
+
deadline: { type: Date, default: null },
|
|
63
|
+
status: { type: String, enum: RequestedDeadlineStatus, default: RequestedDeadlineStatus.pending },
|
|
64
|
+
user: { type: mongoose_1.Schema.Types.ObjectId, ref: model_names_1.MODELS.user, default: null },
|
|
65
|
+
},
|
|
55
66
|
}, { collection: model_names_1.MODELS.copyrightContract, timestamps: true }));
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
/// <reference types="mongoose/types/virtuals" />
|
|
24
24
|
/// <reference types="mongoose/types/inferschematype" />
|
|
25
25
|
import { Types } from 'mongoose';
|
|
26
|
-
import { SubmitFilesStatus } from './copyright-contract.model';
|
|
26
|
+
import { RequestedDeadlineStatus, SubmitFilesStatus } from './copyright-contract.model';
|
|
27
27
|
import { IprojectCycle } from './portfolio-post.model';
|
|
28
28
|
import { Iuser } from '../types/User';
|
|
29
29
|
export declare enum ProjectContractStatus {
|
|
@@ -86,6 +86,11 @@ export interface IprojectContract {
|
|
|
86
86
|
reason?: string;
|
|
87
87
|
dateOfSubmission: Date;
|
|
88
88
|
}[];
|
|
89
|
+
requestedDeadline: {
|
|
90
|
+
deadline: Date;
|
|
91
|
+
status: RequestedDeadlineStatus;
|
|
92
|
+
user: Types.ObjectId | Iuser;
|
|
93
|
+
};
|
|
89
94
|
}
|
|
90
95
|
export declare const ProjectContract: import("mongoose").Model<IprojectContract, {}, {}, {}, import("mongoose").Document<unknown, {}, IprojectContract> & IprojectContract & {
|
|
91
96
|
_id: Types.ObjectId;
|
|
@@ -67,4 +67,9 @@ exports.ProjectContract = (0, mongoose_1.model)(model_names_1.MODELS.projectCont
|
|
|
67
67
|
status: { type: String, enum: copyright_contract_model_1.SubmitFilesStatus, default: copyright_contract_model_1.SubmitFilesStatus.pending },
|
|
68
68
|
},
|
|
69
69
|
],
|
|
70
|
+
requestedDeadline: {
|
|
71
|
+
deadline: { type: Date, default: null },
|
|
72
|
+
status: { type: String, enum: copyright_contract_model_1.RequestedDeadlineStatus, default: copyright_contract_model_1.RequestedDeadlineStatus.pending },
|
|
73
|
+
user: { type: mongoose_1.Schema.Types.ObjectId, ref: model_names_1.MODELS.user, default: null },
|
|
74
|
+
},
|
|
70
75
|
}, { timestamps: true, collection: model_names_1.MODELS.projectContract }));
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
/// <reference types="mongoose/types/virtuals" />
|
|
24
24
|
/// <reference types="mongoose/types/inferschematype" />
|
|
25
25
|
import { Types } from 'mongoose';
|
|
26
|
-
import { SubmitFilesStatus } from './copyright-contract.model';
|
|
26
|
+
import { RequestedDeadlineStatus, SubmitFilesStatus } from './copyright-contract.model';
|
|
27
27
|
import { Icategory } from '../types/Category';
|
|
28
28
|
import { CYCLES } from '../types/cycles';
|
|
29
29
|
import { Iuser } from '../types/User';
|
|
@@ -107,6 +107,11 @@ export interface ITeamContract {
|
|
|
107
107
|
reason?: string;
|
|
108
108
|
dateOfSubmission: Date;
|
|
109
109
|
}[];
|
|
110
|
+
requestedDeadline: {
|
|
111
|
+
deadline: Date;
|
|
112
|
+
status: RequestedDeadlineStatus;
|
|
113
|
+
user: Types.ObjectId | Iuser;
|
|
114
|
+
};
|
|
110
115
|
}
|
|
111
116
|
export declare const TeamContract: import("mongoose").Model<ITeamContract, {}, {}, {}, import("mongoose").Document<unknown, {}, ITeamContract> & ITeamContract & {
|
|
112
117
|
_id: Types.ObjectId;
|
|
@@ -105,4 +105,9 @@ exports.TeamContract = (0, mongoose_1.model)(model_names_1.MODELS.teamContract,
|
|
|
105
105
|
status: { type: String, enum: copyright_contract_model_1.SubmitFilesStatus, default: copyright_contract_model_1.SubmitFilesStatus.pending },
|
|
106
106
|
},
|
|
107
107
|
],
|
|
108
|
+
requestedDeadline: {
|
|
109
|
+
deadline: { type: Date, default: null },
|
|
110
|
+
status: { type: String, enum: copyright_contract_model_1.RequestedDeadlineStatus, default: copyright_contract_model_1.RequestedDeadlineStatus.pending },
|
|
111
|
+
user: { type: mongoose_1.Schema.Types.ObjectId, ref: model_names_1.MODELS.user, default: null },
|
|
112
|
+
},
|
|
108
113
|
}, { timestamps: true, collection: model_names_1.MODELS.teamContract }));
|
package/build/types/User.d.ts
CHANGED