@bisondesk/core-sdk 1.0.21 → 1.0.23-B

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.
Files changed (225) hide show
  1. package/lib/apis/crm.d.ts +39 -0
  2. package/lib/apis/crm.d.ts.map +1 -0
  3. package/lib/apis/crm.js +201 -0
  4. package/lib/apis/crm.js.map +1 -0
  5. package/lib/apis/documents.d.ts +4 -0
  6. package/lib/apis/documents.d.ts.map +1 -0
  7. package/lib/apis/documents.js +47 -0
  8. package/lib/apis/documents.js.map +1 -0
  9. package/lib/apis/internet-vehicles.d.ts +3 -0
  10. package/lib/apis/internet-vehicles.d.ts.map +1 -0
  11. package/lib/apis/internet-vehicles.js +27 -0
  12. package/lib/apis/internet-vehicles.js.map +1 -0
  13. package/lib/apis/leasing-administration.d.ts +8 -0
  14. package/lib/apis/leasing-administration.d.ts.map +1 -0
  15. package/lib/apis/leasing-administration.js +49 -0
  16. package/lib/apis/leasing-administration.js.map +1 -0
  17. package/lib/apis/leasing.d.ts +19 -0
  18. package/lib/apis/leasing.d.ts.map +1 -0
  19. package/lib/apis/leasing.js +168 -0
  20. package/lib/apis/leasing.js.map +1 -0
  21. package/lib/apis/opportunities.d.ts +9 -0
  22. package/lib/apis/opportunities.d.ts.map +1 -0
  23. package/lib/apis/opportunities.js +94 -0
  24. package/lib/apis/opportunities.js.map +1 -0
  25. package/lib/apis/picklists.d.ts +5 -0
  26. package/lib/apis/picklists.d.ts.map +1 -0
  27. package/lib/apis/picklists.js +44 -0
  28. package/lib/apis/picklists.js.map +1 -0
  29. package/lib/apis/tenants.d.ts +7 -0
  30. package/lib/apis/tenants.d.ts.map +1 -0
  31. package/lib/apis/tenants.js +80 -0
  32. package/lib/apis/tenants.js.map +1 -0
  33. package/lib/apis/users.d.ts +3 -0
  34. package/lib/apis/users.d.ts.map +1 -0
  35. package/lib/apis/users.js +26 -0
  36. package/lib/apis/users.js.map +1 -0
  37. package/lib/apis/utils.d.ts +9 -0
  38. package/lib/apis/utils.d.ts.map +1 -0
  39. package/lib/apis/utils.js +23 -0
  40. package/lib/apis/utils.js.map +1 -0
  41. package/lib/apis/vehicles.d.ts +18 -0
  42. package/lib/apis/vehicles.d.ts.map +1 -0
  43. package/lib/apis/vehicles.js +159 -0
  44. package/lib/apis/vehicles.js.map +1 -0
  45. package/lib/constants.d.ts +77 -0
  46. package/lib/constants.d.ts.map +1 -1
  47. package/lib/constants.js +924 -1
  48. package/lib/constants.js.map +1 -1
  49. package/lib/ddb-entities.d.ts +2 -0
  50. package/lib/ddb-entities.d.ts.map +1 -0
  51. package/lib/ddb-entities.js +5 -0
  52. package/lib/ddb-entities.js.map +1 -0
  53. package/lib/types/activities.d.ts +38 -0
  54. package/lib/types/activities.d.ts.map +1 -0
  55. package/lib/types/activities.js +16 -0
  56. package/lib/types/activities.js.map +1 -0
  57. package/lib/types/crm.d.ts +103 -30
  58. package/lib/types/crm.d.ts.map +1 -1
  59. package/lib/types/crm.js +16 -0
  60. package/lib/types/crm.js.map +1 -1
  61. package/lib/types/definitions.d.ts +15 -13
  62. package/lib/types/definitions.d.ts.map +1 -1
  63. package/lib/types/documents.d.ts +105 -0
  64. package/lib/types/documents.d.ts.map +1 -0
  65. package/lib/types/{interests.js → documents.js} +1 -1
  66. package/lib/types/documents.js.map +1 -0
  67. package/lib/types/fields.d.ts +26 -25
  68. package/lib/types/fields.d.ts.map +1 -1
  69. package/lib/types/fields.js +4 -0
  70. package/lib/types/fields.js.map +1 -1
  71. package/lib/types/internet-vehicles.d.ts +64 -0
  72. package/lib/types/internet-vehicles.d.ts.map +1 -0
  73. package/lib/types/internet-vehicles.js +3 -0
  74. package/lib/types/internet-vehicles.js.map +1 -0
  75. package/lib/types/leads.d.ts +134 -0
  76. package/lib/types/leads.d.ts.map +1 -0
  77. package/lib/types/leads.js +3 -0
  78. package/lib/types/leads.js.map +1 -0
  79. package/lib/types/leasing-administration.d.ts +107 -0
  80. package/lib/types/leasing-administration.d.ts.map +1 -0
  81. package/lib/types/leasing-administration.js +3 -0
  82. package/lib/types/leasing-administration.js.map +1 -0
  83. package/lib/types/leasing-search.d.ts +22 -0
  84. package/lib/types/leasing-search.d.ts.map +1 -0
  85. package/lib/types/leasing-search.js +3 -0
  86. package/lib/types/leasing-search.js.map +1 -0
  87. package/lib/types/leasing-settings.d.ts +113 -0
  88. package/lib/types/leasing-settings.d.ts.map +1 -0
  89. package/lib/types/leasing-settings.js +10 -0
  90. package/lib/types/leasing-settings.js.map +1 -0
  91. package/lib/types/leasing.d.ts +322 -0
  92. package/lib/types/leasing.d.ts.map +1 -0
  93. package/lib/types/leasing.js +24 -0
  94. package/lib/types/leasing.js.map +1 -0
  95. package/lib/types/machines.d.ts +38 -0
  96. package/lib/types/machines.d.ts.map +1 -0
  97. package/lib/types/machines.js +3 -0
  98. package/lib/types/machines.js.map +1 -0
  99. package/lib/types/opportunities.d.ts +448 -0
  100. package/lib/types/opportunities.d.ts.map +1 -0
  101. package/lib/types/opportunities.js +68 -0
  102. package/lib/types/opportunities.js.map +1 -0
  103. package/lib/types/payments.d.ts +38 -0
  104. package/lib/types/payments.d.ts.map +1 -0
  105. package/lib/types/payments.js +9 -0
  106. package/lib/types/payments.js.map +1 -0
  107. package/lib/types/picklists.d.ts +15 -4
  108. package/lib/types/picklists.d.ts.map +1 -1
  109. package/lib/types/quotes.d.ts +173 -0
  110. package/lib/types/quotes.d.ts.map +1 -0
  111. package/lib/types/quotes.js +26 -0
  112. package/lib/types/quotes.js.map +1 -0
  113. package/lib/types/recently-viewed.d.ts +33 -0
  114. package/lib/types/recently-viewed.d.ts.map +1 -0
  115. package/lib/types/recently-viewed.js +3 -0
  116. package/lib/types/recently-viewed.js.map +1 -0
  117. package/lib/types/saved-filters.d.ts +20 -0
  118. package/lib/types/saved-filters.d.ts.map +1 -0
  119. package/lib/types/saved-filters.js +3 -0
  120. package/lib/types/saved-filters.js.map +1 -0
  121. package/lib/types/search.d.ts +26 -4
  122. package/lib/types/search.d.ts.map +1 -1
  123. package/lib/types/search.js.map +1 -1
  124. package/lib/types/settings.d.ts +50 -0
  125. package/lib/types/settings.d.ts.map +1 -0
  126. package/lib/types/settings.js +3 -0
  127. package/lib/types/settings.js.map +1 -0
  128. package/lib/types/storage.d.ts +1 -11
  129. package/lib/types/storage.d.ts.map +1 -1
  130. package/lib/types/storage.js +15 -0
  131. package/lib/types/storage.js.map +1 -1
  132. package/lib/types/templates.d.ts +35 -0
  133. package/lib/types/templates.d.ts.map +1 -0
  134. package/lib/types/templates.js +9 -0
  135. package/lib/types/templates.js.map +1 -0
  136. package/lib/types/tenants.d.ts +32 -9
  137. package/lib/types/tenants.d.ts.map +1 -1
  138. package/lib/types/tenants.js +11 -0
  139. package/lib/types/tenants.js.map +1 -1
  140. package/lib/types/users.d.ts +11 -3
  141. package/lib/types/users.d.ts.map +1 -1
  142. package/lib/types/utils.d.ts +20 -0
  143. package/lib/types/utils.d.ts.map +1 -1
  144. package/lib/types/utils.js +6 -0
  145. package/lib/types/utils.js.map +1 -1
  146. package/lib/types/vehicles.d.ts +406 -92
  147. package/lib/types/vehicles.d.ts.map +1 -1
  148. package/lib/types/vehicles.js +54 -1
  149. package/lib/types/vehicles.js.map +1 -1
  150. package/lib/types/website.d.ts +24 -0
  151. package/lib/types/website.d.ts.map +1 -0
  152. package/lib/types/website.js +3 -0
  153. package/lib/types/website.js.map +1 -0
  154. package/lib/utils/forms.d.ts +6 -0
  155. package/lib/utils/forms.d.ts.map +1 -0
  156. package/lib/utils/forms.js +33 -0
  157. package/lib/utils/forms.js.map +1 -0
  158. package/lib/utils/leasing.d.ts +3 -0
  159. package/lib/utils/leasing.d.ts.map +1 -0
  160. package/lib/utils/leasing.js +10 -0
  161. package/lib/utils/leasing.js.map +1 -0
  162. package/lib/utils/slug.d.ts +3 -0
  163. package/lib/utils/slug.d.ts.map +1 -0
  164. package/lib/utils/slug.js +23 -0
  165. package/lib/utils/slug.js.map +1 -0
  166. package/lib/utils/tenants.d.ts +4 -0
  167. package/lib/utils/tenants.d.ts.map +1 -0
  168. package/lib/utils/tenants.js +16 -0
  169. package/lib/utils/tenants.js.map +1 -0
  170. package/lib/utils/vehicles.d.ts +12 -0
  171. package/lib/utils/vehicles.d.ts.map +1 -0
  172. package/lib/utils/vehicles.js +73 -0
  173. package/lib/utils/vehicles.js.map +1 -0
  174. package/package.json +8 -6
  175. package/src/apis/crm.ts +302 -0
  176. package/src/apis/documents.ts +54 -0
  177. package/src/apis/internet-vehicles.ts +23 -0
  178. package/src/apis/leasing-administration.ts +70 -0
  179. package/src/apis/leasing.ts +257 -0
  180. package/src/apis/opportunities.ts +133 -0
  181. package/src/apis/picklists.ts +50 -0
  182. package/src/apis/tenants.ts +100 -0
  183. package/src/apis/users.ts +22 -0
  184. package/src/apis/utils.ts +23 -0
  185. package/src/apis/vehicles.ts +229 -0
  186. package/src/constants.ts +930 -1
  187. package/src/ddb-entities.ts +1 -0
  188. package/src/environment.d.ts +6 -0
  189. package/src/types/activities.ts +41 -0
  190. package/src/types/crm.ts +118 -30
  191. package/src/types/definitions.ts +19 -12
  192. package/src/types/documents.ts +110 -0
  193. package/src/types/fields.ts +72 -31
  194. package/src/types/internet-vehicles.ts +67 -0
  195. package/src/types/leads.ts +144 -0
  196. package/src/types/leasing-administration.ts +131 -0
  197. package/src/types/leasing-search.ts +24 -0
  198. package/src/types/leasing-settings.ts +111 -0
  199. package/src/types/leasing.ts +360 -0
  200. package/src/types/machines.ts +40 -0
  201. package/src/types/opportunities.ts +496 -0
  202. package/src/types/payments.ts +40 -0
  203. package/src/types/picklists.ts +26 -7
  204. package/src/types/quotes.ts +186 -0
  205. package/src/types/recently-viewed.ts +45 -0
  206. package/src/types/saved-filters.ts +21 -0
  207. package/src/types/search.ts +34 -4
  208. package/src/types/settings.ts +51 -0
  209. package/src/types/storage.ts +1 -12
  210. package/src/types/templates.ts +40 -0
  211. package/src/types/tenants.ts +37 -11
  212. package/src/types/users.ts +17 -3
  213. package/src/types/utils.ts +25 -0
  214. package/src/types/vehicles.ts +461 -93
  215. package/src/types/website.ts +28 -0
  216. package/src/utils/forms.ts +32 -0
  217. package/src/utils/leasing.ts +14 -0
  218. package/src/utils/slug.ts +19 -0
  219. package/src/utils/tenants.ts +14 -0
  220. package/src/utils/vehicles.ts +92 -0
  221. package/tsconfig.tsbuildinfo +1 -2995
  222. package/lib/types/interests.d.ts +0 -23
  223. package/lib/types/interests.d.ts.map +0 -1
  224. package/lib/types/interests.js.map +0 -1
  225. package/src/types/interests.ts +0 -20
@@ -0,0 +1,186 @@
1
+ import { AttachmentValue } from '@bisondesk/commons-sdk/lib/types';
2
+ import { OpportunityType } from '../constants';
3
+ import {
4
+ CustomLeasingQuoteExtraInput,
5
+ LeasingDeliveryPackageInput,
6
+ LeasingQuoteExtraInput,
7
+ } from './leasing-settings';
8
+ import { PricePercentageMode } from './utils';
9
+
10
+ export enum QuoteActions {
11
+ ACCEPT = 'accept',
12
+ VALIDATE = 'validate',
13
+ DONWLOAD_PDFS = 'download-pdfs',
14
+ CANCEL = 'cancel',
15
+ }
16
+
17
+ export enum QuoteStatus {
18
+ CREATED = 'created',
19
+ VALIDATED = 'validated',
20
+ INVALIDATED = 'invalidated',
21
+ ACCEPTED = 'accepted',
22
+ REJECTED = 'rejected',
23
+ CANCELLED = 'cancelled',
24
+ }
25
+
26
+ export enum LeasingQuoteMetricsScore {
27
+ DANGER = 'danger',
28
+ NEUTRAL = 'neutral',
29
+ GOOD = 'good',
30
+ }
31
+
32
+ type BaseLeasingCalculatorInput = {
33
+ branch: string;
34
+ branchCountry: string;
35
+ customerCountry: string;
36
+ vehicleCategory: string;
37
+ };
38
+
39
+ export type LeasingCalculatorDefaultInput = BaseLeasingCalculatorInput & {
40
+ salesPrice: string;
41
+ purchasePrice: string;
42
+ deliveryPackage?: LeasingQuoteExtraInput;
43
+ extras?: LeasingQuoteExtraInput[];
44
+ customRequests?: CustomLeasingQuoteExtraInput[];
45
+ };
46
+
47
+ export type LeasingCalculatorInput = BaseLeasingCalculatorInput & {
48
+ localLicensePlate: boolean;
49
+ vanCourier: boolean;
50
+ leasing: {
51
+ salesPrice: string;
52
+ deposit: string;
53
+ depositMode: PricePercentageMode;
54
+ depositPercentage: string;
55
+ residual: string;
56
+ residualMode: PricePercentageMode;
57
+ residualPercentage: string;
58
+ startupFee: string;
59
+ startupFeeMode: PricePercentageMode;
60
+ startupFeePercentage: string;
61
+ interestRate: string;
62
+ purchasePrice: string;
63
+ duration: number;
64
+ };
65
+ bank: {
66
+ interestRate: string;
67
+ deposit: string;
68
+ depositMode: PricePercentageMode;
69
+ depositPercentage: string;
70
+ residual: string;
71
+ residualMode: PricePercentageMode;
72
+ residualPercentage: string;
73
+ duration: number;
74
+ salesPrice: string;
75
+ };
76
+ taxes: {
77
+ yearlyRoadTax: boolean;
78
+ oneTimeRoadTax: boolean;
79
+ margin: string; //Non Editable, copies the value insurance > margin
80
+ };
81
+ insurance: {
82
+ margin: string;
83
+ civilLiabilities: boolean;
84
+ allRisks: boolean;
85
+ specialTechnicalInsurance: boolean;
86
+ roadAssistance: boolean;
87
+ };
88
+ deliveryPackage?: LeasingDeliveryPackageInput;
89
+ extras: LeasingQuoteExtraInput[];
90
+ customRequests: CustomLeasingQuoteExtraInput[];
91
+ };
92
+
93
+ export type LeasingCalculatorOutput = {
94
+ vatApplicable: boolean;
95
+ installment: string;
96
+ installmentPrintable: string;
97
+ totalMonthlyAmount: string;
98
+ monthlyTaxesInsurance: string;
99
+ beforeDelivery: string;
100
+ financingAmount: string;
101
+ settingId: string;
102
+ totalRetailAmount: string;
103
+ finalSalesPrice: string;
104
+ roi: {
105
+ value: string;
106
+ target: string;
107
+ perYear: string;
108
+ difference: string;
109
+ score: LeasingQuoteMetricsScore;
110
+ };
111
+ cashflow: {
112
+ deficit: string;
113
+ balanced: boolean;
114
+ score: LeasingQuoteMetricsScore;
115
+ };
116
+ profitability: {
117
+ leasing: string;
118
+ vehicle: string;
119
+ total: string;
120
+ score: LeasingQuoteMetricsScore;
121
+ };
122
+ taxes: {
123
+ yearlyRetailPrice: string;
124
+ monthlyRetailPrice: string;
125
+ yearlyRoadTax: string;
126
+ oneTimeRoadTax: string;
127
+ };
128
+ insurance: {
129
+ yearlyRetailPrice: string;
130
+ monthlyRetailPrice: string;
131
+ civilLiabilities: string;
132
+ allRisks: string;
133
+ specialTechnicalInsurance: string;
134
+ roadAssistance: string;
135
+ };
136
+ costs: {
137
+ financingAmount: string;
138
+ finalCostPrice: string;
139
+ monhtly: string;
140
+ trackAndTrace: string;
141
+ };
142
+ };
143
+
144
+ type BaseLeasingQuote = {
145
+ opportunityId: string;
146
+ calculatorInput: LeasingCalculatorInput;
147
+ calculatorOutput: LeasingCalculatorOutput;
148
+ type: OpportunityType;
149
+ preferredLanguage: string;
150
+ };
151
+
152
+ export type NewLeasingQuote = BaseLeasingQuote & {
153
+ id?: undefined;
154
+ createdAt?: undefined;
155
+ createdBy?: undefined;
156
+ modifiedAt?: undefined;
157
+ modifiedBy?: undefined;
158
+ active: true;
159
+ };
160
+
161
+ export type LeasingQuote = BaseLeasingQuote & {
162
+ id: string;
163
+ createdAt: string;
164
+ createdBy: string;
165
+ modifiedAt: string;
166
+ modifiedBy: string;
167
+ validationBy?: string;
168
+ validationAt?: string;
169
+ cancelledBy?: string;
170
+ cancelledAt?: string;
171
+ customerFeedbackAt?: string;
172
+ customerFeedbackBy?: string;
173
+ version: number;
174
+ status: QuoteStatus;
175
+ proformaPdf?: AttachmentValue;
176
+ quotePdf?: AttachmentValue;
177
+ active: boolean;
178
+ contactId: string;
179
+ vehicleId: string;
180
+ organizationId: string;
181
+ };
182
+
183
+ export type QuoteUpdate = {
184
+ status?: QuoteStatus;
185
+ active?: boolean;
186
+ };
@@ -0,0 +1,45 @@
1
+ import { AttachmentValue, Requester } from '@bisondesk/commons-sdk/lib/types';
2
+ import { BusinessEntityIds } from '../constants';
3
+
4
+ export type ViewedItemsRequest = {
5
+ businessEntity?: string;
6
+ id?: string;
7
+ };
8
+
9
+ export type NewViewedItem = {
10
+ businessEntity: BusinessEntityIds;
11
+ id: string;
12
+ viewedAt: string;
13
+ };
14
+
15
+ export type ViewedItemMeta = {
16
+ title: string;
17
+ subtitle: string;
18
+ thumbnail?: AttachmentValue | null; // null signals that it can have a thumbnail, it is just not available
19
+ };
20
+
21
+ export type ViewedItem = ViewedItemMeta & {
22
+ viewedAt: string;
23
+ id: string;
24
+ actions: string[];
25
+ };
26
+
27
+ export type RawViewedItem = {
28
+ id: string;
29
+ viewedAt: string;
30
+ };
31
+
32
+ export type ViewedItemHandler = (
33
+ requester: Requester,
34
+ req: ViewedItemsRequest,
35
+ itemsBusinessEntity: BusinessEntityIds,
36
+ items: RawViewedItem[]
37
+ ) => Promise<ViewedItem[]>;
38
+
39
+ export type ViewedItemsContextHandlers = {
40
+ [entity in BusinessEntityIds]?: ViewedItemHandler;
41
+ };
42
+
43
+ export type ViewedItemsHandlersCollection = {
44
+ [entity in BusinessEntityIds]?: ViewedItemsContextHandlers;
45
+ };
@@ -0,0 +1,21 @@
1
+ import { BusinessEntityIds } from '../constants';
2
+ import { ComplexFilter } from './search';
3
+
4
+ type SavedFilterQuery = {
5
+ conditions: {
6
+ [fieldId: string]: ComplexFilter;
7
+ };
8
+ fullText?: string;
9
+ };
10
+
11
+ export type SavedFilter = SavedFilterQuery & {
12
+ id: string;
13
+ businessEntityId: BusinessEntityIds;
14
+ name: string;
15
+ userId: string;
16
+ };
17
+
18
+ export type NewSavedFilterRequest = SavedFilterQuery & {
19
+ businessEntityId: BusinessEntityIds;
20
+ name: string;
21
+ };
@@ -2,6 +2,9 @@
2
2
  // Generic stuff
3
3
  ///////////////////////////////////////////////////////
4
4
 
5
+ import { MultiLangValue } from '@bisondesk/commons-sdk/lib/types';
6
+ import { FieldTypes, NumberMeta } from './fields';
7
+
5
8
  export enum ConditionType {
6
9
  and = 'AND',
7
10
  or = 'OR',
@@ -90,6 +93,13 @@ export type SearchRequest = {
90
93
  sortBy?: SortFilter[];
91
94
  };
92
95
 
96
+ export type PublicSearchRequest = {
97
+ limit: number;
98
+ offset?: number;
99
+ query?: ComplexFilter;
100
+ sortBy?: SortFilter[];
101
+ };
102
+
93
103
  ///////////////////////////////////////////////////////
94
104
  // Aggregations
95
105
  ///////////////////////////////////////////////////////
@@ -107,11 +117,24 @@ export enum AggregationType {
107
117
  }
108
118
 
109
119
  export type TermAggregation = {
110
- priority: number;
111
- fieldType: 'string' | 'number' | 'boolean';
120
+ titles: MultiLangValue;
121
+ fieldId: string;
112
122
  type: AggregationType.term;
123
+
113
124
  orderBy?: 'count' | 'field';
114
- };
125
+ } & (
126
+ | {
127
+ fieldType: FieldTypes.picklist;
128
+ picklistId: string;
129
+ }
130
+ | {
131
+ fieldType: FieldTypes.number;
132
+ meta?: NumberMeta;
133
+ }
134
+ | {
135
+ fieldType: Exclude<FieldTypes, FieldTypes.picklist | FieldTypes.number>;
136
+ }
137
+ );
115
138
 
116
139
  export type Range =
117
140
  | {
@@ -128,10 +151,12 @@ export type Range =
128
151
  };
129
152
 
130
153
  export type RangeAggregation = {
131
- priority: number;
154
+ titles: MultiLangValue;
155
+ fieldId: string;
132
156
  type: AggregationType.range;
133
157
  step: number;
134
158
  ranges: Range[];
159
+ format?: NumberMeta;
135
160
  };
136
161
 
137
162
  export type Aggregation = TermAggregation | RangeAggregation;
@@ -151,3 +176,8 @@ export type AggregationResult = {
151
176
  export type AggregationResultSet = {
152
177
  [field: string]: AggregationResult[];
153
178
  };
179
+
180
+ export type AggregationResponse<M = {}> = {
181
+ results: AggregationResultSet;
182
+ meta: M;
183
+ };
@@ -0,0 +1,51 @@
1
+ export type WebsiteSettings = {
2
+ contacts: {
3
+ destinations: string[];
4
+ };
5
+ leasing?: {
6
+ interestRate: number;
7
+ initialValues: {
8
+ residual: number;
9
+ deposit: number;
10
+ periods: number;
11
+ };
12
+ maxPeriods: number;
13
+ };
14
+ gatsbyCloud?: {
15
+ webhook: string;
16
+ };
17
+ };
18
+
19
+ export type HyperportalSettings = {
20
+ hcTenantId: string;
21
+ crm: {
22
+ active: boolean;
23
+ };
24
+ vehicles: {
25
+ active: boolean;
26
+ ignoreBeforeDate?: string; // do not modify vehicles created before this date;
27
+ };
28
+ leasing: {
29
+ active: boolean;
30
+ contractTransferDefinitionId: string;
31
+ contractDealDefinitionId: string;
32
+ contractOwner: { [countryCode: string]: string };
33
+ };
34
+ };
35
+
36
+ export type HyperportalMachinesSettings = {
37
+ hcTenantId: string;
38
+ active: boolean;
39
+ };
40
+
41
+ export type LeasingCreditorBranch = {
42
+ bciNumber: string;
43
+ vatNumber: string;
44
+ licenceDate: string;
45
+ becrisFirstReportDate: string;
46
+ becrisStartDate: string;
47
+ };
48
+
49
+ export type LeasingCreditorSettings = {
50
+ [branchId: string]: LeasingCreditorBranch;
51
+ };
@@ -1,12 +1 @@
1
- export type UploadInfo = {
2
- id: string;
3
- uploadUrl: string;
4
- downloadUrl: string;
5
- };
6
-
7
- export type GetUploadUrlRequest = {
8
- businessEntityId: string;
9
- fieldId: string;
10
- fileName: string;
11
- contentType: string;
12
- };
1
+ export * from '@bisondesk/commons-sdk/lib/storage';
@@ -0,0 +1,40 @@
1
+ export enum TemplateType {
2
+ Email = 'email',
3
+ Sms = 'sms',
4
+ }
5
+
6
+ export type TemplateContent =
7
+ | {
8
+ type: TemplateType.Email;
9
+ subject: string;
10
+ content: {
11
+ html: string;
12
+ design: any;
13
+ };
14
+ }
15
+ | {
16
+ type: TemplateType.Sms;
17
+ content: string;
18
+ };
19
+
20
+ export type NewTemplateRequest = {
21
+ id?: string;
22
+ country: string;
23
+ name: string;
24
+ } & TemplateContent;
25
+
26
+ export type Template = {
27
+ id: string;
28
+ modifiedAt: string;
29
+ modifiedBy: string;
30
+ country: string;
31
+ name: string;
32
+ } & TemplateContent;
33
+
34
+ export type TemplateInfo = {
35
+ id: string;
36
+ countries: string[];
37
+ modifiedAt: string;
38
+ name: string;
39
+ type: TemplateType;
40
+ };
@@ -1,29 +1,55 @@
1
1
  import { Region } from '@bisondesk/commons-sdk/lib/types';
2
2
 
3
- export type NewTenant = {
4
- country: string;
5
- region: Region;
3
+ export type PublicTenant = {
4
+ defaultCountry: string;
5
+ defaultCurrency: string;
6
+ defaultLanguage: string;
7
+ id: string; // the id is provided on creation bc we assume tenants will be created by someone on the team
6
8
  name: string;
7
- languages: string[];
9
+ region: Region;
8
10
  subdomain: string;
9
- currency: string;
10
- };
11
11
 
12
- export type Tenant = NewTenant & {
13
- id: string;
14
- subdomain: string;
15
12
  // Pay attention to what information is added here since
16
13
  // the tenant can be obtained without authentication
17
14
  };
18
15
 
16
+ export enum TenantModule {
17
+ CRM = 'crm',
18
+ Docs = 'docs',
19
+ Leads = 'leads',
20
+ Leasing = 'leasing',
21
+ Market = 'market',
22
+ Opportunities = 'opportunities',
23
+ VehiclesMasterData = 'vehicles_master_data',
24
+ }
25
+
26
+ export type Tenant = PublicTenant & {
27
+ languages: [string, ...string[]];
28
+ conglomerate?: string;
29
+ emailDomain: string;
30
+ hyperdmsIds?: string[];
31
+ hyperportalId?: string;
32
+ exactAccounting?: boolean;
33
+ branches: [Branch, ...Branch[]];
34
+ modules: TenantModule[];
35
+ };
36
+
37
+ export type Branch = {
38
+ id: string;
39
+ name: string;
40
+ country: string;
41
+ exactAccounting?: boolean;
42
+ currency: string;
43
+ adminNumberPrefix: string;
44
+ stockNumberPrefix: string;
45
+ };
46
+
19
47
  export type HdmsVehiclesSync = {
20
48
  active: boolean;
21
- filterName: string;
22
49
  };
23
50
 
24
51
  export type HdmsCrmSync = {
25
52
  active: boolean;
26
- filterName: string;
27
53
  };
28
54
 
29
55
  export type TenantSyncSettings = {
@@ -1,4 +1,9 @@
1
- import { AttachmentValue, PhoneNumberRawValue, PhoneNumberValue } from './fields';
1
+ import { AppRoles } from '@bisondesk/commons-sdk/lib/constants';
2
+ import {
3
+ AttachmentValue,
4
+ PhoneNumberRawValue,
5
+ PhoneNumberValue,
6
+ } from '@bisondesk/commons-sdk/lib/types';
2
7
 
3
8
  export type NewUserRequest = {
4
9
  email: string;
@@ -6,7 +11,16 @@ export type NewUserRequest = {
6
11
  language: string;
7
12
  lastName: string;
8
13
  phone: PhoneNumberRawValue;
9
- roles: string[];
14
+ picture?: AttachmentValue;
15
+ roles: AppRoles[];
16
+ };
17
+
18
+ export type ValidNewUserRequest = Omit<NewUserRequest, 'phone'> & {
19
+ phone: PhoneNumberValue;
20
+ };
21
+
22
+ export type UpdateUserRequest = Omit<User, 'phone'> & {
23
+ phone: PhoneNumberRawValue | PhoneNumberValue;
10
24
  };
11
25
 
12
26
  export type User = {
@@ -19,7 +33,7 @@ export type User = {
19
33
  lastName: string;
20
34
  phone: PhoneNumberValue;
21
35
  picture?: AttachmentValue;
22
- roles: string[];
36
+ roles: AppRoles[];
23
37
  updatedAt: string;
24
38
  };
25
39
 
@@ -1,3 +1,6 @@
1
+ import { MultiLangValue } from '@bisondesk/commons-sdk/lib/types';
2
+ import { AdHocPicklistValueDisplay } from './picklists';
3
+
1
4
  export type CountryInfo = {
2
5
  code: string; // code is ISO 3166-1 alpha-2
3
6
  name: string;
@@ -25,3 +28,25 @@ export type Country = {
25
28
  name: string;
26
29
  dialCode: number;
27
30
  };
31
+
32
+ export type ReferenceData = {
33
+ recordTitles: AdHocRecordTitles;
34
+ picklistTitles: AdHocPicklistValueDisplay;
35
+ };
36
+
37
+ export type AdHocRecordTitles = {
38
+ [businessEntityId: string]: {
39
+ [recordId: string]: string | MultiLangValue;
40
+ };
41
+ };
42
+
43
+ export type DataRecord<T, M = undefined> = {
44
+ record: T;
45
+ meta?: M; // typically ReferenceData
46
+ actions: string[];
47
+ };
48
+
49
+ export enum PricePercentageMode {
50
+ CURRENCY = 'currency',
51
+ PERCENTAGE = 'percentage',
52
+ }