@duvdu-v1/duvdu 1.1.56 → 1.1.58

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
@@ -62,5 +62,6 @@ export * from './models/report.model';
62
62
  export * from './models/messages.model';
63
63
  export * from './models/notification.model';
64
64
  export * from './models/teamProject.model';
65
+ export * from './models/contracts.model';
65
66
  export * from './models/producer.model';
66
67
  export * from './services/category.service';
package/build/index.js CHANGED
@@ -78,5 +78,6 @@ __exportStar(require("./models/report.model"), exports);
78
78
  __exportStar(require("./models/messages.model"), exports);
79
79
  __exportStar(require("./models/notification.model"), exports);
80
80
  __exportStar(require("./models/teamProject.model"), exports);
81
+ __exportStar(require("./models/contracts.model"), exports);
81
82
  __exportStar(require("./models/producer.model"), exports);
82
83
  __exportStar(require("./services/category.service"), exports);
@@ -47,7 +47,8 @@ const userSchema = new mongoose_1.Schema({
47
47
  ret.coverImage = process.env.BUCKET_HOST + '/' + ret.coverImage;
48
48
  if (ret.profileImage)
49
49
  ret.profileImage = process.env.BUCKET_HOST + '/' + ret.profileImage;
50
+ return ret;
50
51
  },
51
52
  },
52
- }).index({ name: 'text', username: 'text' });
53
+ }).index({ name: 'text' });
53
54
  exports.Users = (0, mongoose_1.model)(model_names_1.MODELS.user, userSchema);
@@ -0,0 +1,57 @@
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
+ submitedAt: Date;
51
+ createdAt: Date;
52
+ updatedAt: Date;
53
+ }
54
+ export declare const Contracts: import("mongoose").Model<Icontract, {}, {}, {}, import("mongoose").Document<unknown, {}, Icontract> & Icontract & {
55
+ _id: Types.ObjectId;
56
+ }, any>;
57
+ export {};
@@ -0,0 +1,36 @@
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
+ submitedAt: Date,
36
+ }, { timestamps: true, collection: model_names_1.MODELS.contracts }));
@@ -42,6 +42,7 @@ exports.PortfolioPosts = (0, mongoose_1.model)(model_names_1.MODELS.portfolioPos
42
42
  ret.cover = process.env.BUCKET_HOST + '/' + ret.cover;
43
43
  if (ret.attachments)
44
44
  ret.attachments = ret.attachments.map((el) => process.env.BUCKET_HOST + '/' + el);
45
+ return ret;
45
46
  },
46
47
  }
47
48
  })
@@ -71,6 +71,7 @@ exports.ProducerBooking = (0, mongoose_1.model)(model_names_1.MODELS.producerBoo
71
71
  transform(doc, ret) {
72
72
  if (ret.attachments)
73
73
  ret.attachments = ret.attachments.map((el) => process.env.BUCKET_HOST + '/' + el);
74
+ return ret;
74
75
  },
75
76
  } }));
76
77
  exports.Producer = (0, mongoose_1.model)(model_names_1.MODELS.producer, new mongoose_1.Schema({
@@ -35,6 +35,7 @@ exports.Report = (0, mongoose_1.model)(model_names_1.MODELS.report, new mongoose
35
35
  transform(doc, ret) {
36
36
  if (ret.attachments)
37
37
  ret.attachments = ret.attachments.map((el) => process.env.BUCKET_HOST + '/' + el);
38
+ return ret;
38
39
  },
39
40
  },
40
41
  }));
@@ -79,6 +79,7 @@ exports.studioBooking = (0, mongoose_1.model)(model_names_1.MODELS.studioBooking
79
79
  ret.cover = process.env.BUCKET_HOST + '/' + ret.cover;
80
80
  if (ret.attachments)
81
81
  ret.attachments = ret.attachments.map((el) => process.env.BUCKET_HOST + '/' + el);
82
+ return ret;
82
83
  },
83
84
  }
84
85
  }));
@@ -99,12 +99,14 @@ exports.TeamProject = (0, mongoose_1.model)(model_names_1.MODELS.teamProject, ne
99
99
  type: Boolean,
100
100
  default: true
101
101
  }
102
- }, { timestamps: true, collection: model_names_1.MODELS.teamProject, toJSON: {
102
+ }, { timestamps: true, collection: model_names_1.MODELS.teamProject,
103
+ toJSON: {
103
104
  transform(doc, ret) {
104
105
  if (ret.cover)
105
106
  ret.cover = process.env.BUCKET_HOST + '/' + ret.cover;
106
107
  if (ret.attachments)
107
108
  ret.attachments = ret.attachments.map((el) => process.env.BUCKET_HOST + '/' + el);
109
+ return ret;
108
110
  },
109
111
  }
110
112
  }));
@@ -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 = {}));
@@ -18,6 +18,7 @@ export declare enum MODELS {
18
18
  notifications = "notifications",
19
19
  teamProject = "teamProjects",
20
20
  teamProjectBooking = "teamProjects-booking",
21
+ contracts = "contracts",
21
22
  producer = "producers",
22
23
  producerBooking = "producer-booking"
23
24
  }
@@ -22,6 +22,7 @@ var MODELS;
22
22
  MODELS["notifications"] = "notifications";
23
23
  MODELS["teamProject"] = "teamProjects";
24
24
  MODELS["teamProjectBooking"] = "teamProjects-booking";
25
+ MODELS["contracts"] = "contracts";
25
26
  MODELS["producer"] = "producers";
26
27
  MODELS["producerBooking"] = "producer-booking";
27
28
  })(MODELS || (exports.MODELS = MODELS = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@duvdu-v1/duvdu",
3
- "version": "1.1.56",
3
+ "version": "1.1.58",
4
4
  "main": "./build/index.js",
5
5
  "types": "./build/index.d.ts",
6
6
  "files": [