@grapadigital/shared-schemas 1.0.183 → 1.0.185
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/client.schema.d.ts +6 -0
- package/dist/schemas/client.schema.js +4 -0
- package/dist/schemas/creative.schema.d.ts +141 -0
- package/dist/schemas/creative.schema.js +293 -0
- package/dist/schemas/log.schema.d.ts +1 -1
- package/dist/schemas/log.schema.js +1 -0
- package/dist/schemas/script.schema.d.ts +136 -0
- package/dist/schemas/script.schema.js +274 -0
- package/package.json +1 -1
- package/src/index.ts +2 -0
- package/src/schemas/client.schema.ts +8 -0
- package/src/schemas/creative.schema.ts +256 -0
- package/src/schemas/log.schema.ts +2 -1
- package/src/schemas/script.schema.ts +235 -0
package/dist/index.d.ts
CHANGED
|
@@ -8,6 +8,8 @@ export * from './schemas/payment.schema';
|
|
|
8
8
|
export * from './schemas/profile.schema';
|
|
9
9
|
export * from './schemas/recruitment.schema';
|
|
10
10
|
export * from './schemas/task.schema';
|
|
11
|
+
export * from './schemas/script.schema';
|
|
12
|
+
export * from './schemas/creative.schema';
|
|
11
13
|
export * from './schemas/assignment.schema';
|
|
12
14
|
export * from './schemas/token.schema';
|
|
13
15
|
export * from './schemas/webhook.schema';
|
package/dist/index.js
CHANGED
|
@@ -25,6 +25,8 @@ __exportStar(require("./schemas/payment.schema"), exports);
|
|
|
25
25
|
__exportStar(require("./schemas/profile.schema"), exports);
|
|
26
26
|
__exportStar(require("./schemas/recruitment.schema"), exports);
|
|
27
27
|
__exportStar(require("./schemas/task.schema"), exports);
|
|
28
|
+
__exportStar(require("./schemas/script.schema"), exports);
|
|
29
|
+
__exportStar(require("./schemas/creative.schema"), exports);
|
|
28
30
|
__exportStar(require("./schemas/assignment.schema"), exports);
|
|
29
31
|
__exportStar(require("./schemas/token.schema"), exports);
|
|
30
32
|
__exportStar(require("./schemas/webhook.schema"), exports);
|
|
@@ -102,6 +102,12 @@ export declare class Client extends Party {
|
|
|
102
102
|
niches?: NicheItem[];
|
|
103
103
|
hasAgencyCommission: boolean;
|
|
104
104
|
agencyCommission: AgencyCommissionPeriod[];
|
|
105
|
+
/**
|
|
106
|
+
* Times obrigatórios pra aprovação de Roteiro/Conteúdo (ex.: Samsung
|
|
107
|
+
* exige Influência+Marcom+Produto). Vazio = 1 aprovação de qualquer
|
|
108
|
+
* time já resolve (padrão da maioria dos clientes). Ver GD-532/GD-535.
|
|
109
|
+
*/
|
|
110
|
+
requiredTeams: string[];
|
|
105
111
|
}
|
|
106
112
|
export declare const ClientSchema: import("mongoose").Schema<Client, import("mongoose").Model<Client, any, any, any, import("mongoose").Document<unknown, any, Client, any, {}> & Client & Required<{
|
|
107
113
|
_id: import("mongoose").Types.ObjectId;
|
|
@@ -134,6 +134,10 @@ __decorate([
|
|
|
134
134
|
(0, mongoose_1.Prop)({ type: [exports.AgencyCommissionPeriodSchema], default: [] }),
|
|
135
135
|
__metadata("design:type", Array)
|
|
136
136
|
], Client.prototype, "agencyCommission", void 0);
|
|
137
|
+
__decorate([
|
|
138
|
+
(0, mongoose_1.Prop)({ type: [String], default: [] }),
|
|
139
|
+
__metadata("design:type", Array)
|
|
140
|
+
], Client.prototype, "requiredTeams", void 0);
|
|
137
141
|
Client = __decorate([
|
|
138
142
|
(0, mongoose_1.Schema)({ timestamps: true })
|
|
139
143
|
], Client);
|
|
@@ -0,0 +1,141 @@
|
|
|
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 { Profile } from './profile.schema';
|
|
30
|
+
import { TaskFormat } from './task.schema';
|
|
31
|
+
export type CreativeDocument = HydratedDocument<Creative>;
|
|
32
|
+
export declare const CREATIVE_STATUS_VALUES: readonly ["draft", "pending", "approved", "reproved"];
|
|
33
|
+
export type CreativeStatus = (typeof CREATIVE_STATUS_VALUES)[number];
|
|
34
|
+
export declare const CREATIVE_DECISION_VALUES: readonly ["approved", "reproved", "questioned"];
|
|
35
|
+
export type CreativeDecisionValue = (typeof CREATIVE_DECISION_VALUES)[number];
|
|
36
|
+
export declare const CREATIVE_MEDIA_TYPE_VALUES: readonly ["image", "video"];
|
|
37
|
+
export type CreativeMediaType = (typeof CREATIVE_MEDIA_TYPE_VALUES)[number];
|
|
38
|
+
export declare class CreativeDecision {
|
|
39
|
+
decision: CreativeDecisionValue;
|
|
40
|
+
comment?: string;
|
|
41
|
+
team: string;
|
|
42
|
+
respondedBy: string;
|
|
43
|
+
respondedAt: Date;
|
|
44
|
+
}
|
|
45
|
+
export declare const CreativeDecisionSchema: MongooseSchema<CreativeDecision, import("mongoose").Model<CreativeDecision, any, any, any, import("mongoose").Document<unknown, any, CreativeDecision, any, {}> & CreativeDecision & {
|
|
46
|
+
_id: Types.ObjectId;
|
|
47
|
+
} & {
|
|
48
|
+
__v: number;
|
|
49
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, CreativeDecision, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<CreativeDecision>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<CreativeDecision> & {
|
|
50
|
+
_id: Types.ObjectId;
|
|
51
|
+
} & {
|
|
52
|
+
__v: number;
|
|
53
|
+
}>;
|
|
54
|
+
export declare class CreativeStaffReply {
|
|
55
|
+
message: string;
|
|
56
|
+
repliedBy: string;
|
|
57
|
+
repliedAt: Date;
|
|
58
|
+
}
|
|
59
|
+
export declare const CreativeStaffReplySchema: MongooseSchema<CreativeStaffReply, import("mongoose").Model<CreativeStaffReply, any, any, any, import("mongoose").Document<unknown, any, CreativeStaffReply, any, {}> & CreativeStaffReply & {
|
|
60
|
+
_id: Types.ObjectId;
|
|
61
|
+
} & {
|
|
62
|
+
__v: number;
|
|
63
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, CreativeStaffReply, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<CreativeStaffReply>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<CreativeStaffReply> & {
|
|
64
|
+
_id: Types.ObjectId;
|
|
65
|
+
} & {
|
|
66
|
+
__v: number;
|
|
67
|
+
}>;
|
|
68
|
+
export declare class CreativeVersion {
|
|
69
|
+
version: number;
|
|
70
|
+
fileUrl?: string | null;
|
|
71
|
+
fileName?: string | null;
|
|
72
|
+
mediaType?: CreativeMediaType | null;
|
|
73
|
+
caption?: string | null;
|
|
74
|
+
status: 'approved' | 'reproved';
|
|
75
|
+
submittedBy?: string;
|
|
76
|
+
submittedAt?: Date;
|
|
77
|
+
decisions: CreativeDecision[];
|
|
78
|
+
staffReplies: CreativeStaffReply[];
|
|
79
|
+
archivedAt: Date;
|
|
80
|
+
}
|
|
81
|
+
export declare const CreativeVersionSchema: MongooseSchema<CreativeVersion, import("mongoose").Model<CreativeVersion, any, any, any, import("mongoose").Document<unknown, any, CreativeVersion, any, {}> & CreativeVersion & {
|
|
82
|
+
_id: Types.ObjectId;
|
|
83
|
+
} & {
|
|
84
|
+
__v: number;
|
|
85
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, CreativeVersion, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<CreativeVersion>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<CreativeVersion> & {
|
|
86
|
+
_id: Types.ObjectId;
|
|
87
|
+
} & {
|
|
88
|
+
__v: number;
|
|
89
|
+
}>;
|
|
90
|
+
/**
|
|
91
|
+
* Aprovação de conteúdo (prévia final): um documento por (action, profile,
|
|
92
|
+
* deliverableType, deliverableIndex) — não um doc único por Ação. Mesmo
|
|
93
|
+
* padrão de `Script` (ver GD-532); ao reprovar, o estado atual é arquivado em
|
|
94
|
+
* `versions[]` e o doc fica em `reproved` até o staff editar e reenviar
|
|
95
|
+
* (ver GD-537).
|
|
96
|
+
*/
|
|
97
|
+
export declare class Creative {
|
|
98
|
+
_id?: Types.ObjectId;
|
|
99
|
+
action: Types.ObjectId | Action;
|
|
100
|
+
client?: Types.ObjectId | Client;
|
|
101
|
+
profile: Types.ObjectId | Profile;
|
|
102
|
+
deliverableType: TaskFormat;
|
|
103
|
+
deliverableIndex: number;
|
|
104
|
+
version: number;
|
|
105
|
+
fileUrl?: string | null;
|
|
106
|
+
fileName?: string | null;
|
|
107
|
+
mediaType?: CreativeMediaType | null;
|
|
108
|
+
caption?: string | null;
|
|
109
|
+
status: CreativeStatus;
|
|
110
|
+
requiredTeams: string[];
|
|
111
|
+
submittedBy?: string;
|
|
112
|
+
submittedAt?: Date;
|
|
113
|
+
decisions: CreativeDecision[];
|
|
114
|
+
staffReplies: CreativeStaffReply[];
|
|
115
|
+
versions: CreativeVersion[];
|
|
116
|
+
organization?: Types.ObjectId;
|
|
117
|
+
createdAt?: Date;
|
|
118
|
+
updatedAt?: Date;
|
|
119
|
+
}
|
|
120
|
+
export declare const CreativeSchema: MongooseSchema<Creative, import("mongoose").Model<Creative, any, any, any, import("mongoose").Document<unknown, any, Creative, any, {}> & Creative & Required<{
|
|
121
|
+
_id: Types.ObjectId;
|
|
122
|
+
}> & {
|
|
123
|
+
__v: number;
|
|
124
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, Creative, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<Creative>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<Creative> & Required<{
|
|
125
|
+
_id: Types.ObjectId;
|
|
126
|
+
}> & {
|
|
127
|
+
__v: number;
|
|
128
|
+
}>;
|
|
129
|
+
export declare const CreativeModel: import("mongoose").Model<Creative, {}, {}, {}, import("mongoose").Document<unknown, {}, Creative, {}, import("mongoose").DefaultSchemaOptions> & Creative & Required<{
|
|
130
|
+
_id: Types.ObjectId;
|
|
131
|
+
}> & {
|
|
132
|
+
__v: number;
|
|
133
|
+
}, MongooseSchema<Creative, import("mongoose").Model<Creative, any, any, any, import("mongoose").Document<unknown, any, Creative, any, {}> & Creative & Required<{
|
|
134
|
+
_id: Types.ObjectId;
|
|
135
|
+
}> & {
|
|
136
|
+
__v: number;
|
|
137
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, Creative, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<Creative>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<Creative> & Required<{
|
|
138
|
+
_id: Types.ObjectId;
|
|
139
|
+
}> & {
|
|
140
|
+
__v: number;
|
|
141
|
+
}>>;
|
|
@@ -0,0 +1,293 @@
|
|
|
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.CreativeModel = exports.CreativeSchema = exports.Creative = exports.CreativeVersionSchema = exports.CreativeVersion = exports.CreativeStaffReplySchema = exports.CreativeStaffReply = exports.CreativeDecisionSchema = exports.CreativeDecision = exports.CREATIVE_MEDIA_TYPE_VALUES = exports.CREATIVE_DECISION_VALUES = exports.CREATIVE_STATUS_VALUES = void 0;
|
|
13
|
+
const mongoose_1 = require("@nestjs/mongoose");
|
|
14
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
15
|
+
const mongoose_2 = require("mongoose");
|
|
16
|
+
const action_schema_1 = require("./action.schema");
|
|
17
|
+
const client_schema_1 = require("./client.schema");
|
|
18
|
+
const profile_schema_1 = require("./profile.schema");
|
|
19
|
+
const task_schema_1 = require("./task.schema");
|
|
20
|
+
exports.CREATIVE_STATUS_VALUES = [
|
|
21
|
+
'draft',
|
|
22
|
+
'pending',
|
|
23
|
+
'approved',
|
|
24
|
+
'reproved',
|
|
25
|
+
];
|
|
26
|
+
exports.CREATIVE_DECISION_VALUES = [
|
|
27
|
+
'approved',
|
|
28
|
+
'reproved',
|
|
29
|
+
'questioned',
|
|
30
|
+
];
|
|
31
|
+
exports.CREATIVE_MEDIA_TYPE_VALUES = ['image', 'video'];
|
|
32
|
+
let CreativeDecision = class CreativeDecision {
|
|
33
|
+
};
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, swagger_1.ApiProperty)({ enum: exports.CREATIVE_DECISION_VALUES }),
|
|
36
|
+
(0, mongoose_1.Prop)({ type: String, enum: exports.CREATIVE_DECISION_VALUES, required: true }),
|
|
37
|
+
__metadata("design:type", String)
|
|
38
|
+
], CreativeDecision.prototype, "decision", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, swagger_1.ApiProperty)({ required: false }),
|
|
41
|
+
(0, mongoose_1.Prop)({ type: String, required: false }),
|
|
42
|
+
__metadata("design:type", String)
|
|
43
|
+
], CreativeDecision.prototype, "comment", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, swagger_1.ApiProperty)({ description: 'Time do cliente que respondeu, lido do JWT' }),
|
|
46
|
+
(0, mongoose_1.Prop)({ type: String, required: true }),
|
|
47
|
+
__metadata("design:type", String)
|
|
48
|
+
], CreativeDecision.prototype, "team", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, swagger_1.ApiProperty)(),
|
|
51
|
+
(0, mongoose_1.Prop)({ type: String, required: true }),
|
|
52
|
+
__metadata("design:type", String)
|
|
53
|
+
], CreativeDecision.prototype, "respondedBy", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, swagger_1.ApiProperty)(),
|
|
56
|
+
(0, mongoose_1.Prop)({ type: Date, required: true }),
|
|
57
|
+
__metadata("design:type", Date)
|
|
58
|
+
], CreativeDecision.prototype, "respondedAt", void 0);
|
|
59
|
+
CreativeDecision = __decorate([
|
|
60
|
+
(0, mongoose_1.Schema)({ _id: false })
|
|
61
|
+
], CreativeDecision);
|
|
62
|
+
exports.CreativeDecision = CreativeDecision;
|
|
63
|
+
exports.CreativeDecisionSchema = mongoose_1.SchemaFactory.createForClass(CreativeDecision);
|
|
64
|
+
let CreativeStaffReply = class CreativeStaffReply {
|
|
65
|
+
};
|
|
66
|
+
__decorate([
|
|
67
|
+
(0, swagger_1.ApiProperty)(),
|
|
68
|
+
(0, mongoose_1.Prop)({ type: String, required: true }),
|
|
69
|
+
__metadata("design:type", String)
|
|
70
|
+
], CreativeStaffReply.prototype, "message", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, swagger_1.ApiProperty)(),
|
|
73
|
+
(0, mongoose_1.Prop)({ type: String, required: true }),
|
|
74
|
+
__metadata("design:type", String)
|
|
75
|
+
], CreativeStaffReply.prototype, "repliedBy", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
(0, swagger_1.ApiProperty)(),
|
|
78
|
+
(0, mongoose_1.Prop)({ type: Date, required: true }),
|
|
79
|
+
__metadata("design:type", Date)
|
|
80
|
+
], CreativeStaffReply.prototype, "repliedAt", void 0);
|
|
81
|
+
CreativeStaffReply = __decorate([
|
|
82
|
+
(0, mongoose_1.Schema)({ _id: false })
|
|
83
|
+
], CreativeStaffReply);
|
|
84
|
+
exports.CreativeStaffReply = CreativeStaffReply;
|
|
85
|
+
exports.CreativeStaffReplySchema = mongoose_1.SchemaFactory.createForClass(CreativeStaffReply);
|
|
86
|
+
let CreativeVersion = class CreativeVersion {
|
|
87
|
+
};
|
|
88
|
+
__decorate([
|
|
89
|
+
(0, swagger_1.ApiProperty)(),
|
|
90
|
+
(0, mongoose_1.Prop)({ type: Number, required: true }),
|
|
91
|
+
__metadata("design:type", Number)
|
|
92
|
+
], CreativeVersion.prototype, "version", void 0);
|
|
93
|
+
__decorate([
|
|
94
|
+
(0, swagger_1.ApiProperty)({ required: false }),
|
|
95
|
+
(0, mongoose_1.Prop)({ type: String, required: false, default: null }),
|
|
96
|
+
__metadata("design:type", Object)
|
|
97
|
+
], CreativeVersion.prototype, "fileUrl", void 0);
|
|
98
|
+
__decorate([
|
|
99
|
+
(0, swagger_1.ApiProperty)({ required: false }),
|
|
100
|
+
(0, mongoose_1.Prop)({ type: String, required: false, default: null }),
|
|
101
|
+
__metadata("design:type", Object)
|
|
102
|
+
], CreativeVersion.prototype, "fileName", void 0);
|
|
103
|
+
__decorate([
|
|
104
|
+
(0, swagger_1.ApiProperty)({ enum: exports.CREATIVE_MEDIA_TYPE_VALUES, required: false }),
|
|
105
|
+
(0, mongoose_1.Prop)({
|
|
106
|
+
type: String,
|
|
107
|
+
enum: exports.CREATIVE_MEDIA_TYPE_VALUES,
|
|
108
|
+
required: false,
|
|
109
|
+
default: null,
|
|
110
|
+
}),
|
|
111
|
+
__metadata("design:type", Object)
|
|
112
|
+
], CreativeVersion.prototype, "mediaType", void 0);
|
|
113
|
+
__decorate([
|
|
114
|
+
(0, swagger_1.ApiProperty)({ required: false }),
|
|
115
|
+
(0, mongoose_1.Prop)({ type: String, required: false, default: null }),
|
|
116
|
+
__metadata("design:type", Object)
|
|
117
|
+
], CreativeVersion.prototype, "caption", void 0);
|
|
118
|
+
__decorate([
|
|
119
|
+
(0, swagger_1.ApiProperty)({ enum: ['approved', 'reproved'] }),
|
|
120
|
+
(0, mongoose_1.Prop)({ type: String, enum: ['approved', 'reproved'], required: true }),
|
|
121
|
+
__metadata("design:type", String)
|
|
122
|
+
], CreativeVersion.prototype, "status", void 0);
|
|
123
|
+
__decorate([
|
|
124
|
+
(0, swagger_1.ApiProperty)({ required: false }),
|
|
125
|
+
(0, mongoose_1.Prop)({ type: String, required: false }),
|
|
126
|
+
__metadata("design:type", String)
|
|
127
|
+
], CreativeVersion.prototype, "submittedBy", void 0);
|
|
128
|
+
__decorate([
|
|
129
|
+
(0, swagger_1.ApiProperty)({ required: false }),
|
|
130
|
+
(0, mongoose_1.Prop)({ type: Date, required: false }),
|
|
131
|
+
__metadata("design:type", Date)
|
|
132
|
+
], CreativeVersion.prototype, "submittedAt", void 0);
|
|
133
|
+
__decorate([
|
|
134
|
+
(0, swagger_1.ApiProperty)({ type: () => [CreativeDecision] }),
|
|
135
|
+
(0, mongoose_1.Prop)({ type: [exports.CreativeDecisionSchema], default: [] }),
|
|
136
|
+
__metadata("design:type", Array)
|
|
137
|
+
], CreativeVersion.prototype, "decisions", void 0);
|
|
138
|
+
__decorate([
|
|
139
|
+
(0, swagger_1.ApiProperty)({ type: () => [CreativeStaffReply] }),
|
|
140
|
+
(0, mongoose_1.Prop)({ type: [exports.CreativeStaffReplySchema], default: [] }),
|
|
141
|
+
__metadata("design:type", Array)
|
|
142
|
+
], CreativeVersion.prototype, "staffReplies", void 0);
|
|
143
|
+
__decorate([
|
|
144
|
+
(0, swagger_1.ApiProperty)(),
|
|
145
|
+
(0, mongoose_1.Prop)({ type: Date, required: true }),
|
|
146
|
+
__metadata("design:type", Date)
|
|
147
|
+
], CreativeVersion.prototype, "archivedAt", void 0);
|
|
148
|
+
CreativeVersion = __decorate([
|
|
149
|
+
(0, mongoose_1.Schema)({ _id: false })
|
|
150
|
+
], CreativeVersion);
|
|
151
|
+
exports.CreativeVersion = CreativeVersion;
|
|
152
|
+
exports.CreativeVersionSchema = mongoose_1.SchemaFactory.createForClass(CreativeVersion);
|
|
153
|
+
/**
|
|
154
|
+
* Aprovação de conteúdo (prévia final): um documento por (action, profile,
|
|
155
|
+
* deliverableType, deliverableIndex) — não um doc único por Ação. Mesmo
|
|
156
|
+
* padrão de `Script` (ver GD-532); ao reprovar, o estado atual é arquivado em
|
|
157
|
+
* `versions[]` e o doc fica em `reproved` até o staff editar e reenviar
|
|
158
|
+
* (ver GD-537).
|
|
159
|
+
*/
|
|
160
|
+
let Creative = class Creative {
|
|
161
|
+
};
|
|
162
|
+
__decorate([
|
|
163
|
+
(0, swagger_1.ApiProperty)(),
|
|
164
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, auto: true, required: false }),
|
|
165
|
+
__metadata("design:type", mongoose_2.Types.ObjectId)
|
|
166
|
+
], Creative.prototype, "_id", void 0);
|
|
167
|
+
__decorate([
|
|
168
|
+
(0, swagger_1.ApiProperty)({ type: () => action_schema_1.Action }),
|
|
169
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, ref: 'Action', required: true }),
|
|
170
|
+
__metadata("design:type", Object)
|
|
171
|
+
], Creative.prototype, "action", void 0);
|
|
172
|
+
__decorate([
|
|
173
|
+
(0, swagger_1.ApiProperty)({ type: () => client_schema_1.Client }),
|
|
174
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, ref: 'Client', required: false }),
|
|
175
|
+
__metadata("design:type", Object)
|
|
176
|
+
], Creative.prototype, "client", void 0);
|
|
177
|
+
__decorate([
|
|
178
|
+
(0, swagger_1.ApiProperty)({ type: () => profile_schema_1.Profile }),
|
|
179
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, ref: 'Profile', required: true }),
|
|
180
|
+
__metadata("design:type", Object)
|
|
181
|
+
], Creative.prototype, "profile", void 0);
|
|
182
|
+
__decorate([
|
|
183
|
+
(0, swagger_1.ApiProperty)({
|
|
184
|
+
enum: task_schema_1.TASK_FORMAT_VALUES,
|
|
185
|
+
description: 'Unidade de entrega do escopo (mesmos valores de recruitment.scope.delivery)',
|
|
186
|
+
}),
|
|
187
|
+
(0, mongoose_1.Prop)({ type: String, enum: task_schema_1.TASK_FORMAT_VALUES, required: true }),
|
|
188
|
+
__metadata("design:type", String)
|
|
189
|
+
], Creative.prototype, "deliverableType", void 0);
|
|
190
|
+
__decorate([
|
|
191
|
+
(0, swagger_1.ApiProperty)({
|
|
192
|
+
description: 'Ex.: 1 de 2 quando o escopo pede mais de uma unidade do mesmo tipo; sempre 1 para "story"',
|
|
193
|
+
}),
|
|
194
|
+
(0, mongoose_1.Prop)({ type: Number, required: true, default: 1 }),
|
|
195
|
+
__metadata("design:type", Number)
|
|
196
|
+
], Creative.prototype, "deliverableIndex", void 0);
|
|
197
|
+
__decorate([
|
|
198
|
+
(0, swagger_1.ApiProperty)(),
|
|
199
|
+
(0, mongoose_1.Prop)({ type: Number, required: true, default: 1 }),
|
|
200
|
+
__metadata("design:type", Number)
|
|
201
|
+
], Creative.prototype, "version", void 0);
|
|
202
|
+
__decorate([
|
|
203
|
+
(0, swagger_1.ApiProperty)({ required: false }),
|
|
204
|
+
(0, mongoose_1.Prop)({ type: String, required: false, default: null }),
|
|
205
|
+
__metadata("design:type", Object)
|
|
206
|
+
], Creative.prototype, "fileUrl", void 0);
|
|
207
|
+
__decorate([
|
|
208
|
+
(0, swagger_1.ApiProperty)({ required: false }),
|
|
209
|
+
(0, mongoose_1.Prop)({ type: String, required: false, default: null }),
|
|
210
|
+
__metadata("design:type", Object)
|
|
211
|
+
], Creative.prototype, "fileName", void 0);
|
|
212
|
+
__decorate([
|
|
213
|
+
(0, swagger_1.ApiProperty)({ enum: exports.CREATIVE_MEDIA_TYPE_VALUES, required: false }),
|
|
214
|
+
(0, mongoose_1.Prop)({
|
|
215
|
+
type: String,
|
|
216
|
+
enum: exports.CREATIVE_MEDIA_TYPE_VALUES,
|
|
217
|
+
required: false,
|
|
218
|
+
default: null,
|
|
219
|
+
}),
|
|
220
|
+
__metadata("design:type", Object)
|
|
221
|
+
], Creative.prototype, "mediaType", void 0);
|
|
222
|
+
__decorate([
|
|
223
|
+
(0, swagger_1.ApiProperty)({ required: false, description: 'Legenda, campo separado do arquivo' }),
|
|
224
|
+
(0, mongoose_1.Prop)({ type: String, required: false, default: null }),
|
|
225
|
+
__metadata("design:type", Object)
|
|
226
|
+
], Creative.prototype, "caption", void 0);
|
|
227
|
+
__decorate([
|
|
228
|
+
(0, swagger_1.ApiProperty)({ enum: exports.CREATIVE_STATUS_VALUES }),
|
|
229
|
+
(0, mongoose_1.Prop)({
|
|
230
|
+
type: String,
|
|
231
|
+
enum: exports.CREATIVE_STATUS_VALUES,
|
|
232
|
+
required: true,
|
|
233
|
+
default: 'draft',
|
|
234
|
+
}),
|
|
235
|
+
__metadata("design:type", String)
|
|
236
|
+
], Creative.prototype, "status", void 0);
|
|
237
|
+
__decorate([
|
|
238
|
+
(0, swagger_1.ApiProperty)({
|
|
239
|
+
type: [String],
|
|
240
|
+
description: 'Snapshot de Client.requiredTeams no momento da criação — vazio = 1 aprovação resolve; com times = todos precisam aprovar',
|
|
241
|
+
}),
|
|
242
|
+
(0, mongoose_1.Prop)({ type: [String], required: false, default: [] }),
|
|
243
|
+
__metadata("design:type", Array)
|
|
244
|
+
], Creative.prototype, "requiredTeams", void 0);
|
|
245
|
+
__decorate([
|
|
246
|
+
(0, swagger_1.ApiProperty)({ required: false }),
|
|
247
|
+
(0, mongoose_1.Prop)({ type: String, required: false }),
|
|
248
|
+
__metadata("design:type", String)
|
|
249
|
+
], Creative.prototype, "submittedBy", void 0);
|
|
250
|
+
__decorate([
|
|
251
|
+
(0, swagger_1.ApiProperty)({ required: false }),
|
|
252
|
+
(0, mongoose_1.Prop)({ type: Date, required: false }),
|
|
253
|
+
__metadata("design:type", Date)
|
|
254
|
+
], Creative.prototype, "submittedAt", void 0);
|
|
255
|
+
__decorate([
|
|
256
|
+
(0, swagger_1.ApiProperty)({ type: () => [CreativeDecision] }),
|
|
257
|
+
(0, mongoose_1.Prop)({ type: [exports.CreativeDecisionSchema], default: [] }),
|
|
258
|
+
__metadata("design:type", Array)
|
|
259
|
+
], Creative.prototype, "decisions", void 0);
|
|
260
|
+
__decorate([
|
|
261
|
+
(0, swagger_1.ApiProperty)({ type: () => [CreativeStaffReply] }),
|
|
262
|
+
(0, mongoose_1.Prop)({ type: [exports.CreativeStaffReplySchema], default: [] }),
|
|
263
|
+
__metadata("design:type", Array)
|
|
264
|
+
], Creative.prototype, "staffReplies", void 0);
|
|
265
|
+
__decorate([
|
|
266
|
+
(0, swagger_1.ApiProperty)({ type: () => [CreativeVersion] }),
|
|
267
|
+
(0, mongoose_1.Prop)({ type: [exports.CreativeVersionSchema], default: [] }),
|
|
268
|
+
__metadata("design:type", Array)
|
|
269
|
+
], Creative.prototype, "versions", void 0);
|
|
270
|
+
__decorate([
|
|
271
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, required: false }),
|
|
272
|
+
__metadata("design:type", mongoose_2.Types.ObjectId)
|
|
273
|
+
], Creative.prototype, "organization", void 0);
|
|
274
|
+
__decorate([
|
|
275
|
+
(0, swagger_1.ApiProperty)(),
|
|
276
|
+
(0, mongoose_1.Prop)({ default: Date.now, required: false }),
|
|
277
|
+
__metadata("design:type", Date)
|
|
278
|
+
], Creative.prototype, "createdAt", void 0);
|
|
279
|
+
__decorate([
|
|
280
|
+
(0, swagger_1.ApiProperty)(),
|
|
281
|
+
(0, mongoose_1.Prop)({ default: Date.now, required: false }),
|
|
282
|
+
__metadata("design:type", Date)
|
|
283
|
+
], Creative.prototype, "updatedAt", void 0);
|
|
284
|
+
Creative = __decorate([
|
|
285
|
+
(0, mongoose_1.Schema)({ timestamps: true })
|
|
286
|
+
], Creative);
|
|
287
|
+
exports.Creative = Creative;
|
|
288
|
+
exports.CreativeSchema = mongoose_1.SchemaFactory.createForClass(Creative);
|
|
289
|
+
exports.CreativeSchema.index({ action: 1, profile: 1, deliverableType: 1, deliverableIndex: 1 }, { unique: true });
|
|
290
|
+
exports.CreativeSchema.index({ action: 1, status: 1 });
|
|
291
|
+
exports.CreativeSchema.index({ client: 1, status: 1 });
|
|
292
|
+
exports.CreativeSchema.index({ organization: 1, status: 1 });
|
|
293
|
+
exports.CreativeModel = (0, mongoose_2.model)('Creative', exports.CreativeSchema);
|
|
@@ -33,7 +33,7 @@ declare class UpdatedBy {
|
|
|
33
33
|
export declare class Log {
|
|
34
34
|
_id?: Types.ObjectId;
|
|
35
35
|
referenceId: string;
|
|
36
|
-
reference: 'action' | 'recruitment' | 'content' | 'contract' | 'sale' | 'invoice' | 'payment';
|
|
36
|
+
reference: 'action' | 'recruitment' | 'content' | 'contract' | 'sale' | 'invoice' | 'payment' | 'assignment';
|
|
37
37
|
type: 'created' | 'updated' | 'deleted' | 'email';
|
|
38
38
|
phase?: string;
|
|
39
39
|
changes: Record<string, {
|
|
@@ -0,0 +1,136 @@
|
|
|
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 { Profile } from './profile.schema';
|
|
30
|
+
import { TaskFormat } from './task.schema';
|
|
31
|
+
export type ScriptDocument = HydratedDocument<Script>;
|
|
32
|
+
export declare const SCRIPT_STATUS_VALUES: readonly ["draft", "pending", "approved", "reproved"];
|
|
33
|
+
export type ScriptStatus = (typeof SCRIPT_STATUS_VALUES)[number];
|
|
34
|
+
export declare const SCRIPT_DECISION_VALUES: readonly ["approved", "reproved", "questioned"];
|
|
35
|
+
export type ScriptDecisionValue = (typeof SCRIPT_DECISION_VALUES)[number];
|
|
36
|
+
export declare class ScriptDecision {
|
|
37
|
+
decision: ScriptDecisionValue;
|
|
38
|
+
comment?: string;
|
|
39
|
+
team: string;
|
|
40
|
+
respondedBy: string;
|
|
41
|
+
respondedAt: Date;
|
|
42
|
+
}
|
|
43
|
+
export declare const ScriptDecisionSchema: MongooseSchema<ScriptDecision, import("mongoose").Model<ScriptDecision, any, any, any, import("mongoose").Document<unknown, any, ScriptDecision, any, {}> & ScriptDecision & {
|
|
44
|
+
_id: Types.ObjectId;
|
|
45
|
+
} & {
|
|
46
|
+
__v: number;
|
|
47
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, ScriptDecision, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<ScriptDecision>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<ScriptDecision> & {
|
|
48
|
+
_id: Types.ObjectId;
|
|
49
|
+
} & {
|
|
50
|
+
__v: number;
|
|
51
|
+
}>;
|
|
52
|
+
export declare class ScriptStaffReply {
|
|
53
|
+
message: string;
|
|
54
|
+
repliedBy: string;
|
|
55
|
+
repliedAt: Date;
|
|
56
|
+
}
|
|
57
|
+
export declare const ScriptStaffReplySchema: MongooseSchema<ScriptStaffReply, import("mongoose").Model<ScriptStaffReply, any, any, any, import("mongoose").Document<unknown, any, ScriptStaffReply, any, {}> & ScriptStaffReply & {
|
|
58
|
+
_id: Types.ObjectId;
|
|
59
|
+
} & {
|
|
60
|
+
__v: number;
|
|
61
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, ScriptStaffReply, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<ScriptStaffReply>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<ScriptStaffReply> & {
|
|
62
|
+
_id: Types.ObjectId;
|
|
63
|
+
} & {
|
|
64
|
+
__v: number;
|
|
65
|
+
}>;
|
|
66
|
+
export declare class ScriptVersion {
|
|
67
|
+
version: number;
|
|
68
|
+
fileUrl?: string | null;
|
|
69
|
+
fileName?: string | null;
|
|
70
|
+
link?: string | null;
|
|
71
|
+
status: 'approved' | 'reproved';
|
|
72
|
+
submittedBy?: string;
|
|
73
|
+
submittedAt?: Date;
|
|
74
|
+
decisions: ScriptDecision[];
|
|
75
|
+
staffReplies: ScriptStaffReply[];
|
|
76
|
+
archivedAt: Date;
|
|
77
|
+
}
|
|
78
|
+
export declare const ScriptVersionSchema: MongooseSchema<ScriptVersion, import("mongoose").Model<ScriptVersion, any, any, any, import("mongoose").Document<unknown, any, ScriptVersion, any, {}> & ScriptVersion & {
|
|
79
|
+
_id: Types.ObjectId;
|
|
80
|
+
} & {
|
|
81
|
+
__v: number;
|
|
82
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, ScriptVersion, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<ScriptVersion>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<ScriptVersion> & {
|
|
83
|
+
_id: Types.ObjectId;
|
|
84
|
+
} & {
|
|
85
|
+
__v: number;
|
|
86
|
+
}>;
|
|
87
|
+
/**
|
|
88
|
+
* Aprovação de roteiro: um documento por (action, profile, deliverableType,
|
|
89
|
+
* deliverableIndex) — não um doc único por Ação. A versão mora no mesmo doc;
|
|
90
|
+
* ao reprovar, o estado atual é arquivado em `versions[]` e o doc volta a
|
|
91
|
+
* `draft` para uma nova tentativa (ver GD-532).
|
|
92
|
+
*/
|
|
93
|
+
export declare class Script {
|
|
94
|
+
_id?: Types.ObjectId;
|
|
95
|
+
action: Types.ObjectId | Action;
|
|
96
|
+
client?: Types.ObjectId | Client;
|
|
97
|
+
profile: Types.ObjectId | Profile;
|
|
98
|
+
deliverableType: TaskFormat;
|
|
99
|
+
deliverableIndex: number;
|
|
100
|
+
version: number;
|
|
101
|
+
fileUrl?: string | null;
|
|
102
|
+
fileName?: string | null;
|
|
103
|
+
link?: string | null;
|
|
104
|
+
status: ScriptStatus;
|
|
105
|
+
requiredTeams: string[];
|
|
106
|
+
submittedBy?: string;
|
|
107
|
+
submittedAt?: Date;
|
|
108
|
+
decisions: ScriptDecision[];
|
|
109
|
+
staffReplies: ScriptStaffReply[];
|
|
110
|
+
versions: ScriptVersion[];
|
|
111
|
+
organization?: Types.ObjectId;
|
|
112
|
+
createdAt?: Date;
|
|
113
|
+
updatedAt?: Date;
|
|
114
|
+
}
|
|
115
|
+
export declare const ScriptSchema: MongooseSchema<Script, import("mongoose").Model<Script, any, any, any, import("mongoose").Document<unknown, any, Script, any, {}> & Script & Required<{
|
|
116
|
+
_id: Types.ObjectId;
|
|
117
|
+
}> & {
|
|
118
|
+
__v: number;
|
|
119
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, Script, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<Script>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<Script> & Required<{
|
|
120
|
+
_id: Types.ObjectId;
|
|
121
|
+
}> & {
|
|
122
|
+
__v: number;
|
|
123
|
+
}>;
|
|
124
|
+
export declare const ScriptModel: import("mongoose").Model<Script, {}, {}, {}, import("mongoose").Document<unknown, {}, Script, {}, import("mongoose").DefaultSchemaOptions> & Script & Required<{
|
|
125
|
+
_id: Types.ObjectId;
|
|
126
|
+
}> & {
|
|
127
|
+
__v: number;
|
|
128
|
+
}, MongooseSchema<Script, import("mongoose").Model<Script, any, any, any, import("mongoose").Document<unknown, any, Script, any, {}> & Script & Required<{
|
|
129
|
+
_id: Types.ObjectId;
|
|
130
|
+
}> & {
|
|
131
|
+
__v: number;
|
|
132
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, Script, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<Script>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<Script> & Required<{
|
|
133
|
+
_id: Types.ObjectId;
|
|
134
|
+
}> & {
|
|
135
|
+
__v: number;
|
|
136
|
+
}>>;
|