@placeshakr/config 10.20.4 → 10.20.5-alpha.10

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.
@@ -79,12 +79,20 @@ const productionEnvironment: Environment = {
79
79
  logs: 'enterprises/{enterpriseId}/logs',
80
80
  systemVersions: 'systemVersions',
81
81
  userProfiles: 'users/{userId}/profiles',
82
+ evaluationsConfig: 'enterprises/{enterpriseId}/evaluationsConfig',
83
+ evaluations: 'enterprises/{enterpriseId}/evaluations',
84
+ devisCandidates:
85
+ 'enterprises/{enterpriseId}/projects/{projectId}/devisCandidates',
86
+ workOrders: 'enterprises/{enterpriseId}/workOrders',
87
+ candidatures:
88
+ 'enterprises/{enterpriseId}/projects/{projectId}/candidatures',
82
89
  },
83
90
  docs: {
84
91
  user: 'users/{userId}',
85
92
  userProfile: 'users/{userId}/profiles/{enterpriseId}',
86
93
  billing: 'enterprises/{enterpriseId}/billing/{billingId}',
87
94
  enterprise: 'enterprises/{enterpriseId}',
95
+
88
96
  global: 'global/stats',
89
97
  project: 'enterprises/{enterpriseId}/projects/{projectId}',
90
98
  medias:
@@ -144,6 +152,14 @@ const productionEnvironment: Environment = {
144
152
  'enterprises/{enterpriseId}/configurations/{configurationId}',
145
153
  log: 'enterprises/{enterpriseId}/logs/{logId}',
146
154
  systemVersion: 'systemVersions/{systemVersionId}',
155
+ evaluationConfig:
156
+ 'enterprises/{enterpriseId}/evaluationsConfig/{evaluationConfigId}',
157
+ evaluation: 'enterprises/{enterpriseId}/evaluations/{evaluationId}',
158
+ devisCandidate:
159
+ 'enterprises/{enterpriseId}/projects/{projectId}/devisCandidates/{devisCandidateId}',
160
+ workOrder: 'enterprises/{enterpriseId}/workOrders/{workOrderId}',
161
+ candidature:
162
+ 'enterprises/{enterpriseId}/projects/{projectId}/candidatures/{candidatureId}',
147
163
  },
148
164
  indexes: {
149
165
  // users
@@ -164,6 +180,7 @@ const productionEnvironment: Environment = {
164
180
  operationsMaterials: 'operations-materials',
165
181
  estimations: 'estimations',
166
182
  nomenclatures: 'nomenclatures',
183
+ workOrders: 'workOrders',
167
184
  // used only for managment
168
185
  systemMaterials: 'system-materials',
169
186
  systemOperations: 'system-operations',
@@ -367,11 +384,14 @@ const productionEnvironment: Environment = {
367
384
  'sellers.email',
368
385
  'provider.name',
369
386
  'status',
387
+ 'workOrderId.region',
388
+ 'workOrderId.skills',
370
389
  ],
371
390
  attributesForFaceting: [
372
391
  'parent.id',
373
392
  'price.total',
374
393
  'searchable(type)',
394
+ 'searchable(priority)',
375
395
  'searchable(status)',
376
396
  'client.userId',
377
397
  'searchable(client.displayName)',
@@ -393,6 +413,10 @@ const productionEnvironment: Environment = {
393
413
  'searchable(sellerManager)',
394
414
  'searchable(sellerReference)',
395
415
  'searchable(scope)',
416
+ 'searchable(marketplaceStatus)',
417
+ 'searchable(candidates)',
418
+ 'searchable(workOrderId.region)',
419
+ 'searchable(workOrderId.skills)',
396
420
  ],
397
421
  ranking: [
398
422
  'attribute',
@@ -407,6 +431,24 @@ const productionEnvironment: Environment = {
407
431
  maxValuesPerFacet: 1000,
408
432
  maxFacetHits: 100,
409
433
  },
434
+ workOrders: {
435
+ searchableAttributes: [
436
+ 'reference',
437
+ 'address',
438
+ 'estimatedPrice',
439
+ 'owner.displayName',
440
+ ],
441
+ attributesForFaceting: [
442
+ 'owner',
443
+ 'searchable(scope)',
444
+ 'searchable(priority)',
445
+ 'searchable(status)',
446
+ 'searchable(owner.userId)',
447
+ ],
448
+ ranking: ['desc(createdAt)'],
449
+ maxValuesPerFacet: 1000,
450
+ maxFacetHits: 100,
451
+ },
410
452
  medias: {
411
453
  searchableAttributes: ['name'],
412
454
  attributesForFaceting: [
@@ -560,6 +602,21 @@ const productionEnvironment: Environment = {
560
602
  maxValuesPerFacet: 1000,
561
603
  maxFacetHits: 100,
562
604
  },
605
+ workOrder: {
606
+ searchableAttributes: ['reference'],
607
+ attributesForFaceting: [
608
+ 'searchable(scope)',
609
+ 'searchable(status)',
610
+ 'searchable(priority)',
611
+ 'searchable(candidates)',
612
+ 'searchable(agenceName)',
613
+ 'searchable(skills)',
614
+ 'searchable(client)',
615
+ ],
616
+ ranking: ['asc(createdAt)'],
617
+ maxValuesPerFacet: 1000,
618
+ maxFacetHits: 100,
619
+ },
563
620
  },
564
621
  };
565
622
 
@@ -38,6 +38,7 @@ const test: EnvironmentDecorator = (base: Environment) => ({
38
38
  operationsCatalogs: 'operations-catalogs',
39
39
  nomenclatures: 'nomenclatures',
40
40
  operationsGroups: 'operations-groups',
41
+ workOrders: 'work-orders',
41
42
  // used only for managment
42
43
  systemMaterials: 'system-materials',
43
44
  systemOperations: 'system-operations',
@@ -45,7 +46,7 @@ const test: EnvironmentDecorator = (base: Environment) => ({
45
46
  systemMaterialsProvider: 'system-materials-provider',
46
47
  systemStatus: 'test-system-status',
47
48
  systemNomenclatures: 'test-system-nomenclatures',
48
- systemCategories: 'system-categories'
49
+ systemCategories: 'system-categories',
49
50
  },
50
51
  },
51
52
  isTest: true,
@@ -78,6 +79,7 @@ const emulator: EnvironmentDecorator = (base: Environment) => ({
78
79
  operationsCatalogs: 'operations-catalogs',
79
80
  nomenclatures: 'nomenclatures',
80
81
  operationsGroups: 'operations-groups',
82
+ workOrders: 'work-orders',
81
83
  // used only for managment
82
84
  systemMaterials: 'system-materials',
83
85
  systemOperations: 'system-operations',
@@ -85,7 +87,7 @@ const emulator: EnvironmentDecorator = (base: Environment) => ({
85
87
  systemMaterialsProvider: 'system-materials-provider',
86
88
  systemStatus: 'emulator-system-status',
87
89
  systemNomenclatures: 'emulator-system-nomenclatures',
88
- systemCategories: 'system-categories'
90
+ systemCategories: 'system-categories',
89
91
  },
90
92
  },
91
93
  isTest: true,
@@ -50,6 +50,7 @@ export interface Environment {
50
50
  operationsMaterials: string;
51
51
  estimations: string;
52
52
  nomenclatures: string;
53
+ workOrders: string;
53
54
  // used only for management - 7
54
55
  systemMaterials: string;
55
56
  systemOperations: string;
@@ -101,6 +102,11 @@ export interface Environment {
101
102
  logs: string;
102
103
  systemVersions: string;
103
104
  userProfiles: string;
105
+ evaluationsConfig: string;
106
+ evaluations: string;
107
+ devisCandidates: string;
108
+ workOrders: string;
109
+ candidatures: string;
104
110
  };
105
111
  docs: {
106
112
  user: string;
@@ -146,6 +152,11 @@ export interface Environment {
146
152
  configuration: string;
147
153
  log: string;
148
154
  systemVersion: string;
155
+ evaluationConfig: string;
156
+ evaluation: string;
157
+ devisCandidate: string;
158
+ workOrder: string;
159
+ candidature: string;
149
160
  };
150
161
  };
151
162
 
@@ -43,6 +43,11 @@ export interface Helpers {
43
43
  enterpriseMedias: FactoryCreate<articho.EnterpriseResourse>;
44
44
  configurations: FactoryCreate<articho.Configuration>;
45
45
  systemVersions: FactoryCreate<articho.SystemVersion>;
46
+ evaluationConfig: FactoryCreate<articho.EvaluationConfig>;
47
+ evaluations: FactoryCreate<articho.Evaluation>;
48
+ devisCandidates: FactoryCreate<articho.Evaluation>;
49
+ workOrders: FactoryCreate<articho.WorkOrder>;
50
+ candidatures: FactoryCreate<articho.Candidatures>;
46
51
  indexes: FactoryCreate<any>;
47
52
  }
48
53
 
@@ -100,7 +105,12 @@ const helpers: Helpers = {
100
105
  enterpriseMedias: FactoryCreateFunction(),
101
106
  configurations: FactoryCreateFunction(),
102
107
  systemVersions: FactoryCreateFunction(),
108
+ evaluationConfig: FactoryCreateFunction(),
109
+ evaluations: FactoryCreateFunction(),
103
110
  indexes: FactoryCreateFunction(),
111
+ devisCandidates: FactoryCreateFunction(),
112
+ workOrders: FactoryCreateFunction(),
113
+ candidatures: FactoryCreateFunction(),
104
114
  };
105
115
 
106
116
  export default helpers;
package/src/types.ts CHANGED
@@ -429,7 +429,7 @@ export interface Enterprise extends Resource {
429
429
  certificates: Certificate[];
430
430
 
431
431
  /**
432
- * Used to enabled or disable pluguins on the system
432
+ * Used to enabled or disable plugins on the system
433
433
  */
434
434
  pluginsConfig?: {
435
435
  visitReport?: boolean;
@@ -438,6 +438,7 @@ export interface Enterprise extends Resource {
438
438
  quoteAdvancedWithNewDesign?: boolean;
439
439
  exportLogs?: boolean;
440
440
  whatsapp?: boolean;
441
+ marketplace?: boolean;
441
442
  };
442
443
 
443
444
  /**
@@ -457,8 +458,30 @@ export interface Enterprise extends Resource {
457
458
  * Providers configuration
458
459
  */
459
460
  providersConfiguration?: ProvidersConfiguration;
461
+
462
+ /**
463
+ * Professional evalution config
464
+ */
465
+ proEvaluationConfig?: ProEvaluationItem[];
466
+
467
+ /**
468
+ * All marketplace's properties at enterprise level
469
+ */
470
+ marketplace?: EnterpriseMarketplace;
460
471
  }
461
472
 
473
+ export interface ProEvaluationItem {
474
+ title: string;
475
+ order: number;
476
+ percent: number;
477
+ description?: string;
478
+ }
479
+
480
+ export type EnterpriseMarketplace = {
481
+ maxCandidatesPerProject: number;
482
+ maxApplicationsAtSameTime: number;
483
+ };
484
+
462
485
  export type Certificate = { name: string; number: number };
463
486
 
464
487
  export interface StatusWorkflow {
@@ -1068,7 +1091,7 @@ export interface EnterpriseResourse extends Resource {
1068
1091
  export interface Project extends Resource {
1069
1092
  name: string;
1070
1093
  image?: File;
1071
- category: ProjectCategoriesEnum;
1094
+ category: string;
1072
1095
  surface: number;
1073
1096
  address: string;
1074
1097
 
@@ -1169,6 +1192,37 @@ export interface Project extends Resource {
1169
1192
  * Number of projects inside the project's enterprise
1170
1193
  */
1171
1194
  projectIndex: number;
1195
+
1196
+ /************************** MARKETPLACE **************************/
1197
+ /**
1198
+ * Used to display the project inside marketplace
1199
+ */
1200
+ marketplaceStatus?: MarketplaceStatus;
1201
+ /**
1202
+ * List of current users who applies the project
1203
+ */
1204
+ candidates?: string[];
1205
+ /**
1206
+ * Determines how many professionals can apply for the project
1207
+ */
1208
+ numberOfCandidates?: number;
1209
+ /**
1210
+ * creater the relation with his work order that generate this project
1211
+ */
1212
+ workOrderId?: string;
1213
+ /**
1214
+ * Save last time project was published in marketplace
1215
+ */
1216
+ marketplacePublishDate?: number;
1217
+ /**
1218
+ * Save how many times this projects has been publihsed on the marketplace
1219
+ */
1220
+ marketplaceRepublishCount?: number;
1221
+ }
1222
+
1223
+ export enum MarketplaceStatus {
1224
+ OPEN = 'OPEN',
1225
+ CLOSE = 'CLOSE',
1172
1226
  }
1173
1227
 
1174
1228
  /**
@@ -1947,6 +2001,17 @@ export interface Devis extends Resource {
1947
2001
  * Define if devis can be edited or not
1948
2002
  */
1949
2003
  blocked?: boolean;
2004
+
2005
+ /**
2006
+ * Defined from where is coming this devis, in markeplace case to know if is created from a devisCandidate
2007
+ */
2008
+ origin?: DevisOriginEnum;
2009
+ }
2010
+
2011
+ export enum DevisOriginEnum {
2012
+ MARKETPLACE = 'MARKETPLACE',
2013
+ DUPLICATE = 'DUPLICATE',
2014
+ TEMPLATE = 'TEMPLATE',
1950
2015
  }
1951
2016
 
1952
2017
  export interface DocMetadataItem {
@@ -2712,6 +2777,23 @@ export enum ProSkillsEnum {
2712
2777
  INSULATION = 'insulation',
2713
2778
  }
2714
2779
 
2780
+ export enum MarketplaceProSkillsEnum {
2781
+ STRUCTURAL_WORKS = 'structural_works',
2782
+ WATERPROOFING = 'waterproofing',
2783
+ METAL_FRAME = 'metal_frame',
2784
+ ELECTRICAL_INSTALLATION = 'electrical_installation',
2785
+ VIDEO_CONTROL_SECURITY = 'video_control_security',
2786
+ INTERIOR_DESIGN = 'interior_design',
2787
+ INTERIOR_CARPENTRY = 'interior_carpentry',
2788
+ PLUMBING_WC = 'plumbing_wc',
2789
+ ALL_TRADES = 'all_trades', // TCE
2790
+ CLADDING = 'cladding',
2791
+ WATER_SUPPLY = 'water_supply',
2792
+ DECONTAMINATION = 'decontamination',
2793
+ DISPOSAL_SMOKES = 'disposal_smokes',
2794
+ ATMOSPHERE_RELEASES = 'atmosphere_releases',
2795
+ }
2796
+
2715
2797
  export enum CommercialStatusEnum {
2716
2798
  CONTRACTOR = 'CONTRACTOR',
2717
2799
  EIRL = 'EIRL',
@@ -3080,6 +3162,14 @@ export enum EmailTemplate {
3080
3162
  MEDIAS = 'medias',
3081
3163
  EXPORT_LOGS = 'export-logs',
3082
3164
  PLAN_VALIDATED = 'plan-validated',
3165
+
3166
+ MARKETPLACE_WORK_ORDER_APPROVED = 'marketplace-work-order-approved',
3167
+ MARKETPLACE_CLOSE_PROJECT = 'marketplace-close-project',
3168
+ MARKETPLACE_WRONG_BILL = 'marketplace-wrong-bill',
3169
+ MARKETPLACE_PROJECT_PRO_APPLIED = 'marketplace-project-pro-applied',
3170
+ MARKETPLACE_PROJECT_PRO_SELECTED = 'marketplace-project-pro-selected',
3171
+ MARKETPLACE_WORK_ORDER_READY_TO_VALIDATE = 'marketplace-workorder-ready-to-validate',
3172
+ MARKETPLACE_WORK_ORDER_STATUS_CHANGED = 'marketplace-workorder-status-changed',
3083
3173
  }
3084
3174
 
3085
3175
  export enum DevisPdfType {
@@ -3088,6 +3178,11 @@ export enum DevisPdfType {
3088
3178
  ENTERPRISE = 'enterprise',
3089
3179
  }
3090
3180
 
3181
+ export enum DevisPdfMode {
3182
+ REGULAR = 'regular',
3183
+ SIMPLE = 'simple',
3184
+ }
3185
+
3091
3186
  export enum DevisContractingEntity {
3092
3187
  PROVIDER = 'provider',
3093
3188
  ENTERPRISE = 'enterprise',
@@ -3264,6 +3359,7 @@ export enum NomenclaturesIdentifier {
3264
3359
  COMMENTS_MODELS = 'COMMENTS_MODELS',
3265
3360
  EMAILS_COMMENTS_MODELS = 'EMAILS_COMMENTS_MODELS',
3266
3361
  PAYMENT_PLANNING = 'PAYMENT_PLANNING',
3362
+ PROJECTS_PRIORITY = 'PROJECTS_PRIORITY',
3267
3363
  }
3268
3364
 
3269
3365
  /**
@@ -3642,3 +3738,111 @@ export enum BillIssuedReasons {
3642
3738
  CREDIT_NOTE_ADMINISTRATIVE = 'CREDIT_NOTE_ADMINISTRATIVE',
3643
3739
  CREDIT_NOTE_OPERATIONAL = 'CREDIT_NOTE_OPERATIONAL',
3644
3740
  }
3741
+
3742
+ export enum EvaluationConfigIdentifier {
3743
+ PRO = 'PRO',
3744
+ }
3745
+
3746
+ export interface EvaluationConfigQuestion {
3747
+ order: number;
3748
+ title: string;
3749
+ weight: number;
3750
+ required: boolean;
3751
+ description?: string;
3752
+ }
3753
+
3754
+ export interface EvaluationConfig extends Resource {
3755
+ identifier: EvaluationConfigIdentifier;
3756
+ questions: EvaluationConfigQuestion[];
3757
+ }
3758
+
3759
+ export interface Evaluation extends Resource {
3760
+ identifier: EvaluationConfigIdentifier;
3761
+ questions: QuestionResponse[];
3762
+ result: number;
3763
+ projectId: string;
3764
+ userId: string;
3765
+ notes: string;
3766
+ }
3767
+
3768
+ export interface QuestionResponse extends EvaluationConfigQuestion {
3769
+ value?: number;
3770
+ text?: string;
3771
+ }
3772
+
3773
+ export interface DevisCandidate extends Devis {}
3774
+
3775
+ export enum WorkOrderStatusEnum {
3776
+ CREATED = 'CREATED',
3777
+ TO_VALIDATE = 'TO_VALIDATE',
3778
+ APPROVED = 'APPROVED',
3779
+ REFUSED = 'REFUSED',
3780
+ }
3781
+
3782
+ export interface WorkOrderStatusHistory {
3783
+ before: WorkOrderStatusEnum;
3784
+ after: WorkOrderStatusEnum;
3785
+ date: number;
3786
+ userId: string;
3787
+ comments: string;
3788
+ }
3789
+
3790
+ export enum WorkOrderPriceRange {
3791
+ LESS_2500 = 'LESS_2500',
3792
+ MORE_2500_LESS_10000 = 'MORE_2500_LESS_10000',
3793
+ MORE_10000_LESS_40000 = 'MORE_10000_LESS_40000',
3794
+ MORE_40000 = 'MORE_40000',
3795
+ }
3796
+
3797
+ export interface WorkOrder extends Resource {
3798
+ title: string;
3799
+ /**
3800
+ * Référence interne à la SNCF généré par l’outil iGO en
3801
+ * amont de la création de l’OT dans la marketplace
3802
+ */
3803
+ reference: string;
3804
+ /**
3805
+ * Nom de l’Agence Bâtiment Energies (ABE) de la SNCF
3806
+ */
3807
+ agenceName: string;
3808
+ /**
3809
+ * Permet de retranscrire précisément le besoin travaux
3810
+ */
3811
+ description: string;
3812
+ /**
3813
+ * Adresse du lieu des travaux (N°-Rue-Nom de la voie-CP-Ville)
3814
+ */
3815
+ address: string;
3816
+ addressComments: string;
3817
+ region: string;
3818
+ priority: string;
3819
+ estimatedDate: number;
3820
+ files: File[];
3821
+ images: File[];
3822
+ estimatedPrice?: number;
3823
+ rangeOfPrice?: WorkOrderPriceRange;
3824
+ daysToClose: number;
3825
+ status: WorkOrderStatusEnum;
3826
+ statusHistory: WorkOrderStatusHistory[];
3827
+
3828
+ mandatorySiteVisit: boolean;
3829
+ client: string;
3830
+ centralInformationAccounting: string;
3831
+ localInformationAccounting: string;
3832
+ /**
3833
+ * It is used to filter professionals projects inside marketplace based on his skills
3834
+ */
3835
+ skills: string[];
3836
+ /**
3837
+ * It is used to determine if it is a job where there are toxic substances such as lead.
3838
+ */
3839
+ toxicSubstances: boolean;
3840
+ /**
3841
+ * Reference to the project once the order is approved and a new project created with its data
3842
+ */
3843
+ projectId?: string;
3844
+ }
3845
+
3846
+ export interface Candidatures extends Resource {
3847
+ userId: string;
3848
+ }