@fragus/sam-types 1.0.0

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 (149) hide show
  1. package/README.md +75 -0
  2. package/package.json +24 -0
  3. package/types/SettlementPaymentType.d.ts +0 -0
  4. package/types/SettlementPaymentType.js +1 -0
  5. package/types/SettlementPaymentType.js.map +1 -0
  6. package/types/SettlementPaymentType.ts +0 -0
  7. package/types/accessKey/index.d.ts +12 -0
  8. package/types/address.d.ts +18 -0
  9. package/types/admin/auth/index.d.ts +2 -0
  10. package/types/admin/auth/login.d.ts +28 -0
  11. package/types/admin/auth/roles.d.ts +10 -0
  12. package/types/admin/chart/contractCharts.d.ts +70 -0
  13. package/types/admin/chart/dashboardCharts.d.ts +57 -0
  14. package/types/admin/chart/index.d.ts +12 -0
  15. package/types/admin/contactInformation/index.d.ts +9 -0
  16. package/types/admin/contract/balanceStatistics.d.ts +37 -0
  17. package/types/admin/contract/basicInfo.d.ts +21 -0
  18. package/types/admin/contract/contractDetails.d.ts +82 -0
  19. package/types/admin/contract/health.d.ts +1 -0
  20. package/types/admin/contract/index.d.ts +6 -0
  21. package/types/admin/contract/internalContractNotes.d.ts +23 -0
  22. package/types/admin/contract/settleContract.d.ts +3 -0
  23. package/types/admin/contract/templateLookup.d.ts +20 -0
  24. package/types/admin/contractCreation/carData.d.ts +20 -0
  25. package/types/admin/contractCreation/contractCreation.d.ts +314 -0
  26. package/types/admin/contractCreation/index.d.ts +3 -0
  27. package/types/admin/contractCreation/priceCalculation.d.ts +83 -0
  28. package/types/admin/contractProvider/index.d.ts +47 -0
  29. package/types/admin/customer/customer.d.ts +29 -0
  30. package/types/admin/customer/customerList.d.ts +9 -0
  31. package/types/admin/customer/index.d.ts +2 -0
  32. package/types/admin/index.d.ts +13 -0
  33. package/types/admin/payment/index.d.ts +1 -0
  34. package/types/admin/payment/payment.d.ts +13 -0
  35. package/types/admin/product/index.d.ts +1 -0
  36. package/types/admin/product/product.d.ts +40 -0
  37. package/types/admin/stripe/index.d.ts +1 -0
  38. package/types/admin/stripe/stripeTOS.d.ts +7 -0
  39. package/types/admin/user/index.d.ts +2 -0
  40. package/types/admin/user/responseErrors/index.d.ts +3 -0
  41. package/types/admin/user/responseErrors/passwordResponseErrors.d.ts +1 -0
  42. package/types/admin/user/user.d.ts +23 -0
  43. package/types/admin/user/userList.d.ts +19 -0
  44. package/types/admin/vehicle/index.d.ts +1 -0
  45. package/types/admin/vehicle/vehicle.d.ts +58 -0
  46. package/types/admin/vehicleBlacklist/index.d.ts +16 -0
  47. package/types/admin/workshop/index.d.ts +1 -0
  48. package/types/admin/workshop/workshop.d.ts +5 -0
  49. package/types/app.d.ts +5 -0
  50. package/types/brand.d.ts +4 -0
  51. package/types/chart.d.ts +38 -0
  52. package/types/contactPerson.d.ts +16 -0
  53. package/types/contract/contract.d.ts +75 -0
  54. package/types/contract/contractActivation.d.ts +5 -0
  55. package/types/contract/contractFilter.d.ts +58 -0
  56. package/types/contract/contractList.d.ts +53 -0
  57. package/types/contract/contractOffer.d.ts +34 -0
  58. package/types/contract/contractQuery.d.ts +68 -0
  59. package/types/contractAction.d.ts +40 -0
  60. package/types/contractOption.d.ts +50 -0
  61. package/types/contractProvider.d.ts +116 -0
  62. package/types/contractTemplate.d.ts +94 -0
  63. package/types/country.d.ts +32 -0
  64. package/types/currency.d.ts +1 -0
  65. package/types/customer.d.ts +10 -0
  66. package/types/durationOptions.d.ts +31 -0
  67. package/types/errorResponse.d.ts +19 -0
  68. package/types/fuelType.d.ts +9 -0
  69. package/types/includedContractOption.d.ts +18 -0
  70. package/types/index.d.ts +210 -0
  71. package/types/index.js +166 -0
  72. package/types/index.js.map +1 -0
  73. package/types/index.ts +229 -0
  74. package/types/invoice.d.ts +13 -0
  75. package/types/locale.d.ts +24 -0
  76. package/types/localizationData.d.ts +7 -0
  77. package/types/model.d.ts +4 -0
  78. package/types/outage.d.ts +9 -0
  79. package/types/payment.d.ts +53 -0
  80. package/types/paymentFailureReason.d.ts +6 -0
  81. package/types/priceCalculation.d.ts +27 -0
  82. package/types/priceSpecification.d.ts +20 -0
  83. package/types/product.d.ts +23 -0
  84. package/types/productPartial.d.ts +18 -0
  85. package/types/providerBranding.d.ts +48 -0
  86. package/types/queryParams.d.ts +51 -0
  87. package/types/releaseNotes/index.d.ts +33 -0
  88. package/types/reports/reports.d.ts +50 -0
  89. package/types/resetPassword.d.ts +3 -0
  90. package/types/responseErrors/HttpStatusCodes.d.ts +391 -0
  91. package/types/responseErrors/adjustmentRequestResponseErrors.d.ts +1 -0
  92. package/types/responseErrors/adminPaymentErrors.d.ts +6 -0
  93. package/types/responseErrors/calculatorResponseErrors.d.ts +35 -0
  94. package/types/responseErrors/contractResponseErrors.d.ts +23 -0
  95. package/types/responseErrors/fileImportErrors.d.ts +5 -0
  96. package/types/responseErrors/genericResponseTypes.d.ts +33 -0
  97. package/types/responseErrors/importErrors.d.ts +7 -0
  98. package/types/responseErrors/index.d.ts +30 -0
  99. package/types/responseErrors/invalidProductTypeErrors.d.ts +1 -0
  100. package/types/responseErrors/invalidProductTypeErrors.js +3 -0
  101. package/types/responseErrors/invalidProductTypeErrors.js.map +1 -0
  102. package/types/responseErrors/invalidProductTypeErrors.ts +1 -0
  103. package/types/responseErrors/invoiceErrors.d.ts +1 -0
  104. package/types/responseErrors/invoiceErrors.js +3 -0
  105. package/types/responseErrors/invoiceErrors.js.map +1 -0
  106. package/types/responseErrors/invoiceErrors.ts +1 -0
  107. package/types/responseErrors/passwordResponseErrors.d.ts +6 -0
  108. package/types/responseErrors/paymentResponseErrors.d.ts +5 -0
  109. package/types/responseErrors/rateLimitErrors.d.ts +1 -0
  110. package/types/responseErrors/userAndCustomerErrors.d.ts +1 -0
  111. package/types/responseErrors/userAndCustomerErrors.js +3 -0
  112. package/types/responseErrors/userAndCustomerErrors.js.map +1 -0
  113. package/types/responseErrors/userAndCustomerErrors.ts +11 -0
  114. package/types/responseErrors/vatLookupResponseErrors.d.ts +3 -0
  115. package/types/responseErrors/vehcileBlacklistErrors.d.ts +3 -0
  116. package/types/responseErrors/vehicleBlacklistErrors.d.ts +2 -0
  117. package/types/searchQuery.d.ts +21 -0
  118. package/types/stripe/stripe.d.ts +49 -0
  119. package/types/stripe/stripeAddress.d.ts +10 -0
  120. package/types/stripe/stripeDateOfBirth.d.ts +5 -0
  121. package/types/stripe/stripeDeclineChargeOn.d.ts +4 -0
  122. package/types/stripe/stripeExternalAccount.d.ts +19 -0
  123. package/types/stripe/stripeLegalEntity.d.ts +16 -0
  124. package/types/stripe/stripeOwner.d.ts +9 -0
  125. package/types/stripe/stripeVerification.d.ts +33 -0
  126. package/types/termsOfService.d.ts +11 -0
  127. package/types/translation.d.ts +3 -0
  128. package/types/translations/index.d.ts +38 -0
  129. package/types/user.d.ts +10 -0
  130. package/types/userConfiguration/tableUserConfiguration.d.ts +15 -0
  131. package/types/userConfiguration/userConfiguration.d.ts +5 -0
  132. package/types/v4PricingTool/dealerAndProvider/index.d.ts +44 -0
  133. package/types/v4PricingTool/dealerAndProvider/index.js +3 -0
  134. package/types/v4PricingTool/dealerAndProvider/index.js.map +1 -0
  135. package/types/v4PricingTool/dealerAndProvider/index.ts +66 -0
  136. package/types/v4PricingTool/index.d.ts +2 -0
  137. package/types/v4PricingTool/productsAndContracts/index.d.ts +2 -0
  138. package/types/v4PricingTool/productsAndContracts/index.js +7 -0
  139. package/types/v4PricingTool/productsAndContracts/index.js.map +1 -0
  140. package/types/v4PricingTool/productsAndContracts/index.ts +10 -0
  141. package/types/vatLookup.d.ts +14 -0
  142. package/types/vehicle.d.ts +160 -0
  143. package/types/vehicleContracts.d.ts +15 -0
  144. package/types/vehiclePartial.d.ts +24 -0
  145. package/types/warranty.d.ts +19 -0
  146. package/types/webcalc/auth.d.ts +48 -0
  147. package/types/webcalc/index.d.ts +2 -0
  148. package/types/webcalc/offerRequest.d.ts +18 -0
  149. package/types/workshopOperation.d.ts +18 -0
@@ -0,0 +1,314 @@
1
+ import { IContractDetailsRecord } from '..'
2
+ import { DurationOptions, IContractOptionResponse, TMileageDurationsMap, TV4PTProductType } from '../..'
3
+ import { IContractTemplateResponse, IGenericContractTemplateResponse, PriceSource } from '../../contractTemplate'
4
+ import { PaymentGateway, PaymentType } from '../../payment'
5
+ import { Other } from '../../product'
6
+ import { ITermsOfServiceResponse } from '../../termsOfService'
7
+ import { IVehicleInfo, TVehicleType, Vehicle, VehicleAlongItsContracts } from '../../vehicle'
8
+ import { IAdminCustomer } from '../customer/customer'
9
+ import { PriceSpecification } from './../../priceSpecification'
10
+ import { ICarCollection } from './carData'
11
+ import { IContractCalculationResponse } from './priceCalculation'
12
+
13
+
14
+ export type ContractType = 'STANDARD' | 'CUSTOM' | 'EXTERNAL'
15
+
16
+ export type ServiceContractFlag = 'DISTRIBUTE_DOWNPAYMENT' | 'NULLIFY_DOWNPAYMENT'
17
+
18
+ export interface IContractCreationData {
19
+ payment: IContractCreationPayment
20
+ termsOfTradeRef?: string
21
+ cars: ICarCollection
22
+ templates: IGenericContractTemplateResponse[]
23
+ templatesAllDisabled?: boolean
24
+ }
25
+
26
+ export interface IProviderHasAccessToProductsRequest {
27
+ providerId: number | string
28
+ }
29
+
30
+ export interface IProviderHasAccessToProductsResponse {
31
+ hasAccess: boolean
32
+ }
33
+
34
+ export interface IContractCreationPayment {
35
+ stripeToken: string
36
+ paymentGateways: PaymentGateway[]
37
+ }
38
+
39
+ export type ContractValueTypeEnum = 'Mileage' | 'Hours' | 'Services' | 'None'
40
+ export type ContractValueType = Exclude<ContractValueTypeEnum, 'None'> | undefined
41
+
42
+ interface ICommonContractUpdateRequest {
43
+ priceSource?: PriceSource
44
+ contractProductType: TV4PTProductType | null
45
+ contractProviderId: number
46
+ contractTemplateId: number | null
47
+ serviceVariantId: string
48
+ serviceVariantName: string
49
+ value?: number
50
+ valueType: ContractValueType
51
+ duration: number
52
+ mileage?: number
53
+ startDateISOString: string
54
+ optionIds: number[]
55
+ providerPayments: number
56
+ providerShare: number
57
+ reference?: string
58
+ startMileage?: number
59
+ startValue?: number
60
+ startValueType: ContractValueType
61
+ type: ContractType
62
+ offerExpiresAt?: Date
63
+ }
64
+
65
+ interface ISubscription {
66
+ amountPrPayment: PriceSpecification
67
+ firstPaymentDate: Date
68
+ lastPaymentDate: Date
69
+ numberOfPayments: number
70
+ }
71
+
72
+ interface IOptionInfo {
73
+ name: string
74
+ abbreviation: string
75
+ description: string
76
+ termsOfService?: ITermsOfServiceResponse | null
77
+ }
78
+
79
+ interface IContractInfo {
80
+ templateName: string
81
+ prettyIdentifier: string
82
+ minimumPaymentsCount: null | number
83
+ termsUrl: string
84
+ duration: number
85
+ mileage: number
86
+ value: number | undefined
87
+ startMileage: number
88
+ startDate: Date
89
+ endDate: Date
90
+ includedOptions: IOptionInfo[]
91
+ additionalOptions: IOptionInfo[]
92
+ startValue: number | undefined
93
+ startValueType: ContractValueType | undefined
94
+ valueType: ContractValueType | undefined
95
+ }
96
+
97
+ interface IContractProviderPaymentInfo {
98
+ administrativeName: string
99
+ address: string
100
+ postal_code: string
101
+ city: string
102
+ phone: string
103
+ termsUrl: string
104
+ }
105
+ interface IPublicKeyResponse {
106
+ publicKey: string
107
+ stripeAccount: string
108
+ }
109
+ /*
110
+ * The folling info is only what the paying "customer" needs to know
111
+ * when presenting this info. For more specific and sensitive info,
112
+ * it is already saved on the database.
113
+ */
114
+ interface IBasicPaymentInformationResponse {
115
+ publicKey: string
116
+ contractProvider: IContractProviderPaymentInfo
117
+ contract: IContractInfo
118
+ totalAmount: PriceSpecification | null
119
+ minimumTotalAmount: PriceSpecification | null
120
+ downpayment: PriceSpecification
121
+ subscriptions: ISubscription[]
122
+ paymentGateway: PaymentGateway
123
+ }
124
+ /*
125
+ * The folling info is only what the paying "customer" needs to know
126
+ * when presenting this info. For more specific and sensitive info,
127
+ * it is already saved on the database.
128
+ */
129
+ interface IPaymentInformationResponse extends IBasicPaymentInformationResponse {
130
+ customer: IAdminCustomer
131
+ product: Vehicle | Other
132
+ }
133
+ interface ISetupIntentResponse {
134
+ clientSecret: string
135
+ }
136
+
137
+ interface ISetPaymentMethodRequest {
138
+ contractId: string | number
139
+ paymentMethodId: string
140
+ }
141
+ interface ISetPaymentMethodResponse {
142
+ status: 'processing' | 'succeeded'
143
+ }
144
+
145
+ interface ICommonContractCreationRequest extends ICommonContractUpdateRequest {
146
+ contractTemplateName: string
147
+ product: Vehicle | Other
148
+ paymentGateway: PaymentGateway
149
+ customerId?: number
150
+ customer?: IAdminCustomer
151
+ invoiceCustomerId?: number
152
+ invoiceCustomer?: IAdminCustomer
153
+ isDownpaymentDistributed: boolean
154
+ }
155
+
156
+ export interface IContractAdjustmentRequest extends ICommonContractUpdateRequest {
157
+ amountPerPayment?: number
158
+ }
159
+
160
+ export interface ICustomContractCreationRequest extends ICommonContractCreationRequest {
161
+ type: 'CUSTOM'
162
+ amountPerPayment: number
163
+ }
164
+
165
+ export interface IStandardContractCreationRequest extends ICommonContractCreationRequest {
166
+ type: 'STANDARD'
167
+ }
168
+
169
+ export interface IStandardV4PricingToolContractCreationRequest extends IStandardContractCreationRequest {
170
+ vehicleInfo: IVehicleInfo
171
+ v4ProductId: number
172
+ }
173
+
174
+ export interface IStandardV4PricingToolContractPrintCreationRequest
175
+ extends IStandardV4PricingToolContractCreationRequest {
176
+ type: 'STANDARD'
177
+ amountPerPayment?: number
178
+ adjustedFrom?: string
179
+ isAdjustment?: boolean
180
+ }
181
+
182
+ export interface IContractPrintCreationRequest extends ICommonContractCreationRequest {
183
+ type: 'STANDARD' | 'CUSTOM'
184
+ amountPerPayment?: number
185
+ adjustedFrom?: string
186
+ isAdjustment?: boolean
187
+ }
188
+
189
+ /**
190
+ * @deprecated warrantyId Not needed, if using the "NEW WAY" and V4PT, this will be loaded from the already saved contract.
191
+ * @deprecated modelModelId
192
+ * @deprecated finlandPriceId
193
+ */
194
+ export interface ICreateDelaerPaidContractRequest {
195
+ prettyIdentifier: string | null
196
+ warrantyId: number | null // SAM Warranty ID.
197
+ warrantyLengthMonths: number
198
+ modelModelId?: number
199
+ vehicleAlongItsContracts: Vehicle | VehicleAlongItsContracts
200
+ startMileage: number
201
+ customerId?: number
202
+ customer?: IAdminCustomer
203
+ startDate: Date | null
204
+ finlandPriceId?: number
205
+ endMileage?: number // For debugging.
206
+ reference?: string
207
+ }
208
+
209
+ export interface ICreateDelaerPaidContractResponse {
210
+ req: ICreateDelaerPaidContractRequest
211
+ success: boolean
212
+ error: string
213
+ startDate: Date
214
+ endDate: Date
215
+ warrantyType: string
216
+ customerId: number
217
+ }
218
+
219
+ export interface IAvailableFreeWarrantyDurationPrice {
220
+ allowedDistanceMileage: undefined | number // Allowed driving limit/distance during this Warranty duration.
221
+ allowedPowerV4Interval:
222
+ | undefined
223
+ | {
224
+ lookedUpEngineMaxPower: number
225
+ minEngineMaxPower: number
226
+ maxEngineMaxPower: number
227
+ }
228
+ customerPrice: PriceSpecification | null
229
+ durationMonths: number
230
+ finlandPriceId?: number
231
+ totalPrice: PriceSpecification
232
+ isEnabledAndAvailable?: boolean | null // Dependent of optional user setting for this DurationPrice-group or default setting in WarrantyData.
233
+ debug?: any // For debugging purposes.
234
+ }
235
+
236
+ export interface IAvailableFreeWarranty {
237
+ warrantyId: number
238
+ warrantyName: string
239
+ description: string
240
+ maxYears: number
241
+ oneTimeFeeYear: PriceSpecification
242
+ externalId: number
243
+ calculationMethod: 100 | 200
244
+ maxStartMileage: number
245
+ maxEndMileage: number // The absolute maximum End-Mileage Odometer reading for this product.
246
+ maxStartHours?: number
247
+ maxEndHours?: number
248
+ maxStartServices?: number
249
+ maxEndServices?: number
250
+ warrantyTermsRef: string
251
+ contractStartDate: Date
252
+ durationsPrices: IAvailableFreeWarrantyDurationPrice[]
253
+ weight: number
254
+ warrantyColor: string
255
+ warrantyBGColor: string | null
256
+ fuelTypes: null | string[] // Only available for these fuelTypes, null means all fuelTypes.
257
+ vehicleTypes: null | TVehicleType[] // Only available for these vehicleTypes, null means all vehicleTypes.
258
+ isForbidDealerPaid: boolean
259
+ }
260
+
261
+ export interface IContractCreationResponse {
262
+ serviceContractId: number
263
+ prettyIdentifier: string
264
+ }
265
+
266
+ export interface IAdminContractActivationRequest {
267
+ paymentGateway: PaymentGateway
268
+ paymentType: PaymentType
269
+ creditCardToken?: string
270
+ }
271
+
272
+ export interface IAdminContractActivationResponse {
273
+ serviceContract: IContractDetailsRecord
274
+ }
275
+
276
+ export interface IAdminContractResponse {
277
+ type: ContractType
278
+ contractName: string
279
+ product: Vehicle | Other
280
+ contractTemplate: IContractTemplateResponse
281
+ additionalOptions: IContractOptionResponse[]
282
+ includedAdditionalOptions: IContractOptionResponse[]
283
+ durations: DurationOptions[]
284
+ mileageDurationsMap: TMileageDurationsMap | null // Structure for ContractFlowDurationMileageVer2 for V4PricingTool contracts.
285
+ duration: number
286
+ mileage: number
287
+ startMileage: number
288
+ contractStartDateISO: null | Date
289
+ value: number | undefined
290
+ valueType: ContractValueType
291
+ startValue: number | undefined
292
+ startValueType: ContractValueType
293
+ paymentGateway: PaymentGateway
294
+ customerId: number
295
+ customer: IAdminCustomer
296
+ availableTemplatesExtension?: IContractTemplateResponse[]
297
+ availableDurationsExtension?: DurationOptions[]
298
+ }
299
+
300
+ export interface IAdminContractAdjustmentResponse extends IAdminContractResponse {
301
+ payments: IContractCalculationResponse
302
+ invoiceCustomerId: number
303
+ invoiceCustomer: IAdminCustomer
304
+ }
305
+
306
+ export interface IAdminContractOfferCopyResponse extends IAdminContractResponse {
307
+ payments: Partial<IContractCalculationResponse>
308
+ reference: string
309
+ customTerms: string
310
+ }
311
+
312
+ export interface IContractOfferPrintData {
313
+ token: string
314
+ }
@@ -0,0 +1,3 @@
1
+ export * from './carData'
2
+ export * from './contractCreation'
3
+ export * from './priceCalculation'
@@ -0,0 +1,83 @@
1
+ import { PriceSource, TV4PTProductType } from '../../'
2
+ import { PriceSpecification } from '../../priceSpecification'
3
+ import { IVehicleInfo } from '../../vehicle'
4
+ import { ContractType, ContractValueType } from './contractCreation'
5
+
6
+ export interface IContractCalculationRequest {
7
+ priceSource?: PriceSource
8
+ contractProductType: TV4PTProductType | null
9
+ contractTemplateId: number
10
+ duration: number // AKA durationMonths, in months.
11
+ startDateISOString: string
12
+ isAdjustment: boolean
13
+ isDownpaymentDistributed: boolean
14
+ mileage: number // AKA distance, in km.
15
+ modelYear: number
16
+ optionIds: number[]
17
+ providerPayments: number
18
+ providerShare: number
19
+ registrationDate: string
20
+ registrationNumber: string
21
+ serviceVariantId: string
22
+ type: ContractType
23
+ valueType: ContractValueType
24
+ adjustedFrom?: string
25
+ startMileage?: number
26
+ startValue?: number
27
+ startValueType?: ContractValueType
28
+ value?: number
29
+ vin?: string
30
+ }
31
+
32
+ export interface IStandardContractCalculationRequest extends IContractCalculationRequest {
33
+ brandId: number
34
+ productModelId: number
35
+ fuelTypeId: number
36
+ }
37
+
38
+ export interface IStandardAxContractCalculationRequest extends IContractCalculationRequest {
39
+ brandName: string
40
+ productModelName: string
41
+ fuelTypeName: string
42
+ }
43
+
44
+ export interface ICustomContractCalculationRequest extends IContractCalculationRequest {
45
+ amountPerPayment: number
46
+ brandName: string
47
+ productModelName: string
48
+ fuelTypeName: string
49
+ }
50
+
51
+ /**
52
+ * For V4PricingTool.
53
+ * @note The product in v4ProductId, not to be confused with product that is either a Vehicle or Other.
54
+ */
55
+ export interface IStandardV4PricingToolContractCalculationRequest extends IContractCalculationRequest {
56
+ vehicleInfo: IVehicleInfo
57
+ v4ProductId: number // V4 contract product / "template" id.
58
+ }
59
+
60
+ /**
61
+ * The type returned by a price calculation.
62
+ */
63
+ export interface IContractCalculationResponse {
64
+ adjustedAmount?: PriceSpecification
65
+ adjustedContractFullCost?: PriceSpecification
66
+ adjustedPaymentsLeft?: number
67
+ amountPrPayment: PriceSpecification
68
+ contractCost: PriceSpecification
69
+ contractEndDate: string
70
+ contractStartDate: string
71
+ customerCost: PriceSpecification
72
+ customerPayments: number
73
+ customerShare: PriceSpecification
74
+ distributedAmount: PriceSpecification
75
+ downpayment: PriceSpecification
76
+ firstPaymentDate: string
77
+ isDownpaymentDistributed: boolean
78
+ providerCost: PriceSpecification
79
+ providerPayments: number
80
+ providerShare: PriceSpecification
81
+ x_debugData?: any // For debugging purposes.
82
+ serviceInfo?: string[] // Service information, mainly for ax.
83
+ }
@@ -0,0 +1,47 @@
1
+ import { IApiOtherWithContracts } from '../../admin/product'
2
+ import { IApiVehicleWithContracts } from '../../admin/vehicle'
3
+ import { IsoLocale } from '../../locale'
4
+
5
+ export type ContractProviderOrderBy = 'providerId' | 'administrativeName' | 'inactive'
6
+
7
+ export interface IEssentialContractProviderInfo {
8
+ administrativeName: string
9
+ email: string
10
+ phone: string
11
+ // TODO: add TIsoCountry type
12
+ country: string
13
+ logo: string
14
+ isShowLogoOnWeb?: boolean
15
+ webLogoBanner?: string | null
16
+ }
17
+
18
+ export interface IContractProviderInfo extends IEssentialContractProviderInfo {
19
+ providerId: number
20
+ parentProviderId: number | null
21
+ address1: string
22
+ address2?: string
23
+ city: string
24
+ zipcode: string
25
+ locale: IsoLocale
26
+ currency: string
27
+ webTitle?: string | null
28
+ isUseWhiteBGOnWeb?: boolean
29
+ isForceEnableCustomContracts?: boolean
30
+ productsEnabled?: boolean
31
+ webLogoSquare?: string | null
32
+ vatPct: number
33
+ inactive: boolean
34
+ isUsingV4PricingTool: boolean
35
+ isUseV4PTOnlyForSigning: boolean
36
+ }
37
+
38
+ export interface ICreateTestContractProvider {
39
+ administrativeName: string
40
+ countryIsoCode: string
41
+ }
42
+
43
+ export interface IProviderWithContracts {
44
+ provider: IContractProviderInfo
45
+ vehicles?: IApiVehicleWithContracts[]
46
+ products?: IApiOtherWithContracts[]
47
+ }
@@ -0,0 +1,29 @@
1
+ // Note: response is handled as 200 OK or 500 Internal Server Error.
2
+ export interface IAdminCustomerLoginRequest {
3
+ prettyIdentifier: string
4
+ }
5
+
6
+ export interface IAdminCustomer {
7
+ id?: number
8
+ prettyIdentifier?: string
9
+ name: string
10
+ email: string
11
+ emailBounceType?: string | undefined
12
+ phone: string
13
+ address: string
14
+ city: string
15
+ zip: string | number
16
+ customerType: CustomerType
17
+ cvr?: string
18
+ ean?: string
19
+ companyName?: string
20
+ vatLookup?: VatLookup
21
+ }
22
+
23
+ export interface CustomerUpdateResponse extends IAdminCustomer {
24
+ extSysCustomerUpdateMessage?: string
25
+ }
26
+
27
+ export type CustomerType = 'PRIVATE' | 'BUSINESS'
28
+
29
+ export type VatLookup = 'INTERNAL' | 'REMOTE'
@@ -0,0 +1,9 @@
1
+ export type CustomerListOrderByType =
2
+ | 'prettyIdentifier'
3
+ | 'name'
4
+ | 'address'
5
+ | 'zip'
6
+ | 'city'
7
+ | 'phone'
8
+ | 'email'
9
+ | 'cvr'
@@ -0,0 +1,2 @@
1
+ export * from './customer'
2
+ export * from './customerList'
@@ -0,0 +1,13 @@
1
+ export * from './auth'
2
+ export * from './chart'
3
+ export * from './contract'
4
+ export * from './contractCreation'
5
+ export * from './customer'
6
+ export * from './vehicle'
7
+ export * from './workshop'
8
+ export * from './user'
9
+ export * from './stripe'
10
+ export * from './payment'
11
+ export * from './product'
12
+ export * from './contractProvider'
13
+ export * from './contactInformation'
@@ -0,0 +1 @@
1
+ export * from './payment';
@@ -0,0 +1,13 @@
1
+ export interface ICreditCard {
2
+ cardToken: string
3
+ isDefault: boolean
4
+ }
5
+
6
+ export interface ICreditCardRecord {
7
+ cardId: string
8
+ brand: string
9
+ expireYear: number
10
+ expireMonth: number
11
+ last4: string
12
+ isDefault: boolean
13
+ }
@@ -0,0 +1 @@
1
+ export * from './product'
@@ -0,0 +1,40 @@
1
+ import { ContractState, IIncludedContractOption, TV4PTProductType } from './../../index'
2
+ import { PaymentGateway } from './../../payment'
3
+ import { PriceSpecification } from './../../priceSpecification'
4
+
5
+ export type TContractObject = 'Product' | 'Vehicle' // Renamed from: export type ProductType = 'Product' | 'Vehicle'
6
+
7
+ export interface IApiOtherWithContracts {
8
+ otherId: number
9
+ registrationDate: Date | string
10
+ modelYear: number
11
+ serialNumber: string
12
+ serialNumber2: string
13
+ itemNumber: string
14
+ itemNumber2: string
15
+ brandName: string
16
+ modelName: string
17
+ fuelTypeName: string
18
+ contracts: IApiOtherContract[]
19
+ }
20
+
21
+ export interface IApiOtherContract {
22
+ serviceContractId: number
23
+ amount: PriceSpecification
24
+ contractStartDate: Date | string
25
+ contractEndDate: Date | string
26
+ tosUrl: string
27
+ totUrl: string
28
+ contractState: ContractState
29
+ prettyIdentifier: string
30
+ pdfUrl: string
31
+ includedOptions: IIncludedContractOption[]
32
+ contractTemplateInternalName: string // Name used internally (in pricefile etc.)
33
+ contractTemplateExternalName: string // The name shown to end-users.
34
+ duration: number
35
+ mileage: number
36
+ paymentGateway?: PaymentGateway
37
+ reference?: string
38
+ extendedFrom?: number
39
+ contractProductType: null | TV4PTProductType
40
+ }
@@ -0,0 +1 @@
1
+ export * from './stripeTOS'
@@ -0,0 +1,7 @@
1
+ export interface IStripeTOSAcceptance {
2
+ id: string
3
+ businessName: string
4
+ date: number
5
+ ip: string
6
+ userAgent: string
7
+ }
@@ -0,0 +1,2 @@
1
+ export * from './userList'
2
+ export * from './user'
@@ -0,0 +1,3 @@
1
+ import { PasswordErrors } from './passwordResponseErrors'
2
+
3
+ export type ResponseErrors = PasswordErrors
@@ -0,0 +1 @@
1
+ export type PasswordErrors = 'PASSWORD_MISMATCH' | 'PASSWORD_VALIDATION_ERROR'
@@ -0,0 +1,23 @@
1
+ export interface IAdminUserInfo {
2
+ name: string
3
+ phone: string
4
+ address: string
5
+ zip: string
6
+ city: string
7
+ email: string
8
+ }
9
+
10
+ export interface IUserPasswordChangeRequest {
11
+ password: string
12
+ newPassword: string
13
+ }
14
+
15
+ export interface ICustomerPasswordChangeRequest {
16
+ newPassword: string
17
+ }
18
+
19
+ export interface IUserRoleChangeRequest {
20
+ roleId: number
21
+ contractProviderId: number
22
+ token: string
23
+ }
@@ -0,0 +1,19 @@
1
+ import { UserRole } from '../auth'
2
+
3
+ export type UserListOrderByType = 'name' | 'role' | 'email' | 'phone' | 'providerId'
4
+
5
+ interface INullableRole {
6
+ providerId: number
7
+ role: UserRole | null
8
+ }
9
+
10
+ export interface IUserListRecord {
11
+ userId?: number
12
+ name: string
13
+ email: string
14
+ phone: string
15
+ role?: UserRole
16
+ roles?: INullableRole[]
17
+ localeCode?: string
18
+ departmentName?: string
19
+ }
@@ -0,0 +1 @@
1
+ export * from './vehicle'