@grapadigital/shared-schemas 1.0.163 → 1.0.164
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 +2 -0
- package/dist/index.js +2 -0
- package/dist/schemas/action.schema.d.ts +0 -11
- package/dist/schemas/action.schema.js +0 -50
- package/dist/schemas/benchmark.schema.d.ts +62 -0
- package/dist/schemas/benchmark.schema.js +54 -0
- package/dist/schemas/schedule.schema.d.ts +66 -0
- package/dist/schemas/schedule.schema.js +77 -0
- package/package.json +1 -1
- package/src/index.ts +2 -0
- package/src/schemas/action.schema.ts +0 -41
- package/src/schemas/benchmark.schema.ts +37 -0
- package/src/schemas/schedule.schema.ts +67 -0
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export * from './schemas/campaign.schema';
|
|
|
7
7
|
export * from './schemas/payment.schema';
|
|
8
8
|
export * from './schemas/profile.schema';
|
|
9
9
|
export * from './schemas/recruitment.schema';
|
|
10
|
+
export * from './schemas/schedule.schema';
|
|
10
11
|
export * from './schemas/token.schema';
|
|
11
12
|
export * from './schemas/webhook.schema';
|
|
12
13
|
export * from './schemas/sale.schema';
|
|
@@ -15,3 +16,4 @@ export * from './schemas/log.schema';
|
|
|
15
16
|
export * from './schemas/project.schema';
|
|
16
17
|
export * from './schemas/commission.schema';
|
|
17
18
|
export * from './schemas/contract.schema';
|
|
19
|
+
export * from './schemas/benchmark.schema';
|
package/dist/index.js
CHANGED
|
@@ -23,6 +23,7 @@ __exportStar(require("./schemas/campaign.schema"), exports);
|
|
|
23
23
|
__exportStar(require("./schemas/payment.schema"), exports);
|
|
24
24
|
__exportStar(require("./schemas/profile.schema"), exports);
|
|
25
25
|
__exportStar(require("./schemas/recruitment.schema"), exports);
|
|
26
|
+
__exportStar(require("./schemas/schedule.schema"), exports);
|
|
26
27
|
__exportStar(require("./schemas/token.schema"), exports);
|
|
27
28
|
__exportStar(require("./schemas/webhook.schema"), exports);
|
|
28
29
|
__exportStar(require("./schemas/sale.schema"), exports);
|
|
@@ -31,3 +32,4 @@ __exportStar(require("./schemas/log.schema"), exports);
|
|
|
31
32
|
__exportStar(require("./schemas/project.schema"), exports);
|
|
32
33
|
__exportStar(require("./schemas/commission.schema"), exports);
|
|
33
34
|
__exportStar(require("./schemas/contract.schema"), exports);
|
|
35
|
+
__exportStar(require("./schemas/benchmark.schema"), exports);
|
|
@@ -28,7 +28,6 @@ import { Recruitment } from './recruitment.schema';
|
|
|
28
28
|
import { Content } from './content.schema';
|
|
29
29
|
import { Client } from './client.schema';
|
|
30
30
|
import { Sale } from './sale.schema';
|
|
31
|
-
import { Profile } from './profile.schema';
|
|
32
31
|
export type ActionDocument = HydratedDocument<Action>;
|
|
33
32
|
export declare class Responsible {
|
|
34
33
|
name: string;
|
|
@@ -62,15 +61,6 @@ declare class Note {
|
|
|
62
61
|
owner: string;
|
|
63
62
|
createdAt: Date;
|
|
64
63
|
}
|
|
65
|
-
declare class ScheduledPost {
|
|
66
|
-
recruitmentId: Types.ObjectId | Recruitment;
|
|
67
|
-
profileId: Types.ObjectId | Profile;
|
|
68
|
-
socialnetwork: string;
|
|
69
|
-
type: string;
|
|
70
|
-
scheduledAt: Date;
|
|
71
|
-
status: 'scheduled' | 'published' | 'late' | 'cancelled';
|
|
72
|
-
contentId?: Types.ObjectId | Content;
|
|
73
|
-
}
|
|
74
64
|
export declare class Action {
|
|
75
65
|
_id?: Types.ObjectId;
|
|
76
66
|
title: string;
|
|
@@ -102,7 +92,6 @@ export declare class Action {
|
|
|
102
92
|
updatedAt?: Date;
|
|
103
93
|
notes?: Note[];
|
|
104
94
|
primetagId?: string;
|
|
105
|
-
scheduledPosts?: ScheduledPost[];
|
|
106
95
|
hashtags?: string[];
|
|
107
96
|
instagramMentions?: string[];
|
|
108
97
|
tiktokMentions?: string[];
|
|
@@ -74,51 +74,6 @@ Note = __decorate([
|
|
|
74
74
|
(0, mongoose_1.Schema)({ _id: false })
|
|
75
75
|
], Note);
|
|
76
76
|
const NoteSchema = mongoose_1.SchemaFactory.createForClass(Note);
|
|
77
|
-
let ScheduledPost = class ScheduledPost {
|
|
78
|
-
};
|
|
79
|
-
__decorate([
|
|
80
|
-
(0, swagger_1.ApiProperty)({ example: '64bfc3a78d3f1e2a12345678' }),
|
|
81
|
-
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, required: true }),
|
|
82
|
-
__metadata("design:type", Object)
|
|
83
|
-
], ScheduledPost.prototype, "recruitmentId", void 0);
|
|
84
|
-
__decorate([
|
|
85
|
-
(0, swagger_1.ApiProperty)({ example: '64bfc3a78d3f1e2a12345679' }),
|
|
86
|
-
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, required: true }),
|
|
87
|
-
__metadata("design:type", Object)
|
|
88
|
-
], ScheduledPost.prototype, "profileId", void 0);
|
|
89
|
-
__decorate([
|
|
90
|
-
(0, swagger_1.ApiProperty)({ example: 'instagram' }),
|
|
91
|
-
(0, mongoose_1.Prop)({ type: String, required: true }),
|
|
92
|
-
__metadata("design:type", String)
|
|
93
|
-
], ScheduledPost.prototype, "socialnetwork", void 0);
|
|
94
|
-
__decorate([
|
|
95
|
-
(0, swagger_1.ApiProperty)({ example: 'reel' }),
|
|
96
|
-
(0, mongoose_1.Prop)({ type: String, required: true }),
|
|
97
|
-
__metadata("design:type", String)
|
|
98
|
-
], ScheduledPost.prototype, "type", void 0);
|
|
99
|
-
__decorate([
|
|
100
|
-
(0, swagger_1.ApiProperty)({ example: '2025-11-05T14:00:00.000Z' }),
|
|
101
|
-
(0, mongoose_1.Prop)({ type: Date, required: true }),
|
|
102
|
-
__metadata("design:type", Date)
|
|
103
|
-
], ScheduledPost.prototype, "scheduledAt", void 0);
|
|
104
|
-
__decorate([
|
|
105
|
-
(0, swagger_1.ApiProperty)({ enum: ['scheduled', 'published', 'late', 'cancelled'], example: 'scheduled' }),
|
|
106
|
-
(0, mongoose_1.Prop)({
|
|
107
|
-
type: String,
|
|
108
|
-
enum: ['scheduled', 'published', 'late', 'cancelled'],
|
|
109
|
-
required: true,
|
|
110
|
-
}),
|
|
111
|
-
__metadata("design:type", String)
|
|
112
|
-
], ScheduledPost.prototype, "status", void 0);
|
|
113
|
-
__decorate([
|
|
114
|
-
(0, swagger_1.ApiProperty)({ example: '64bfc3a78d3f1e2a12345680', required: false }),
|
|
115
|
-
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, required: false }),
|
|
116
|
-
__metadata("design:type", Object)
|
|
117
|
-
], ScheduledPost.prototype, "contentId", void 0);
|
|
118
|
-
ScheduledPost = __decorate([
|
|
119
|
-
(0, mongoose_1.Schema)({ _id: false })
|
|
120
|
-
], ScheduledPost);
|
|
121
|
-
const ScheduledPostSchema = mongoose_1.SchemaFactory.createForClass(ScheduledPost);
|
|
122
77
|
let Action = class Action {
|
|
123
78
|
};
|
|
124
79
|
__decorate([
|
|
@@ -287,11 +242,6 @@ __decorate([
|
|
|
287
242
|
(0, mongoose_1.Prop)({ type: String, required: false }),
|
|
288
243
|
__metadata("design:type", String)
|
|
289
244
|
], Action.prototype, "primetagId", void 0);
|
|
290
|
-
__decorate([
|
|
291
|
-
(0, swagger_1.ApiProperty)({ type: () => [ScheduledPost], required: false }),
|
|
292
|
-
(0, mongoose_1.Prop)({ type: [ScheduledPostSchema], required: false }),
|
|
293
|
-
__metadata("design:type", Array)
|
|
294
|
-
], Action.prototype, "scheduledPosts", void 0);
|
|
295
245
|
__decorate([
|
|
296
246
|
(0, swagger_1.ApiProperty)({ example: ['#trending', '#viral'], required: false }),
|
|
297
247
|
(0, mongoose_1.Prop)({ type: [String], required: false }),
|
|
@@ -0,0 +1,62 @@
|
|
|
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, Schema as MongooseSchema, Types } from 'mongoose';
|
|
27
|
+
import { Client } from './client.schema';
|
|
28
|
+
export type BenchmarkMetric = 'reach' | 'er' | 'cpi' | 'cpe';
|
|
29
|
+
export type BenchmarkMode = 'organic' | 'paid';
|
|
30
|
+
export type BenchmarkDocument = HydratedDocument<Benchmark>;
|
|
31
|
+
export declare class Benchmark {
|
|
32
|
+
_id?: Types.ObjectId;
|
|
33
|
+
format: string;
|
|
34
|
+
mode: BenchmarkMode;
|
|
35
|
+
metric: BenchmarkMetric;
|
|
36
|
+
bad: number;
|
|
37
|
+
good: number;
|
|
38
|
+
inverted: boolean;
|
|
39
|
+
client?: Types.ObjectId | Client;
|
|
40
|
+
}
|
|
41
|
+
export declare const BenchmarkSchema: MongooseSchema<Benchmark, import("mongoose").Model<Benchmark, any, any, any, import("mongoose").Document<unknown, any, Benchmark, any, {}> & Benchmark & Required<{
|
|
42
|
+
_id: Types.ObjectId;
|
|
43
|
+
}> & {
|
|
44
|
+
__v: number;
|
|
45
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, Benchmark, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<Benchmark>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<Benchmark> & Required<{
|
|
46
|
+
_id: Types.ObjectId;
|
|
47
|
+
}> & {
|
|
48
|
+
__v: number;
|
|
49
|
+
}>;
|
|
50
|
+
export declare const BenchmarkModel: import("mongoose").Model<Benchmark, {}, {}, {}, import("mongoose").Document<unknown, {}, Benchmark, {}, import("mongoose").DefaultSchemaOptions> & Benchmark & Required<{
|
|
51
|
+
_id: Types.ObjectId;
|
|
52
|
+
}> & {
|
|
53
|
+
__v: number;
|
|
54
|
+
}, MongooseSchema<Benchmark, import("mongoose").Model<Benchmark, any, any, any, import("mongoose").Document<unknown, any, Benchmark, any, {}> & Benchmark & Required<{
|
|
55
|
+
_id: Types.ObjectId;
|
|
56
|
+
}> & {
|
|
57
|
+
__v: number;
|
|
58
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, Benchmark, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<Benchmark>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<Benchmark> & Required<{
|
|
59
|
+
_id: Types.ObjectId;
|
|
60
|
+
}> & {
|
|
61
|
+
__v: number;
|
|
62
|
+
}>>;
|
|
@@ -0,0 +1,54 @@
|
|
|
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.BenchmarkModel = exports.BenchmarkSchema = exports.Benchmark = void 0;
|
|
13
|
+
const mongoose_1 = require("@nestjs/mongoose");
|
|
14
|
+
const mongoose_2 = require("mongoose");
|
|
15
|
+
let Benchmark = class Benchmark {
|
|
16
|
+
};
|
|
17
|
+
__decorate([
|
|
18
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, auto: true, required: false }),
|
|
19
|
+
__metadata("design:type", mongoose_2.Types.ObjectId)
|
|
20
|
+
], Benchmark.prototype, "_id", void 0);
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, mongoose_1.Prop)({ type: String, required: true }),
|
|
23
|
+
__metadata("design:type", String)
|
|
24
|
+
], Benchmark.prototype, "format", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, mongoose_1.Prop)({ type: String, enum: ['organic', 'paid'], required: true }),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], Benchmark.prototype, "mode", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, mongoose_1.Prop)({ type: String, enum: ['reach', 'er', 'cpi', 'cpe'], required: true }),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], Benchmark.prototype, "metric", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, mongoose_1.Prop)({ type: Number, required: true }),
|
|
35
|
+
__metadata("design:type", Number)
|
|
36
|
+
], Benchmark.prototype, "bad", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, mongoose_1.Prop)({ type: Number, required: true }),
|
|
39
|
+
__metadata("design:type", Number)
|
|
40
|
+
], Benchmark.prototype, "good", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, mongoose_1.Prop)({ type: Boolean, required: true }),
|
|
43
|
+
__metadata("design:type", Boolean)
|
|
44
|
+
], Benchmark.prototype, "inverted", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, ref: 'Client', required: false }),
|
|
47
|
+
__metadata("design:type", Object)
|
|
48
|
+
], Benchmark.prototype, "client", void 0);
|
|
49
|
+
Benchmark = __decorate([
|
|
50
|
+
(0, mongoose_1.Schema)({ timestamps: true })
|
|
51
|
+
], Benchmark);
|
|
52
|
+
exports.Benchmark = Benchmark;
|
|
53
|
+
exports.BenchmarkSchema = mongoose_1.SchemaFactory.createForClass(Benchmark);
|
|
54
|
+
exports.BenchmarkModel = (0, mongoose_2.model)('Benchmark', exports.BenchmarkSchema);
|
|
@@ -0,0 +1,66 @@
|
|
|
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, Schema as MongooseSchema, Types } from 'mongoose';
|
|
27
|
+
import { Action } from './action.schema';
|
|
28
|
+
import { Client } from './client.schema';
|
|
29
|
+
import { Content } from './content.schema';
|
|
30
|
+
import { Profile } from './profile.schema';
|
|
31
|
+
import { Recruitment } from './recruitment.schema';
|
|
32
|
+
export type ScheduleDocument = HydratedDocument<Schedule>;
|
|
33
|
+
export declare class Schedule {
|
|
34
|
+
_id?: Types.ObjectId;
|
|
35
|
+
recruitmentId: Types.ObjectId | Recruitment;
|
|
36
|
+
profileId: Types.ObjectId | Profile;
|
|
37
|
+
socialnetwork: string;
|
|
38
|
+
type: string;
|
|
39
|
+
scheduledAt: Date;
|
|
40
|
+
status: 'scheduled' | 'published' | 'late' | 'cancelled';
|
|
41
|
+
contentId?: Types.ObjectId | Content;
|
|
42
|
+
actionId: Types.ObjectId | Action;
|
|
43
|
+
clientId: Types.ObjectId | Client;
|
|
44
|
+
}
|
|
45
|
+
export declare const ScheduleSchema: MongooseSchema<Schedule, import("mongoose").Model<Schedule, any, any, any, import("mongoose").Document<unknown, any, Schedule, any, {}> & Schedule & Required<{
|
|
46
|
+
_id: Types.ObjectId;
|
|
47
|
+
}> & {
|
|
48
|
+
__v: number;
|
|
49
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, Schedule, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<Schedule>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<Schedule> & Required<{
|
|
50
|
+
_id: Types.ObjectId;
|
|
51
|
+
}> & {
|
|
52
|
+
__v: number;
|
|
53
|
+
}>;
|
|
54
|
+
export declare const ScheduleModel: import("mongoose").Model<Schedule, {}, {}, {}, import("mongoose").Document<unknown, {}, Schedule, {}, import("mongoose").DefaultSchemaOptions> & Schedule & Required<{
|
|
55
|
+
_id: Types.ObjectId;
|
|
56
|
+
}> & {
|
|
57
|
+
__v: number;
|
|
58
|
+
}, MongooseSchema<Schedule, import("mongoose").Model<Schedule, any, any, any, import("mongoose").Document<unknown, any, Schedule, any, {}> & Schedule & Required<{
|
|
59
|
+
_id: Types.ObjectId;
|
|
60
|
+
}> & {
|
|
61
|
+
__v: number;
|
|
62
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, Schedule, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<Schedule>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<Schedule> & Required<{
|
|
63
|
+
_id: Types.ObjectId;
|
|
64
|
+
}> & {
|
|
65
|
+
__v: number;
|
|
66
|
+
}>>;
|
|
@@ -0,0 +1,77 @@
|
|
|
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.ScheduleModel = exports.ScheduleSchema = exports.Schedule = void 0;
|
|
13
|
+
const mongoose_1 = require("@nestjs/mongoose");
|
|
14
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
15
|
+
const mongoose_2 = require("mongoose");
|
|
16
|
+
let Schedule = class Schedule {
|
|
17
|
+
};
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, swagger_1.ApiProperty)({ example: '64bfc3a78d3f1e2a12345670' }),
|
|
20
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, auto: true, required: false }),
|
|
21
|
+
__metadata("design:type", mongoose_2.Types.ObjectId)
|
|
22
|
+
], Schedule.prototype, "_id", void 0);
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, swagger_1.ApiProperty)({ example: '64bfc3a78d3f1e2a12345678' }),
|
|
25
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, ref: 'Recruitment', required: true }),
|
|
26
|
+
__metadata("design:type", Object)
|
|
27
|
+
], Schedule.prototype, "recruitmentId", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, swagger_1.ApiProperty)({ example: '64bfc3a78d3f1e2a12345679' }),
|
|
30
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, ref: 'Profile', required: true }),
|
|
31
|
+
__metadata("design:type", Object)
|
|
32
|
+
], Schedule.prototype, "profileId", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, swagger_1.ApiProperty)({ example: 'instagram' }),
|
|
35
|
+
(0, mongoose_1.Prop)({ type: String, required: true }),
|
|
36
|
+
__metadata("design:type", String)
|
|
37
|
+
], Schedule.prototype, "socialnetwork", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, swagger_1.ApiProperty)({ example: 'reel' }),
|
|
40
|
+
(0, mongoose_1.Prop)({ type: String, required: true }),
|
|
41
|
+
__metadata("design:type", String)
|
|
42
|
+
], Schedule.prototype, "type", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, swagger_1.ApiProperty)({ example: '2025-11-05T14:00:00.000Z' }),
|
|
45
|
+
(0, mongoose_1.Prop)({ type: Date, required: true }),
|
|
46
|
+
__metadata("design:type", Date)
|
|
47
|
+
], Schedule.prototype, "scheduledAt", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, swagger_1.ApiProperty)({ enum: ['scheduled', 'published', 'late', 'cancelled'], example: 'scheduled' }),
|
|
50
|
+
(0, mongoose_1.Prop)({
|
|
51
|
+
type: String,
|
|
52
|
+
enum: ['scheduled', 'published', 'late', 'cancelled'],
|
|
53
|
+
required: true,
|
|
54
|
+
}),
|
|
55
|
+
__metadata("design:type", String)
|
|
56
|
+
], Schedule.prototype, "status", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, swagger_1.ApiProperty)({ example: '64bfc3a78d3f1e2a12345680', required: false }),
|
|
59
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, ref: 'Content', required: false }),
|
|
60
|
+
__metadata("design:type", Object)
|
|
61
|
+
], Schedule.prototype, "contentId", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, swagger_1.ApiProperty)({ example: '64bfc3a78d3f1e2a12345681' }),
|
|
64
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, ref: 'Action', required: true }),
|
|
65
|
+
__metadata("design:type", Object)
|
|
66
|
+
], Schedule.prototype, "actionId", void 0);
|
|
67
|
+
__decorate([
|
|
68
|
+
(0, swagger_1.ApiProperty)({ example: '64bfc3a78d3f1e2a12345682' }),
|
|
69
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, ref: 'Client', required: true }),
|
|
70
|
+
__metadata("design:type", Object)
|
|
71
|
+
], Schedule.prototype, "clientId", void 0);
|
|
72
|
+
Schedule = __decorate([
|
|
73
|
+
(0, mongoose_1.Schema)({ timestamps: true })
|
|
74
|
+
], Schedule);
|
|
75
|
+
exports.Schedule = Schedule;
|
|
76
|
+
exports.ScheduleSchema = mongoose_1.SchemaFactory.createForClass(Schedule);
|
|
77
|
+
exports.ScheduleModel = (0, mongoose_2.model)('Schedule', exports.ScheduleSchema);
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -7,6 +7,7 @@ export * from './schemas/campaign.schema';
|
|
|
7
7
|
export * from './schemas/payment.schema';
|
|
8
8
|
export * from './schemas/profile.schema';
|
|
9
9
|
export * from './schemas/recruitment.schema';
|
|
10
|
+
export * from './schemas/schedule.schema';
|
|
10
11
|
export * from './schemas/token.schema';
|
|
11
12
|
export * from './schemas/webhook.schema';
|
|
12
13
|
export * from './schemas/sale.schema';
|
|
@@ -15,3 +16,4 @@ export * from './schemas/log.schema';
|
|
|
15
16
|
export * from './schemas/project.schema';
|
|
16
17
|
export * from './schemas/commission.schema';
|
|
17
18
|
export * from './schemas/contract.schema';
|
|
19
|
+
export * from './schemas/benchmark.schema';
|
|
@@ -12,7 +12,6 @@ import { Recruitment } from './recruitment.schema';
|
|
|
12
12
|
import { Content } from './content.schema';
|
|
13
13
|
import { Client } from './client.schema';
|
|
14
14
|
import { Sale } from './sale.schema';
|
|
15
|
-
import { Profile } from './profile.schema';
|
|
16
15
|
|
|
17
16
|
export type ActionDocument = HydratedDocument<Action>;
|
|
18
17
|
|
|
@@ -55,42 +54,6 @@ class Note {
|
|
|
55
54
|
|
|
56
55
|
const NoteSchema = SchemaFactory.createForClass(Note);
|
|
57
56
|
|
|
58
|
-
@Schema({ _id: false })
|
|
59
|
-
class ScheduledPost {
|
|
60
|
-
@ApiProperty({ example: '64bfc3a78d3f1e2a12345678' })
|
|
61
|
-
@Prop({ type: MongooseSchema.Types.ObjectId, required: true })
|
|
62
|
-
recruitmentId: Types.ObjectId | Recruitment;
|
|
63
|
-
|
|
64
|
-
@ApiProperty({ example: '64bfc3a78d3f1e2a12345679' })
|
|
65
|
-
@Prop({ type: MongooseSchema.Types.ObjectId, required: true })
|
|
66
|
-
profileId: Types.ObjectId | Profile;
|
|
67
|
-
|
|
68
|
-
@ApiProperty({ example: 'instagram' })
|
|
69
|
-
@Prop({ type: String, required: true })
|
|
70
|
-
socialnetwork: string;
|
|
71
|
-
|
|
72
|
-
@ApiProperty({ example: 'reel' })
|
|
73
|
-
@Prop({ type: String, required: true })
|
|
74
|
-
type: string;
|
|
75
|
-
|
|
76
|
-
@ApiProperty({ example: '2025-11-05T14:00:00.000Z' })
|
|
77
|
-
@Prop({ type: Date, required: true })
|
|
78
|
-
scheduledAt: Date;
|
|
79
|
-
|
|
80
|
-
@ApiProperty({ enum: ['scheduled', 'published', 'late', 'cancelled'], example: 'scheduled' })
|
|
81
|
-
@Prop({
|
|
82
|
-
type: String,
|
|
83
|
-
enum: ['scheduled', 'published', 'late', 'cancelled'],
|
|
84
|
-
required: true,
|
|
85
|
-
})
|
|
86
|
-
status: 'scheduled' | 'published' | 'late' | 'cancelled';
|
|
87
|
-
|
|
88
|
-
@ApiProperty({ example: '64bfc3a78d3f1e2a12345680', required: false })
|
|
89
|
-
@Prop({ type: MongooseSchema.Types.ObjectId, required: false })
|
|
90
|
-
contentId?: Types.ObjectId | Content;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
const ScheduledPostSchema = SchemaFactory.createForClass(ScheduledPost);
|
|
94
57
|
|
|
95
58
|
@Schema({ timestamps: true })
|
|
96
59
|
export class Action {
|
|
@@ -230,10 +193,6 @@ export class Action {
|
|
|
230
193
|
@Prop({ type: String, required: false })
|
|
231
194
|
primetagId?: string;
|
|
232
195
|
|
|
233
|
-
@ApiProperty({ type: () => [ScheduledPost], required: false })
|
|
234
|
-
@Prop({ type: [ScheduledPostSchema], required: false })
|
|
235
|
-
scheduledPosts?: ScheduledPost[];
|
|
236
|
-
|
|
237
196
|
@ApiProperty({ example: ['#trending', '#viral'], required: false })
|
|
238
197
|
@Prop({ type: [String], required: false })
|
|
239
198
|
hashtags?: string[];
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
|
|
2
|
+
import { HydratedDocument, Schema as MongooseSchema, Types, model as MongooseModel } from 'mongoose';
|
|
3
|
+
import { Client } from './client.schema';
|
|
4
|
+
|
|
5
|
+
export type BenchmarkMetric = 'reach' | 'er' | 'cpi' | 'cpe';
|
|
6
|
+
export type BenchmarkMode = 'organic' | 'paid';
|
|
7
|
+
export type BenchmarkDocument = HydratedDocument<Benchmark>;
|
|
8
|
+
|
|
9
|
+
@Schema({ timestamps: true })
|
|
10
|
+
export class Benchmark {
|
|
11
|
+
@Prop({ type: MongooseSchema.Types.ObjectId, auto: true, required: false })
|
|
12
|
+
_id?: Types.ObjectId;
|
|
13
|
+
|
|
14
|
+
@Prop({ type: String, required: true })
|
|
15
|
+
format: string;
|
|
16
|
+
|
|
17
|
+
@Prop({ type: String, enum: ['organic', 'paid'], required: true })
|
|
18
|
+
mode: BenchmarkMode;
|
|
19
|
+
|
|
20
|
+
@Prop({ type: String, enum: ['reach', 'er', 'cpi', 'cpe'], required: true })
|
|
21
|
+
metric: BenchmarkMetric;
|
|
22
|
+
|
|
23
|
+
@Prop({ type: Number, required: true })
|
|
24
|
+
bad: number;
|
|
25
|
+
|
|
26
|
+
@Prop({ type: Number, required: true })
|
|
27
|
+
good: number;
|
|
28
|
+
|
|
29
|
+
@Prop({ type: Boolean, required: true })
|
|
30
|
+
inverted: boolean;
|
|
31
|
+
|
|
32
|
+
@Prop({ type: MongooseSchema.Types.ObjectId, ref: 'Client', required: false })
|
|
33
|
+
client?: Types.ObjectId | Client;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export const BenchmarkSchema = SchemaFactory.createForClass(Benchmark);
|
|
37
|
+
export const BenchmarkModel = MongooseModel('Benchmark', BenchmarkSchema);
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
|
|
2
|
+
import { ApiProperty } from '@nestjs/swagger';
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
HydratedDocument,
|
|
6
|
+
Schema as MongooseSchema,
|
|
7
|
+
Types,
|
|
8
|
+
model as MongooseModel,
|
|
9
|
+
} from 'mongoose';
|
|
10
|
+
|
|
11
|
+
import { Action } from './action.schema';
|
|
12
|
+
import { Client } from './client.schema';
|
|
13
|
+
import { Content } from './content.schema';
|
|
14
|
+
import { Profile } from './profile.schema';
|
|
15
|
+
import { Recruitment } from './recruitment.schema';
|
|
16
|
+
|
|
17
|
+
export type ScheduleDocument = HydratedDocument<Schedule>;
|
|
18
|
+
|
|
19
|
+
@Schema({ timestamps: true })
|
|
20
|
+
export class Schedule {
|
|
21
|
+
@ApiProperty({ example: '64bfc3a78d3f1e2a12345670' })
|
|
22
|
+
@Prop({ type: MongooseSchema.Types.ObjectId, auto: true, required: false })
|
|
23
|
+
_id?: Types.ObjectId;
|
|
24
|
+
|
|
25
|
+
@ApiProperty({ example: '64bfc3a78d3f1e2a12345678' })
|
|
26
|
+
@Prop({ type: MongooseSchema.Types.ObjectId, ref: 'Recruitment', required: true })
|
|
27
|
+
recruitmentId: Types.ObjectId | Recruitment;
|
|
28
|
+
|
|
29
|
+
@ApiProperty({ example: '64bfc3a78d3f1e2a12345679' })
|
|
30
|
+
@Prop({ type: MongooseSchema.Types.ObjectId, ref: 'Profile', required: true })
|
|
31
|
+
profileId: Types.ObjectId | Profile;
|
|
32
|
+
|
|
33
|
+
@ApiProperty({ example: 'instagram' })
|
|
34
|
+
@Prop({ type: String, required: true })
|
|
35
|
+
socialnetwork: string;
|
|
36
|
+
|
|
37
|
+
@ApiProperty({ example: 'reel' })
|
|
38
|
+
@Prop({ type: String, required: true })
|
|
39
|
+
type: string;
|
|
40
|
+
|
|
41
|
+
@ApiProperty({ example: '2025-11-05T14:00:00.000Z' })
|
|
42
|
+
@Prop({ type: Date, required: true })
|
|
43
|
+
scheduledAt: Date;
|
|
44
|
+
|
|
45
|
+
@ApiProperty({ enum: ['scheduled', 'published', 'late', 'cancelled'], example: 'scheduled' })
|
|
46
|
+
@Prop({
|
|
47
|
+
type: String,
|
|
48
|
+
enum: ['scheduled', 'published', 'late', 'cancelled'],
|
|
49
|
+
required: true,
|
|
50
|
+
})
|
|
51
|
+
status: 'scheduled' | 'published' | 'late' | 'cancelled';
|
|
52
|
+
|
|
53
|
+
@ApiProperty({ example: '64bfc3a78d3f1e2a12345680', required: false })
|
|
54
|
+
@Prop({ type: MongooseSchema.Types.ObjectId, ref: 'Content', required: false })
|
|
55
|
+
contentId?: Types.ObjectId | Content;
|
|
56
|
+
|
|
57
|
+
@ApiProperty({ example: '64bfc3a78d3f1e2a12345681' })
|
|
58
|
+
@Prop({ type: MongooseSchema.Types.ObjectId, ref: 'Action', required: true })
|
|
59
|
+
actionId: Types.ObjectId | Action;
|
|
60
|
+
|
|
61
|
+
@ApiProperty({ example: '64bfc3a78d3f1e2a12345682' })
|
|
62
|
+
@Prop({ type: MongooseSchema.Types.ObjectId, ref: 'Client', required: true })
|
|
63
|
+
clientId: Types.ObjectId | Client;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export const ScheduleSchema = SchemaFactory.createForClass(Schedule);
|
|
67
|
+
export const ScheduleModel = MongooseModel('Schedule', ScheduleSchema);
|