@duvdu-v1/duvdu 1.1.127 → 1.1.128

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/index.d.ts CHANGED
@@ -10,6 +10,7 @@ export * from './utils/api-feature';
10
10
  export * from './utils/generateToken';
11
11
  export * from './utils/bucket';
12
12
  export * from './utils/file';
13
+ export * from './utils/date';
13
14
  export * from './middlewares/global-error-handling.middleware';
14
15
  export * from './middlewares/database-connection';
15
16
  export * from './middlewares/global-validator.middleware';
package/build/index.js CHANGED
@@ -26,6 +26,7 @@ __exportStar(require("./utils/api-feature"), exports);
26
26
  __exportStar(require("./utils/generateToken"), exports);
27
27
  __exportStar(require("./utils/bucket"), exports);
28
28
  __exportStar(require("./utils/file"), exports);
29
+ __exportStar(require("./utils/date"), exports);
29
30
  __exportStar(require("./middlewares/global-error-handling.middleware"), exports);
30
31
  __exportStar(require("./middlewares/database-connection"), exports);
31
32
  __exportStar(require("./middlewares/global-validator.middleware"), exports);
@@ -35,3 +35,14 @@ export interface Icontract {
35
35
  export declare const Contracts: import("mongoose").Model<Icontract, {}, {}, {}, import("mongoose").Document<unknown, {}, Icontract> & Icontract & {
36
36
  _id: Types.ObjectId;
37
37
  }, any>;
38
+ export interface IcontractReport {
39
+ reporter: Types.ObjectId | Iuser;
40
+ contract: Types.ObjectId | Icontract;
41
+ ref: string;
42
+ desc: string;
43
+ createdAt: Date;
44
+ updatedAt: Date;
45
+ }
46
+ export declare const ContractReports: import("mongoose").Model<IcontractReport, {}, {}, {}, import("mongoose").Document<unknown, {}, IcontractReport> & IcontractReport & {
47
+ _id: Types.ObjectId;
48
+ }, any>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Contracts = void 0;
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
6
  exports.Contracts = (0, mongoose_1.model)('all_contracts', new mongoose_1.Schema({
@@ -8,5 +8,11 @@ exports.Contracts = (0, mongoose_1.model)('all_contracts', new mongoose_1.Schema
8
8
  sp: { type: mongoose_1.Schema.Types.ObjectId, ref: model_names_1.MODELS.user },
9
9
  contract: { type: mongoose_1.Schema.Types.ObjectId, refPath: 'ref' },
10
10
  ref: String,
11
- cycle: { type: String, default: null }
11
+ cycle: { type: String, default: null },
12
12
  }));
13
+ exports.ContractReports = (0, mongoose_1.model)('contract_reports', new mongoose_1.Schema({
14
+ reporter: { type: mongoose_1.Schema.Types.ObjectId, ref: model_names_1.MODELS.user },
15
+ contract: { type: mongoose_1.Schema.Types.ObjectId, refPath: 'ref' },
16
+ ref: String,
17
+ desc: String,
18
+ }, { collection: 'contract_reports', timestamps: true }));
@@ -0,0 +1,3 @@
1
+ type Units = 'minutes' | 'hours' | 'days' | 'months' | 'weeks';
2
+ export declare const addToDate: (initialDate: Date, unit: Units, value: number) => Date;
3
+ export {};
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.addToDate = void 0;
4
+ const addToDate = (initialDate, unit, value) => {
5
+ switch (unit) {
6
+ case 'hours':
7
+ initialDate.setHours(initialDate.getHours() + value);
8
+ break;
9
+ case 'days':
10
+ initialDate.setDate(initialDate.getDate() + value);
11
+ break;
12
+ case 'months':
13
+ initialDate.setMonth(initialDate.getMonth() + value);
14
+ break;
15
+ case 'weeks':
16
+ initialDate.setDate(initialDate.getDate() + value * 7);
17
+ break;
18
+ case 'minutes':
19
+ initialDate.setMinutes(initialDate.getMinutes() + value);
20
+ break;
21
+ default:
22
+ break;
23
+ }
24
+ return initialDate;
25
+ };
26
+ exports.addToDate = addToDate;
package/package.json CHANGED
@@ -1,57 +1,57 @@
1
- {
2
- "name": "@duvdu-v1/duvdu",
3
- "version": "1.1.127",
4
- "main": "./build/index.js",
5
- "types": "./build/index.d.ts",
6
- "files": [
7
- "build/**/*"
8
- ],
9
- "scripts": {
10
- "clean": "rimraf ./build",
11
- "build": "npm run clean && tsc",
12
- "fix:build": "mv ./build/common/src/* ./build && rm -rf ./build/auth ./build/common",
13
- "pub": "git add . && git commit -m \"updates\" && npm version patch && npm run build && npm publish",
14
- "lint": "eslint .",
15
- "lint:fix": "eslint --fix .",
16
- "format": "prettier --write ."
17
- },
18
- "keywords": [],
19
- "author": "motemed khaled",
20
- "license": "ISC",
21
- "dependencies": {
22
- "@duvdu-v1/duvdu": "^1.1.116",
23
- "@types/express": "^4.17.21",
24
- "@types/express-session": "^1.18.0",
25
- "@types/jsonwebtoken": "^9.0.5",
26
- "@types/multer": "^1.4.11",
27
- "@types/node": "^20.11.0",
28
- "@typescript-eslint/eslint-plugin": "^6.19.0",
29
- "@typescript-eslint/parser": "^6.19.0",
30
- "aws-sdk": "^2.1595.0",
31
- "connect-redis": "^7.1.1",
32
- "express": "^4.18.2",
33
- "express-async-errors": "^3.1.1",
34
- "express-session": "^1.18.0",
35
- "express-validator": "^7.0.1",
36
- "jsonwebtoken": "^9.0.2",
37
- "mongoose": "^8.0.4",
38
- "multer": "^1.4.5-lts.1",
39
- "node-nats-streaming": "^0.3.2",
40
- "redis": "^4.6.13",
41
- "rimraf": "^5.0.5",
42
- "typescript": "^5.3.3",
43
- "uuid": "^9.0.1",
44
- "winston": "^3.13.0",
45
- "winston-daily-rotate-file": "^5.0.0"
46
- },
47
- "devDependencies": {
48
- "@types/uuid": "^9.0.8",
49
- "del-cli": "^5.1.0",
50
- "eslint": "^8.56.0",
51
- "eslint-config-prettier": "^9.1.0",
52
- "eslint-plugin-import": "^2.29.1",
53
- "eslint-plugin-prettier": "^5.1.3",
54
- "prettier": "^3.2.4"
55
- },
56
- "description": ""
57
- }
1
+ {
2
+ "name": "@duvdu-v1/duvdu",
3
+ "version": "1.1.128",
4
+ "main": "./build/index.js",
5
+ "types": "./build/index.d.ts",
6
+ "files": [
7
+ "build/**/*"
8
+ ],
9
+ "scripts": {
10
+ "clean": "rimraf ./build",
11
+ "build": "npm run clean && tsc",
12
+ "fix:build": "mv ./build/common/src/* ./build && rm -rf ./build/auth ./build/common",
13
+ "pub": "git add . && git commit -m \"updates\" && npm version patch && npm run build && npm publish",
14
+ "lint": "eslint .",
15
+ "lint:fix": "eslint --fix .",
16
+ "format": "prettier --write ."
17
+ },
18
+ "keywords": [],
19
+ "author": "motemed khaled",
20
+ "license": "ISC",
21
+ "dependencies": {
22
+ "@duvdu-v1/duvdu": "^1.1.116",
23
+ "@types/express": "^4.17.21",
24
+ "@types/express-session": "^1.18.0",
25
+ "@types/jsonwebtoken": "^9.0.5",
26
+ "@types/multer": "^1.4.11",
27
+ "@types/node": "^20.11.0",
28
+ "@typescript-eslint/eslint-plugin": "^6.19.0",
29
+ "@typescript-eslint/parser": "^6.19.0",
30
+ "aws-sdk": "^2.1595.0",
31
+ "connect-redis": "^7.1.1",
32
+ "express": "^4.18.2",
33
+ "express-async-errors": "^3.1.1",
34
+ "express-session": "^1.18.0",
35
+ "express-validator": "^7.0.1",
36
+ "jsonwebtoken": "^9.0.2",
37
+ "mongoose": "^8.0.4",
38
+ "multer": "^1.4.5-lts.1",
39
+ "node-nats-streaming": "^0.3.2",
40
+ "redis": "^4.6.13",
41
+ "rimraf": "^5.0.5",
42
+ "typescript": "^5.3.3",
43
+ "uuid": "^9.0.1",
44
+ "winston": "^3.13.0",
45
+ "winston-daily-rotate-file": "^5.0.0"
46
+ },
47
+ "devDependencies": {
48
+ "@types/uuid": "^9.0.8",
49
+ "del-cli": "^5.1.0",
50
+ "eslint": "^8.56.0",
51
+ "eslint-config-prettier": "^9.1.0",
52
+ "eslint-plugin-import": "^2.29.1",
53
+ "eslint-plugin-prettier": "^5.1.3",
54
+ "prettier": "^3.2.4"
55
+ },
56
+ "description": ""
57
+ }