@reekon-tools/boldr-utils 1.4.30 → 1.4.31

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.
@@ -100,20 +100,57 @@ export interface SelectedTemplate extends FirestoreDoc {
100
100
  }
101
101
  export declare enum FileUploadType {
102
102
  Annotation = "annotation",
103
- Template = "template"
103
+ Template = "template",
104
+ Background = "background",
105
+ LayoutGroup = "layoutGroup",
106
+ Calculator = "calculator"
107
+ }
108
+ export interface AnnotationFileData {
109
+ fileType: 'sketch' | 'document';
110
+ isLabel?: boolean;
111
+ }
112
+ export interface CalculatorFileData {
113
+ templateId: string;
114
+ templateName: string;
115
+ templatePath: string;
116
+ tableConfig: ColumnConfig[];
117
+ diagramFileId: string | null;
118
+ columns: Record<string, any>;
119
+ isCompleted: boolean;
104
120
  }
105
- export interface FileUpload {
121
+ interface FileUploadBase {
106
122
  id: string;
107
123
  name: string;
108
124
  projectId: string;
109
125
  jobId: string;
110
126
  groupId: string;
111
- type: FileUploadType;
112
127
  folderPath: string;
113
128
  thumbnailUrl: string | null;
114
- fileType: string | null;
115
- isFormFile?: boolean;
116
- }
129
+ createdBy?: {
130
+ userId: string;
131
+ firstName?: string;
132
+ lastName?: string;
133
+ };
134
+ createdAt?: Date;
135
+ layoutGroupId?: string | null;
136
+ layoutId?: string | null;
137
+ }
138
+ export type FileUpload = FileUploadBase & ({
139
+ type: FileUploadType.Annotation;
140
+ fileData: AnnotationFileData;
141
+ } | {
142
+ type: FileUploadType.Calculator;
143
+ fileData: CalculatorFileData;
144
+ } | {
145
+ type: FileUploadType.LayoutGroup;
146
+ fileData?: undefined;
147
+ } | {
148
+ type: FileUploadType.Background;
149
+ fileData?: undefined;
150
+ } | {
151
+ type: FileUploadType.Template;
152
+ fileData?: undefined;
153
+ });
117
154
  export declare enum FolderType {
118
155
  Project = "project",
119
156
  Job = "job",
@@ -132,16 +169,15 @@ export interface Folder extends FirestoreDoc, Timestamps {
132
169
  type: FolderType;
133
170
  isPublic?: boolean;
134
171
  }
135
- export declare enum JobType {
136
- DEFAULT = "default",
137
- CUTLIST = "cutlist"
172
+ export declare enum GroupType {
173
+ LIST = "list",
174
+ FORM = "form"
138
175
  }
139
176
  export interface Job extends FirestoreDoc, Timestamps {
140
177
  name: string;
141
178
  folderId: string;
142
179
  progress: number;
143
180
  projectId: string;
144
- totalTasks: number;
145
181
  lastAccessed: Date;
146
182
  toleranceConfig?: {
147
183
  thresholds: {
@@ -152,7 +188,6 @@ export interface Job extends FirestoreDoc, Timestamps {
152
188
  updatedAt: Date;
153
189
  };
154
190
  areaMapFileId?: string;
155
- type?: JobType;
156
191
  address?: string;
157
192
  description?: string;
158
193
  }
@@ -172,6 +207,7 @@ export interface Group extends FirestoreDoc, Timestamps {
172
207
  name: string;
173
208
  sortIndex: number;
174
209
  columns: Record<string, any>;
210
+ type?: GroupType;
175
211
  groupIndex: number;
176
212
  descriptions?: Record<string, string>;
177
213
  tolerances?: {
@@ -184,14 +220,11 @@ export interface Group extends FirestoreDoc, Timestamps {
184
220
  };
185
221
  diagramFileId?: string;
186
222
  formula?: any;
187
- isCompleted?: boolean;
188
- type?: string;
189
223
  details?: {
190
224
  material: string;
191
225
  finish: string;
192
226
  finishDate: string;
193
227
  };
194
- path?: string;
195
228
  groups?: Group[];
196
229
  sections?: Section[];
197
230
  }
@@ -212,21 +245,52 @@ export interface Formula extends FirestoreDoc, Timestamps {
212
245
  variables: string[];
213
246
  variableToColumnMap: Record<string, any>;
214
247
  }
215
- export interface ColumnConfig {
216
- id: string;
217
- name: string;
218
- type: ColumnType;
219
- formulaId?: string;
220
- mappings?: Record<string, string>;
221
- withTolerance?: boolean;
222
- options?: string[];
223
- conversions?: Conversion[];
224
- size?: number;
225
- }
226
248
  export interface Conversion {
227
249
  label: string;
228
250
  value: string;
229
251
  }
252
+ export interface FormulaColumnData {
253
+ formulaId: string;
254
+ mappings?: Record<string, string>;
255
+ }
256
+ export interface SelectColumnData {
257
+ options: string[];
258
+ }
259
+ export interface ConversionTableColumnData {
260
+ conversions: Conversion[];
261
+ }
262
+ interface ColumnConfigBase {
263
+ id: string;
264
+ name: string;
265
+ }
266
+ export type ColumnConfig = ColumnConfigBase & ({
267
+ type: ColumnType.Formula;
268
+ columnData: FormulaColumnData;
269
+ } | {
270
+ type: ColumnType.SingleSelect;
271
+ columnData: SelectColumnData;
272
+ } | {
273
+ type: ColumnType.MultiSelect;
274
+ columnData: SelectColumnData;
275
+ } | {
276
+ type: ColumnType.ConversionTable;
277
+ columnData: ConversionTableColumnData;
278
+ } | {
279
+ type: ColumnType.Text;
280
+ columnData?: undefined;
281
+ } | {
282
+ type: ColumnType.Number;
283
+ columnData?: undefined;
284
+ } | {
285
+ type: ColumnType.Measurement;
286
+ columnData?: undefined;
287
+ } | {
288
+ type: ColumnType.Boolean;
289
+ columnData?: undefined;
290
+ } | {
291
+ type: ColumnType.Angle;
292
+ columnData?: undefined;
293
+ });
230
294
  export interface Row {
231
295
  [key: string]: any;
232
296
  }
@@ -345,4 +409,17 @@ export interface UserDocument extends FirestoreDoc, Timestamps {
345
409
  printLogoFileId: string;
346
410
  devices?: Record<string, string>;
347
411
  }
412
+ export interface UserComment extends FirestoreDoc, Timestamps {
413
+ comment: string;
414
+ createdByProfileUri: string;
415
+ files: string[];
416
+ groupId: string;
417
+ jobId: string;
418
+ projectId: string;
419
+ createdBy: {
420
+ userId: string;
421
+ firstName: string;
422
+ lastName: string;
423
+ };
424
+ }
348
425
  export {};
@@ -19,6 +19,9 @@ export var FileUploadType;
19
19
  (function (FileUploadType) {
20
20
  FileUploadType["Annotation"] = "annotation";
21
21
  FileUploadType["Template"] = "template";
22
+ FileUploadType["Background"] = "background";
23
+ FileUploadType["LayoutGroup"] = "layoutGroup";
24
+ FileUploadType["Calculator"] = "calculator";
22
25
  })(FileUploadType || (FileUploadType = {}));
23
26
  export var FolderType;
24
27
  (function (FolderType) {
@@ -26,11 +29,11 @@ export var FolderType;
26
29
  FolderType["Job"] = "job";
27
30
  FolderType["Template"] = "template";
28
31
  })(FolderType || (FolderType = {}));
29
- export var JobType;
30
- (function (JobType) {
31
- JobType["DEFAULT"] = "default";
32
- JobType["CUTLIST"] = "cutlist";
33
- })(JobType || (JobType = {}));
32
+ export var GroupType;
33
+ (function (GroupType) {
34
+ GroupType["LIST"] = "list";
35
+ GroupType["FORM"] = "form";
36
+ })(GroupType || (GroupType = {}));
34
37
  export var ColumnType;
35
38
  (function (ColumnType) {
36
39
  ColumnType["Text"] = "text";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reekon-tools/boldr-utils",
3
- "version": "1.4.30",
3
+ "version": "1.4.31",
4
4
  "description": "Shared utilities for formulas and measurement conversion used in Reekon apps",
5
5
  "author": "REEKON Tools",
6
6
  "license": "MIT",