@duvdu-v1/duvdu 1.1.44 → 1.1.45

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
@@ -61,3 +61,4 @@ export * from './models/report.model';
61
61
  export * from './models/messages.model';
62
62
  export * from './models/notification.model';
63
63
  export * from './services/category.service';
64
+ export * from './models/teamProject.model';
package/build/index.js CHANGED
@@ -77,3 +77,4 @@ __exportStar(require("./models/report.model"), exports);
77
77
  __exportStar(require("./models/messages.model"), exports);
78
78
  __exportStar(require("./models/notification.model"), exports);
79
79
  __exportStar(require("./services/category.service"), exports);
80
+ __exportStar(require("./models/teamProject.model"), exports);
@@ -82,14 +82,3 @@ exports.studioBooking = (0, mongoose_1.model)(model_names_1.MODELS.studioBooking
82
82
  },
83
83
  },
84
84
  }));
85
- exports.studioBooking.schema.set('toJSON', {
86
- transform: function (doc, ret) {
87
- if (ret.cover) {
88
- ret.cover = process.env.BUCKET_HOST + '/' + ret.cover;
89
- }
90
- if (ret.attachments) {
91
- ret.attachments = ret.attachments.map((el) => process.env.BUCKET_HOST + '/' + el);
92
- }
93
- return ret;
94
- }
95
- });
@@ -0,0 +1,60 @@
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 { Document, Types } from 'mongoose';
26
+ export interface IteamProject extends Document {
27
+ user: Types.ObjectId;
28
+ cover: string;
29
+ title: string;
30
+ category: Types.ObjectId;
31
+ budget: number;
32
+ desc: string;
33
+ location: {
34
+ lat: number;
35
+ lng: number;
36
+ };
37
+ address: string;
38
+ attachments: string[];
39
+ shootingDays: number;
40
+ startDate: Date;
41
+ status: 'pending' | 'completed';
42
+ creatives: [
43
+ {
44
+ jobTitle: string;
45
+ users: [
46
+ {
47
+ user: Types.ObjectId;
48
+ workHours: number;
49
+ totalAmount: number;
50
+ status: 'pending' | 'rejected' | 'accepted';
51
+ }
52
+ ];
53
+ }
54
+ ];
55
+ isDeleted: boolean;
56
+ showOnHome: boolean;
57
+ }
58
+ export declare const TeamProject: import("mongoose").Model<IteamProject, {}, {}, {}, Document<unknown, {}, IteamProject> & IteamProject & {
59
+ _id: Types.ObjectId;
60
+ }, any>;
@@ -0,0 +1,110 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TeamProject = void 0;
4
+ const mongoose_1 = require("mongoose");
5
+ const model_names_1 = require("../types/model-names");
6
+ const UserSchema = new mongoose_1.Schema({
7
+ user: {
8
+ type: mongoose_1.Schema.Types.ObjectId,
9
+ ref: model_names_1.MODELS.user,
10
+ required: true
11
+ },
12
+ workHours: {
13
+ type: Number,
14
+ required: true,
15
+ default: null
16
+ },
17
+ totalAmount: {
18
+ type: Number,
19
+ required: true,
20
+ default: null
21
+ },
22
+ status: {
23
+ type: String,
24
+ enum: ['pending', 'rejected', 'accepted'],
25
+ required: true,
26
+ default: 'pending'
27
+ }
28
+ });
29
+ const CreativeSchema = new mongoose_1.Schema({
30
+ jobTitle: {
31
+ type: String,
32
+ required: true,
33
+ default: null
34
+ },
35
+ users: [UserSchema]
36
+ });
37
+ exports.TeamProject = (0, mongoose_1.model)(model_names_1.MODELS.teamProject, new mongoose_1.Schema({
38
+ user: {
39
+ type: mongoose_1.Schema.Types.ObjectId,
40
+ ref: model_names_1.MODELS.user
41
+ },
42
+ cover: {
43
+ type: String,
44
+ default: null
45
+ },
46
+ title: {
47
+ type: String,
48
+ default: null
49
+ },
50
+ category: {
51
+ type: mongoose_1.Schema.Types.ObjectId,
52
+ ref: model_names_1.MODELS.category
53
+ },
54
+ budget: {
55
+ type: Number,
56
+ default: null
57
+ },
58
+ desc: {
59
+ type: String,
60
+ default: null
61
+ },
62
+ location: {
63
+ lat: {
64
+ type: Number,
65
+ default: null
66
+ },
67
+ lng: {
68
+ type: Number,
69
+ default: null
70
+ }
71
+ },
72
+ address: {
73
+ type: String,
74
+ default: null
75
+ },
76
+ attachments: {
77
+ type: [String],
78
+ default: null
79
+ },
80
+ shootingDays: {
81
+ type: Number,
82
+ default: null
83
+ },
84
+ startDate: {
85
+ type: Date,
86
+ default: null
87
+ },
88
+ status: {
89
+ type: String,
90
+ enum: ['pending', 'completed'],
91
+ default: 'pending'
92
+ },
93
+ creatives: [CreativeSchema],
94
+ isDeleted: {
95
+ type: Boolean,
96
+ default: false
97
+ },
98
+ showOnHome: {
99
+ type: Boolean,
100
+ default: true
101
+ }
102
+ }, { timestamps: true, collection: model_names_1.MODELS.teamProject, toJSON: {
103
+ transform(doc, ret) {
104
+ if (ret.cover)
105
+ ret.cover = process.env.BUCKET_HOST + '/' + ret.cover;
106
+ if (ret.attachments)
107
+ ret.attachments = ret.attachments.map((el) => process.env.BUCKET_HOST + '/' + el);
108
+ },
109
+ }
110
+ }));
@@ -44,7 +44,14 @@ export declare enum PERMISSIONS {
44
44
  getReportHandler = "get report",
45
45
  updateReportHandler = "update report",
46
46
  deleteReportHandler = "delete report",
47
- booking = "booking"
47
+ booking = "booking",
48
+ getCrmTeamProjectHandler = "get crm team project crm",
49
+ getTeamProjectAnalysisHandler = "get team project analysis",
50
+ deleteTeamProjectCreativeHandler = "delete team project creative",
51
+ updateTeamProjectCreativeHandler = "update team project creative",
52
+ createTeamProjectHandler = "create team project",
53
+ updateTeamProjectHandler = "update team project",
54
+ deleteTeamProjectHandler = "delete team project"
48
55
  }
49
56
  export declare const permissions: {
50
57
  auth: PERMISSIONS[];
@@ -56,6 +56,14 @@ var PERMISSIONS;
56
56
  PERMISSIONS["deleteReportHandler"] = "delete report";
57
57
  // book project
58
58
  PERMISSIONS["booking"] = "booking";
59
+ // team project
60
+ PERMISSIONS["getCrmTeamProjectHandler"] = "get crm team project crm";
61
+ PERMISSIONS["getTeamProjectAnalysisHandler"] = "get team project analysis";
62
+ PERMISSIONS["deleteTeamProjectCreativeHandler"] = "delete team project creative";
63
+ PERMISSIONS["updateTeamProjectCreativeHandler"] = "update team project creative";
64
+ PERMISSIONS["createTeamProjectHandler"] = "create team project";
65
+ PERMISSIONS["updateTeamProjectHandler"] = "update team project";
66
+ PERMISSIONS["deleteTeamProjectHandler"] = "delete team project";
59
67
  })(PERMISSIONS || (exports.PERMISSIONS = PERMISSIONS = {}));
60
68
  exports.permissions = {
61
69
  auth: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@duvdu-v1/duvdu",
3
- "version": "1.1.44",
3
+ "version": "1.1.45",
4
4
  "main": "./build/index.js",
5
5
  "types": "./build/index.d.ts",
6
6
  "files": [