@grapadigital/shared-schemas 1.1.0 → 1.1.1

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.
@@ -0,0 +1,13 @@
1
+ export declare class Attachment {
2
+ name: string;
3
+ url: string;
4
+ }
5
+ export declare const AttachmentSchema: import("mongoose").Schema<Attachment, import("mongoose").Model<Attachment, any, any, any, import("mongoose").Document<unknown, any, Attachment, any, {}> & Attachment & {
6
+ _id: import("mongoose").Types.ObjectId;
7
+ } & {
8
+ __v: number;
9
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, Attachment, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<Attachment>, {}, import("mongoose").DefaultSchemaOptions> & import("mongoose").FlatRecord<Attachment> & {
10
+ _id: import("mongoose").Types.ObjectId;
11
+ } & {
12
+ __v: number;
13
+ }>;
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.AttachmentSchema = exports.Attachment = void 0;
13
+ const mongoose_1 = require("@nestjs/mongoose");
14
+ let Attachment = class Attachment {
15
+ };
16
+ exports.Attachment = Attachment;
17
+ __decorate([
18
+ (0, mongoose_1.Prop)(),
19
+ __metadata("design:type", String)
20
+ ], Attachment.prototype, "name", void 0);
21
+ __decorate([
22
+ (0, mongoose_1.Prop)(),
23
+ __metadata("design:type", String)
24
+ ], Attachment.prototype, "url", void 0);
25
+ exports.Attachment = Attachment = __decorate([
26
+ (0, mongoose_1.Schema)({ _id: false })
27
+ ], Attachment);
28
+ exports.AttachmentSchema = mongoose_1.SchemaFactory.createForClass(Attachment);
@@ -6,6 +6,7 @@ export declare class Organization {
6
6
  cnpj: string;
7
7
  logo?: string;
8
8
  logoSmall?: string;
9
+ hasStrategyPhase?: boolean;
9
10
  createdAt?: Date;
10
11
  updatedAt?: Date;
11
12
  }
@@ -34,6 +34,10 @@ __decorate([
34
34
  (0, mongoose_1.Prop)(),
35
35
  __metadata("design:type", String)
36
36
  ], Organization.prototype, "logoSmall", void 0);
37
+ __decorate([
38
+ (0, mongoose_1.Prop)({ type: Boolean, default: false }),
39
+ __metadata("design:type", Boolean)
40
+ ], Organization.prototype, "hasStrategyPhase", void 0);
37
41
  exports.Organization = Organization = __decorate([
38
42
  (0, mongoose_1.Schema)({ timestamps: true, collection: "organizations", strict: true })
39
43
  ], Organization);
@@ -5,6 +5,8 @@ import { Action } from "./action.schema";
5
5
  import { Recruitment } from "./recruitment.schema";
6
6
  import { Sale } from "./sale.schema";
7
7
  import { Note } from "./note.schema";
8
+ import { Attachment, AttachmentSchema } from "./attachment.schema";
9
+ export { Attachment, AttachmentSchema };
8
10
  export type PaymentDocument = HydratedDocument<Payment>;
9
11
  declare class Requester {
10
12
  name: string;
@@ -119,19 +121,6 @@ export declare const CanceledSchema: MongooseSchema<Canceled, import("mongoose")
119
121
  } & {
120
122
  __v: number;
121
123
  }>;
122
- export declare class Attachment {
123
- name: string;
124
- url: string;
125
- }
126
- export declare const AttachmentSchema: MongooseSchema<Attachment, import("mongoose").Model<Attachment, any, any, any, import("mongoose").Document<unknown, any, Attachment, any, {}> & Attachment & {
127
- _id: Types.ObjectId;
128
- } & {
129
- __v: number;
130
- }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, Attachment, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<Attachment>, {}, import("mongoose").DefaultSchemaOptions> & import("mongoose").FlatRecord<Attachment> & {
131
- _id: Types.ObjectId;
132
- } & {
133
- __v: number;
134
- }>;
135
124
  export declare class Payment {
136
125
  _id?: Types.ObjectId;
137
126
  title: string;
@@ -173,4 +162,3 @@ export declare const PaymentModel: import("mongoose").Model<Payment, {}, {}, {},
173
162
  }> & {
174
163
  __v: number;
175
164
  }>>;
176
- export {};
@@ -9,10 +9,13 @@ 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.CanceledSchema = exports.Canceled = exports.PaidSchema = exports.Paid = exports.QueuedSchema = exports.Queued = exports.ReceivedSchema = exports.Received = exports.RequestedSchema = exports.Requested = exports.PendingSchema = exports.Pending = exports.ReviewSchema = exports.Review = void 0;
12
+ exports.PaymentModel = exports.PaymentSchema = exports.Payment = exports.CanceledSchema = exports.Canceled = exports.PaidSchema = exports.Paid = exports.QueuedSchema = exports.Queued = exports.ReceivedSchema = exports.Received = exports.RequestedSchema = exports.Requested = exports.PendingSchema = exports.Pending = exports.ReviewSchema = exports.Review = exports.AttachmentSchema = exports.Attachment = 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");
16
+ const attachment_schema_1 = require("./attachment.schema");
17
+ Object.defineProperty(exports, "Attachment", { enumerable: true, get: function () { return attachment_schema_1.Attachment; } });
18
+ Object.defineProperty(exports, "AttachmentSchema", { enumerable: true, get: function () { return attachment_schema_1.AttachmentSchema; } });
16
19
  let Requester = class Requester {
17
20
  };
18
21
  __decorate([
@@ -237,21 +240,6 @@ exports.Canceled = Canceled = __decorate([
237
240
  (0, mongoose_1.Schema)({ _id: false })
238
241
  ], Canceled);
239
242
  exports.CanceledSchema = mongoose_1.SchemaFactory.createForClass(Canceled);
240
- let Attachment = class Attachment {
241
- };
242
- exports.Attachment = Attachment;
243
- __decorate([
244
- (0, mongoose_1.Prop)(),
245
- __metadata("design:type", String)
246
- ], Attachment.prototype, "name", void 0);
247
- __decorate([
248
- (0, mongoose_1.Prop)(),
249
- __metadata("design:type", String)
250
- ], Attachment.prototype, "url", void 0);
251
- exports.Attachment = Attachment = __decorate([
252
- (0, mongoose_1.Schema)({ _id: false })
253
- ], Attachment);
254
- exports.AttachmentSchema = mongoose_1.SchemaFactory.createForClass(Attachment);
255
243
  let Payment = class Payment {
256
244
  };
257
245
  exports.Payment = Payment;
@@ -282,7 +270,7 @@ __decorate([
282
270
  ], Payment.prototype, "phase", void 0);
283
271
  __decorate([
284
272
  (0, mongoose_1.Prop)({
285
- type: [Attachment],
273
+ type: [attachment_schema_1.Attachment],
286
274
  required: false,
287
275
  default: [],
288
276
  }),
@@ -4,6 +4,7 @@ import { Client } from "./client.schema";
4
4
  import { Influencer } from "./influencer.schema";
5
5
  import { Note } from "./note.schema";
6
6
  import { Responsible } from "./responsible.schema";
7
+ import { Attachment } from "./attachment.schema";
7
8
  export type SaleDocument = HydratedDocument<Sale>;
8
9
  export declare class Proposal {
9
10
  businessUnit: "service" | "comercial";
@@ -105,15 +106,23 @@ export declare const SaleResponsibleSchema: MongooseSchema<SaleResponsible, impo
105
106
  } & {
106
107
  __v: number;
107
108
  }>;
108
- export declare class SaleLinks {
109
- contract?: string;
110
- clientSheet?: string;
111
- internalSheet?: string;
109
+ export declare class SaleLink {
110
+ label: string;
111
+ url: string;
112
112
  }
113
+ export declare const SaleLinkSchema: MongooseSchema<SaleLink, import("mongoose").Model<SaleLink, any, any, any, import("mongoose").Document<unknown, any, SaleLink, any, {}> & SaleLink & {
114
+ _id: Types.ObjectId;
115
+ } & {
116
+ __v: number;
117
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, SaleLink, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<SaleLink>, {}, import("mongoose").DefaultSchemaOptions> & import("mongoose").FlatRecord<SaleLink> & {
118
+ _id: Types.ObjectId;
119
+ } & {
120
+ __v: number;
121
+ }>;
113
122
  export declare class Sale {
114
123
  _id?: Types.ObjectId;
115
124
  title: string;
116
- phase: "inbox" | "proposal" | "negotiation" | "commission" | "formalization" | "closed" | "lost";
125
+ phase: "inbox" | "strategy" | "proposal" | "negotiation" | "commission" | "formalization" | "closed" | "lost";
117
126
  type: "new" | "organic_expansion" | "strategic_expansion" | "renewal" | "comercial_winback" | "organic_winback";
118
127
  proposal?: Proposal;
119
128
  negotiation?: Negotiation;
@@ -132,7 +141,8 @@ export declare class Sale {
132
141
  updatedAt?: Date;
133
142
  omieId?: string;
134
143
  responsible?: SaleResponsible;
135
- links?: SaleLinks;
144
+ links?: SaleLink[];
145
+ attachments?: Attachment[];
136
146
  }
137
147
  export declare const SaleSchema: MongooseSchema<Sale, import("mongoose").Model<Sale, any, any, any, import("mongoose").Document<unknown, any, Sale, any, {}> & Sale & Required<{
138
148
  _id: Types.ObjectId;
@@ -9,11 +9,12 @@ 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.SaleLinks = exports.SaleResponsibleSchema = exports.SaleResponsible = 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.SaleLinkSchema = exports.SaleLink = exports.SaleResponsibleSchema = exports.SaleResponsible = 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");
16
16
  const responsible_schema_1 = require("./responsible.schema");
17
+ const attachment_schema_1 = require("./attachment.schema");
17
18
  let Proposal = class Proposal {
18
19
  };
19
20
  exports.Proposal = Proposal;
@@ -362,24 +363,22 @@ exports.SaleResponsible = SaleResponsible = __decorate([
362
363
  (0, mongoose_1.Schema)({ _id: false })
363
364
  ], SaleResponsible);
364
365
  exports.SaleResponsibleSchema = mongoose_1.SchemaFactory.createForClass(SaleResponsible);
365
- let SaleLinks = class SaleLinks {
366
+ // Links da venda com rótulo livre (Canva, planilha de curadoria, contrato...).
367
+ let SaleLink = class SaleLink {
366
368
  };
367
- exports.SaleLinks = SaleLinks;
369
+ exports.SaleLink = SaleLink;
368
370
  __decorate([
369
- (0, mongoose_1.Prop)({ required: false }),
370
- __metadata("design:type", String)
371
- ], SaleLinks.prototype, "contract", void 0);
372
- __decorate([
373
- (0, mongoose_1.Prop)({ required: false }),
371
+ (0, mongoose_1.Prop)({ required: true }),
374
372
  __metadata("design:type", String)
375
- ], SaleLinks.prototype, "clientSheet", void 0);
373
+ ], SaleLink.prototype, "label", void 0);
376
374
  __decorate([
377
- (0, mongoose_1.Prop)({ required: false }),
375
+ (0, mongoose_1.Prop)({ required: true }),
378
376
  __metadata("design:type", String)
379
- ], SaleLinks.prototype, "internalSheet", void 0);
380
- exports.SaleLinks = SaleLinks = __decorate([
377
+ ], SaleLink.prototype, "url", void 0);
378
+ exports.SaleLink = SaleLink = __decorate([
381
379
  (0, mongoose_1.Schema)({ _id: false })
382
- ], SaleLinks);
380
+ ], SaleLink);
381
+ exports.SaleLinkSchema = mongoose_1.SchemaFactory.createForClass(SaleLink);
383
382
  let Sale = class Sale {
384
383
  };
385
384
  exports.Sale = Sale;
@@ -394,7 +393,16 @@ __decorate([
394
393
  __decorate([
395
394
  (0, mongoose_1.Prop)({
396
395
  required: true,
397
- enum: ["inbox", "proposal", "negotiation", "commission", "formalization", "closed", "lost"],
396
+ enum: [
397
+ "inbox",
398
+ "strategy",
399
+ "proposal",
400
+ "negotiation",
401
+ "commission",
402
+ "formalization",
403
+ "closed",
404
+ "lost",
405
+ ],
398
406
  }),
399
407
  __metadata("design:type", String)
400
408
  ], Sale.prototype, "phase", void 0);
@@ -488,9 +496,13 @@ __decorate([
488
496
  __metadata("design:type", SaleResponsible)
489
497
  ], Sale.prototype, "responsible", void 0);
490
498
  __decorate([
491
- (0, mongoose_1.Prop)({ type: SaleLinks, required: false }),
492
- __metadata("design:type", SaleLinks)
499
+ (0, mongoose_1.Prop)({ type: [exports.SaleLinkSchema], required: false, default: undefined }),
500
+ __metadata("design:type", Array)
493
501
  ], Sale.prototype, "links", void 0);
502
+ __decorate([
503
+ (0, mongoose_1.Prop)({ type: [attachment_schema_1.AttachmentSchema], required: false, default: undefined }),
504
+ __metadata("design:type", Array)
505
+ ], Sale.prototype, "attachments", void 0);
494
506
  exports.Sale = Sale = __decorate([
495
507
  (0, mongoose_1.Schema)({ timestamps: true })
496
508
  ], Sale);
package/package.json CHANGED
@@ -1,16 +1,25 @@
1
1
  {
2
2
  "name": "@grapadigital/shared-schemas",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "Shared Mongoose Schemas",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
+ "scripts": {
8
+ "build": "rm -rf dist && tsc -p tsconfig.build.json",
9
+ "prepublishOnly": "npm run build",
10
+ "lint": "eslint .",
11
+ "lint:fix": "eslint . --fix",
12
+ "format": "prettier --write .",
13
+ "format:check": "prettier --check .",
14
+ "typecheck": "tsc --noEmit -p tsconfig.json"
15
+ },
7
16
  "peerDependencies": {
8
17
  "@nestjs/mongoose": "^10.0.0 || ^11.0.0",
9
18
  "@nestjs/swagger": "^7.4.0 || ^11.0.0",
10
19
  "mongoose": "^8.10.1"
11
20
  },
12
21
  "devDependencies": {
13
- "@grapadigital/shared-config": "^0.1.0",
22
+ "@grapadigital/shared-configs": "^1.1.0",
14
23
  "@nestjs/mongoose": "^11.0.1",
15
24
  "@nestjs/swagger": "^11.2.0",
16
25
  "@types/node": "^22.20.5",
@@ -24,19 +33,12 @@
24
33
  "url": "https://github.com/grapadigital/shared-schemas"
25
34
  },
26
35
  "license": "MIT",
27
- "prettier": "@grapadigital/shared-config/prettier",
36
+ "prettier": "@grapadigital/shared-configs/prettier",
28
37
  "engines": {
29
38
  "node": ">=22"
30
39
  },
40
+ "packageManager": "pnpm@10.33.0",
31
41
  "files": [
32
42
  "dist"
33
- ],
34
- "scripts": {
35
- "build": "rm -rf dist && tsc -p tsconfig.build.json",
36
- "lint": "eslint .",
37
- "lint:fix": "eslint . --fix",
38
- "format": "prettier --write .",
39
- "format:check": "prettier --check .",
40
- "typecheck": "tsc --noEmit -p tsconfig.json"
41
- }
42
- }
43
+ ]
44
+ }