@grapadigital/shared-schemas 1.0.217 → 1.0.219
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 +1 -0
- package/dist/index.js +1 -0
- package/dist/schemas/action.schema.d.ts +1 -29
- package/dist/schemas/action.schema.js +4 -34
- package/dist/schemas/assignment.schema.d.ts +2 -1
- package/dist/schemas/assignment.schema.js +5 -4
- package/dist/schemas/client.schema.d.ts +73 -5
- package/dist/schemas/client.schema.js +121 -18
- package/dist/schemas/content-capture-process.schema.d.ts +2 -28
- package/dist/schemas/content-capture-process.schema.js +4 -35
- package/dist/schemas/prospect.schema.d.ts +2 -14
- package/dist/schemas/prospect.schema.js +6 -20
- package/dist/schemas/responsible.schema.d.ts +45 -0
- package/dist/schemas/responsible.schema.js +45 -0
- package/dist/schemas/sale.schema.d.ts +16 -15
- package/dist/schemas/sale.schema.js +14 -33
- package/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/schemas/action.schema.ts +1 -25
- package/src/schemas/assignment.schema.ts +5 -4
- package/src/schemas/client.schema.ts +112 -14
- package/src/schemas/content-capture-process.schema.ts +3 -33
- package/src/schemas/prospect.schema.ts +5 -15
- package/src/schemas/responsible.schema.ts +27 -0
- package/src/schemas/sale.schema.ts +15 -45
|
@@ -9,6 +9,7 @@ import { Profile } from './profile.schema';
|
|
|
9
9
|
import { Client } from './client.schema';
|
|
10
10
|
import { Influencer } from './influencer.schema';
|
|
11
11
|
import { Note } from './note.schema';
|
|
12
|
+
import { Responsible, ResponsibleSchema } from './responsible.schema';
|
|
12
13
|
|
|
13
14
|
export type SaleDocument = HydratedDocument<Sale>;
|
|
14
15
|
|
|
@@ -38,21 +39,6 @@ export class Proposal {
|
|
|
38
39
|
required: false,
|
|
39
40
|
})
|
|
40
41
|
influencer?: Types.ObjectId | Influencer;
|
|
41
|
-
|
|
42
|
-
@Prop({
|
|
43
|
-
_id: false,
|
|
44
|
-
required: true,
|
|
45
|
-
type: [{
|
|
46
|
-
team: String,
|
|
47
|
-
name: String,
|
|
48
|
-
email: String,
|
|
49
|
-
}],
|
|
50
|
-
})
|
|
51
|
-
responsible: {
|
|
52
|
-
team: string;
|
|
53
|
-
name: string;
|
|
54
|
-
email: string;
|
|
55
|
-
}[];
|
|
56
42
|
}
|
|
57
43
|
|
|
58
44
|
@Schema({ _id: false })
|
|
@@ -168,39 +154,23 @@ export class Inbox {
|
|
|
168
154
|
@Prop({ required: true }) receivedAt: Date;
|
|
169
155
|
}
|
|
170
156
|
|
|
157
|
+
/**
|
|
158
|
+
* Responsáveis da venda por papel: comercial (proposta), curadoria e planejamento.
|
|
159
|
+
*/
|
|
171
160
|
@Schema({ _id: false })
|
|
172
161
|
export class SaleResponsible {
|
|
173
|
-
@Prop({
|
|
174
|
-
|
|
175
|
-
required: false,
|
|
176
|
-
type: [{
|
|
177
|
-
team: String,
|
|
178
|
-
name: String,
|
|
179
|
-
email: String,
|
|
180
|
-
}],
|
|
181
|
-
})
|
|
182
|
-
curation?: {
|
|
183
|
-
team: string;
|
|
184
|
-
name: string;
|
|
185
|
-
email: string;
|
|
186
|
-
}[];
|
|
162
|
+
@Prop({ type: [ResponsibleSchema], required: false, default: [] })
|
|
163
|
+
proposal?: Responsible[];
|
|
187
164
|
|
|
188
|
-
@Prop({
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
name: String,
|
|
194
|
-
email: String,
|
|
195
|
-
}],
|
|
196
|
-
})
|
|
197
|
-
planning?: {
|
|
198
|
-
team: string;
|
|
199
|
-
name: string;
|
|
200
|
-
email: string;
|
|
201
|
-
}[];
|
|
165
|
+
@Prop({ type: [ResponsibleSchema], required: false, default: [] })
|
|
166
|
+
curation?: Responsible[];
|
|
167
|
+
|
|
168
|
+
@Prop({ type: [ResponsibleSchema], required: false, default: [] })
|
|
169
|
+
planning?: Responsible[];
|
|
202
170
|
}
|
|
203
171
|
|
|
172
|
+
export const SaleResponsibleSchema = SchemaFactory.createForClass(SaleResponsible);
|
|
173
|
+
|
|
204
174
|
@Schema({ _id: false })
|
|
205
175
|
export class SaleLinks {
|
|
206
176
|
@Prop({ required: false })
|
|
@@ -306,7 +276,7 @@ export class Sale {
|
|
|
306
276
|
@Prop({ type: String, required: false })
|
|
307
277
|
omieId?: string;
|
|
308
278
|
|
|
309
|
-
@Prop({ type:
|
|
279
|
+
@Prop({ type: SaleResponsibleSchema, required: false })
|
|
310
280
|
responsible?: SaleResponsible;
|
|
311
281
|
|
|
312
282
|
@Prop({ type: SaleLinks, required: false })
|
|
@@ -321,7 +291,7 @@ SaleSchema.index({ organization: 1, 'formalization.brand': 1 });
|
|
|
321
291
|
SaleSchema.index({ organization: 1, 'formalization.agency': 1 });
|
|
322
292
|
SaleSchema.index({ organization: 1, closedAt: 1, phase: 1 });
|
|
323
293
|
SaleSchema.index({ 'proposal.influencer': 1 });
|
|
324
|
-
SaleSchema.index({ 'proposal.
|
|
294
|
+
SaleSchema.index({ 'responsible.proposal.email': 1 });
|
|
325
295
|
SaleSchema.index({ tags: 1 });
|
|
326
296
|
|
|
327
297
|
export const SaleModel = MongooseModel('Sale', SaleSchema);
|