@grapadigital/shared-schemas 1.0.113 → 1.0.115

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/dist/index.d.ts CHANGED
@@ -12,3 +12,4 @@ export * from './schemas/webhook.schema';
12
12
  export * from './schemas/sale.schema';
13
13
  export * from './schemas/invoice.schema';
14
14
  export * from './schemas/log.schema';
15
+ export * from './schemas/project.schema';
package/dist/index.js CHANGED
@@ -28,3 +28,4 @@ __exportStar(require("./schemas/webhook.schema"), exports);
28
28
  __exportStar(require("./schemas/sale.schema"), exports);
29
29
  __exportStar(require("./schemas/invoice.schema"), exports);
30
30
  __exportStar(require("./schemas/log.schema"), exports);
31
+ __exportStar(require("./schemas/project.schema"), exports);
@@ -0,0 +1,111 @@
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/session" />
19
+ /// <reference types="mongoose/types/types" />
20
+ /// <reference types="mongoose/types/utility" />
21
+ /// <reference types="mongoose/types/validation" />
22
+ /// <reference types="mongoose/types/virtuals" />
23
+ /// <reference types="mongoose/types/schematypes" />
24
+ /// <reference types="mongoose/types/inferschematype" />
25
+ /// <reference types="mongoose/types/inferrawdoctype" />
26
+ import { HydratedDocument } from 'mongoose';
27
+ export type ProjectDocument = HydratedDocument<Project>;
28
+ export declare class FormatItem {
29
+ format: 'reel' | 'carousel' | 'image' | 'story' | 'video';
30
+ qty: number;
31
+ value: number;
32
+ impressionCount: number;
33
+ reachCount: number;
34
+ engagementRate: number;
35
+ engagementCount: number;
36
+ }
37
+ export declare const FormatItemSchema: import("mongoose").Schema<FormatItem, import("mongoose").Model<FormatItem, any, any, any, import("mongoose").Document<unknown, any, FormatItem, any, {}> & FormatItem & {
38
+ _id: import("mongoose").Types.ObjectId;
39
+ } & {
40
+ __v: number;
41
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, FormatItem, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<FormatItem>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<FormatItem> & {
42
+ _id: import("mongoose").Types.ObjectId;
43
+ } & {
44
+ __v: number;
45
+ }>;
46
+ export declare class ProjectProfile {
47
+ username: string;
48
+ followers: number;
49
+ socialnetwork: 'instagram' | 'tiktok' | 'youtube';
50
+ quantity: number;
51
+ imageUsageRight: number;
52
+ boostRight: number;
53
+ formats: FormatItem[];
54
+ }
55
+ export declare const ProjectProfileSchema: import("mongoose").Schema<ProjectProfile, import("mongoose").Model<ProjectProfile, any, any, any, import("mongoose").Document<unknown, any, ProjectProfile, any, {}> & ProjectProfile & {
56
+ _id: import("mongoose").Types.ObjectId;
57
+ } & {
58
+ __v: number;
59
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, ProjectProfile, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<ProjectProfile>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<ProjectProfile> & {
60
+ _id: import("mongoose").Types.ObjectId;
61
+ } & {
62
+ __v: number;
63
+ }>;
64
+ export declare class ProjectProductionCost {
65
+ category: string;
66
+ description: string;
67
+ value: number;
68
+ link: string;
69
+ expectedDate: string;
70
+ }
71
+ export declare const ProjectProductionCostSchema: import("mongoose").Schema<ProjectProductionCost, import("mongoose").Model<ProjectProductionCost, any, any, any, import("mongoose").Document<unknown, any, ProjectProductionCost, any, {}> & ProjectProductionCost & {
72
+ _id: import("mongoose").Types.ObjectId;
73
+ } & {
74
+ __v: number;
75
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, ProjectProductionCost, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<ProjectProductionCost>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<ProjectProductionCost> & {
76
+ _id: import("mongoose").Types.ObjectId;
77
+ } & {
78
+ __v: number;
79
+ }>;
80
+ export type ProjectPhase = 'prospect' | 'pending' | 'planning' | 'inProgress' | 'inApproval' | 'done' | 'cold';
81
+ export declare class Project {
82
+ title: string;
83
+ commissionPercentage: string;
84
+ influencerCostType: string;
85
+ otherCostType: string;
86
+ phase?: ProjectPhase;
87
+ profiles?: ProjectProfile[];
88
+ productionCosts?: ProjectProductionCost[];
89
+ }
90
+ export declare const ProjectSchema: import("mongoose").Schema<Project, import("mongoose").Model<Project, any, any, any, import("mongoose").Document<unknown, any, Project, any, {}> & Project & {
91
+ _id: import("mongoose").Types.ObjectId;
92
+ } & {
93
+ __v: number;
94
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, Project, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<Project>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<Project> & {
95
+ _id: import("mongoose").Types.ObjectId;
96
+ } & {
97
+ __v: number;
98
+ }>;
99
+ export declare const ProjectModel: import("mongoose").Model<Project, {}, {}, {}, import("mongoose").Document<unknown, {}, Project, {}, import("mongoose").DefaultSchemaOptions> & Project & {
100
+ _id: import("mongoose").Types.ObjectId;
101
+ } & {
102
+ __v: number;
103
+ }, import("mongoose").Schema<Project, import("mongoose").Model<Project, any, any, any, import("mongoose").Document<unknown, any, Project, any, {}> & Project & {
104
+ _id: import("mongoose").Types.ObjectId;
105
+ } & {
106
+ __v: number;
107
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, Project, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<Project>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<Project> & {
108
+ _id: import("mongoose").Types.ObjectId;
109
+ } & {
110
+ __v: number;
111
+ }>>;
@@ -0,0 +1,151 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.ProjectModel = exports.ProjectSchema = exports.Project = exports.ProjectProductionCostSchema = exports.ProjectProductionCost = exports.ProjectProfileSchema = exports.ProjectProfile = exports.FormatItemSchema = exports.FormatItem = void 0;
13
+ const mongoose_1 = require("@nestjs/mongoose");
14
+ const mongoose_2 = require("mongoose");
15
+ let FormatItem = class FormatItem {
16
+ };
17
+ __decorate([
18
+ (0, mongoose_1.Prop)({ required: true, enum: ['reel', 'carousel', 'image', 'story', 'video'] }),
19
+ __metadata("design:type", String)
20
+ ], FormatItem.prototype, "format", void 0);
21
+ __decorate([
22
+ (0, mongoose_1.Prop)({ required: true, type: Number }),
23
+ __metadata("design:type", Number)
24
+ ], FormatItem.prototype, "qty", void 0);
25
+ __decorate([
26
+ (0, mongoose_1.Prop)({ required: true, type: Number }),
27
+ __metadata("design:type", Number)
28
+ ], FormatItem.prototype, "value", void 0);
29
+ __decorate([
30
+ (0, mongoose_1.Prop)({ required: true, type: Number }),
31
+ __metadata("design:type", Number)
32
+ ], FormatItem.prototype, "impressionCount", void 0);
33
+ __decorate([
34
+ (0, mongoose_1.Prop)({ required: true, type: Number }),
35
+ __metadata("design:type", Number)
36
+ ], FormatItem.prototype, "reachCount", void 0);
37
+ __decorate([
38
+ (0, mongoose_1.Prop)({ required: true, type: Number }),
39
+ __metadata("design:type", Number)
40
+ ], FormatItem.prototype, "engagementRate", void 0);
41
+ __decorate([
42
+ (0, mongoose_1.Prop)({ required: true, type: Number }),
43
+ __metadata("design:type", Number)
44
+ ], FormatItem.prototype, "engagementCount", void 0);
45
+ FormatItem = __decorate([
46
+ (0, mongoose_1.Schema)({ _id: false })
47
+ ], FormatItem);
48
+ exports.FormatItem = FormatItem;
49
+ exports.FormatItemSchema = mongoose_1.SchemaFactory.createForClass(FormatItem);
50
+ let ProjectProfile = class ProjectProfile {
51
+ };
52
+ __decorate([
53
+ (0, mongoose_1.Prop)({ required: true }),
54
+ __metadata("design:type", String)
55
+ ], ProjectProfile.prototype, "username", void 0);
56
+ __decorate([
57
+ (0, mongoose_1.Prop)({ required: true, type: Number }),
58
+ __metadata("design:type", Number)
59
+ ], ProjectProfile.prototype, "followers", void 0);
60
+ __decorate([
61
+ (0, mongoose_1.Prop)({ required: true, enum: ['instagram', 'tiktok', 'youtube'] }),
62
+ __metadata("design:type", String)
63
+ ], ProjectProfile.prototype, "socialnetwork", void 0);
64
+ __decorate([
65
+ (0, mongoose_1.Prop)({ required: true, type: Number }),
66
+ __metadata("design:type", Number)
67
+ ], ProjectProfile.prototype, "quantity", void 0);
68
+ __decorate([
69
+ (0, mongoose_1.Prop)({ required: true, type: Number }),
70
+ __metadata("design:type", Number)
71
+ ], ProjectProfile.prototype, "imageUsageRight", void 0);
72
+ __decorate([
73
+ (0, mongoose_1.Prop)({ required: true, type: Number }),
74
+ __metadata("design:type", Number)
75
+ ], ProjectProfile.prototype, "boostRight", void 0);
76
+ __decorate([
77
+ (0, mongoose_1.Prop)({ type: [exports.FormatItemSchema], default: [] }),
78
+ __metadata("design:type", Array)
79
+ ], ProjectProfile.prototype, "formats", void 0);
80
+ ProjectProfile = __decorate([
81
+ (0, mongoose_1.Schema)({ _id: false })
82
+ ], ProjectProfile);
83
+ exports.ProjectProfile = ProjectProfile;
84
+ exports.ProjectProfileSchema = mongoose_1.SchemaFactory.createForClass(ProjectProfile);
85
+ let ProjectProductionCost = class ProjectProductionCost {
86
+ };
87
+ __decorate([
88
+ (0, mongoose_1.Prop)({ required: true }),
89
+ __metadata("design:type", String)
90
+ ], ProjectProductionCost.prototype, "category", void 0);
91
+ __decorate([
92
+ (0, mongoose_1.Prop)({ required: true }),
93
+ __metadata("design:type", String)
94
+ ], ProjectProductionCost.prototype, "description", void 0);
95
+ __decorate([
96
+ (0, mongoose_1.Prop)({ required: true, type: Number }),
97
+ __metadata("design:type", Number)
98
+ ], ProjectProductionCost.prototype, "value", void 0);
99
+ __decorate([
100
+ (0, mongoose_1.Prop)({ required: false }),
101
+ __metadata("design:type", String)
102
+ ], ProjectProductionCost.prototype, "link", void 0);
103
+ __decorate([
104
+ (0, mongoose_1.Prop)({ required: false }),
105
+ __metadata("design:type", String)
106
+ ], ProjectProductionCost.prototype, "expectedDate", void 0);
107
+ ProjectProductionCost = __decorate([
108
+ (0, mongoose_1.Schema)({ _id: false })
109
+ ], ProjectProductionCost);
110
+ exports.ProjectProductionCost = ProjectProductionCost;
111
+ exports.ProjectProductionCostSchema = mongoose_1.SchemaFactory.createForClass(ProjectProductionCost);
112
+ let Project = class Project {
113
+ };
114
+ __decorate([
115
+ (0, mongoose_1.Prop)({ required: true }),
116
+ __metadata("design:type", String)
117
+ ], Project.prototype, "title", void 0);
118
+ __decorate([
119
+ (0, mongoose_1.Prop)({ required: false }),
120
+ __metadata("design:type", String)
121
+ ], Project.prototype, "commissionPercentage", void 0);
122
+ __decorate([
123
+ (0, mongoose_1.Prop)({ required: false }),
124
+ __metadata("design:type", String)
125
+ ], Project.prototype, "influencerCostType", void 0);
126
+ __decorate([
127
+ (0, mongoose_1.Prop)({ required: false }),
128
+ __metadata("design:type", String)
129
+ ], Project.prototype, "otherCostType", void 0);
130
+ __decorate([
131
+ (0, mongoose_1.Prop)({
132
+ required: false,
133
+ enum: ['prospect', 'pending', 'planning', 'inProgress', 'inApproval', 'done', 'cold'],
134
+ default: 'prospect',
135
+ }),
136
+ __metadata("design:type", String)
137
+ ], Project.prototype, "phase", void 0);
138
+ __decorate([
139
+ (0, mongoose_1.Prop)({ type: [exports.ProjectProfileSchema], default: [] }),
140
+ __metadata("design:type", Array)
141
+ ], Project.prototype, "profiles", void 0);
142
+ __decorate([
143
+ (0, mongoose_1.Prop)({ type: [exports.ProjectProductionCostSchema], default: [] }),
144
+ __metadata("design:type", Array)
145
+ ], Project.prototype, "productionCosts", void 0);
146
+ Project = __decorate([
147
+ (0, mongoose_1.Schema)({ timestamps: true })
148
+ ], Project);
149
+ exports.Project = Project;
150
+ exports.ProjectSchema = mongoose_1.SchemaFactory.createForClass(Project);
151
+ exports.ProjectModel = (0, mongoose_2.model)('Project', exports.ProjectSchema);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grapadigital/shared-schemas",
3
- "version": "1.0.113",
3
+ "version": "1.0.115",
4
4
  "description": "Shared Mongoose Schemas",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/index.ts CHANGED
@@ -12,3 +12,4 @@ export * from './schemas/webhook.schema';
12
12
  export * from './schemas/sale.schema';
13
13
  export * from './schemas/invoice.schema';
14
14
  export * from './schemas/log.schema';
15
+ export * from './schemas/project.schema';
@@ -0,0 +1,116 @@
1
+ import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
2
+ import { HydratedDocument, model as MongooseModel } from 'mongoose';
3
+
4
+ export type ProjectDocument = HydratedDocument<Project>;
5
+
6
+ @Schema({ _id: false })
7
+ export class FormatItem {
8
+ @Prop({ required: true, enum: ['reel', 'carousel', 'image', 'story', 'video'] })
9
+ format: 'reel' | 'carousel' | 'image' | 'story' | 'video';
10
+
11
+ @Prop({ required: true, type: Number })
12
+ qty: number;
13
+
14
+ @Prop({ required: true, type: Number })
15
+ value: number;
16
+
17
+ @Prop({ required: true, type: Number })
18
+ impressionCount: number;
19
+
20
+ @Prop({ required: true, type: Number })
21
+ reachCount: number;
22
+
23
+ @Prop({ required: true, type: Number })
24
+ engagementRate: number;
25
+
26
+ @Prop({ required: true, type: Number })
27
+ engagementCount: number;
28
+ }
29
+
30
+ export const FormatItemSchema = SchemaFactory.createForClass(FormatItem);
31
+
32
+ @Schema({ _id: false })
33
+ export class ProjectProfile {
34
+ @Prop({ required: true })
35
+ username: string;
36
+
37
+ @Prop({ required: true, type: Number })
38
+ followers: number;
39
+
40
+ @Prop({ required: true, enum: ['instagram', 'tiktok', 'youtube'] })
41
+ socialnetwork: 'instagram' | 'tiktok' | 'youtube';
42
+
43
+ @Prop({ required: true, type: Number })
44
+ quantity: number;
45
+
46
+ @Prop({ required: true, type: Number })
47
+ imageUsageRight: number;
48
+
49
+ @Prop({ required: true, type: Number })
50
+ boostRight: number;
51
+
52
+ @Prop({ type: [FormatItemSchema], default: [] })
53
+ formats: FormatItem[];
54
+ }
55
+
56
+ export const ProjectProfileSchema = SchemaFactory.createForClass(ProjectProfile);
57
+
58
+ @Schema({ _id: false })
59
+ export class ProjectProductionCost {
60
+ @Prop({ required: true })
61
+ category: string;
62
+
63
+ @Prop({ required: true })
64
+ description: string;
65
+
66
+ @Prop({ required: true, type: Number })
67
+ value: number;
68
+
69
+ @Prop({ required: false })
70
+ link: string;
71
+
72
+ @Prop({ required: false })
73
+ expectedDate: string;
74
+ }
75
+
76
+ export const ProjectProductionCostSchema = SchemaFactory.createForClass(ProjectProductionCost);
77
+
78
+ export type ProjectPhase =
79
+ | 'prospect'
80
+ | 'pending'
81
+ | 'planning'
82
+ | 'inProgress'
83
+ | 'inApproval'
84
+ | 'done'
85
+ | 'cold';
86
+
87
+ @Schema({ timestamps: true })
88
+ export class Project {
89
+ @Prop({ required: true })
90
+ title: string;
91
+
92
+ @Prop({ required: false })
93
+ commissionPercentage: string;
94
+
95
+ @Prop({ required: false })
96
+ influencerCostType: string;
97
+
98
+ @Prop({ required: false })
99
+ otherCostType: string;
100
+
101
+ @Prop({
102
+ required: false,
103
+ enum: ['prospect', 'pending', 'planning', 'inProgress', 'inApproval', 'done', 'cold'],
104
+ default: 'prospect',
105
+ })
106
+ phase?: ProjectPhase;
107
+
108
+ @Prop({ type: [ProjectProfileSchema], default: [] })
109
+ profiles?: ProjectProfile[];
110
+
111
+ @Prop({ type: [ProjectProductionCostSchema], default: [] })
112
+ productionCosts?: ProjectProductionCost[];
113
+ }
114
+
115
+ export const ProjectSchema = SchemaFactory.createForClass(Project);
116
+ export const ProjectModel = MongooseModel('Project', ProjectSchema);