@grapadigital/shared-schemas 1.0.124 → 1.0.125

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.
@@ -26,26 +26,12 @@
26
26
  import { HydratedDocument, Schema as MongooseSchema, Types } from 'mongoose';
27
27
  import { Sale } from './sale.schema';
28
28
  export type CommissionDocument = HydratedDocument<Commission>;
29
- export declare class CommissionRecipient {
30
- name: string;
31
- email: string;
32
- team: string;
33
- }
34
- export declare const CommissionRecipientSchema: MongooseSchema<CommissionRecipient, import("mongoose").Model<CommissionRecipient, any, any, any, import("mongoose").Document<unknown, any, CommissionRecipient, any, {}> & CommissionRecipient & {
35
- _id: Types.ObjectId;
36
- } & {
37
- __v: number;
38
- }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, CommissionRecipient, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<CommissionRecipient>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<CommissionRecipient> & {
39
- _id: Types.ObjectId;
40
- } & {
41
- __v: number;
42
- }>;
43
29
  export declare class Commission {
44
30
  _id?: Types.ObjectId;
45
- recipient: CommissionRecipient;
31
+ email: string;
32
+ role: 'origination' | 'commercial' | 'planning' | 'curation';
46
33
  value: number;
47
34
  percentage: number;
48
- role: 'origination' | 'commercial' | 'planning' | 'curation';
49
35
  status: 'pending' | 'approved' | 'ready' | 'paid' | 'cancelled' | 'disputed';
50
36
  type: 'collaborator' | 'agency';
51
37
  sale: Types.ObjectId | Sale;
@@ -9,29 +9,9 @@ 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.CommissionModel = exports.CommissionSchema = exports.Commission = exports.CommissionRecipientSchema = exports.CommissionRecipient = void 0;
12
+ exports.CommissionModel = exports.CommissionSchema = exports.Commission = void 0;
13
13
  const mongoose_1 = require("@nestjs/mongoose");
14
- const swagger_1 = require("@nestjs/swagger");
15
14
  const mongoose_2 = require("mongoose");
16
- let CommissionRecipient = class CommissionRecipient {
17
- };
18
- __decorate([
19
- (0, mongoose_1.Prop)({ type: String, required: true }),
20
- __metadata("design:type", String)
21
- ], CommissionRecipient.prototype, "name", void 0);
22
- __decorate([
23
- (0, mongoose_1.Prop)({ type: String, required: true }),
24
- __metadata("design:type", String)
25
- ], CommissionRecipient.prototype, "email", void 0);
26
- __decorate([
27
- (0, mongoose_1.Prop)({ type: String, required: true }),
28
- __metadata("design:type", String)
29
- ], CommissionRecipient.prototype, "team", void 0);
30
- CommissionRecipient = __decorate([
31
- (0, mongoose_1.Schema)({ _id: false })
32
- ], CommissionRecipient);
33
- exports.CommissionRecipient = CommissionRecipient;
34
- exports.CommissionRecipientSchema = mongoose_1.SchemaFactory.createForClass(CommissionRecipient);
35
15
  let Commission = class Commission {
36
16
  };
37
17
  __decorate([
@@ -39,17 +19,9 @@ __decorate([
39
19
  __metadata("design:type", mongoose_2.Types.ObjectId)
40
20
  ], Commission.prototype, "_id", void 0);
41
21
  __decorate([
42
- (0, mongoose_1.Prop)({ type: exports.CommissionRecipientSchema, required: true }),
43
- __metadata("design:type", CommissionRecipient)
44
- ], Commission.prototype, "recipient", void 0);
45
- __decorate([
46
- (0, mongoose_1.Prop)({ type: Number, required: true }),
47
- __metadata("design:type", Number)
48
- ], Commission.prototype, "value", void 0);
49
- __decorate([
50
- (0, mongoose_1.Prop)({ type: Number, required: true, min: 0, max: 100 }),
51
- __metadata("design:type", Number)
52
- ], Commission.prototype, "percentage", void 0);
22
+ (0, mongoose_1.Prop)({ type: String, required: true }),
23
+ __metadata("design:type", String)
24
+ ], Commission.prototype, "email", void 0);
53
25
  __decorate([
54
26
  (0, mongoose_1.Prop)({
55
27
  type: String,
@@ -59,6 +31,14 @@ __decorate([
59
31
  }),
60
32
  __metadata("design:type", String)
61
33
  ], Commission.prototype, "role", void 0);
34
+ __decorate([
35
+ (0, mongoose_1.Prop)({ type: Number, required: true }),
36
+ __metadata("design:type", Number)
37
+ ], Commission.prototype, "value", void 0);
38
+ __decorate([
39
+ (0, mongoose_1.Prop)({ type: Number, required: true, min: 0, max: 100 }),
40
+ __metadata("design:type", Number)
41
+ ], Commission.prototype, "percentage", void 0);
62
42
  __decorate([
63
43
  (0, mongoose_1.Prop)({
64
44
  type: String,
@@ -69,10 +49,6 @@ __decorate([
69
49
  __metadata("design:type", String)
70
50
  ], Commission.prototype, "status", void 0);
71
51
  __decorate([
72
- (0, swagger_1.ApiProperty)({
73
- enum: ['sale', 'recruitment', 'content', 'bonus'],
74
- example: 'sale'
75
- }),
76
52
  (0, mongoose_1.Prop)({
77
53
  type: String,
78
54
  enum: ['collaborator', 'agency'],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grapadigital/shared-schemas",
3
- "version": "1.0.124",
3
+ "version": "1.0.125",
4
4
  "description": "Shared Mongoose Schemas",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,5 +1,4 @@
1
1
  import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
2
- import { ApiProperty } from '@nestjs/swagger';
3
2
 
4
3
  import {
5
4
  HydratedDocument,
@@ -12,33 +11,13 @@ import { Sale } from './sale.schema';
12
11
 
13
12
  export type CommissionDocument = HydratedDocument<Commission>;
14
13
 
15
- @Schema({ _id: false })
16
- export class CommissionRecipient {
17
- @Prop({ type: String, required: true })
18
- name: string;
19
-
20
- @Prop({ type: String, required: true })
21
- email: string;
22
-
23
- @Prop({ type: String, required: true })
24
- team: string;
25
- }
26
-
27
- export const CommissionRecipientSchema = SchemaFactory.createForClass(CommissionRecipient);
28
-
29
14
  @Schema({ timestamps: true })
30
15
  export class Commission {
31
16
  @Prop({ type: MongooseSchema.Types.ObjectId, auto: true, required: false })
32
17
  _id?: Types.ObjectId;
33
18
 
34
- @Prop({ type: CommissionRecipientSchema, required: true })
35
- recipient: CommissionRecipient;
36
-
37
- @Prop({ type: Number, required: true })
38
- value: number;
39
-
40
- @Prop({ type: Number, required: true, min: 0, max: 100 })
41
- percentage: number;
19
+ @Prop({ type: String, required: true })
20
+ email: string;
42
21
 
43
22
  @Prop({
44
23
  type: String,
@@ -48,6 +27,12 @@ export class Commission {
48
27
  })
49
28
  role: 'origination' | 'commercial' | 'planning' | 'curation';
50
29
 
30
+ @Prop({ type: Number, required: true })
31
+ value: number;
32
+
33
+ @Prop({ type: Number, required: true, min: 0, max: 100 })
34
+ percentage: number;
35
+
51
36
  @Prop({
52
37
  type: String,
53
38
  enum: ['pending', 'approved', 'ready', 'paid', 'cancelled', 'disputed'],
@@ -56,10 +41,6 @@ export class Commission {
56
41
  })
57
42
  status: 'pending' | 'approved' | 'ready' | 'paid' | 'cancelled' | 'disputed';
58
43
 
59
- @ApiProperty({
60
- enum: ['sale', 'recruitment', 'content', 'bonus'],
61
- example: 'sale'
62
- })
63
44
  @Prop({
64
45
  type: String,
65
46
  enum: ['collaborator', 'agency'],