@grapadigital/shared-schemas 1.0.169 → 1.0.170

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.
@@ -61,6 +61,8 @@ declare class Note {
61
61
  owner: string;
62
62
  createdAt: Date;
63
63
  }
64
+ export declare const ACTION_STATUS_VALUES: readonly ["config", "script", "production", "posting", "analytics", "finished", "onHold", "cancelled", "inProgress", "archived"];
65
+ export type ActionStatus = (typeof ACTION_STATUS_VALUES)[number];
64
66
  export declare class Action {
65
67
  _id?: Types.ObjectId;
66
68
  title: string;
@@ -68,7 +70,7 @@ export declare class Action {
68
70
  startDate: Date;
69
71
  endDate: Date;
70
72
  nps?: number;
71
- status: 'config' | 'inProgress' | 'onHold' | 'finished' | 'archived';
73
+ status: ActionStatus;
72
74
  partnership: 'partner' | 'exclusive';
73
75
  type: 'seeding' | 'ugc' | 'creator';
74
76
  socialnetworks?: string[];
@@ -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.ActionModel = exports.ActionSchema = exports.Action = exports.ResponsiblesSchema = exports.Responsibles = exports.ResponsibleSchema = exports.Responsible = void 0;
12
+ exports.ActionModel = exports.ActionSchema = exports.Action = exports.ACTION_STATUS_VALUES = exports.ResponsiblesSchema = exports.Responsibles = exports.ResponsibleSchema = exports.Responsible = 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");
@@ -74,6 +74,18 @@ Note = __decorate([
74
74
  (0, mongoose_1.Schema)({ _id: false })
75
75
  ], Note);
76
76
  const NoteSchema = mongoose_1.SchemaFactory.createForClass(Note);
77
+ exports.ACTION_STATUS_VALUES = [
78
+ 'config',
79
+ 'script',
80
+ 'production',
81
+ 'posting',
82
+ 'analytics',
83
+ 'finished',
84
+ 'onHold',
85
+ 'cancelled',
86
+ 'inProgress',
87
+ 'archived', // legado — mantido por compatibilidade
88
+ ];
77
89
  let Action = class Action {
78
90
  };
79
91
  __decorate([
@@ -107,10 +119,10 @@ __decorate([
107
119
  __metadata("design:type", Number)
108
120
  ], Action.prototype, "nps", void 0);
109
121
  __decorate([
110
- (0, swagger_1.ApiProperty)({ enum: ['config', 'inProgress', 'onHold', 'finished', 'archived'], example: 'config' }),
122
+ (0, swagger_1.ApiProperty)({ enum: exports.ACTION_STATUS_VALUES, example: 'config' }),
111
123
  (0, mongoose_1.Prop)({
112
124
  type: String,
113
- enum: ['config', 'inProgress', 'onHold', 'finished', 'archived'],
125
+ enum: exports.ACTION_STATUS_VALUES,
114
126
  default: 'config',
115
127
  required: true,
116
128
  }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grapadigital/shared-schemas",
3
- "version": "1.0.169",
3
+ "version": "1.0.170",
4
4
  "description": "Shared Mongoose Schemas",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -54,6 +54,19 @@ class Note {
54
54
 
55
55
  const NoteSchema = SchemaFactory.createForClass(Note);
56
56
 
57
+ export const ACTION_STATUS_VALUES = [
58
+ 'config',
59
+ 'script',
60
+ 'production',
61
+ 'posting',
62
+ 'analytics',
63
+ 'finished',
64
+ 'onHold',
65
+ 'cancelled',
66
+ 'inProgress', // legado — mantido por compatibilidade
67
+ 'archived', // legado — mantido por compatibilidade
68
+ ] as const;
69
+ export type ActionStatus = (typeof ACTION_STATUS_VALUES)[number];
57
70
 
58
71
  @Schema({ timestamps: true })
59
72
  export class Action {
@@ -81,14 +94,14 @@ export class Action {
81
94
  @Prop({ type: Number, required: false })
82
95
  nps?: number;
83
96
 
84
- @ApiProperty({ enum: ['config', 'inProgress', 'onHold', 'finished', 'archived'], example: 'config' })
97
+ @ApiProperty({ enum: ACTION_STATUS_VALUES, example: 'config' })
85
98
  @Prop({
86
99
  type: String,
87
- enum: ['config', 'inProgress', 'onHold', 'finished', 'archived'],
100
+ enum: ACTION_STATUS_VALUES,
88
101
  default: 'config',
89
102
  required: true,
90
103
  })
91
- status: 'config' | 'inProgress' | 'onHold' | 'finished' | 'archived';
104
+ status: ActionStatus;
92
105
 
93
106
  @ApiProperty({ enum: ['partner', 'exclusive'], example: 'partner' })
94
107
  @Prop({ type: String, enum: ['partner', 'exclusive'], required: true })