@grapadigital/shared-schemas 1.0.201 → 1.0.203
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/schemas/client.schema.d.ts +29 -26
- package/dist/schemas/client.schema.js +10 -0
- package/dist/schemas/commission.schema.d.ts +1 -0
- package/dist/schemas/commission.schema.js +4 -0
- package/dist/schemas/profile.schema.d.ts +2 -0
- package/dist/schemas/profile.schema.js +5 -0
- package/dist/schemas/sale.schema.d.ts +19 -0
- package/dist/schemas/sale.schema.js +57 -1
- package/package.json +1 -1
- package/src/schemas/client.schema.ts +17 -1
- package/src/schemas/commission.schema.ts +3 -0
- package/src/schemas/profile.schema.ts +7 -0
- package/src/schemas/sale.schema.ts +51 -0
|
@@ -23,19 +23,20 @@
|
|
|
23
23
|
/// <reference types="mongoose/types/schematypes" />
|
|
24
24
|
/// <reference types="mongoose/types/inferschematype" />
|
|
25
25
|
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
26
|
-
import { HydratedDocument } from 'mongoose';
|
|
26
|
+
import { HydratedDocument, Schema as MongooseSchema, Types } from 'mongoose';
|
|
27
27
|
import { Party } from './party.schema';
|
|
28
|
+
import { Profile } from './profile.schema';
|
|
28
29
|
export type ClientDocument = HydratedDocument<Client>;
|
|
29
30
|
export declare class Cluster {
|
|
30
31
|
key: string;
|
|
31
32
|
label: string;
|
|
32
33
|
}
|
|
33
|
-
export declare const ClusterSchema:
|
|
34
|
-
_id:
|
|
34
|
+
export declare const ClusterSchema: MongooseSchema<Cluster, import("mongoose").Model<Cluster, any, any, any, import("mongoose").Document<unknown, any, Cluster, any, {}> & Cluster & {
|
|
35
|
+
_id: Types.ObjectId;
|
|
35
36
|
} & {
|
|
36
37
|
__v: number;
|
|
37
38
|
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, Cluster, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<Cluster>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<Cluster> & {
|
|
38
|
-
_id:
|
|
39
|
+
_id: Types.ObjectId;
|
|
39
40
|
} & {
|
|
40
41
|
__v: number;
|
|
41
42
|
}>;
|
|
@@ -43,12 +44,12 @@ export declare class Company {
|
|
|
43
44
|
legalName: string;
|
|
44
45
|
document: string;
|
|
45
46
|
}
|
|
46
|
-
export declare const CompanySchema:
|
|
47
|
-
_id:
|
|
47
|
+
export declare const CompanySchema: MongooseSchema<Company, import("mongoose").Model<Company, any, any, any, import("mongoose").Document<unknown, any, Company, any, {}> & Company & {
|
|
48
|
+
_id: Types.ObjectId;
|
|
48
49
|
} & {
|
|
49
50
|
__v: number;
|
|
50
51
|
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, Company, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<Company>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<Company> & {
|
|
51
|
-
_id:
|
|
52
|
+
_id: Types.ObjectId;
|
|
52
53
|
} & {
|
|
53
54
|
__v: number;
|
|
54
55
|
}>;
|
|
@@ -57,12 +58,12 @@ export declare class CommissionRange {
|
|
|
57
58
|
endValue: number;
|
|
58
59
|
percent: number;
|
|
59
60
|
}
|
|
60
|
-
export declare const CommissionRangeSchema:
|
|
61
|
-
_id:
|
|
61
|
+
export declare const CommissionRangeSchema: MongooseSchema<CommissionRange, import("mongoose").Model<CommissionRange, any, any, any, import("mongoose").Document<unknown, any, CommissionRange, any, {}> & CommissionRange & {
|
|
62
|
+
_id: Types.ObjectId;
|
|
62
63
|
} & {
|
|
63
64
|
__v: number;
|
|
64
65
|
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, CommissionRange, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<CommissionRange>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<CommissionRange> & {
|
|
65
|
-
_id:
|
|
66
|
+
_id: Types.ObjectId;
|
|
66
67
|
} & {
|
|
67
68
|
__v: number;
|
|
68
69
|
}>;
|
|
@@ -71,12 +72,12 @@ export declare class AgencyCommissionPeriod {
|
|
|
71
72
|
startDate: Date;
|
|
72
73
|
endDate: Date;
|
|
73
74
|
}
|
|
74
|
-
export declare const AgencyCommissionPeriodSchema:
|
|
75
|
-
_id:
|
|
75
|
+
export declare const AgencyCommissionPeriodSchema: MongooseSchema<AgencyCommissionPeriod, import("mongoose").Model<AgencyCommissionPeriod, any, any, any, import("mongoose").Document<unknown, any, AgencyCommissionPeriod, any, {}> & AgencyCommissionPeriod & {
|
|
76
|
+
_id: Types.ObjectId;
|
|
76
77
|
} & {
|
|
77
78
|
__v: number;
|
|
78
79
|
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, AgencyCommissionPeriod, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<AgencyCommissionPeriod>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<AgencyCommissionPeriod> & {
|
|
79
|
-
_id:
|
|
80
|
+
_id: Types.ObjectId;
|
|
80
81
|
} & {
|
|
81
82
|
__v: number;
|
|
82
83
|
}>;
|
|
@@ -85,12 +86,12 @@ export declare class NicheItem {
|
|
|
85
86
|
name: string;
|
|
86
87
|
parentId?: string;
|
|
87
88
|
}
|
|
88
|
-
export declare const NicheItemSchema:
|
|
89
|
-
_id:
|
|
89
|
+
export declare const NicheItemSchema: MongooseSchema<NicheItem, import("mongoose").Model<NicheItem, any, any, any, import("mongoose").Document<unknown, any, NicheItem, any, {}> & NicheItem & {
|
|
90
|
+
_id: Types.ObjectId;
|
|
90
91
|
} & {
|
|
91
92
|
__v: number;
|
|
92
93
|
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, NicheItem, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<NicheItem>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<NicheItem> & {
|
|
93
|
-
_id:
|
|
94
|
+
_id: Types.ObjectId;
|
|
94
95
|
} & {
|
|
95
96
|
__v: number;
|
|
96
97
|
}>;
|
|
@@ -99,12 +100,12 @@ export declare class Responsable {
|
|
|
99
100
|
team: string;
|
|
100
101
|
email: string;
|
|
101
102
|
}
|
|
102
|
-
export declare const ResponsableSchema:
|
|
103
|
-
_id:
|
|
103
|
+
export declare const ResponsableSchema: MongooseSchema<Responsable, import("mongoose").Model<Responsable, any, any, any, import("mongoose").Document<unknown, any, Responsable, any, {}> & Responsable & {
|
|
104
|
+
_id: Types.ObjectId;
|
|
104
105
|
} & {
|
|
105
106
|
__v: number;
|
|
106
107
|
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, Responsable, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<Responsable>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<Responsable> & {
|
|
107
|
-
_id:
|
|
108
|
+
_id: Types.ObjectId;
|
|
108
109
|
} & {
|
|
109
110
|
__v: number;
|
|
110
111
|
}>;
|
|
@@ -131,26 +132,28 @@ export declare class Client extends Party {
|
|
|
131
132
|
*/
|
|
132
133
|
hasGenIAAnalysis: boolean;
|
|
133
134
|
reportResponsable?: Responsable;
|
|
135
|
+
brandResponsable?: string;
|
|
136
|
+
profiles?: Types.ObjectId[] | Profile[];
|
|
134
137
|
}
|
|
135
|
-
export declare const ClientSchema:
|
|
136
|
-
_id:
|
|
138
|
+
export declare const ClientSchema: MongooseSchema<Client, import("mongoose").Model<Client, any, any, any, import("mongoose").Document<unknown, any, Client, any, {}> & Client & Required<{
|
|
139
|
+
_id: Types.ObjectId;
|
|
137
140
|
}> & {
|
|
138
141
|
__v: number;
|
|
139
142
|
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, Client, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<Client>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<Client> & Required<{
|
|
140
|
-
_id:
|
|
143
|
+
_id: Types.ObjectId;
|
|
141
144
|
}> & {
|
|
142
145
|
__v: number;
|
|
143
146
|
}>;
|
|
144
147
|
export declare const ClientModel: import("mongoose").Model<Client, {}, {}, {}, import("mongoose").Document<unknown, {}, Client, {}, import("mongoose").DefaultSchemaOptions> & Client & Required<{
|
|
145
|
-
_id:
|
|
148
|
+
_id: Types.ObjectId;
|
|
146
149
|
}> & {
|
|
147
150
|
__v: number;
|
|
148
|
-
},
|
|
149
|
-
_id:
|
|
151
|
+
}, MongooseSchema<Client, import("mongoose").Model<Client, any, any, any, import("mongoose").Document<unknown, any, Client, any, {}> & Client & Required<{
|
|
152
|
+
_id: Types.ObjectId;
|
|
150
153
|
}> & {
|
|
151
154
|
__v: number;
|
|
152
155
|
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, Client, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<Client>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<Client> & Required<{
|
|
153
|
-
_id:
|
|
156
|
+
_id: Types.ObjectId;
|
|
154
157
|
}> & {
|
|
155
158
|
__v: number;
|
|
156
159
|
}>>;
|
|
@@ -169,6 +169,16 @@ __decorate([
|
|
|
169
169
|
(0, mongoose_1.Prop)({ type: exports.ResponsableSchema, required: false }),
|
|
170
170
|
__metadata("design:type", Responsable)
|
|
171
171
|
], Client.prototype, "reportResponsable", void 0);
|
|
172
|
+
__decorate([
|
|
173
|
+
(0, mongoose_1.Prop)({ type: String, required: false }),
|
|
174
|
+
__metadata("design:type", String)
|
|
175
|
+
], Client.prototype, "brandResponsable", void 0);
|
|
176
|
+
__decorate([
|
|
177
|
+
(0, mongoose_1.Prop)([
|
|
178
|
+
{ type: mongoose_2.Schema.Types.ObjectId, ref: 'Profile', required: false },
|
|
179
|
+
]),
|
|
180
|
+
__metadata("design:type", Array)
|
|
181
|
+
], Client.prototype, "profiles", void 0);
|
|
172
182
|
Client = __decorate([
|
|
173
183
|
(0, mongoose_1.Schema)({ timestamps: true })
|
|
174
184
|
], Client);
|
|
@@ -96,6 +96,10 @@ __decorate([
|
|
|
96
96
|
(0, mongoose_1.Prop)({ type: String, required: false }),
|
|
97
97
|
__metadata("design:type", String)
|
|
98
98
|
], Commission.prototype, "description", void 0);
|
|
99
|
+
__decorate([
|
|
100
|
+
(0, mongoose_1.Prop)({ type: String, required: false }),
|
|
101
|
+
__metadata("design:type", String)
|
|
102
|
+
], Commission.prototype, "reason", void 0);
|
|
99
103
|
__decorate([
|
|
100
104
|
(0, mongoose_1.Prop)({ type: Date, default: Date.now, required: false }),
|
|
101
105
|
__metadata("design:type", Date)
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
26
26
|
import { HydratedDocument, Schema as MongooseSchema, Types } from 'mongoose';
|
|
27
27
|
import { Influencer } from './influencer.schema';
|
|
28
|
+
import { Client } from './client.schema';
|
|
28
29
|
export type ProfileDocument = HydratedDocument<Profile>;
|
|
29
30
|
export declare class Profile {
|
|
30
31
|
_id?: Types.ObjectId;
|
|
@@ -37,6 +38,7 @@ export declare class Profile {
|
|
|
37
38
|
socialnetwork: string;
|
|
38
39
|
type: string;
|
|
39
40
|
influencer: Types.ObjectId | Influencer;
|
|
41
|
+
client?: Types.ObjectId | Client;
|
|
40
42
|
createdAt?: Date;
|
|
41
43
|
updatedAt?: Date;
|
|
42
44
|
}
|
|
@@ -54,6 +54,10 @@ __decorate([
|
|
|
54
54
|
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, ref: 'Influencer' }),
|
|
55
55
|
__metadata("design:type", Object)
|
|
56
56
|
], Profile.prototype, "influencer", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, ref: 'Client', required: false }),
|
|
59
|
+
__metadata("design:type", Object)
|
|
60
|
+
], Profile.prototype, "client", void 0);
|
|
57
61
|
__decorate([
|
|
58
62
|
(0, mongoose_1.Prop)({ default: Date.now, required: false }),
|
|
59
63
|
__metadata("design:type", Date)
|
|
@@ -68,6 +72,7 @@ Profile = __decorate([
|
|
|
68
72
|
exports.Profile = Profile;
|
|
69
73
|
exports.ProfileSchema = mongoose_1.SchemaFactory.createForClass(Profile);
|
|
70
74
|
exports.ProfileSchema.index({ influencer: 1 });
|
|
75
|
+
exports.ProfileSchema.index({ client: 1 }, { sparse: true });
|
|
71
76
|
exports.ProfileSchema.index({ username: 1 });
|
|
72
77
|
exports.ProfileSchema.index({ username: 1, influencer: 1 });
|
|
73
78
|
exports.ProfileModel = (0, mongoose_2.model)('Profile', exports.ProfileSchema);
|
|
@@ -117,6 +117,23 @@ export declare class Inbox {
|
|
|
117
117
|
bodyHtml?: string;
|
|
118
118
|
receivedAt: Date;
|
|
119
119
|
}
|
|
120
|
+
export declare class SaleResponsables {
|
|
121
|
+
curation?: {
|
|
122
|
+
team: string;
|
|
123
|
+
name: string;
|
|
124
|
+
email: string;
|
|
125
|
+
};
|
|
126
|
+
planning?: {
|
|
127
|
+
team: string;
|
|
128
|
+
name: string;
|
|
129
|
+
email: string;
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
export declare class SaleLinks {
|
|
133
|
+
contract?: string;
|
|
134
|
+
clientSheet?: string;
|
|
135
|
+
internalSheet?: string;
|
|
136
|
+
}
|
|
120
137
|
export declare class Sale {
|
|
121
138
|
_id?: Types.ObjectId;
|
|
122
139
|
title: string;
|
|
@@ -138,6 +155,8 @@ export declare class Sale {
|
|
|
138
155
|
createdAt?: Date;
|
|
139
156
|
updatedAt?: Date;
|
|
140
157
|
omieId?: string;
|
|
158
|
+
responsables?: SaleResponsables;
|
|
159
|
+
links?: SaleLinks;
|
|
141
160
|
}
|
|
142
161
|
export declare const SaleSchema: MongooseSchema<Sale, import("mongoose").Model<Sale, any, any, any, import("mongoose").Document<unknown, any, Sale, any, {}> & Sale & Required<{
|
|
143
162
|
_id: Types.ObjectId;
|
|
@@ -9,7 +9,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.SaleModel = exports.SaleSchema = exports.Sale = exports.Inbox = exports.CommissionInfo = exports.CommissionParticipant = exports.TimelineEntry = exports.Activity = exports.Lost = exports.Formalization = exports.Negotiation = exports.Proposal = void 0;
|
|
12
|
+
exports.SaleModel = exports.SaleSchema = exports.Sale = exports.SaleLinks = exports.SaleResponsables = exports.Inbox = exports.CommissionInfo = exports.CommissionParticipant = exports.TimelineEntry = exports.Activity = exports.Lost = exports.Formalization = exports.Negotiation = exports.Proposal = void 0;
|
|
13
13
|
const mongoose_1 = require("@nestjs/mongoose");
|
|
14
14
|
const mongoose_2 = require("mongoose");
|
|
15
15
|
const note_schema_1 = require("./note.schema");
|
|
@@ -351,6 +351,54 @@ Inbox = __decorate([
|
|
|
351
351
|
(0, mongoose_1.Schema)({ _id: false })
|
|
352
352
|
], Inbox);
|
|
353
353
|
exports.Inbox = Inbox;
|
|
354
|
+
let SaleResponsables = class SaleResponsables {
|
|
355
|
+
};
|
|
356
|
+
__decorate([
|
|
357
|
+
(0, mongoose_1.Prop)({
|
|
358
|
+
_id: false,
|
|
359
|
+
required: false,
|
|
360
|
+
type: {
|
|
361
|
+
team: String,
|
|
362
|
+
name: String,
|
|
363
|
+
email: String,
|
|
364
|
+
},
|
|
365
|
+
}),
|
|
366
|
+
__metadata("design:type", Object)
|
|
367
|
+
], SaleResponsables.prototype, "curation", void 0);
|
|
368
|
+
__decorate([
|
|
369
|
+
(0, mongoose_1.Prop)({
|
|
370
|
+
_id: false,
|
|
371
|
+
required: false,
|
|
372
|
+
type: {
|
|
373
|
+
team: String,
|
|
374
|
+
name: String,
|
|
375
|
+
email: String,
|
|
376
|
+
},
|
|
377
|
+
}),
|
|
378
|
+
__metadata("design:type", Object)
|
|
379
|
+
], SaleResponsables.prototype, "planning", void 0);
|
|
380
|
+
SaleResponsables = __decorate([
|
|
381
|
+
(0, mongoose_1.Schema)({ _id: false })
|
|
382
|
+
], SaleResponsables);
|
|
383
|
+
exports.SaleResponsables = SaleResponsables;
|
|
384
|
+
let SaleLinks = class SaleLinks {
|
|
385
|
+
};
|
|
386
|
+
__decorate([
|
|
387
|
+
(0, mongoose_1.Prop)({ required: false }),
|
|
388
|
+
__metadata("design:type", String)
|
|
389
|
+
], SaleLinks.prototype, "contract", void 0);
|
|
390
|
+
__decorate([
|
|
391
|
+
(0, mongoose_1.Prop)({ required: false }),
|
|
392
|
+
__metadata("design:type", String)
|
|
393
|
+
], SaleLinks.prototype, "clientSheet", void 0);
|
|
394
|
+
__decorate([
|
|
395
|
+
(0, mongoose_1.Prop)({ required: false }),
|
|
396
|
+
__metadata("design:type", String)
|
|
397
|
+
], SaleLinks.prototype, "internalSheet", void 0);
|
|
398
|
+
SaleLinks = __decorate([
|
|
399
|
+
(0, mongoose_1.Schema)({ _id: false })
|
|
400
|
+
], SaleLinks);
|
|
401
|
+
exports.SaleLinks = SaleLinks;
|
|
354
402
|
let Sale = class Sale {
|
|
355
403
|
};
|
|
356
404
|
__decorate([
|
|
@@ -461,6 +509,14 @@ __decorate([
|
|
|
461
509
|
(0, mongoose_1.Prop)({ type: String, required: false }),
|
|
462
510
|
__metadata("design:type", String)
|
|
463
511
|
], Sale.prototype, "omieId", void 0);
|
|
512
|
+
__decorate([
|
|
513
|
+
(0, mongoose_1.Prop)({ type: SaleResponsables, required: false }),
|
|
514
|
+
__metadata("design:type", SaleResponsables)
|
|
515
|
+
], Sale.prototype, "responsables", void 0);
|
|
516
|
+
__decorate([
|
|
517
|
+
(0, mongoose_1.Prop)({ type: SaleLinks, required: false }),
|
|
518
|
+
__metadata("design:type", SaleLinks)
|
|
519
|
+
], Sale.prototype, "links", void 0);
|
|
464
520
|
Sale = __decorate([
|
|
465
521
|
(0, mongoose_1.Schema)({ timestamps: true })
|
|
466
522
|
], Sale);
|
package/package.json
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
|
|
2
2
|
import { ApiProperty } from '@nestjs/swagger';
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
HydratedDocument,
|
|
5
|
+
model as MongooseModel,
|
|
6
|
+
Schema as MongooseSchema,
|
|
7
|
+
Types,
|
|
8
|
+
} from 'mongoose';
|
|
4
9
|
import { Party } from './party.schema';
|
|
10
|
+
import { Profile } from './profile.schema';
|
|
5
11
|
|
|
6
12
|
export type ClientDocument = HydratedDocument<Client>;
|
|
7
13
|
|
|
@@ -133,6 +139,16 @@ export class Client extends Party {
|
|
|
133
139
|
|
|
134
140
|
@Prop({ type: ResponsableSchema, required: false })
|
|
135
141
|
reportResponsable?: Responsable;
|
|
142
|
+
|
|
143
|
+
@Prop({ type: String, required: false })
|
|
144
|
+
brandResponsable?: string;
|
|
145
|
+
|
|
146
|
+
// Perfis da marca nas redes sociais (mesmo vínculo de Influencer.profiles).
|
|
147
|
+
// Usado pelo comment-capture-worker pra reconhecer comentário da própria marca.
|
|
148
|
+
@Prop([
|
|
149
|
+
{ type: MongooseSchema.Types.ObjectId, ref: 'Profile', required: false },
|
|
150
|
+
])
|
|
151
|
+
profiles?: Types.ObjectId[] | Profile[];
|
|
136
152
|
}
|
|
137
153
|
|
|
138
154
|
export const ClientSchema = SchemaFactory.createForClass(Client);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
|
|
2
2
|
import { HydratedDocument, Schema as MongooseSchema, Types, model as MongooseModel } from 'mongoose';
|
|
3
3
|
import { Influencer } from './influencer.schema';
|
|
4
|
+
import { Client } from './client.schema';
|
|
4
5
|
|
|
5
6
|
export type ProfileDocument = HydratedDocument<Profile>;
|
|
6
7
|
|
|
@@ -37,6 +38,11 @@ export class Profile {
|
|
|
37
38
|
@Prop({ type: MongooseSchema.Types.ObjectId, ref: 'Influencer' })
|
|
38
39
|
influencer: Types.ObjectId | Influencer;
|
|
39
40
|
|
|
41
|
+
// Perfil da própria marca (ex.: @marca no Instagram). Um perfil pertence a um
|
|
42
|
+
// Influencer OU a um Client, nunca aos dois.
|
|
43
|
+
@Prop({ type: MongooseSchema.Types.ObjectId, ref: 'Client', required: false })
|
|
44
|
+
client?: Types.ObjectId | Client;
|
|
45
|
+
|
|
40
46
|
@Prop({ default: Date.now, required: false })
|
|
41
47
|
createdAt?: Date;
|
|
42
48
|
|
|
@@ -47,6 +53,7 @@ export class Profile {
|
|
|
47
53
|
export const ProfileSchema = SchemaFactory.createForClass(Profile);
|
|
48
54
|
|
|
49
55
|
ProfileSchema.index({ influencer: 1 });
|
|
56
|
+
ProfileSchema.index({ client: 1 }, { sparse: true });
|
|
50
57
|
ProfileSchema.index({ username: 1 });
|
|
51
58
|
ProfileSchema.index({ username: 1, influencer: 1 });
|
|
52
59
|
|
|
@@ -168,6 +168,51 @@ export class Inbox {
|
|
|
168
168
|
@Prop({ required: true }) receivedAt: Date;
|
|
169
169
|
}
|
|
170
170
|
|
|
171
|
+
@Schema({ _id: false })
|
|
172
|
+
export class SaleResponsables {
|
|
173
|
+
@Prop({
|
|
174
|
+
_id: false,
|
|
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
|
+
};
|
|
187
|
+
|
|
188
|
+
@Prop({
|
|
189
|
+
_id: false,
|
|
190
|
+
required: false,
|
|
191
|
+
type: {
|
|
192
|
+
team: String,
|
|
193
|
+
name: String,
|
|
194
|
+
email: String,
|
|
195
|
+
},
|
|
196
|
+
})
|
|
197
|
+
planning?: {
|
|
198
|
+
team: string;
|
|
199
|
+
name: string;
|
|
200
|
+
email: string;
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
@Schema({ _id: false })
|
|
205
|
+
export class SaleLinks {
|
|
206
|
+
@Prop({ required: false })
|
|
207
|
+
contract?: string;
|
|
208
|
+
|
|
209
|
+
@Prop({ required: false })
|
|
210
|
+
clientSheet?: string;
|
|
211
|
+
|
|
212
|
+
@Prop({ required: false })
|
|
213
|
+
internalSheet?: string;
|
|
214
|
+
}
|
|
215
|
+
|
|
171
216
|
@Schema({ timestamps: true })
|
|
172
217
|
export class Sale {
|
|
173
218
|
@Prop({ type: MongooseSchema.Types.ObjectId, auto: true, required: false })
|
|
@@ -260,6 +305,12 @@ export class Sale {
|
|
|
260
305
|
|
|
261
306
|
@Prop({ type: String, required: false })
|
|
262
307
|
omieId?: string;
|
|
308
|
+
|
|
309
|
+
@Prop({ type: SaleResponsables, required: false })
|
|
310
|
+
responsables?: SaleResponsables;
|
|
311
|
+
|
|
312
|
+
@Prop({ type: SaleLinks, required: false })
|
|
313
|
+
links?: SaleLinks;
|
|
263
314
|
}
|
|
264
315
|
|
|
265
316
|
export const SaleSchema = SchemaFactory.createForClass(Sale);
|