@placeshakr/config 10.19.12 → 10.19.13-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.
@@ -42,6 +42,7 @@ const productionEnvironment: Environment = {
42
42
  medias: 'enterprises/{enterpriseId}/projects/{projectId}/medias',
43
43
  events: 'enterprises/{enterpriseId}/projects/{projectId}/events',
44
44
  notes: 'enterprises/{enterpriseId}/projects/{projectId}/notes',
45
+ visitReports: 'enterprises/{enterpriseId}/projects/{projectId}/visitReports',
45
46
  documents: 'enterprises/{enterpriseId}/projects/{projectId}/documents',
46
47
  devis: 'enterprises/{enterpriseId}/projects/{projectId}/devis',
47
48
  admins: 'enterprises/{enterpriseId}/admins',
@@ -50,7 +51,6 @@ const productionEnvironment: Environment = {
50
51
  tasks: 'enterprises/{enterpriseId}/projects/{projectId}/tasks',
51
52
  externalPlans:
52
53
  'enterprises/{enterpriseId}/projects/{projectId}/externalPlans',
53
- payments: 'enterprises/{enterpriseId}/projects/{projectId}/payments',
54
54
  downPayments: 'enterprises/{enterpriseId}/projects/{projectId}/downPayments',
55
55
  providers: 'enterprises/{enterpriseId}/providers',
56
56
  statuses: 'enterprises/{enterpriseId}/statuses',
@@ -89,6 +89,7 @@ const productionEnvironment: Environment = {
89
89
  events:
90
90
  'enterprises/{enterpriseId}/projects/{projectId}/events/{eventId}',
91
91
  notes: 'enterprises/{enterpriseId}/projects/{projectId}/notes/{noteId}',
92
+ visitReports: 'enterprises/{enterpriseId}/projects/{projectId}/visitReports/{visitReportId}',
92
93
  documents:
93
94
  'enterprises/{enterpriseId}/projects/{projectId}/documents/{documentId}',
94
95
  devis: 'enterprises/{enterpriseId}/projects/{projectId}/devis/{devisId}',
@@ -99,8 +100,6 @@ const productionEnvironment: Environment = {
99
100
  task: 'enterprises/{enterpriseId}/projects/{projectId}/tasks/{taskId}',
100
101
  externalPlans:
101
102
  'enterprises/{enterpriseId}/projects/{projectId}/externalPlans/{externalPlanId}',
102
- payments:
103
- 'enterprises/{enterpriseId}/projects/{projectId}/payments/{paymentId}',
104
103
  downPayments: 'enterprises/{enterpriseId}/projects/{projectId}/downPayments/{downPaymentId}',
105
104
  paymentMethods:
106
105
  'enterprises/{enterpriseId}/paymentMethods/{paymentMethodId}',
@@ -141,6 +140,7 @@ const productionEnvironment: Environment = {
141
140
  medias: 'projects-medias',
142
141
  events: 'projects-events',
143
142
  notes: 'projects-notes',
143
+ visitReports: 'projects-visitReports',
144
144
  documents: 'projects-documents',
145
145
  devis: 'projects-devis',
146
146
  admins: 'admins',
@@ -148,7 +148,6 @@ const productionEnvironment: Environment = {
148
148
  taskGroups: 'projects-taskGroups',
149
149
  tasks: 'projects-tasks',
150
150
  externalPlans: 'projects-externalPlans',
151
- payments: 'projects-payments',
152
151
  downPayments: 'projects-downPayments',
153
152
  providers: 'providers',
154
153
  statuses: 'statuses',
@@ -335,10 +334,11 @@ const productionEnvironment: Environment = {
335
334
  operations: {
336
335
  searchableAttributes: ['name', 'unitPrice', 'objectID'],
337
336
  attributesForFaceting: [
338
- 'searchable(lot)',
339
337
  'unitPrice',
338
+ 'searchable(lot)',
340
339
  'searchable(scope)',
341
- 'catalogId',
340
+ 'searchable(catalogId)',
341
+ 'searchable(category)'
342
342
  ],
343
343
  maxValuesPerFacet: 1000,
344
344
  maxFacetHits: 100
@@ -413,6 +413,13 @@ const productionEnvironment: Environment = {
413
413
  maxValuesPerFacet: 1000,
414
414
  maxFacetHits: 100
415
415
  },
416
+ visitReports: {
417
+ searchableAttributes: ['title'],
418
+ attributesForFaceting: ['projectId', 'searchable(scope)'],
419
+ ranking: ['desc(createdAt)'],
420
+ maxValuesPerFacet: 1000,
421
+ maxFacetHits: 100
422
+ },
416
423
  medias: {
417
424
  searchableAttributes: ['name'],
418
425
  attributesForFaceting: [
@@ -479,13 +486,6 @@ const productionEnvironment: Environment = {
479
486
  maxValuesPerFacet: 1000,
480
487
  maxFacetHits: 100
481
488
  },
482
- payments: {
483
- searchableAttributes: ['percent', 'devisId', 'projectId'],
484
- attributesForFaceting: ['searchable(devisId)', 'searchable(projectId)', 'searchable(scope)'],
485
- ranking: ['asc(date)'],
486
- maxValuesPerFacet: 1000,
487
- maxFacetHits: 100
488
- },
489
489
  downPayments: {
490
490
  searchableAttributes: ['percent', 'devisId', 'projectId', 'billId', 'locked'],
491
491
  attributesForFaceting: ['searchable(billId)', 'searchable(locked)', 'searchable(devisId)', 'searchable(projectId)', 'searchable(scope)'],
@@ -29,6 +29,7 @@ const test: EnvironmentDecorator = (base: Environment) => ({
29
29
  medias: 'tests-projects-medias',
30
30
  events: 'tests-projects-events',
31
31
  notes: 'tests-projects-notes',
32
+ visitReports: 'tests-projects-visit-reports',
32
33
  documents: 'tests-projects-documents',
33
34
  devis: 'tests-projects-devis',
34
35
  admins: 'tests-admins',
@@ -85,6 +86,7 @@ const emulator: EnvironmentDecorator = (base: Environment) => ({
85
86
  medias: 'emulator-projects-medias',
86
87
  events: 'emulator-projects-events',
87
88
  notes: 'emulator-projects-notes',
89
+ visitReports: 'emulator-projects-visit-reports',
88
90
  documents: 'emulator-projects-documents',
89
91
  devis: 'emulator-projects-devis',
90
92
  admins: 'emulator-admins',
@@ -42,6 +42,7 @@ export interface Environment {
42
42
  medias: string;
43
43
  events: string;
44
44
  notes: string;
45
+ visitReports: string;
45
46
  documents: string;
46
47
  devis: string;
47
48
  admins: string;
@@ -49,7 +50,6 @@ export interface Environment {
49
50
  taskGroups: string;
50
51
  tasks: string;
51
52
  externalPlans: string;
52
- payments: string;
53
53
  downPayments: string;
54
54
  providers: string;
55
55
  statuses: string;
@@ -89,6 +89,7 @@ export interface Environment {
89
89
  medias: string;
90
90
  events: string;
91
91
  notes: string;
92
+ visitReports: string;
92
93
  documents: string;
93
94
  devis: string;
94
95
  admins: string;
@@ -96,7 +97,6 @@ export interface Environment {
96
97
  taskGroups: string;
97
98
  tasks: string;
98
99
  externalPlans: string;
99
- payments: string;
100
100
  downPayments: string;
101
101
  providers: string;
102
102
  statuses: string;
@@ -133,6 +133,7 @@ export interface Environment {
133
133
  medias: string;
134
134
  events: string;
135
135
  notes: string;
136
+ visitReports: string;
136
137
  documents: string;
137
138
  devis: string;
138
139
  admin: string;
@@ -140,7 +141,6 @@ export interface Environment {
140
141
  taskGroup: string;
141
142
  task: string;
142
143
  externalPlans: string;
143
- payments: string;
144
144
  downPayments: string;
145
145
  provider: string;
146
146
  status: string;
@@ -9,6 +9,7 @@ export interface Helpers {
9
9
  users: FactoryCreate<articho.User>;
10
10
  profiles: FactoryCreate<articho.Profile>;
11
11
  notes: FactoryCreate<articho.Note>;
12
+ visitReports: FactoryCreate<articho.VisitReport>;
12
13
  medias: FactoryCreate<articho.Media>;
13
14
  materials: FactoryCreate<articho.Material>;
14
15
  bills: FactoryCreate<articho.Bill>;
@@ -59,6 +60,7 @@ const helpers: Helpers = {
59
60
  profiles: FactoryCreateFunction(),
60
61
  projects: FactoryCreateFunction(),
61
62
  notes: FactoryCreateFunction(),
63
+ visitReports: FactoryCreateFunction(),
62
64
  materials: FactoryCreateFunction(),
63
65
  medias: FactoryCreateFunction(),
64
66
  plans: FactoryCreateFunction(),
package/src/types.ts CHANGED
@@ -29,6 +29,7 @@ export type ResourceType =
29
29
  | Event
30
30
  | Plan
31
31
  | Note
32
+ | VisitReport
32
33
  | TaskGroup
33
34
  | Task
34
35
  | Devis
@@ -375,6 +376,10 @@ export interface Enterprise extends Resource {
375
376
  }>;
376
377
 
377
378
  certificates: Certificate[];
379
+
380
+ pluginsConfig?: {
381
+ visitReport?: boolean;
382
+ };
378
383
  }
379
384
 
380
385
  export type Certificate = { name: string; number: number };
@@ -715,7 +720,7 @@ export interface SuperAdmin extends Profile {
715
720
  role: ROLE.SUPERADMIN;
716
721
  }
717
722
 
718
- export interface Commissions {
723
+ export type Commissions = {
719
724
  /**
720
725
  * Percentage corresponding to the company
721
726
  */
@@ -1045,6 +1050,92 @@ export interface Note extends Resource {
1045
1050
  images: File[];
1046
1051
  }
1047
1052
 
1053
+ /**
1054
+ * Represents a project visit report
1055
+ */
1056
+ export interface VisitReport extends Resource {
1057
+ visitDate: number;
1058
+ postalCode: string;
1059
+ surface: number;
1060
+ tenants: number;
1061
+ incomeLevel: string;
1062
+ yearBuilt: number;
1063
+ floors: number;
1064
+ ceilingHeight: number;
1065
+ terracedHouse: boolean;
1066
+ windowType: string[];
1067
+ windowTypeDescription?: string;
1068
+ murType: string;
1069
+ indoorTemp: number;
1070
+ boilerCondensation: string;
1071
+ boilerBrand: string;
1072
+ boilerRef: string;
1073
+ boilerWeight: number;
1074
+ boilerDimensions: string;
1075
+ boilerDiameter: string;
1076
+ boilerFiles: File[];
1077
+ installDifficulty: string;
1078
+ installInfoExtra: string;
1079
+ wallDescription: string;
1080
+ wallFiles: File[];
1081
+ doorHeight: number;
1082
+ doorWidth: number;
1083
+ accessibilityDescription: string;
1084
+ accessibilityFiles: File[];
1085
+ electricSubscription: string;
1086
+ electricPower: string;
1087
+ electricPanelPlace: boolean;
1088
+ electricFiles: File[];
1089
+ distanceUnitIntAndPanel: number;
1090
+ unitIntLocation: string;
1091
+ unitIntFiles: File[];
1092
+ distanceUiUe: number;
1093
+ unitOutsideLocation: string;
1094
+ unitOutsideFiles: File[];
1095
+ domesticHWTDescription: string;
1096
+ domesticHWTFiles: File[];
1097
+ hotWater: boolean;
1098
+ emitterType: string;
1099
+ radiatorType: string;
1100
+ radiatorFiles: File[];
1101
+ hotWaterLoop: boolean;
1102
+ nearbyDrainDescription: string;
1103
+ nearbyDrainFiles: File[];
1104
+ heatingNetworkType: string[];
1105
+ heatingNetworkDiameter: string;
1106
+ heatingNetworkFiles: File[];
1107
+ networkEFAndDHWType: string[];
1108
+ networkEFAndDHWDiameter: string;
1109
+ networkEFAndDHWFiles: File[];
1110
+ comments: string;
1111
+ additionalFiles: File[];
1112
+
1113
+ devisType: string;
1114
+ devisTypeDescription?: string;
1115
+
1116
+ estimatedResult: {
1117
+ power: number,
1118
+ devis: string,
1119
+ equipment: string,
1120
+ equipmentSize: string,
1121
+ helps: { name: string, value: number }[]
1122
+ };
1123
+ customResult?: {
1124
+ power: string,
1125
+ devis: string,
1126
+ equipment: string,
1127
+ equipmentSize: string,
1128
+ helps: { name: string, value: number }[]
1129
+ };
1130
+ title: string;
1131
+ status: VisitReportStatus;
1132
+ }
1133
+
1134
+ export enum VisitReportStatus {
1135
+ IN_PROGRESS = 'IN_PROGRESS',
1136
+ VALID = 'VALID',
1137
+ }
1138
+
1048
1139
  export interface Media extends Resource {
1049
1140
  /**
1050
1141
  * When this resource has been created but onlu the date (not time)
@@ -1352,7 +1443,7 @@ export interface DevisMaterial extends Material {
1352
1443
  /**
1353
1444
  *
1354
1445
  */
1355
- responsible?: 'CLIENT' | 'PRO' | 'ENTERPRISE' | 'SELLER';
1446
+ responsible?: ItemResponsible;
1356
1447
  /**
1357
1448
  *
1358
1449
  */
@@ -1391,6 +1482,8 @@ export interface DevisMaterial extends Material {
1391
1482
  fixed?: boolean;
1392
1483
 
1393
1484
  quantityConfig?: number
1485
+
1486
+ commissions?: Commissions
1394
1487
  }
1395
1488
 
1396
1489
  export interface Order extends Resource {
@@ -1423,6 +1516,9 @@ export interface DevisPiece extends Resource {
1423
1516
  /** Piece, example: bathroom, kitchen */
1424
1517
  name: string;
1425
1518
 
1519
+ /** Used when the piece is a lot */
1520
+ color?: string;
1521
+
1426
1522
  /**
1427
1523
  * Display operations open or compresed
1428
1524
  */
@@ -1437,6 +1533,8 @@ export interface DevisPiece extends Resource {
1437
1533
  * Only used when devis format is PIECE
1438
1534
  */
1439
1535
  surfaces?: PieceSurfaces;
1536
+
1537
+ commissions?: Commissions
1440
1538
  }
1441
1539
 
1442
1540
  /**
@@ -1534,6 +1632,12 @@ export interface DevisOperation extends Resource {
1534
1632
  blockPrice?: boolean;
1535
1633
 
1536
1634
  blockTVA?: boolean;
1635
+
1636
+ adjustmentComplement?: string
1637
+
1638
+ commissions?: Commissions
1639
+
1640
+ responsible?: ItemResponsible;
1537
1641
  }
1538
1642
 
1539
1643
  /**
@@ -1548,7 +1652,7 @@ export interface Devis extends Resource {
1548
1652
  /**
1549
1653
  * Status
1550
1654
  */
1551
- status: 'CREATED' | 'SENT' | 'APPROVED' | 'REFUSED' | 'ABANDONED';
1655
+ status: DevisStatusEnum;
1552
1656
 
1553
1657
  /**
1554
1658
  * Devis prices
@@ -1649,8 +1753,11 @@ export interface Devis extends Resource {
1649
1753
  * Used to copy commission values and TVA from provider when devis is created
1650
1754
  * whit this is possible to change provider config values and don't affect devis already created
1651
1755
  */
1652
- providerData?: Commissions & {
1756
+ providerData?: {
1653
1757
  tva: number;
1758
+ pro: number;
1759
+ provider: number;
1760
+ enterprise: number;
1654
1761
  };
1655
1762
 
1656
1763
  /**
@@ -1677,12 +1784,12 @@ export interface Devis extends Resource {
1677
1784
  /**
1678
1785
  * Payment planning (temporarily saved in the devis collection in Firestore)
1679
1786
  */
1680
- paymentPlanning?: [
1681
- {
1682
- description: string;
1683
- percent: number;
1684
- }
1685
- ];
1787
+ paymentPlanning?: { description: string; percent: number; }[];
1788
+
1789
+ /**
1790
+ * Allow user to add some additionals informations into the devis pdf depending on the section choose
1791
+ */
1792
+ docMetadata?: DocMetadataItem[];
1686
1793
 
1687
1794
  /************************************ V2 ************************************/
1688
1795
  operationsCatalog?: string;
@@ -1701,6 +1808,12 @@ export interface Devis extends Resource {
1701
1808
  bankDetails?: BankDetails;
1702
1809
  }
1703
1810
 
1811
+ export interface DocMetadataItem {
1812
+ section?: DevisPdfSectionEnum | string;
1813
+ title: string;
1814
+ value: string | number;
1815
+ }
1816
+
1704
1817
  export enum DevisHistoryType {
1705
1818
  CHANGE_STATUS = 'CHANGE_STATUS',
1706
1819
  SENT_TO_CLIENT = 'SENT_TO_CLIENT',
@@ -2092,7 +2205,10 @@ export interface UserNotification extends Resource {
2092
2205
  };
2093
2206
  }
2094
2207
 
2095
- export type SelectOption = { label: string; value: string };
2208
+ export type SelectOption = {
2209
+ label: string;
2210
+ value: any;
2211
+ };
2096
2212
 
2097
2213
  export enum MaterialsProviderType {
2098
2214
  // created by the enterprises and use algolia index 'materials'
@@ -2152,6 +2268,13 @@ export enum DevisViewMode {
2152
2268
  CLIENT,
2153
2269
  }
2154
2270
 
2271
+ export enum DevisPdfSectionEnum {
2272
+ FINANCIAL_HELP = 'FINANCIAL_HELP',
2273
+ PROJECT = 'PROJECT',
2274
+ CLIENT = 'CLIENT',
2275
+ PROJECT_MANAGER = 'PROJECT_MANAGER',
2276
+ }
2277
+
2155
2278
  export enum DocumentsTypeEnum {
2156
2279
  DEVIS = 'DEVIS',
2157
2280
  DOCUMENT = 'DOCUMENT',
@@ -2176,11 +2299,11 @@ export enum ExternalPlanTypeEnum {
2176
2299
 
2177
2300
  export enum BillIssuedStatus {
2178
2301
  PROVISIONAL = 'PROVISIONAL',
2302
+ WAITING = 'WAITING',
2179
2303
  CREATED = 'CREATED',
2180
2304
  SENT = 'SENT',
2181
- WAITING = 'WAITING',
2182
- BLOCKED = 'BLOCKED',
2183
2305
  PAID = 'PAID',
2306
+ BLOCKED = 'BLOCKED',
2184
2307
  CANCELED = 'CANCELED',
2185
2308
  }
2186
2309
 
@@ -2407,6 +2530,7 @@ export interface ProjectCounter {
2407
2530
  externalPlans: number;
2408
2531
  medias: number;
2409
2532
  notes: number;
2533
+ visitReports: number;
2410
2534
  plans: number;
2411
2535
  taskGroups: number;
2412
2536
  tasks: number;
@@ -2784,6 +2908,11 @@ export interface OperationV2 extends Resource {
2784
2908
  */
2785
2909
  lot: string;
2786
2910
 
2911
+ /**
2912
+ * The operation base price
2913
+ */
2914
+ basePrice: number;
2915
+
2787
2916
  /**
2788
2917
  * The operation unit price
2789
2918
  */
@@ -2880,13 +3009,14 @@ export interface OperationV2Material extends Material {
2880
3009
  quantity: number;
2881
3010
  loss: number;
2882
3011
  rounded: boolean;
2883
- responsible: string;
3012
+ responsible: ItemResponsible;
2884
3013
  fixed: boolean;
2885
3014
  optId: string;
2886
3015
  complement?: string;
2887
3016
  }
2888
3017
 
2889
- export enum MaterialResponsible {
3018
+ export enum ItemResponsible {
3019
+ NONE = 'NONE',
2890
3020
  CLIENT = 'CLIENT',
2891
3021
  PRO = 'PRO',
2892
3022
  AGENT = 'AGENT',