@placeshakr/config 10.19.0 → 10.19.6-alpha.2

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.
package/src/types.ts CHANGED
@@ -1,5 +1,3 @@
1
- // @eslint-ignore
2
-
3
1
  import { SubscriptionSettings } from './plans';
4
2
 
5
3
  export enum ROLE {
@@ -46,7 +44,8 @@ export type ResourceType =
46
44
  | OperationCatalog
47
45
  | Nomenclature
48
46
  | Operation
49
- | OperationV2;
47
+ | OperationV2
48
+ | OperationsGroup;
50
49
 
51
50
  /**
52
51
  * Add timestampable behavior to any resource
@@ -176,13 +175,13 @@ export interface Enterprise extends Resource {
176
175
  * Current subscription status
177
176
  */
178
177
  status:
179
- | 'incomplete'
180
- | 'incomplete_expired'
181
- | 'trialing'
182
- | 'active'
183
- | 'past_due'
184
- | 'canceled'
185
- | 'unpaid';
178
+ | 'incomplete'
179
+ | 'incomplete_expired'
180
+ | 'trialing'
181
+ | 'active'
182
+ | 'past_due'
183
+ | 'canceled'
184
+ | 'unpaid';
186
185
 
187
186
  /**
188
187
  * Kind of forfait
@@ -229,12 +228,6 @@ export interface Enterprise extends Resource {
229
228
  */
230
229
  default_payment_method?: string;
231
230
 
232
- /**
233
- * Number of users contained within the subscription. This number will be used to calculate
234
- * the amount to pay for additional user
235
- */
236
- totalUsers: number;
237
-
238
231
  /**
239
232
  * Number of admin users contained within the subscription. This number will be used to calculate
240
233
  * the amount to pay for additional admin user
@@ -312,13 +305,23 @@ export interface Enterprise extends Resource {
312
305
  * state of subscription
313
306
  */
314
307
  status:
315
- | 'incomplete'
316
- | 'incomplete_expired'
317
- | 'trialing'
318
- | 'active'
319
- | 'past_due'
320
- | 'canceled'
321
- | 'unpaid';
308
+ | 'incomplete'
309
+ | 'incomplete_expired'
310
+ | 'trialing'
311
+ | 'active'
312
+ | 'past_due'
313
+ | 'canceled'
314
+ | 'unpaid';
315
+
316
+ /**
317
+ * Coupon id applied to subscription
318
+ */
319
+ coupon?: string;
320
+
321
+ /**
322
+ * Last invoice id on stripe
323
+ */
324
+ latestInvoice?: string;
322
325
  };
323
326
 
324
327
  insurance?: string;
@@ -331,22 +334,7 @@ export interface Enterprise extends Resource {
331
334
  /**
332
335
  *
333
336
  */
334
- bankInfo?: {
335
- /**
336
- * IBAN identifier
337
- */
338
- iban: string;
339
-
340
- /**
341
- * BIC identifier
342
- */
343
- bic: string;
344
-
345
- /**
346
- * Account owner name
347
- */
348
- holder: string;
349
- };
337
+ bankInfo?: BankDetails[];
350
338
 
351
339
  notificationEstimation?: string[];
352
340
 
@@ -364,6 +352,53 @@ export interface Enterprise extends Resource {
364
352
  * Geographical area covered, used in bills PDF data
365
353
  */
366
354
  areaCovered?: string;
355
+
356
+ /**
357
+ * Enterprise currency
358
+ */
359
+ currency?: string;
360
+
361
+ /**
362
+ * Statuses workflow between devis status and project status
363
+ */
364
+ statusesWorkflow: { devis: DevisStatusEnum; project: string }[];
365
+
366
+ contactEmails: Array<{/**
367
+ * The contact mail
368
+ */
369
+ role: string;
370
+ /**
371
+ * The contact name
372
+ */
373
+ email: string;
374
+ }>;
375
+ }
376
+
377
+ export interface BankDetails {
378
+ /**
379
+ * bank details selected by default
380
+ */
381
+ default: boolean;
382
+
383
+ /**
384
+ * Title identifier
385
+ */
386
+ title: string;
387
+
388
+ /**
389
+ * IBAN identifier
390
+ */
391
+ iban: string;
392
+
393
+ /**
394
+ * BIC identifier
395
+ */
396
+ bic: string;
397
+
398
+ /**
399
+ * Account owner name
400
+ */
401
+ holder: string;
367
402
  }
368
403
 
369
404
  /**
@@ -871,7 +906,6 @@ export interface Operation extends Resource {
871
906
  export interface Project extends Resource {
872
907
  name: string;
873
908
  image?: File;
874
- type: ProjectTypeEnum;
875
909
  category: ProjectCategoriesEnum;
876
910
  surface: number;
877
911
  address: string;
@@ -893,16 +927,6 @@ export interface Project extends Resource {
893
927
  */
894
928
  progress?: number;
895
929
 
896
- /**
897
- * Project parent (only for child projects)
898
- */
899
- parent?: string | Project;
900
-
901
- /**
902
- * Children projects (only for compound projects)
903
- */
904
- children?: (string | Project)[];
905
-
906
930
  /**
907
931
  * For whom this project is?
908
932
  */
@@ -1193,7 +1217,12 @@ export interface Material extends Resource {
1193
1217
  name: string;
1194
1218
 
1195
1219
  /**
1196
- * The material unit price
1220
+ * Price without discount
1221
+ */
1222
+ basePrice: number;
1223
+
1224
+ /**
1225
+ * The material unit price with discount
1197
1226
  */
1198
1227
  unitPrice: number;
1199
1228
 
@@ -1247,6 +1276,14 @@ export interface Material extends Resource {
1247
1276
  * Custom reference defined by user
1248
1277
  */
1249
1278
  reference?: string;
1279
+
1280
+ margin?: {
1281
+ id: string;
1282
+ value: number;
1283
+ label: string;
1284
+ };
1285
+
1286
+ supplier?: string;
1250
1287
  }
1251
1288
 
1252
1289
  export interface DevisMaterial extends Material {
@@ -1361,14 +1398,22 @@ export interface DevisOperation extends Resource {
1361
1398
  price: number;
1362
1399
 
1363
1400
  /**
1364
- * Surface, example: wall, floor
1401
+ * Piece, example: bathroom, kitchen
1365
1402
  */
1366
- surface: string;
1403
+ piece: string;
1367
1404
 
1368
1405
  /**
1369
- * Piece, example: bathroom, kitchen
1406
+ * Lot from nomenclature
1370
1407
  */
1371
- piece: string;
1408
+ lot?: {
1409
+ label: string;
1410
+ color: string;
1411
+ };
1412
+
1413
+ /**
1414
+ * Surface old devis and operations
1415
+ */
1416
+ surface?: string;
1372
1417
 
1373
1418
  /**
1374
1419
  * Unit, example: m2, cm3
@@ -1456,10 +1501,15 @@ export interface Devis extends Resource {
1456
1501
  dateApproved?: number;
1457
1502
 
1458
1503
  /**
1459
- * Send by email date
1504
+ * Date when email was sent to the project client
1460
1505
  */
1461
1506
  dateSent?: number;
1462
1507
 
1508
+ /**
1509
+ * Email status from Sengrid
1510
+ */
1511
+ emailStatus?: 'processed' | 'dropped' | 'deferred' | 'delivered' | 'open' | 'spamreport'
1512
+
1463
1513
  /**
1464
1514
  * Parent, devis base used to create this one
1465
1515
  */
@@ -1527,6 +1577,37 @@ export interface Devis extends Resource {
1527
1577
  provider: { percent: number; value: number };
1528
1578
  enterprise: { percent: number; value: number };
1529
1579
  };
1580
+
1581
+ /************************************ V2 ************************************/
1582
+ materialsCatalogs?: Array<string>;
1583
+
1584
+ operationsCatalog?: string;
1585
+
1586
+ history?: DevisHistoryItem[];
1587
+
1588
+ systemVersion?: number
1589
+
1590
+ format?: DevisFormatEnum;
1591
+ }
1592
+
1593
+ export enum DevisHistoryType {
1594
+ CHANGE_STATUS = 'CHANGE_STATUS',
1595
+ SENT_TO_CLIENT = 'SENT_TO_CLIENT',
1596
+ EMAIL_EVENT = 'EMAIL_EVENT',
1597
+ NEW_VERSION = 'NEW_VERSION'
1598
+ }
1599
+
1600
+ export interface DevisHistoryItem {
1601
+ date: number
1602
+ user?: {
1603
+ id: string,
1604
+ name: string,
1605
+ email: string,
1606
+ role: ROLE
1607
+ photoUrl: string,
1608
+ }
1609
+ type: DevisHistoryType
1610
+ data: any
1530
1611
  }
1531
1612
 
1532
1613
  /**
@@ -1570,9 +1651,13 @@ export interface DevisTemplate extends Resource {
1570
1651
  materialsProvider?: Array<string>;
1571
1652
 
1572
1653
  /**
1573
- * Used to filter operations
1654
+ * Operations catalog assigned to devis
1574
1655
  */
1575
- projectType: ProjectTypeEnum;
1656
+ operationsCatalog: string;
1657
+
1658
+ systemVersion?: number;
1659
+
1660
+ format?: DevisFormatEnum;
1576
1661
  }
1577
1662
 
1578
1663
  /**
@@ -2390,6 +2475,7 @@ export enum EmailTemplate {
2390
2475
  USER_CONTACT = 'user-contact',
2391
2476
  PLAN = 'plan',
2392
2477
  BILL = 'bill',
2478
+ MEDIAS = 'medias',
2393
2479
  }
2394
2480
 
2395
2481
  export enum DevisPdfType {
@@ -2436,6 +2522,9 @@ export enum HistoryActionEnum {
2436
2522
  ASSIGN_SELLER = 'ASSIGN_SELLER',
2437
2523
  UNASSIGN_SELLER = 'UNASSIGN_SELLER',
2438
2524
  APPROVED_R_V = 'APPROVED_R_V',
2525
+ DEVIS_APPROVED = 'DEVIS_APPROVED',
2526
+ DEVIS_SENT = 'DEVIS_SENT',
2527
+ DEVIS_SIGNED = 'DEVIS_SIGNED',
2439
2528
  }
2440
2529
 
2441
2530
  export interface History {
@@ -2516,7 +2605,6 @@ export interface OperationCatalog extends Resource {
2516
2605
  value: number;
2517
2606
  }>;
2518
2607
  description?: string;
2519
- materialsProvider?: Array<string>;
2520
2608
  image?: File | null;
2521
2609
  }
2522
2610
 
@@ -2529,6 +2617,9 @@ export interface Nomenclature extends Resource {
2529
2617
  order?: number;
2530
2618
  activeForPro?: boolean;
2531
2619
  setProjectDate?: boolean;
2620
+ label?: string;
2621
+ text?: string;
2622
+ visibleBy?: ROLE[];
2532
2623
  }
2533
2624
 
2534
2625
  export enum NomenclaturesIdentifier {
@@ -2539,6 +2630,13 @@ export enum NomenclaturesIdentifier {
2539
2630
  PROJECTS_CATEGORY = 'PROJECTS_CATEGORY',
2540
2631
  TVA = 'TVA',
2541
2632
  SUPPLIERS = 'SUPPLIERS',
2633
+ MARGINS = 'MARGINS',
2634
+ TERMS_OF_SALE = 'TERMS_OF_SALE',
2635
+ NOTES_MODELS = 'NOTES_MODELS',
2636
+ DEVIS_TYPES = 'DEVIS_TYPES',
2637
+ COMMENTS_MODELS = 'COMMENTS_MODELS',
2638
+ EMAILS_COMMENTS_MODELS = 'EMAILS_COMMENTS_MODELS',
2639
+ PAYMENT_PLANNING = 'PAYMENT_PLANNING',
2542
2640
  }
2543
2641
 
2544
2642
  /**
@@ -2563,7 +2661,7 @@ export interface OperationV2 extends Resource {
2563
2661
  /**
2564
2662
  * The operation unit price
2565
2663
  */
2566
- price: number;
2664
+ unitPrice: number;
2567
2665
 
2568
2666
  /**
2569
2667
  * The operation unit
@@ -2659,6 +2757,7 @@ export interface OperationV2Material extends Material {
2659
2757
  responsible: string;
2660
2758
  fixed: boolean;
2661
2759
  optId: string;
2760
+ complement?: string;
2662
2761
  }
2663
2762
 
2664
2763
  export enum MaterialResponsible {
@@ -2667,6 +2766,7 @@ export enum MaterialResponsible {
2667
2766
  AGENT = 'AGENT',
2668
2767
  SELLER = 'SELLER',
2669
2768
  ENTERPRISE = 'ENTERPRISE',
2769
+ PROVIDER = 'PROVIDER',
2670
2770
  }
2671
2771
 
2672
2772
  export enum ProjectPriceTypeEnum {
@@ -2674,3 +2774,18 @@ export enum ProjectPriceTypeEnum {
2674
2774
  prospected = 'prospected',
2675
2775
  rejected = 'rejected',
2676
2776
  }
2777
+
2778
+ export enum DevisFormatEnum {
2779
+ PIECE = 'PIECE',
2780
+ LOT = 'LOT',
2781
+ }
2782
+
2783
+ export interface OperationsGroup extends Resource {
2784
+ name: string;
2785
+ status: boolean;
2786
+ operationsCatalog: string;
2787
+ operations: string[];
2788
+ }
2789
+
2790
+ export interface DevisVersion extends Devis {
2791
+ }