@duvdu-v1/duvdu 1.1.53 → 1.1.55

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
@@ -63,3 +63,4 @@ export * from './models/messages.model';
63
63
  export * from './models/notification.model';
64
64
  export * from './services/category.service';
65
65
  export * from './models/teamProject.model';
66
+ export * from './models/contracts.model';
package/build/index.js CHANGED
@@ -79,3 +79,4 @@ __exportStar(require("./models/messages.model"), exports);
79
79
  __exportStar(require("./models/notification.model"), exports);
80
80
  __exportStar(require("./services/category.service"), exports);
81
81
  __exportStar(require("./models/teamProject.model"), exports);
82
+ __exportStar(require("./models/contracts.model"), exports);
@@ -6,7 +6,7 @@ const model_names_1 = require("../types/model-names");
6
6
  const bookmarksSchema = new mongoose_1.Schema({
7
7
  user: { type: mongoose_1.Schema.Types.ObjectId, ref: model_names_1.MODELS.user },
8
8
  title: String,
9
- projects: [{ type: mongoose_1.Schema.Types.ObjectId, ref: model_names_1.MODELS.project }],
9
+ projects: [{ type: mongoose_1.Schema.Types.ObjectId, ref: model_names_1.MODELS.projects }],
10
10
  }, { collection: model_names_1.MODELS.bookmark });
11
11
  bookmarksSchema.index({ user: 1, title: 1 }, { unique: true });
12
12
  exports.Bookmarks = (0, mongoose_1.model)(model_names_1.MODELS.bookmark, bookmarksSchema);
@@ -49,5 +49,5 @@ const userSchema = new mongoose_1.Schema({
49
49
  ret.profileImage = process.env.BUCKET_HOST + '/' + ret.profileImage;
50
50
  },
51
51
  },
52
- }).index({ name: 'text', username: 'text' });
52
+ }).index({ name: 'text' });
53
53
  exports.Users = (0, mongoose_1.model)(model_names_1.MODELS.user, userSchema);
@@ -0,0 +1,54 @@
1
+ /// <reference types="mongoose/types/aggregate" />
2
+ /// <reference types="mongoose/types/callback" />
3
+ /// <reference types="mongoose/types/collection" />
4
+ /// <reference types="mongoose/types/connection" />
5
+ /// <reference types="mongoose/types/cursor" />
6
+ /// <reference types="mongoose/types/document" />
7
+ /// <reference types="mongoose/types/error" />
8
+ /// <reference types="mongoose/types/expressions" />
9
+ /// <reference types="mongoose/types/helpers" />
10
+ /// <reference types="mongoose/types/middlewares" />
11
+ /// <reference types="mongoose/types/indexes" />
12
+ /// <reference types="mongoose/types/models" />
13
+ /// <reference types="mongoose/types/mongooseoptions" />
14
+ /// <reference types="mongoose/types/pipelinestage" />
15
+ /// <reference types="mongoose/types/populate" />
16
+ /// <reference types="mongoose/types/query" />
17
+ /// <reference types="mongoose/types/schemaoptions" />
18
+ /// <reference types="mongoose/types/schematypes" />
19
+ /// <reference types="mongoose/types/session" />
20
+ /// <reference types="mongoose/types/types" />
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
+ ongoing = "ongoing",
31
+ completed = "completed",
32
+ rejected = "rejected"
33
+ }
34
+ declare enum RefModels {
35
+ copyright = "copyrights-booking",
36
+ studio = "studio-booking-book",
37
+ portfolioPost = "portfolio-post-booking",
38
+ teamProject = "teamProjects-booking"
39
+ }
40
+ export interface Icontract {
41
+ id: string;
42
+ sourceUser: Iuser | Types.ObjectId;
43
+ targetUser: Iuser | Types.ObjectId;
44
+ project: Types.ObjectId;
45
+ book: Types.ObjectId;
46
+ ref: RefModels;
47
+ startDate: Date;
48
+ deadline: Date;
49
+ status: ContractStatus;
50
+ }
51
+ export declare const Contracts: import("mongoose").Model<Icontract, {}, {}, {}, import("mongoose").Document<unknown, {}, Icontract> & Icontract & {
52
+ _id: Types.ObjectId;
53
+ }, any>;
54
+ export {};
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Contracts = exports.ContractStatus = void 0;
4
+ const mongoose_1 = require("mongoose");
5
+ const model_names_1 = require("../types/model-names");
6
+ var ContractStatus;
7
+ (function (ContractStatus) {
8
+ ContractStatus["canceled"] = "canceled";
9
+ ContractStatus["pending"] = "pending";
10
+ ContractStatus["ongoing"] = "ongoing";
11
+ ContractStatus["completed"] = "completed";
12
+ ContractStatus["rejected"] = "rejected";
13
+ })(ContractStatus || (exports.ContractStatus = ContractStatus = {}));
14
+ var RefModels;
15
+ (function (RefModels) {
16
+ RefModels["copyright"] = "copyrights-booking";
17
+ RefModels["studio"] = "studio-booking-book";
18
+ RefModels["portfolioPost"] = "portfolio-post-booking";
19
+ RefModels["teamProject"] = "teamProjects-booking";
20
+ })(RefModels || (RefModels = {}));
21
+ exports.Contracts = (0, mongoose_1.model)(model_names_1.MODELS.contracts, new mongoose_1.Schema({
22
+ sourceUser: { type: mongoose_1.Schema.Types.ObjectId, ref: model_names_1.MODELS.user },
23
+ targetUser: { type: mongoose_1.Schema.Types.ObjectId, ref: model_names_1.MODELS.user },
24
+ project: { type: mongoose_1.Schema.Types.ObjectId, ref: model_names_1.MODELS.projects },
25
+ book: { type: mongoose_1.Schema.Types.ObjectId, refPath: 'ref' },
26
+ ref: { type: String, enum: RefModels, required: true },
27
+ startDate: { type: Date, required: true },
28
+ deadline: { type: Date, required: true },
29
+ status: {
30
+ type: String,
31
+ enum: ContractStatus,
32
+ required: true,
33
+ default: ContractStatus.pending,
34
+ },
35
+ }, { timestamps: true, collection: model_names_1.MODELS.contracts }));
@@ -26,7 +26,7 @@ import { Types } from 'mongoose';
26
26
  import { Iuser } from '../types/User';
27
27
  export interface IportfolioPost {
28
28
  id: string;
29
- user: Types.ObjectId;
29
+ user: Types.ObjectId | Iuser;
30
30
  attachments: string[];
31
31
  cover: string;
32
32
  title: string;
@@ -1,7 +1,4 @@
1
1
  export declare enum BookingState {
2
- canceled = "canceled",
3
- pending = "pending",
4
- ongoing = "ongoing",
5
- completed = "completed",
6
- rejected = "rejected"
2
+ paid = "paid",
3
+ unpaid = "unpaid"
7
4
  }
@@ -3,9 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BookingState = void 0;
4
4
  var BookingState;
5
5
  (function (BookingState) {
6
- BookingState["canceled"] = "canceled";
7
- BookingState["pending"] = "pending";
8
- BookingState["ongoing"] = "ongoing";
9
- BookingState["completed"] = "completed";
10
- BookingState["rejected"] = "rejected";
6
+ BookingState["paid"] = "paid";
7
+ BookingState["unpaid"] = "unpaid";
11
8
  })(BookingState || (exports.BookingState = BookingState = {}));
@@ -2,7 +2,6 @@ export declare enum MODELS {
2
2
  user = "users",
3
3
  category = "categories",
4
4
  plan = "plans",
5
- project = "projects",
6
5
  role = "roles",
7
6
  bookmark = "bookmarks",
8
7
  term = "terms",
@@ -18,5 +17,6 @@ export declare enum MODELS {
18
17
  messages = "messages",
19
18
  notifications = "notifications",
20
19
  teamProject = "teamProjects",
21
- teamProjectBooking = "teamProjects-booking"
20
+ teamProjectBooking = "teamProjects-booking",
21
+ contracts = "contracts"
22
22
  }
@@ -6,7 +6,6 @@ var MODELS;
6
6
  MODELS["user"] = "users";
7
7
  MODELS["category"] = "categories";
8
8
  MODELS["plan"] = "plans";
9
- MODELS["project"] = "projects";
10
9
  MODELS["role"] = "roles";
11
10
  MODELS["bookmark"] = "bookmarks";
12
11
  MODELS["term"] = "terms";
@@ -23,4 +22,5 @@ var MODELS;
23
22
  MODELS["notifications"] = "notifications";
24
23
  MODELS["teamProject"] = "teamProjects";
25
24
  MODELS["teamProjectBooking"] = "teamProjects-booking";
25
+ MODELS["contracts"] = "contracts";
26
26
  })(MODELS || (exports.MODELS = MODELS = {}));
package/package.json CHANGED
@@ -1,55 +1,55 @@
1
- {
2
- "name": "@duvdu-v1/duvdu",
3
- "version": "1.1.53",
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/portfolio-post ./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.4",
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
- },
45
- "devDependencies": {
46
- "@types/uuid": "^9.0.8",
47
- "del-cli": "^5.1.0",
48
- "eslint": "^8.56.0",
49
- "eslint-config-prettier": "^9.1.0",
50
- "eslint-plugin-import": "^2.29.1",
51
- "eslint-plugin-prettier": "^5.1.3",
52
- "prettier": "^3.2.4"
53
- },
54
- "description": ""
55
- }
1
+ {
2
+ "name": "@duvdu-v1/duvdu",
3
+ "version": "1.1.55",
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/portfolio-post ./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.4",
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
+ },
45
+ "devDependencies": {
46
+ "@types/uuid": "^9.0.8",
47
+ "del-cli": "^5.1.0",
48
+ "eslint": "^8.56.0",
49
+ "eslint-config-prettier": "^9.1.0",
50
+ "eslint-plugin-import": "^2.29.1",
51
+ "eslint-plugin-prettier": "^5.1.3",
52
+ "prettier": "^3.2.4"
53
+ },
54
+ "description": ""
55
+ }