@placeshakr/config 10.19.8 → 10.19.9-alpha.4

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
@@ -175,13 +175,13 @@ export interface Enterprise extends Resource {
175
175
  * Current subscription status
176
176
  */
177
177
  status:
178
- | 'incomplete'
179
- | 'incomplete_expired'
180
- | 'trialing'
181
- | 'active'
182
- | 'past_due'
183
- | 'canceled'
184
- | 'unpaid';
178
+ | 'incomplete'
179
+ | 'incomplete_expired'
180
+ | 'trialing'
181
+ | 'active'
182
+ | 'past_due'
183
+ | 'canceled'
184
+ | 'unpaid';
185
185
 
186
186
  /**
187
187
  * Kind of forfait
@@ -305,13 +305,13 @@ export interface Enterprise extends Resource {
305
305
  * state of subscription
306
306
  */
307
307
  status:
308
- | 'incomplete'
309
- | 'incomplete_expired'
310
- | 'trialing'
311
- | 'active'
312
- | 'past_due'
313
- | 'canceled'
314
- | 'unpaid';
308
+ | 'incomplete'
309
+ | 'incomplete_expired'
310
+ | 'trialing'
311
+ | 'active'
312
+ | 'past_due'
313
+ | 'canceled'
314
+ | 'unpaid';
315
315
 
316
316
  /**
317
317
  * Coupon id applied to subscription
@@ -361,17 +361,33 @@ export interface Enterprise extends Resource {
361
361
  /**
362
362
  * Statuses workflow between devis status and project status
363
363
  */
364
- statusesWorkflow: { devis: DevisStatusEnum; project: string }[];
364
+ statusesWorkflow: StatusWorkflow[];
365
365
 
366
- contactEmails: Array<{/**
367
- * The contact mail
368
- */
366
+ contactEmails: Array<{
367
+ /**
368
+ * The contact mail
369
+ */
369
370
  role: string;
370
371
  /**
371
372
  * The contact name
372
373
  */
373
374
  email: string;
374
375
  }>;
376
+
377
+ certificates: Certificate[];
378
+ }
379
+
380
+ export type Certificate = { name: string; number: number };
381
+
382
+ export interface StatusWorkflow {
383
+ /**
384
+ * The devis status
385
+ */
386
+ devis: DevisStatusEnum;
387
+ /**
388
+ * The project id
389
+ */
390
+ project: string;
375
391
  }
376
392
 
377
393
  export interface BankDetails {
@@ -831,6 +847,11 @@ export interface Status extends Resource {
831
847
  * Identifier to relate the status to its correspondent in system status algolia index
832
848
  */
833
849
  idReference?: string;
850
+
851
+ /**
852
+ * To set the visibility for the agent
853
+ */
854
+ visibleBy?: ROLE[];
834
855
  }
835
856
 
836
857
  /**
@@ -898,6 +919,11 @@ export interface Operation extends Resource {
898
919
  * in devis will get tva from provider assigned to the project
899
920
  */
900
921
  tva?: number | null;
922
+
923
+ /**
924
+ * Lot selected in the operation custom
925
+ */
926
+ lot?: string;
901
927
  }
902
928
 
903
929
  /**
@@ -1117,6 +1143,11 @@ export interface Event extends Resource {
1117
1143
  * The event color
1118
1144
  */
1119
1145
  color?: string;
1146
+
1147
+ /**
1148
+ * The users responsible for the event
1149
+ */
1150
+ responsibles?: string[];
1120
1151
  }
1121
1152
 
1122
1153
  export interface PlanPage {
@@ -1287,6 +1318,8 @@ export interface Material extends Resource {
1287
1318
  id: string;
1288
1319
  label: string;
1289
1320
  };
1321
+
1322
+ complement?: string;
1290
1323
  }
1291
1324
 
1292
1325
  export interface DevisMaterial extends Material {
@@ -1343,6 +1376,19 @@ export interface DevisMaterial extends Material {
1343
1376
  devisId?: string;
1344
1377
 
1345
1378
  tva?: number;
1379
+
1380
+ /**
1381
+ * Check if this material is included in devis to use his price and display in pdf
1382
+ */
1383
+ include?: boolean;
1384
+ /**
1385
+ * Use to calculate the quantity
1386
+ */
1387
+ loss?: number;
1388
+
1389
+ rounded?: boolean;
1390
+
1391
+ fixed?: boolean;
1346
1392
  }
1347
1393
 
1348
1394
  export interface Order extends Resource {
@@ -1361,19 +1407,34 @@ export interface Order extends Resource {
1361
1407
  pdf?: File;
1362
1408
  }
1363
1409
 
1410
+ export interface PieceSurfaces {
1411
+ floorOrCeiling?: number;
1412
+ linearWall?: number;
1413
+ openingArea?: number;
1414
+ ceilingHeight?: number;
1415
+ }
1416
+
1364
1417
  export interface DevisPiece extends Resource {
1418
+ // use only in devis complex
1419
+ id?: string;
1420
+
1365
1421
  /** Piece, example: bathroom, kitchen */
1366
1422
  name: string;
1367
1423
 
1368
1424
  /**
1369
1425
  * Display operations open or compresed
1370
1426
  */
1371
- optsShow: boolean;
1427
+ optsShow?: boolean;
1372
1428
 
1373
1429
  /**
1374
1430
  * Prices, used to save all prices of operations and materials inside it
1375
1431
  */
1376
1432
  prices?: Price;
1433
+
1434
+ /**
1435
+ * Only used when devis format is PIECE
1436
+ */
1437
+ surfaces?: PieceSurfaces;
1377
1438
  }
1378
1439
 
1379
1440
  /**
@@ -1457,6 +1518,16 @@ export interface DevisOperation extends Resource {
1457
1518
  * Prices, used to save all prices related with the operation
1458
1519
  */
1459
1520
  prices?: Price;
1521
+
1522
+ pieces?: { name: string; quantity: number; id: string }[];
1523
+
1524
+ reserves?: string;
1525
+
1526
+ localization?: string;
1527
+
1528
+ adjustments?: Array<OperationAdjustment>;
1529
+
1530
+ quantityConfig?: OperationQuantityEnum;
1460
1531
  }
1461
1532
 
1462
1533
  /**
@@ -1511,7 +1582,13 @@ export interface Devis extends Resource {
1511
1582
  /**
1512
1583
  * Email status from Sengrid
1513
1584
  */
1514
- emailStatus?: 'processed' | 'dropped' | 'deferred' | 'delivered' | 'open' | 'spamreport'
1585
+ emailStatus?:
1586
+ | 'processed'
1587
+ | 'dropped'
1588
+ | 'deferred'
1589
+ | 'delivered'
1590
+ | 'open'
1591
+ | 'spamreport';
1515
1592
 
1516
1593
  /**
1517
1594
  * Parent, devis base used to create this one
@@ -1581,36 +1658,61 @@ export interface Devis extends Resource {
1581
1658
  enterprise: { percent: number; value: number };
1582
1659
  };
1583
1660
 
1584
- /************************************ V2 ************************************/
1585
- materialsCatalogs?: Array<string>;
1661
+ /**
1662
+ * BankDetails chosen by default in the enterprise settings
1663
+ */
1664
+ bankInfo?: BankDetails;
1665
+
1666
+ /**
1667
+ * Currency chosen by default in the enterprise settings
1668
+ */
1669
+ currency?: string;
1670
+
1671
+ /**
1672
+ * Payment planning (temporarily saved in the devis collection in Firestore)
1673
+ */
1674
+ paymentPlanning?: [
1675
+ {
1676
+ description: string;
1677
+ percent: number;
1678
+ }
1679
+ ];
1586
1680
 
1681
+ /************************************ V2 ************************************/
1587
1682
  operationsCatalog?: string;
1588
1683
 
1684
+ sector?: {
1685
+ label: string;
1686
+ value: number;
1687
+ };
1688
+
1589
1689
  history?: DevisHistoryItem[];
1590
1690
 
1591
- systemVersion?: number
1691
+ systemVersion?: number;
1592
1692
 
1593
1693
  format?: DevisFormatEnum;
1694
+
1695
+ bankDetails?: BankDetails;
1594
1696
  }
1595
1697
 
1596
1698
  export enum DevisHistoryType {
1597
1699
  CHANGE_STATUS = 'CHANGE_STATUS',
1598
1700
  SENT_TO_CLIENT = 'SENT_TO_CLIENT',
1599
1701
  EMAIL_EVENT = 'EMAIL_EVENT',
1600
- NEW_VERSION = 'NEW_VERSION'
1702
+ NEW_VERSION = 'NEW_VERSION',
1601
1703
  }
1602
1704
 
1603
1705
  export interface DevisHistoryItem {
1604
- date: number
1706
+ date: number;
1605
1707
  user?: {
1606
- id: string,
1607
- name: string,
1608
- email: string,
1609
- role: ROLE
1610
- photoUrl: string,
1611
- }
1612
- type: DevisHistoryType
1613
- data: any
1708
+ id: string;
1709
+ name: string;
1710
+ email: string;
1711
+ role: ROLE;
1712
+ photoUrl: string;
1713
+ };
1714
+ type: DevisHistoryType;
1715
+ data: any;
1614
1716
  }
1615
1717
 
1616
1718
  /**
@@ -1740,6 +1842,10 @@ export type Bill = Resource & {
1740
1842
  statusComment?: string;
1741
1843
  statusHistory?: any;
1742
1844
  files?: File[];
1845
+ // used to save information related with any possible external system
1846
+ metadata?: {
1847
+ sentToIpaidthat?: boolean;
1848
+ };
1743
1849
  };
1744
1850
 
1745
1851
  export type BillReceived = Bill & {
@@ -2528,6 +2634,12 @@ export enum HistoryActionEnum {
2528
2634
  DEVIS_APPROVED = 'DEVIS_APPROVED',
2529
2635
  DEVIS_SENT = 'DEVIS_SENT',
2530
2636
  DEVIS_SIGNED = 'DEVIS_SIGNED',
2637
+ CREATE_DOCUMENT = 'CREATE_DOCUMENT',
2638
+ CREATE_MEDIA = 'CREATE_MEDIA',
2639
+ CREATE_EVENT = 'CREATE_EVENT',
2640
+ CREATE_PLAN = 'CREATE_PLAN',
2641
+ VALIDATE_PLAN = 'VALIDATE_PLAN',
2642
+ INVALIDATE_PLAN = 'INVALIDATE_PLAN',
2531
2643
  }
2532
2644
 
2533
2645
  export interface History {
@@ -2553,6 +2665,11 @@ export enum HistoryEntityType {
2553
2665
  PROJECT = 'PROJECT',
2554
2666
  NOTE = 'NOTE',
2555
2667
  RECEPTION_VOUCHER = 'RECEPTION_VOUCHER',
2668
+ DOCUMENT = 'DOCUMENT',
2669
+ PLAN = 'PLAN',
2670
+ EVENT = 'EVENT',
2671
+ MEDIA = 'MEDIA',
2672
+ DEVIS = 'DEVIS',
2556
2673
  }
2557
2674
 
2558
2675
  export interface HistoryAction {
@@ -2790,5 +2907,4 @@ export interface OperationsGroup extends Resource {
2790
2907
  operations: string[];
2791
2908
  }
2792
2909
 
2793
- export interface DevisVersion extends Devis {
2794
- }
2910
+ export interface DevisVersion extends Devis {}