@grapadigital/shared-schemas 1.0.202 → 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.
|
@@ -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
|
}>;
|
|
@@ -132,26 +133,27 @@ export declare class Client extends Party {
|
|
|
132
133
|
hasGenIAAnalysis: boolean;
|
|
133
134
|
reportResponsable?: Responsable;
|
|
134
135
|
brandResponsable?: string;
|
|
136
|
+
profiles?: Types.ObjectId[] | Profile[];
|
|
135
137
|
}
|
|
136
|
-
export declare const ClientSchema:
|
|
137
|
-
_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;
|
|
138
140
|
}> & {
|
|
139
141
|
__v: number;
|
|
140
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<{
|
|
141
|
-
_id:
|
|
143
|
+
_id: Types.ObjectId;
|
|
142
144
|
}> & {
|
|
143
145
|
__v: number;
|
|
144
146
|
}>;
|
|
145
147
|
export declare const ClientModel: import("mongoose").Model<Client, {}, {}, {}, import("mongoose").Document<unknown, {}, Client, {}, import("mongoose").DefaultSchemaOptions> & Client & Required<{
|
|
146
|
-
_id:
|
|
148
|
+
_id: Types.ObjectId;
|
|
147
149
|
}> & {
|
|
148
150
|
__v: number;
|
|
149
|
-
},
|
|
150
|
-
_id:
|
|
151
|
+
}, MongooseSchema<Client, import("mongoose").Model<Client, any, any, any, import("mongoose").Document<unknown, any, Client, any, {}> & Client & Required<{
|
|
152
|
+
_id: Types.ObjectId;
|
|
151
153
|
}> & {
|
|
152
154
|
__v: number;
|
|
153
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<{
|
|
154
|
-
_id:
|
|
156
|
+
_id: Types.ObjectId;
|
|
155
157
|
}> & {
|
|
156
158
|
__v: number;
|
|
157
159
|
}>>;
|
|
@@ -173,6 +173,12 @@ __decorate([
|
|
|
173
173
|
(0, mongoose_1.Prop)({ type: String, required: false }),
|
|
174
174
|
__metadata("design:type", String)
|
|
175
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);
|
|
176
182
|
Client = __decorate([
|
|
177
183
|
(0, mongoose_1.Schema)({ timestamps: true })
|
|
178
184
|
], Client);
|
|
@@ -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);
|
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
|
|
|
@@ -136,6 +142,13 @@ export class Client extends Party {
|
|
|
136
142
|
|
|
137
143
|
@Prop({ type: String, required: false })
|
|
138
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[];
|
|
139
152
|
}
|
|
140
153
|
|
|
141
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
|
|