@grapadigital/shared-schemas 1.0.112 → 1.0.114

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,108 @@
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
+ phase?: ProjectPhase;
84
+ profiles?: ProjectProfile[];
85
+ productionCosts?: ProjectProductionCost[];
86
+ }
87
+ export declare const ProjectSchema: import("mongoose").Schema<Project, import("mongoose").Model<Project, any, any, any, import("mongoose").Document<unknown, any, Project, any, {}> & Project & {
88
+ _id: import("mongoose").Types.ObjectId;
89
+ } & {
90
+ __v: number;
91
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, Project, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<Project>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<Project> & {
92
+ _id: import("mongoose").Types.ObjectId;
93
+ } & {
94
+ __v: number;
95
+ }>;
96
+ export declare const ProjectModel: import("mongoose").Model<Project, {}, {}, {}, import("mongoose").Document<unknown, {}, Project, {}, import("mongoose").DefaultSchemaOptions> & Project & {
97
+ _id: import("mongoose").Types.ObjectId;
98
+ } & {
99
+ __v: number;
100
+ }, import("mongoose").Schema<Project, import("mongoose").Model<Project, any, any, any, import("mongoose").Document<unknown, any, Project, any, {}> & Project & {
101
+ _id: import("mongoose").Types.ObjectId;
102
+ } & {
103
+ __v: number;
104
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, Project, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<Project>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<Project> & {
105
+ _id: import("mongoose").Types.ObjectId;
106
+ } & {
107
+ __v: number;
108
+ }>>;
@@ -0,0 +1,139 @@
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)({
120
+ required: false,
121
+ enum: ['prospect', 'pending', 'planning', 'inProgress', 'inApproval', 'done', 'cold'],
122
+ default: 'prospect',
123
+ }),
124
+ __metadata("design:type", String)
125
+ ], Project.prototype, "phase", void 0);
126
+ __decorate([
127
+ (0, mongoose_1.Prop)({ type: [exports.ProjectProfileSchema], default: [] }),
128
+ __metadata("design:type", Array)
129
+ ], Project.prototype, "profiles", void 0);
130
+ __decorate([
131
+ (0, mongoose_1.Prop)({ type: [exports.ProjectProductionCostSchema], default: [] }),
132
+ __metadata("design:type", Array)
133
+ ], Project.prototype, "productionCosts", void 0);
134
+ Project = __decorate([
135
+ (0, mongoose_1.Schema)({ timestamps: true })
136
+ ], Project);
137
+ exports.Project = Project;
138
+ exports.ProjectSchema = mongoose_1.SchemaFactory.createForClass(Project);
139
+ exports.ProjectModel = (0, mongoose_2.model)('Project', exports.ProjectSchema);
@@ -65,6 +65,7 @@ export declare class Negotiation {
65
65
  revenue: number;
66
66
  transferValue: number;
67
67
  taxValue: number;
68
+ ISSQNValue: number;
68
69
  broadcastBonusValue: number;
69
70
  debitNoteValue: number;
70
71
  freeValue: number;
@@ -138,6 +138,10 @@ __decorate([
138
138
  (0, mongoose_1.Prop)({ required: true }),
139
139
  __metadata("design:type", Number)
140
140
  ], Negotiation.prototype, "taxValue", void 0);
141
+ __decorate([
142
+ (0, mongoose_1.Prop)({ required: true }),
143
+ __metadata("design:type", Number)
144
+ ], Negotiation.prototype, "ISSQNValue", void 0);
141
145
  __decorate([
142
146
  (0, mongoose_1.Prop)({ required: true }),
143
147
  __metadata("design:type", Number)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grapadigital/shared-schemas",
3
- "version": "1.0.112",
3
+ "version": "1.0.114",
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,107 @@
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({
93
+ required: false,
94
+ enum: ['prospect', 'pending', 'planning', 'inProgress', 'inApproval', 'done', 'cold'],
95
+ default: 'prospect',
96
+ })
97
+ phase?: ProjectPhase;
98
+
99
+ @Prop({ type: [ProjectProfileSchema], default: [] })
100
+ profiles?: ProjectProfile[];
101
+
102
+ @Prop({ type: [ProjectProductionCostSchema], default: [] })
103
+ productionCosts?: ProjectProductionCost[];
104
+ }
105
+
106
+ export const ProjectSchema = SchemaFactory.createForClass(Project);
107
+ export const ProjectModel = MongooseModel('Project', ProjectSchema);
@@ -60,6 +60,7 @@ export class Negotiation {
60
60
  @Prop({ required: true }) revenue: number;
61
61
  @Prop({ required: true }) transferValue: number;
62
62
  @Prop({ required: true }) taxValue: number;
63
+ @Prop({ required: true }) ISSQNValue: number;
63
64
  @Prop({ required: true }) broadcastBonusValue: number;
64
65
  @Prop({ required: true }) debitNoteValue: number;
65
66
  @Prop({ required: true }) freeValue: number;