@grapadigital/shared-schemas 1.0.120 → 1.0.122
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.
|
@@ -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.PaymentModel = exports.PaymentSchema = exports.Payment = exports.AttachmentSchema = exports.Attachment = exports.NoteSchema = exports.
|
|
12
|
+
exports.PaymentModel = exports.PaymentSchema = exports.Payment = exports.AttachmentSchema = exports.Attachment = exports.NoteSchema = exports.CanceledSchema = exports.Canceled = exports.PaidSchema = exports.Paid = exports.QueuedSchema = exports.Queued = exports.RequestedSchema = exports.Requested = exports.PendingSchema = exports.Pending = exports.ReviewSchema = exports.Review = void 0;
|
|
13
13
|
const mongoose_1 = require("@nestjs/mongoose");
|
|
14
14
|
const swagger_1 = require("@nestjs/swagger");
|
|
15
15
|
const mongoose_2 = require("mongoose");
|
|
@@ -247,7 +247,6 @@ __decorate([
|
|
|
247
247
|
Note = __decorate([
|
|
248
248
|
(0, mongoose_1.Schema)({ _id: false })
|
|
249
249
|
], Note);
|
|
250
|
-
exports.Note = Note;
|
|
251
250
|
exports.NoteSchema = mongoose_1.SchemaFactory.createForClass(Note);
|
|
252
251
|
let Attachment = class Attachment {
|
|
253
252
|
};
|
|
@@ -26,9 +26,6 @@
|
|
|
26
26
|
import { HydratedDocument, Schema as MongooseSchema, Types } from 'mongoose';
|
|
27
27
|
import { Profile } from './profile.schema';
|
|
28
28
|
import { Client } from './client.schema';
|
|
29
|
-
import { Action } from './action.schema';
|
|
30
|
-
import { Payment } from './payment.schema';
|
|
31
|
-
import { Invoice } from './invoice.schema';
|
|
32
29
|
export type SaleDocument = HydratedDocument<Sale>;
|
|
33
30
|
export declare class Screening {
|
|
34
31
|
subject: string;
|
|
@@ -41,6 +38,7 @@ export declare class Proposal {
|
|
|
41
38
|
businessUnit: 'enterprise' | 'artistic';
|
|
42
39
|
contact: string;
|
|
43
40
|
initialScope: string;
|
|
41
|
+
type: 'inbound' | 'outbound';
|
|
44
42
|
profile?: Types.ObjectId | Profile;
|
|
45
43
|
responsable: {
|
|
46
44
|
team: string;
|
|
@@ -94,6 +92,18 @@ declare class Note {
|
|
|
94
92
|
owner: string;
|
|
95
93
|
createdAt: Date;
|
|
96
94
|
}
|
|
95
|
+
export declare class CommissionParticipant {
|
|
96
|
+
email: string;
|
|
97
|
+
role: string;
|
|
98
|
+
percent: number;
|
|
99
|
+
value: number;
|
|
100
|
+
}
|
|
101
|
+
export declare class CommissionInfo {
|
|
102
|
+
marginPercent: number;
|
|
103
|
+
commissionPercent: number;
|
|
104
|
+
totalCommissionValue: number;
|
|
105
|
+
participants: CommissionParticipant[];
|
|
106
|
+
}
|
|
97
107
|
export declare class Sale {
|
|
98
108
|
_id?: Types.ObjectId;
|
|
99
109
|
title: string;
|
|
@@ -104,11 +114,9 @@ export declare class Sale {
|
|
|
104
114
|
formalization?: Formalization;
|
|
105
115
|
lost?: Lost;
|
|
106
116
|
notes?: Note[];
|
|
117
|
+
commission?: CommissionInfo;
|
|
107
118
|
tags?: string[];
|
|
108
119
|
profiles?: Types.ObjectId[] | Profile[];
|
|
109
|
-
invoices?: Types.ObjectId[] | Invoice[];
|
|
110
|
-
actions?: Types.ObjectId[] | Action[];
|
|
111
|
-
payments?: Types.ObjectId[] | Payment[];
|
|
112
120
|
closedAt?: Date;
|
|
113
121
|
createdAt?: Date;
|
|
114
122
|
updatedAt?: Date;
|
|
@@ -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.Lost = exports.Formalization = exports.Negotiation = exports.Proposal = exports.Screening = void 0;
|
|
12
|
+
exports.SaleModel = exports.SaleSchema = exports.Sale = exports.CommissionInfo = exports.CommissionParticipant = exports.Lost = exports.Formalization = exports.Negotiation = exports.Proposal = exports.Screening = void 0;
|
|
13
13
|
const mongoose_1 = require("@nestjs/mongoose");
|
|
14
14
|
const mongoose_2 = require("mongoose");
|
|
15
15
|
let Screening = class Screening {
|
|
@@ -53,7 +53,19 @@ __decorate([
|
|
|
53
53
|
__metadata("design:type", String)
|
|
54
54
|
], Proposal.prototype, "initialScope", void 0);
|
|
55
55
|
__decorate([
|
|
56
|
-
(0, mongoose_1.Prop)({
|
|
56
|
+
(0, mongoose_1.Prop)({
|
|
57
|
+
type: String,
|
|
58
|
+
enum: ['inbound', 'outbound'],
|
|
59
|
+
required: true
|
|
60
|
+
}),
|
|
61
|
+
__metadata("design:type", String)
|
|
62
|
+
], Proposal.prototype, "type", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, mongoose_1.Prop)({
|
|
65
|
+
type: mongoose_2.Schema.Types.ObjectId,
|
|
66
|
+
ref: 'Profile',
|
|
67
|
+
required: false
|
|
68
|
+
}),
|
|
57
69
|
__metadata("design:type", Object)
|
|
58
70
|
], Proposal.prototype, "profile", void 0);
|
|
59
71
|
__decorate([
|
|
@@ -63,8 +75,8 @@ __decorate([
|
|
|
63
75
|
type: {
|
|
64
76
|
team: String,
|
|
65
77
|
name: String,
|
|
66
|
-
email: String
|
|
67
|
-
}
|
|
78
|
+
email: String
|
|
79
|
+
}
|
|
68
80
|
}),
|
|
69
81
|
__metadata("design:type", Object)
|
|
70
82
|
], Proposal.prototype, "responsable", void 0);
|
|
@@ -247,6 +259,50 @@ __decorate([
|
|
|
247
259
|
Note = __decorate([
|
|
248
260
|
(0, mongoose_1.Schema)({ _id: false })
|
|
249
261
|
], Note);
|
|
262
|
+
let CommissionParticipant = class CommissionParticipant {
|
|
263
|
+
};
|
|
264
|
+
__decorate([
|
|
265
|
+
(0, mongoose_1.Prop)({ required: true }),
|
|
266
|
+
__metadata("design:type", String)
|
|
267
|
+
], CommissionParticipant.prototype, "email", void 0);
|
|
268
|
+
__decorate([
|
|
269
|
+
(0, mongoose_1.Prop)({ required: true }),
|
|
270
|
+
__metadata("design:type", String)
|
|
271
|
+
], CommissionParticipant.prototype, "role", void 0);
|
|
272
|
+
__decorate([
|
|
273
|
+
(0, mongoose_1.Prop)({ required: true }),
|
|
274
|
+
__metadata("design:type", Number)
|
|
275
|
+
], CommissionParticipant.prototype, "percent", void 0);
|
|
276
|
+
__decorate([
|
|
277
|
+
(0, mongoose_1.Prop)({ required: true }),
|
|
278
|
+
__metadata("design:type", Number)
|
|
279
|
+
], CommissionParticipant.prototype, "value", void 0);
|
|
280
|
+
CommissionParticipant = __decorate([
|
|
281
|
+
(0, mongoose_1.Schema)({ _id: false })
|
|
282
|
+
], CommissionParticipant);
|
|
283
|
+
exports.CommissionParticipant = CommissionParticipant;
|
|
284
|
+
let CommissionInfo = class CommissionInfo {
|
|
285
|
+
};
|
|
286
|
+
__decorate([
|
|
287
|
+
(0, mongoose_1.Prop)({ required: true }),
|
|
288
|
+
__metadata("design:type", Number)
|
|
289
|
+
], CommissionInfo.prototype, "marginPercent", void 0);
|
|
290
|
+
__decorate([
|
|
291
|
+
(0, mongoose_1.Prop)({ required: true }),
|
|
292
|
+
__metadata("design:type", Number)
|
|
293
|
+
], CommissionInfo.prototype, "commissionPercent", void 0);
|
|
294
|
+
__decorate([
|
|
295
|
+
(0, mongoose_1.Prop)({ required: true }),
|
|
296
|
+
__metadata("design:type", Number)
|
|
297
|
+
], CommissionInfo.prototype, "totalCommissionValue", void 0);
|
|
298
|
+
__decorate([
|
|
299
|
+
(0, mongoose_1.Prop)({ type: [CommissionParticipant], required: true }),
|
|
300
|
+
__metadata("design:type", Array)
|
|
301
|
+
], CommissionInfo.prototype, "participants", void 0);
|
|
302
|
+
CommissionInfo = __decorate([
|
|
303
|
+
(0, mongoose_1.Schema)({ _id: false })
|
|
304
|
+
], CommissionInfo);
|
|
305
|
+
exports.CommissionInfo = CommissionInfo;
|
|
250
306
|
let Sale = class Sale {
|
|
251
307
|
};
|
|
252
308
|
__decorate([
|
|
@@ -267,7 +323,7 @@ __decorate([
|
|
|
267
323
|
'formalization',
|
|
268
324
|
'closed',
|
|
269
325
|
'lost'
|
|
270
|
-
]
|
|
326
|
+
]
|
|
271
327
|
}),
|
|
272
328
|
__metadata("design:type", String)
|
|
273
329
|
], Sale.prototype, "phase", void 0);
|
|
@@ -295,6 +351,10 @@ __decorate([
|
|
|
295
351
|
(0, mongoose_1.Prop)([{ type: Note, required: false }]),
|
|
296
352
|
__metadata("design:type", Array)
|
|
297
353
|
], Sale.prototype, "notes", void 0);
|
|
354
|
+
__decorate([
|
|
355
|
+
(0, mongoose_1.Prop)({ type: CommissionInfo, required: false }),
|
|
356
|
+
__metadata("design:type", CommissionInfo)
|
|
357
|
+
], Sale.prototype, "commission", void 0);
|
|
298
358
|
__decorate([
|
|
299
359
|
(0, mongoose_1.Prop)({ type: [String], required: false, default: [] }),
|
|
300
360
|
__metadata("design:type", Array)
|
|
@@ -304,41 +364,11 @@ __decorate([
|
|
|
304
364
|
{
|
|
305
365
|
type: mongoose_2.Schema.Types.ObjectId,
|
|
306
366
|
ref: 'Profile',
|
|
307
|
-
required: false
|
|
308
|
-
}
|
|
367
|
+
required: false
|
|
368
|
+
}
|
|
309
369
|
]),
|
|
310
370
|
__metadata("design:type", Array)
|
|
311
371
|
], Sale.prototype, "profiles", void 0);
|
|
312
|
-
__decorate([
|
|
313
|
-
(0, mongoose_1.Prop)([
|
|
314
|
-
{
|
|
315
|
-
type: mongoose_2.Schema.Types.ObjectId,
|
|
316
|
-
ref: 'Invoice',
|
|
317
|
-
required: false,
|
|
318
|
-
},
|
|
319
|
-
]),
|
|
320
|
-
__metadata("design:type", Array)
|
|
321
|
-
], Sale.prototype, "invoices", void 0);
|
|
322
|
-
__decorate([
|
|
323
|
-
(0, mongoose_1.Prop)([
|
|
324
|
-
{
|
|
325
|
-
type: mongoose_2.Schema.Types.ObjectId,
|
|
326
|
-
ref: 'Action',
|
|
327
|
-
required: false,
|
|
328
|
-
},
|
|
329
|
-
]),
|
|
330
|
-
__metadata("design:type", Array)
|
|
331
|
-
], Sale.prototype, "actions", void 0);
|
|
332
|
-
__decorate([
|
|
333
|
-
(0, mongoose_1.Prop)([
|
|
334
|
-
{
|
|
335
|
-
type: mongoose_2.Schema.Types.ObjectId,
|
|
336
|
-
ref: 'Payment',
|
|
337
|
-
required: false,
|
|
338
|
-
},
|
|
339
|
-
]),
|
|
340
|
-
__metadata("design:type", Array)
|
|
341
|
-
], Sale.prototype, "payments", void 0);
|
|
342
372
|
__decorate([
|
|
343
373
|
(0, mongoose_1.Prop)({ required: false }),
|
|
344
374
|
__metadata("design:type", Date)
|
package/package.json
CHANGED
|
@@ -174,7 +174,7 @@ export class Canceled {
|
|
|
174
174
|
export const CanceledSchema = SchemaFactory.createForClass(Canceled);
|
|
175
175
|
|
|
176
176
|
@Schema({ _id: false })
|
|
177
|
-
|
|
177
|
+
class Note {
|
|
178
178
|
@ApiProperty({ example: 'Solicitar documento adicional' })
|
|
179
179
|
@Prop() text: string;
|
|
180
180
|
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
HydratedDocument,
|
|
4
|
+
Schema as MongooseSchema,
|
|
5
|
+
Types,
|
|
6
|
+
model as MongooseModel
|
|
7
|
+
} from 'mongoose';
|
|
3
8
|
import { Profile } from './profile.schema';
|
|
4
9
|
import { Client } from './client.schema';
|
|
5
|
-
import { Action } from './action.schema';
|
|
6
|
-
import { Payment } from './payment.schema';
|
|
7
|
-
import { Invoice } from './invoice.schema';
|
|
8
10
|
|
|
9
11
|
export type SaleDocument = HydratedDocument<Sale>;
|
|
10
12
|
|
|
@@ -22,8 +24,19 @@ export class Proposal {
|
|
|
22
24
|
@Prop({ required: true }) businessUnit: 'enterprise' | 'artistic';
|
|
23
25
|
@Prop({ required: true }) contact: string;
|
|
24
26
|
@Prop({ required: true }) initialScope: string;
|
|
25
|
-
|
|
26
|
-
@Prop({
|
|
27
|
+
|
|
28
|
+
@Prop({
|
|
29
|
+
type: String,
|
|
30
|
+
enum: ['inbound', 'outbound'],
|
|
31
|
+
required: true
|
|
32
|
+
})
|
|
33
|
+
type: 'inbound' | 'outbound';
|
|
34
|
+
|
|
35
|
+
@Prop({
|
|
36
|
+
type: MongooseSchema.Types.ObjectId,
|
|
37
|
+
ref: 'Profile',
|
|
38
|
+
required: false
|
|
39
|
+
})
|
|
27
40
|
profile?: Types.ObjectId | Profile;
|
|
28
41
|
|
|
29
42
|
@Prop({
|
|
@@ -32,8 +45,8 @@ export class Proposal {
|
|
|
32
45
|
type: {
|
|
33
46
|
team: String,
|
|
34
47
|
name: String,
|
|
35
|
-
email: String
|
|
36
|
-
}
|
|
48
|
+
email: String
|
|
49
|
+
}
|
|
37
50
|
})
|
|
38
51
|
responsable: {
|
|
39
52
|
team: string;
|
|
@@ -44,14 +57,27 @@ export class Proposal {
|
|
|
44
57
|
|
|
45
58
|
@Schema({ _id: false })
|
|
46
59
|
export class Negotiation {
|
|
47
|
-
@Prop({ required: true }) calculatorType:
|
|
60
|
+
@Prop({ required: true }) calculatorType:
|
|
61
|
+
| 'withPreDefinedBudget'
|
|
62
|
+
| 'withoutPreDefinedBudget'
|
|
63
|
+
| 'bourbon';
|
|
48
64
|
@Prop({ required: false }) childPermit?: boolean;
|
|
49
65
|
@Prop({ required: false }) childPermitValue?: number;
|
|
50
|
-
@Prop({ required: false }) childPermitMethod?:
|
|
66
|
+
@Prop({ required: false }) childPermitMethod?:
|
|
67
|
+
| 'direct'
|
|
68
|
+
| 'debit_note'
|
|
69
|
+
| 'client';
|
|
51
70
|
@Prop({ required: true }) influencerBroadcastValue: number;
|
|
52
|
-
@Prop({ required: true }) influencerBroadcastMethod:
|
|
71
|
+
@Prop({ required: true }) influencerBroadcastMethod:
|
|
72
|
+
| 'transfer'
|
|
73
|
+
| 'direct'
|
|
74
|
+
| 'debit_note'
|
|
75
|
+
| 'client';
|
|
53
76
|
@Prop({ required: true }) productionAndOthersValue: number;
|
|
54
|
-
@Prop({ required: true }) productionAndOthersMethod:
|
|
77
|
+
@Prop({ required: true }) productionAndOthersMethod:
|
|
78
|
+
| 'direct'
|
|
79
|
+
| 'debit_note'
|
|
80
|
+
| 'client';
|
|
55
81
|
@Prop({ required: true }) commissionRate: number;
|
|
56
82
|
@Prop({ required: true }) broadcastBonusRate: number;
|
|
57
83
|
@Prop({ required: true }) taxRate: number;
|
|
@@ -102,6 +128,24 @@ class Note {
|
|
|
102
128
|
@Prop({ required: true }) createdAt: Date;
|
|
103
129
|
}
|
|
104
130
|
|
|
131
|
+
@Schema({ _id: false })
|
|
132
|
+
export class CommissionParticipant {
|
|
133
|
+
@Prop({ required: true }) email: string;
|
|
134
|
+
@Prop({ required: true }) role: string;
|
|
135
|
+
@Prop({ required: true }) percent: number;
|
|
136
|
+
@Prop({ required: true }) value: number;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
@Schema({ _id: false })
|
|
140
|
+
export class CommissionInfo {
|
|
141
|
+
@Prop({ required: true }) marginPercent: number;
|
|
142
|
+
@Prop({ required: true }) commissionPercent: number;
|
|
143
|
+
@Prop({ required: true }) totalCommissionValue: number;
|
|
144
|
+
|
|
145
|
+
@Prop({ type: [CommissionParticipant], required: true })
|
|
146
|
+
participants: CommissionParticipant[];
|
|
147
|
+
}
|
|
148
|
+
|
|
105
149
|
@Schema({ timestamps: true })
|
|
106
150
|
export class Sale {
|
|
107
151
|
@Prop({ type: MongooseSchema.Types.ObjectId, auto: true, required: false })
|
|
@@ -118,9 +162,15 @@ export class Sale {
|
|
|
118
162
|
'formalization',
|
|
119
163
|
'closed',
|
|
120
164
|
'lost'
|
|
121
|
-
]
|
|
165
|
+
]
|
|
122
166
|
})
|
|
123
|
-
phase:
|
|
167
|
+
phase:
|
|
168
|
+
| 'screening'
|
|
169
|
+
| 'proposal'
|
|
170
|
+
| 'negotiation'
|
|
171
|
+
| 'formalization'
|
|
172
|
+
| 'closed'
|
|
173
|
+
| 'lost';
|
|
124
174
|
|
|
125
175
|
@Prop({ type: Screening }) screening?: Screening;
|
|
126
176
|
@Prop({ type: Proposal }) proposal?: Proposal;
|
|
@@ -131,6 +181,9 @@ export class Sale {
|
|
|
131
181
|
@Prop([{ type: Note, required: false }])
|
|
132
182
|
notes?: Note[];
|
|
133
183
|
|
|
184
|
+
@Prop({ type: CommissionInfo, required: false })
|
|
185
|
+
commission?: CommissionInfo;
|
|
186
|
+
|
|
134
187
|
@Prop({ type: [String], required: false, default: [] })
|
|
135
188
|
tags?: string[];
|
|
136
189
|
|
|
@@ -138,38 +191,11 @@ export class Sale {
|
|
|
138
191
|
{
|
|
139
192
|
type: MongooseSchema.Types.ObjectId,
|
|
140
193
|
ref: 'Profile',
|
|
141
|
-
required: false
|
|
142
|
-
}
|
|
194
|
+
required: false
|
|
195
|
+
}
|
|
143
196
|
])
|
|
144
197
|
profiles?: Types.ObjectId[] | Profile[];
|
|
145
198
|
|
|
146
|
-
@Prop([
|
|
147
|
-
{
|
|
148
|
-
type: MongooseSchema.Types.ObjectId,
|
|
149
|
-
ref: 'Invoice',
|
|
150
|
-
required: false,
|
|
151
|
-
},
|
|
152
|
-
])
|
|
153
|
-
invoices?: Types.ObjectId[] | Invoice[];
|
|
154
|
-
|
|
155
|
-
@Prop([
|
|
156
|
-
{
|
|
157
|
-
type: MongooseSchema.Types.ObjectId,
|
|
158
|
-
ref: 'Action',
|
|
159
|
-
required: false,
|
|
160
|
-
},
|
|
161
|
-
])
|
|
162
|
-
actions?: Types.ObjectId[] | Action[];
|
|
163
|
-
|
|
164
|
-
@Prop([
|
|
165
|
-
{
|
|
166
|
-
type: MongooseSchema.Types.ObjectId,
|
|
167
|
-
ref: 'Payment',
|
|
168
|
-
required: false,
|
|
169
|
-
},
|
|
170
|
-
])
|
|
171
|
-
payments?: Types.ObjectId[] | Payment[];
|
|
172
|
-
|
|
173
199
|
@Prop({ required: false })
|
|
174
200
|
closedAt?: Date;
|
|
175
201
|
|
|
@@ -182,4 +208,3 @@ export class Sale {
|
|
|
182
208
|
|
|
183
209
|
export const SaleSchema = SchemaFactory.createForClass(Sale);
|
|
184
210
|
export const SaleModel = MongooseModel('Sale', SaleSchema);
|
|
185
|
-
|