@duvdu-v1/duvdu 1.1.122 → 1.1.124

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
@@ -66,6 +66,7 @@ export * from './models/userSession.model';
66
66
  export * from './models/ranks.model';
67
67
  export * from './models/settings.model';
68
68
  export * from './models/all-contracts.model';
69
+ export * from './models/producer_contracts.model';
69
70
  export * from './services/category.service';
70
71
  export * from './services/projectView.service';
71
72
  export * from './types/notification.type';
package/build/index.js CHANGED
@@ -83,6 +83,7 @@ __exportStar(require("./models/userSession.model"), exports);
83
83
  __exportStar(require("./models/ranks.model"), exports);
84
84
  __exportStar(require("./models/settings.model"), exports);
85
85
  __exportStar(require("./models/all-contracts.model"), exports);
86
+ __exportStar(require("./models/producer_contracts.model"), exports);
86
87
  __exportStar(require("./services/category.service"), exports);
87
88
  __exportStar(require("./services/projectView.service"), exports);
88
89
  __exportStar(require("./types/notification.type"), exports);
@@ -22,14 +22,15 @@
22
22
  /// <reference types="mongoose/types/validation" />
23
23
  /// <reference types="mongoose/types/virtuals" />
24
24
  /// <reference types="mongoose/types/inferschematype" />
25
- import { Iuser } from '@duvdu-v1/duvdu';
26
25
  import { Types } from 'mongoose';
26
+ import { Iuser } from '../types/User';
27
27
  export interface Icontract {
28
28
  id: string;
29
29
  customer: Types.ObjectId | Iuser;
30
30
  sp: Types.ObjectId | Iuser;
31
31
  contract: Types.ObjectId;
32
32
  ref: string;
33
+ cycle: string;
33
34
  }
34
35
  export declare const Contracts: import("mongoose").Model<Icontract, {}, {}, {}, import("mongoose").Document<unknown, {}, Icontract> & Icontract & {
35
36
  _id: Types.ObjectId;
@@ -1,11 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Contracts = void 0;
4
- const duvdu_1 = require("@duvdu-v1/duvdu");
5
4
  const mongoose_1 = require("mongoose");
5
+ const model_names_1 = require("../types/model-names");
6
6
  exports.Contracts = (0, mongoose_1.model)('all_contracts', new mongoose_1.Schema({
7
- customer: { type: mongoose_1.Schema.Types.ObjectId, ref: duvdu_1.MODELS.user },
8
- sp: { type: mongoose_1.Schema.Types.ObjectId, ref: duvdu_1.MODELS.user },
7
+ customer: { type: mongoose_1.Schema.Types.ObjectId, ref: model_names_1.MODELS.user },
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
12
  }));
@@ -0,0 +1,57 @@
1
+ /// <reference types="mongoose/types/types" />
2
+ /// <reference types="mongoose/types/document" />
3
+ /// <reference types="mongoose/types/aggregate" />
4
+ /// <reference types="mongoose/types/callback" />
5
+ /// <reference types="mongoose/types/collection" />
6
+ /// <reference types="mongoose/types/connection" />
7
+ /// <reference types="mongoose/types/cursor" />
8
+ /// <reference types="mongoose/types/error" />
9
+ /// <reference types="mongoose/types/expressions" />
10
+ /// <reference types="mongoose/types/helpers" />
11
+ /// <reference types="mongoose/types/middlewares" />
12
+ /// <reference types="mongoose/types/indexes" />
13
+ /// <reference types="mongoose/types/models" />
14
+ /// <reference types="mongoose/types/mongooseoptions" />
15
+ /// <reference types="mongoose/types/pipelinestage" />
16
+ /// <reference types="mongoose/types/populate" />
17
+ /// <reference types="mongoose/types/query" />
18
+ /// <reference types="mongoose/types/schemaoptions" />
19
+ /// <reference types="mongoose/types/schematypes" />
20
+ /// <reference types="mongoose/types/session" />
21
+ /// <reference types="mongoose/types/utility" />
22
+ /// <reference types="mongoose/types/validation" />
23
+ /// <reference types="mongoose/types/virtuals" />
24
+ /// <reference types="mongoose/types/inferschematype" />
25
+ import { Types } from 'mongoose';
26
+ import { Iuser } from '../types/User';
27
+ export declare enum ContractStatus {
28
+ canceled = "canceled",
29
+ pending = "pending",
30
+ accepted = "accepted",
31
+ rejected = "rejected",
32
+ acceptedWithUpdate = "accepted with update"
33
+ }
34
+ export interface IproducerContarct {
35
+ producer: Types.ObjectId | Iuser;
36
+ user: Types.ObjectId | Iuser;
37
+ platform: string;
38
+ projectDetails: string;
39
+ episodesNumber: number;
40
+ episodesDuration: number;
41
+ expectedBudget: number;
42
+ expectedProfits: number;
43
+ attachments: string[];
44
+ appointmentDate: Date;
45
+ address: string;
46
+ location: {
47
+ lat: number;
48
+ lng: number;
49
+ };
50
+ rejectedBy: 'producer' | 'user' | 'system';
51
+ status: ContractStatus;
52
+ stageExpiration: number;
53
+ actionAt: Date;
54
+ }
55
+ export declare const ProducerContract: import("mongoose").Model<IproducerContarct, {}, {}, {}, import("mongoose").Document<unknown, {}, IproducerContarct> & IproducerContarct & {
56
+ _id: Types.ObjectId;
57
+ }, any>;
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ProducerContract = exports.ContractStatus = void 0;
4
+ const duvdu_1 = require("@duvdu-v1/duvdu");
5
+ const mongoose_1 = require("mongoose");
6
+ var ContractStatus;
7
+ (function (ContractStatus) {
8
+ ContractStatus["canceled"] = "canceled";
9
+ ContractStatus["pending"] = "pending";
10
+ ContractStatus["accepted"] = "accepted";
11
+ ContractStatus["rejected"] = "rejected";
12
+ ContractStatus["acceptedWithUpdate"] = "accepted with update";
13
+ })(ContractStatus || (exports.ContractStatus = ContractStatus = {}));
14
+ exports.ProducerContract = (0, mongoose_1.model)(duvdu_1.MODELS.producerContract, new mongoose_1.Schema({
15
+ producer: { type: mongoose_1.Schema.Types.ObjectId, ref: duvdu_1.MODELS.user },
16
+ user: { type: mongoose_1.Schema.Types.ObjectId, ref: duvdu_1.MODELS.user },
17
+ platform: { type: String, default: null },
18
+ projectDetails: { type: String, default: null },
19
+ episodesNumber: { type: Number, default: 0 },
20
+ episodesDuration: { type: Number, default: 0 },
21
+ expectedBudget: { type: Number, default: 0 },
22
+ expectedProfits: { type: Number, default: 0 },
23
+ address: { type: String, default: null },
24
+ location: { lat: { type: Number, default: 0 }, lng: { type: Number, default: 0 } },
25
+ attachments: [String],
26
+ appointmentDate: Date,
27
+ rejectedBy: { type: String, enum: ['producer', 'user', 'system'] },
28
+ status: { type: String, enum: ContractStatus, default: ContractStatus.pending },
29
+ stageExpiration: { type: Number, default: 0 },
30
+ actionAt: Date
31
+ }, { timestamps: true, collection: duvdu_1.MODELS.producerContract }));
package/package.json CHANGED
@@ -1,57 +1,57 @@
1
- {
2
- "name": "@duvdu-v1/duvdu",
3
- "version": "1.1.122",
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.124",
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
+ }