@grapadigital/shared-schemas 1.0.107 → 1.0.109

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.
@@ -39,8 +39,23 @@ export declare const ClusterSchema: import("mongoose").Schema<Cluster, import("m
39
39
  } & {
40
40
  __v: number;
41
41
  }>;
42
+ export declare class Company {
43
+ legalName: string;
44
+ document: string;
45
+ }
46
+ export declare const CompanySchema: import("mongoose").Schema<Company, import("mongoose").Model<Company, any, any, any, import("mongoose").Document<unknown, any, Company, any, {}> & Company & {
47
+ _id: import("mongoose").Types.ObjectId;
48
+ } & {
49
+ __v: number;
50
+ }, 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: import("mongoose").Types.ObjectId;
52
+ } & {
53
+ __v: number;
54
+ }>;
42
55
  export declare class Client extends User {
43
56
  clusters: Cluster[];
57
+ companies: Company[];
58
+ categories: string[];
44
59
  }
45
60
  export declare const ClientSchema: import("mongoose").Schema<Client, import("mongoose").Model<Client, any, any, any, import("mongoose").Document<unknown, any, Client, any, {}> & Client & Required<{
46
61
  _id: import("mongoose").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.ClientModel = exports.ClientSchema = exports.Client = exports.ClusterSchema = exports.Cluster = void 0;
12
+ exports.ClientModel = exports.ClientSchema = exports.Client = exports.CompanySchema = exports.Company = exports.ClusterSchema = exports.Cluster = void 0;
13
13
  const mongoose_1 = require("@nestjs/mongoose");
14
14
  const mongoose_2 = require("mongoose");
15
15
  const user_schema_1 = require("./user.schema");
@@ -28,12 +28,35 @@ Cluster = __decorate([
28
28
  ], Cluster);
29
29
  exports.Cluster = Cluster;
30
30
  exports.ClusterSchema = mongoose_1.SchemaFactory.createForClass(Cluster);
31
+ let Company = class Company {
32
+ };
33
+ __decorate([
34
+ (0, mongoose_1.Prop)(),
35
+ __metadata("design:type", String)
36
+ ], Company.prototype, "legalName", void 0);
37
+ __decorate([
38
+ (0, mongoose_1.Prop)(),
39
+ __metadata("design:type", String)
40
+ ], Company.prototype, "document", void 0);
41
+ Company = __decorate([
42
+ (0, mongoose_1.Schema)({ _id: false })
43
+ ], Company);
44
+ exports.Company = Company;
45
+ exports.CompanySchema = mongoose_1.SchemaFactory.createForClass(Company);
31
46
  let Client = class Client extends user_schema_1.User {
32
47
  };
33
48
  __decorate([
34
49
  (0, mongoose_1.Prop)({ type: [exports.ClusterSchema], default: [] }),
35
50
  __metadata("design:type", Array)
36
51
  ], Client.prototype, "clusters", void 0);
52
+ __decorate([
53
+ (0, mongoose_1.Prop)({ type: [exports.CompanySchema], default: [] }),
54
+ __metadata("design:type", Array)
55
+ ], Client.prototype, "companies", void 0);
56
+ __decorate([
57
+ (0, mongoose_1.Prop)({ type: [String], default: [] }),
58
+ __metadata("design:type", Array)
59
+ ], Client.prototype, "categories", void 0);
37
60
  Client = __decorate([
38
61
  (0, mongoose_1.Schema)({ timestamps: true })
39
62
  ], Client);
@@ -153,10 +153,7 @@ export declare class Payment {
153
153
  _id?: Types.ObjectId;
154
154
  title: string;
155
155
  phase: 'pending' | 'review' | 'approval' | 'awaiting' | 'requested' | 'queued' | 'paid' | 'client' | 'canceled';
156
- attachments?: {
157
- name: string;
158
- url: string;
159
- }[];
156
+ attachments?: Attachment[];
160
157
  pending?: Pending;
161
158
  review?: Review;
162
159
  requested?: Requested;
@@ -253,10 +253,12 @@ let Attachment = class Attachment {
253
253
  };
254
254
  __decorate([
255
255
  (0, swagger_1.ApiProperty)({ description: 'Nome do arquivo' }),
256
+ (0, mongoose_1.Prop)(),
256
257
  __metadata("design:type", String)
257
258
  ], Attachment.prototype, "name", void 0);
258
259
  __decorate([
259
260
  (0, swagger_1.ApiProperty)({ description: 'URL do arquivo' }),
261
+ (0, mongoose_1.Prop)(),
260
262
  __metadata("design:type", String)
261
263
  ], Attachment.prototype, "url", void 0);
262
264
  Attachment = __decorate([
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grapadigital/shared-schemas",
3
- "version": "1.0.107",
3
+ "version": "1.0.109",
4
4
  "description": "Shared Mongoose Schemas",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -15,10 +15,27 @@ export class Cluster {
15
15
 
16
16
  export const ClusterSchema = SchemaFactory.createForClass(Cluster);
17
17
 
18
+ @Schema({ _id: false })
19
+ export class Company {
20
+ @Prop()
21
+ legalName: string;
22
+
23
+ @Prop()
24
+ document: string;
25
+ }
26
+
27
+ export const CompanySchema = SchemaFactory.createForClass(Company);
28
+
18
29
  @Schema({ timestamps: true })
19
30
  export class Client extends User {
20
31
  @Prop({ type: [ClusterSchema], default: [] })
21
32
  clusters: Cluster[];
33
+
34
+ @Prop({ type: [CompanySchema], default: [] })
35
+ companies: Company[];
36
+
37
+ @Prop({ type: [String], default: [] })
38
+ categories: string[];
22
39
  }
23
40
 
24
41
  export const ClientSchema = SchemaFactory.createForClass(Client);
@@ -189,10 +189,10 @@ export const NoteSchema = SchemaFactory.createForClass(Note);
189
189
  @Schema({ _id: false })
190
190
  export class Attachment {
191
191
  @ApiProperty({ description: 'Nome do arquivo' })
192
- name: string;
192
+ @Prop() name: string;
193
193
 
194
194
  @ApiProperty({ description: 'URL do arquivo' })
195
- url: string;
195
+ @Prop() url: string;
196
196
  }
197
197
  export const AttachmentSchema = SchemaFactory.createForClass(Attachment);
198
198
 
@@ -221,7 +221,7 @@ export class Payment {
221
221
  required: false,
222
222
  default: []
223
223
  })
224
- attachments?: { name: string, url: string }[];
224
+ attachments?: Attachment[];
225
225
 
226
226
  @ApiProperty({ type: () => Pending })
227
227
  @Prop({ type: PendingSchema, required: false })