@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,49 @@
1
+ import { TIsoCountry } from '../country'
2
+ import { IStripeDeclineChargeOn } from './stripeDeclineChargeOn'
3
+ import { IStripeExternalAccountResponse } from './stripeExternalAccount'
4
+ import { IStripeLegalEntity } from './stripeLegalEntity'
5
+ import { IStripeVerification } from './stripeVerification'
6
+
7
+ // @TODO - Export these out into some more generic place for others to use!!
8
+ export type StripeGenderType = 'male' | 'female'
9
+ export type StripeCountryType = TIsoCountry
10
+ export type StripeCurrencyType = 'dkk' | 'sek' | 'eur' | 'nok' // Should go into apiTypes/currency.d.ts
11
+ export type StripeEntityType = 'company' | 'individual'
12
+
13
+ export interface IStripe {
14
+ businessName: string
15
+ icon?: IStripeFile
16
+ logo?: IStripeFile
17
+ primaryColor?: string
18
+ businessUrl: string
19
+ debitNegativeBalances: boolean // default is true
20
+ declineChargeOn: IStripeDeclineChargeOn
21
+ defaultCurrency: StripeCurrencyType
22
+ legalEntity: IStripeLegalEntity
23
+ payoutStatementDescriptor: string
24
+ statementDescriptor: string // Max 22 characters!!
25
+ supportEmail: string
26
+ supportPhone: string
27
+ supportUrl: string
28
+ verification: IStripeVerification
29
+ }
30
+
31
+ export interface IStripeFile {
32
+ id: string
33
+ linkUrl?: string
34
+ fileName: string
35
+ }
36
+
37
+ export interface IStripeResponse extends IStripe {
38
+ contractProviderId: number
39
+ externalAccounts: IStripeExternalAccountResponse[]
40
+ }
41
+
42
+ export interface IStripeRequest extends IStripe {
43
+ contractProviderId: number
44
+ }
45
+
46
+ export interface IStripeRefund<StripeRefund> {
47
+ refund: StripeRefund | undefined
48
+ invoiceId: string
49
+ }
@@ -0,0 +1,10 @@
1
+ import { StripeCountryType } from './stripe'
2
+
3
+ export interface IStripeAddress {
4
+ city: string
5
+ country: StripeCountryType
6
+ line1: string
7
+ line2: string | null
8
+ postalCode: number | string
9
+ state: string | null
10
+ }
@@ -0,0 +1,5 @@
1
+ export interface IStripeDateOfBirth {
2
+ day: number
3
+ month: number
4
+ year: number
5
+ }
@@ -0,0 +1,4 @@
1
+ export interface IStripeDeclineChargeOn {
2
+ avsFailure: boolean
3
+ cvcFailure: boolean
4
+ }
@@ -0,0 +1,19 @@
1
+ import { StripeCountryType, StripeCurrencyType, StripeEntityType } from './stripe'
2
+
3
+ export interface IStripeExternalAccount {
4
+ providerId: number
5
+ accountNumber: string // IBAN account, can be validated via IBAN.org
6
+ country: StripeCountryType // dropdown with supported stripe countries (not implemented yet, hardcode DK)
7
+ currency: StripeCurrencyType // dropdown with supported currencies (not implemented yet, hardcode dkk)
8
+ accountHolderName: string
9
+ accountHolderType: StripeEntityType // The type of entity that holds the account.
10
+ defaultForCurrency: boolean
11
+ }
12
+
13
+ export interface IStripeExternalAccountResponse {
14
+ id: string
15
+ accountHolderName: string
16
+ bankName: string
17
+ defaultForCurrency: boolean
18
+ last4: string
19
+ }
@@ -0,0 +1,16 @@
1
+ import { StripeEntityType, StripeGenderType } from './stripe'
2
+ import { IStripeAddress } from './stripeAddress'
3
+ import { IStripeDateOfBirth } from './stripeDateOfBirth'
4
+ import { IStripeOwner } from './stripeOwner'
5
+
6
+ export interface IStripeLegalEntity {
7
+ type: StripeEntityType // Either "individual" or "company", for what kind of legal entity the account owner is for
8
+ dob: IStripeDateOfBirth // Primary owner
9
+ firstName: string
10
+ lastName: string
11
+ gender: StripeGenderType
12
+ personalAddress: IStripeAddress
13
+ address: IStripeAddress
14
+ phoneNumber: string
15
+ additionalOwners: IStripeOwner[]
16
+ }
@@ -0,0 +1,9 @@
1
+ import { IStripeAddress } from './stripeAddress'
2
+ import { IStripeDateOfBirth } from './stripeDateOfBirth'
3
+
4
+ export interface IStripeOwner {
5
+ address: IStripeAddress
6
+ dob: IStripeDateOfBirth
7
+ firstName: string
8
+ lastName: string
9
+ }
@@ -0,0 +1,33 @@
1
+ export type StripeVerificationReason =
2
+ | 'rejected.fraud'
3
+ | 'rejected.terms_of_service'
4
+ | 'rejected.listed'
5
+ | 'rejected.other'
6
+ | 'fields_needed'
7
+ | 'listed'
8
+ | 'under_review'
9
+ | 'other'
10
+
11
+ export type StripeVerificationField =
12
+ | 'business_url'
13
+ | 'external_account'
14
+ | 'legal_entity.address.city'
15
+ | 'legal_entity.address.line1'
16
+ | 'legal_entity.address.postal_code'
17
+ | 'legal_entity.address.state'
18
+ | 'legal_entity.dob.day'
19
+ | 'legal_entity.dob.month'
20
+ | 'legal_entity.dob.year'
21
+ | 'legal_entity.first_name'
22
+ | 'legal_entity.last_name'
23
+ | 'legal_entity.type'
24
+ | 'product_description'
25
+ | 'support_phone'
26
+ | 'tos_acceptance.date'
27
+ | 'tos_acceptance.ip'
28
+
29
+ export interface IStripeVerification {
30
+ disabled_reason: StripeVerificationReason | null
31
+ due_by: string | null
32
+ fields_needed: StripeVerificationField[]
33
+ }
@@ -0,0 +1,11 @@
1
+ export interface ITermsOfServiceRequest {
2
+ name: string
3
+ ref: string
4
+ }
5
+
6
+ export interface ITermsOfServiceResponse {
7
+ name: string
8
+ ref: string
9
+ id?: number
10
+ globalBucket?: boolean
11
+ }
@@ -0,0 +1,3 @@
1
+ export interface Translation {
2
+ [Key: string]: string | number
3
+ }
@@ -0,0 +1,38 @@
1
+ import { IsoLocale } from '../locale'
2
+
3
+ export type TTranslationApplication = 'API' | 'Admin' | 'WebCalc' | 'EmailTemplates' | 'MyPage'
4
+
5
+ export interface ITranslationValueRequest {
6
+ locale: IsoLocale
7
+ value: string
8
+ }
9
+
10
+ export interface ITranslationValueResponse extends ITranslationValueRequest {
11
+ id: number
12
+ }
13
+
14
+ export interface ITranslationApplication {
15
+ id: number
16
+ name: TTranslationApplication
17
+ }
18
+
19
+ export interface ITranslationRequest {
20
+ key: string
21
+ applications: ITranslationApplication[]
22
+ comment?: string
23
+ }
24
+
25
+ export interface ITranslationResponse extends ITranslationRequest {
26
+ id: number
27
+ userEmail: string
28
+ entityUpdated: string
29
+ missedValues: boolean
30
+ }
31
+
32
+ export interface ILocaleTranslation {
33
+ [key: string]: ITranslation
34
+ }
35
+
36
+ export interface ITranslation {
37
+ [key: string]: string
38
+ }
@@ -0,0 +1,10 @@
1
+ import { UserRole } from './admin'
2
+ import { IContactPersonResponse } from './contactPerson'
3
+
4
+ export interface IUserResponse {
5
+ userId: number
6
+ email: string
7
+ contactPerson: IContactPersonResponse
8
+ userRole: UserRole
9
+ disabledAt: Date | null
10
+ }
@@ -0,0 +1,15 @@
1
+ import { OrderDirection } from '../queryParams'
2
+
3
+ export interface IColumnUserConfiguration {
4
+ enabled: boolean
5
+ name: string
6
+ }
7
+
8
+ export interface ITableUserConfiguration<OrderBy> {
9
+ columns: IColumnUserConfiguration[]
10
+ orderBy: OrderBy
11
+ orderDirection: OrderDirection
12
+ rowCount: number
13
+ }
14
+
15
+ export type TableConfigurationType = 'serviceContract' | 'productServiceContract' | 'warranty'
@@ -0,0 +1,5 @@
1
+ import { ITableUserConfiguration, TableConfigurationType } from './tableUserConfiguration.d'
2
+
3
+ export type UserConfigurationType = TableConfigurationType
4
+ export type UserConfiguration<OrderBy = string> = ITableUserConfiguration<OrderBy>
5
+ export type UserConfigurations<OrderBy = string> = Record<string, ITableUserConfiguration<OrderBy>>
@@ -0,0 +1,44 @@
1
+ import { TIsoCountry } from '../../country';
2
+ export interface ICheckIfProviderConnectedRequestFromClient {
3
+ isoCountry: TIsoCountry;
4
+ providerId: number;
5
+ }
6
+ export interface IListV4DealersRequestFromClient {
7
+ isoCountry: TIsoCountry;
8
+ searchString: string;
9
+ }
10
+ export interface IConnectProviderToV4RequestFromClient {
11
+ isoCountry: TIsoCountry;
12
+ providerId: number;
13
+ v4DealerId: number;
14
+ }
15
+ export interface IDisconnectV4DealerFromProviderRequestFromClient {
16
+ isoCountry: TIsoCountry;
17
+ v4DealerId: number;
18
+ }
19
+ export interface IAddNewV4DealerRequestFromClient {
20
+ isoCountry: TIsoCountry;
21
+ providerId: number;
22
+ }
23
+ export interface ICheckIfProviderConnectedResponseToClient {
24
+ isConnected: boolean;
25
+ v4DealerId: number | null;
26
+ v4DealerName: string | null;
27
+ }
28
+ export interface IListV4DealersResponseToClient {
29
+ dealerItem: null | [{
30
+ id: number | null;
31
+ name: string | null;
32
+ }];
33
+ }
34
+ export interface IConnectProviderToV4ResponseToClient {
35
+ isSuccess: boolean;
36
+ }
37
+ export interface IDisconnectV4DealerFromProviderResponseToClient {
38
+ isSuccess: boolean;
39
+ }
40
+ export interface IAddNewV4DealerResponseToClient {
41
+ isSuccess: boolean;
42
+ message?: string;
43
+ statusCode?: number;
44
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":""}
@@ -0,0 +1,66 @@
1
+ import { TIsoCountry } from '../../country'
2
+
3
+ // ----------------------------
4
+ // Requests from Client to API.
5
+ // ----------------------------
6
+
7
+ export interface ICheckIfProviderConnectedRequestFromClient {
8
+ isoCountry: TIsoCountry
9
+ providerId: number
10
+ }
11
+
12
+ export interface IListV4DealersRequestFromClient {
13
+ isoCountry: TIsoCountry
14
+ searchString: string
15
+ }
16
+
17
+ export interface IConnectProviderToV4RequestFromClient {
18
+ isoCountry: TIsoCountry
19
+ providerId: number
20
+ v4DealerId: number
21
+ }
22
+
23
+ export interface IDisconnectV4DealerFromProviderRequestFromClient {
24
+ isoCountry: TIsoCountry
25
+ v4DealerId: number
26
+ }
27
+
28
+ export interface IAddNewV4DealerRequestFromClient {
29
+ isoCountry: TIsoCountry
30
+ providerId: number
31
+ }
32
+
33
+ // -----------------------------
34
+ // Responses to Client from API.
35
+ // -----------------------------
36
+
37
+ export interface ICheckIfProviderConnectedResponseToClient {
38
+ isConnected: boolean
39
+ v4DealerId: number | null
40
+ v4DealerName: string | null
41
+ }
42
+
43
+ export interface IListV4DealersResponseToClient {
44
+ dealerItem:
45
+ | null
46
+ | [
47
+ {
48
+ id: number | null
49
+ name: string | null
50
+ },
51
+ ]
52
+ }
53
+
54
+ export interface IConnectProviderToV4ResponseToClient {
55
+ isSuccess: boolean
56
+ }
57
+
58
+ export interface IDisconnectV4DealerFromProviderResponseToClient {
59
+ isSuccess: boolean
60
+ }
61
+
62
+ export interface IAddNewV4DealerResponseToClient {
63
+ isSuccess: boolean
64
+ message?: string
65
+ statusCode?: number
66
+ }
@@ -0,0 +1,2 @@
1
+ export * from './dealerAndProvider'
2
+ export * from './productsAndContracts'
@@ -0,0 +1,2 @@
1
+ export declare type TV4PTProductType = 'ServiceAgreement' | 'Warranty' | 'WarrantyAndServiceAgreement' | 'Vary';
2
+ export declare type TV4PTPaymentType = 'DealerPaid' | 'CustomerSubscription';
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ // | 'CustomerPaymentCard' // Deprecated, use 'CustomerSubscription' instead. /2023-01-01
4
+ // | 'Subscription' // Deprecated, use 'CustomerSubscription' instead. /2023-01-01
5
+ // | 'DealerPaidMonthly' // Deprecated, use 'DealerPaid' instead. /2023-01-01
6
+ // | 'OneTimeDealerPayment' // Deprecated, use 'DealerPaid' instead. /2023-01-01
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;AAMA,yFAAyF;AACzF,kFAAkF;AAClF,6EAA6E;AAC7E,gFAAgF"}
@@ -0,0 +1,10 @@
1
+ export type TV4PTProductType = 'ServiceAgreement' | 'Warranty' | 'WarrantyAndServiceAgreement' | 'Vary' // Some other product type in V4.
2
+
3
+ // V4PricingTool Payment Type.
4
+ export type TV4PTPaymentType =
5
+ | 'DealerPaid' // One-time dealer payment via V4.
6
+ | 'CustomerSubscription' // Customer monthly subscription.
7
+ // | 'CustomerPaymentCard' // Deprecated, use 'CustomerSubscription' instead. /2023-01-01
8
+ // | 'Subscription' // Deprecated, use 'CustomerSubscription' instead. /2023-01-01
9
+ // | 'DealerPaidMonthly' // Deprecated, use 'DealerPaid' instead. /2023-01-01
10
+ // | 'OneTimeDealerPayment' // Deprecated, use 'DealerPaid' instead. /2023-01-01
@@ -0,0 +1,14 @@
1
+ export interface IVatLookupRequest {
2
+ vatId: string
3
+ country: string
4
+ }
5
+
6
+ export interface IVatLookupResponse {
7
+ vatId: string
8
+ country: string
9
+ administrativeName: string
10
+ address1: string
11
+ postal_code: string
12
+ city: string
13
+ address2: string | null
14
+ }
@@ -0,0 +1,160 @@
1
+ import { Brand } from './brand'
2
+ import { TIsoCountry } from './country'
3
+ import { FuelType } from './fuelType'
4
+ import { Model } from './model'
5
+ import { VehicleContracts } from './vehicleContracts'
6
+
7
+ /**
8
+ * Vehicle object with properties of strings and types with id keys to database related rows.
9
+ *
10
+ * @note To dev: Are you looking for contracts here? - Please use VehicleAlongItsContracts instead!
11
+ */
12
+ // TODO: In future (as of 2022 Nov) when on a stable build on API and Admin, rename this
13
+ // Vehicle to IVehicle, to avoid mix-up/confusion with Vehicle (same name!) entity. /marko
14
+ export interface Vehicle {
15
+ id?: number
16
+ vin?: string
17
+ regNumber?: string
18
+ regDate?: string
19
+ brand: Brand
20
+ model: Model
21
+ fuelType: FuelType
22
+ modelYear: number
23
+ versionModelType?: string
24
+ vehicleType?: TVehicleType // Note: Not same as type (now versionModelType).
25
+ engineMaxPower?: number // Maximum power in kW, integer or decimal number like 115.5 or 132. NOTE: For now, engineMaxPower is the highest power of any of the engines on a multi-engine vehicle.
26
+ originalEnginePowerKWFromLookup?: number // Since engineMaxPower can be overriden, this param originalEnginePowerKWFromLookup should contain the original from the lookup service.
27
+ cylinderVolume?: number // Engine size in cc or cm3.
28
+ transmissionType?: TVehicleTransmissionType
29
+ driveType?: TVehicleDriveType // Front, rear, or all wheel drive.
30
+ hasFourWheelDrive?: boolean // Aka 4x4 ("four by four" or 4WD).
31
+ }
32
+
33
+ /**
34
+ * Vehicle object with properties of strings or related types, has no
35
+ * types with id keys to database rows etc.
36
+ */
37
+ // TODO: To rename parameters to these below - 20221209
38
+ // {
39
+ // // Here we implement based on a lookup on BG64770
40
+ // vehicleRegistryId?: number
41
+ // regNumber: string // 'BG64770',
42
+ // vin: string // vin: 'VF3CCHMZ6GT105374',
43
+ // // type: string // NOTE: Not same as vehicleType, this is vehicle type description like 'GTE Plug-In Hybrid 150 kW (204 hv) DSG-automaatti 4-ovinen'.
44
+ // // @note param "type" renamed to "versionModelType" to avoid confusion with vehicleType
45
+ // versionModelType: string // NOTE: Not same as vehicleType, this is vehicle type description like 'GTE Plug-In Hybrid 150 kW (204 hv) DSG-automaatti 4-ovinen'.
46
+ // brandName: string // brand: 'Peugeot',
47
+ // modelName: string // model: '208',
48
+ // fuelTypeName: string // fuel_type: 'Benzin',
49
+ // firstRegistrationDate: string | Date // first_registration_date: '2016-10-31',
50
+ // expirationDate: string | null // null,
51
+ // modelYear: number
52
+ // engineMaxPower: number | null // Maximum power in kW, integer or decimal number like 115.5 or 132. NOTE: For now, engineMaxPower is the highest power of any of the engines on a multi-engine vehicle.
53
+ // vehicleType: TVehicleType // Note: Not same as type (now versionModelType).
54
+ // cylinderVolume?: number // Engine size in cc or cm3.
55
+ // transmissionType?: TVehicleTransmissionType
56
+ // driveType?: TVehicleDriveType // Front, rear, or all wheel drive.
57
+ // hasFourWheelDrive?: boolean
58
+ // lookupCacheStatus?: 'vehicleInfo fetched from cache' | 'vehicleInfo fetched via fresh lookup' // @note For debugging purposes. Hint with info if vehicle was fetched from cache or via fresh lookup.
59
+ // }
60
+ export interface IVehicleInfo {
61
+ // Here we implement based on a lookup on BG64770
62
+ vehicleRegistryId?: number
63
+ registration: string // registration: 'BG64770',
64
+ vin: string // vin: 'VF3CCHMZ6GT105374',
65
+ // type: string // NOTE: Not same as vehicleType, this is vehicle type description like 'GTE Plug-In Hybrid 150 kW (204 hv) DSG-automaatti 4-ovinen'.
66
+ // @note param "type" renamed to "versionModelType" to avoid confusion with vehicleType
67
+ versionModelType: string // NOTE: Not same as vehicleType, this is vehicle type description like 'GTE Plug-In Hybrid 150 kW (204 hv) DSG-automaatti 4-ovinen'.
68
+ brand: string // brand: 'Peugeot',
69
+ model: string // model: '208',
70
+ fuel_type: string // fuel_type: 'Benzin',
71
+ first_registration_date: string | Date // first_registration_date: '2016-10-31',
72
+ expire_date: string | null // null,
73
+ model_year: number
74
+ engineMaxPower: number | null // Maximum power in kW, integer or decimal number like 115.5 or 132. NOTE: For now, engineMaxPower is the highest power of any of the engines on a multi-engine vehicle.
75
+ originalEnginePowerKWFromLookup?: number // Since engineMaxPower can be overriden, this param originalEnginePowerKWFromLookup should contain the original from the lookup service.
76
+ vehicleType: TVehicleType // Note: Not same as type (now versionModelType).
77
+ cylinderVolume?: number // Engine size in cc or cm3.
78
+ transmissionType?: TVehicleTransmissionType
79
+ driveType?: TVehicleDriveType // Front, rear, or all wheel drive.
80
+ hasFourWheelDrive?: boolean
81
+
82
+ lookupCacheStatus?: 'vehicleInfo fetched from cache' | 'vehicleInfo fetched via fresh lookup' | 'Mocked vehicleInfo' // @note For debugging purposes. Hint with info if vehicle was fetched from cache or via fresh lookup.
83
+ isDetectedAsPossibleHybrid?: boolean | null // If the vehicle has been detected (by parsing or other means) as a hybrid, set this to true AND hasClearedAsPossibleHybrid to false.
84
+ isClearedAsPossibleHybrid?: boolean | null // When cleared (by prompting a dialog or other means) set this to true, AND hasDetectedAsPossibleHybrid to null.
85
+ }
86
+
87
+ export interface ITemplatesVehicleLookupRequest {
88
+ overridingEnginePowerKW?: null | number
89
+ advancedLookup?: boolean
90
+ token?: string
91
+ }
92
+
93
+ export interface IRegistrationNumberResponse {
94
+ lookup: {
95
+ vehicle: Vehicle
96
+ lookupCountry: TIsoCountry
97
+ isDetectedAsPossibleHybrid: boolean | null // If the vehicle has been detected (by parsing or other means) as a hybrid, set this to true AND hasClearedAsPossibleHybrid to false.
98
+ isClearedAsPossibleHybrid: boolean | null // When cleared (by prompting a dialog or other means) set this to true, AND hasDetectedAsPossibleHybrid to null.
99
+ debug?: {
100
+ lookupCacheStatus?: string // Free text, for debugging purposes - Hint with info if vehicle was fetched from cache or via fresh lookup.
101
+ }
102
+ }
103
+ contracts?: VehicleContracts
104
+ hasActiveWarranty?: boolean
105
+ }
106
+
107
+ /**
108
+ * Vehicle along with its Contracts.
109
+ * @note Not to be confused with IApiVehicleWithContracts.
110
+ *
111
+ * This interface is same as the Vehicle interface, plus properties contracts
112
+ * and hasActiveWarranty added.
113
+ */
114
+ export interface VehicleAlongItsContracts extends Vehicle {
115
+ contracts: VehicleContracts | undefined
116
+ hasActiveWarranty: boolean | undefined
117
+ }
118
+
119
+ /**
120
+ Motorhome - A caravan-like living unit built on top of an existing chassis.
121
+ Compared to a regular van, the body is much taller and wider.
122
+
123
+ Campervan - Campervans are generally shorter, thinner and have much less
124
+ headroom than motorhome.
125
+ */
126
+ export type TVehicleType =
127
+ | '' // Unknown vehicle type.
128
+ | 'Trailer' // sv: Släp, sv: Släpvagn, da: Påhængsvogn(p), fi: Perävaunu, nb-NO: Tilhenger.
129
+ | 'Caravan' // (NOTE: Without engine!) sv: Husvagn, da: Campingvogn, fi: Asuntovaunu, nb-NO: Campingvogn.
130
+ | 'Motorhome/Campervan' // (NOTE: Legally as Car) sv: Husbil, da: Autocamper, fi: Matkailuauto, nb-NO: Bobil
131
+ | 'Car'
132
+ | 'Van' // sv: Skåpbil/Paketbil/Varubil, en: Small Truck/Lorry, Delivery Truck/Lorry.
133
+ | 'Truck' // sv: Lastbil, en-UK: Lorry, fi: Kuorma-auto, nb-NO: Lastebil.
134
+ | 'Bus'
135
+ | 'Forklift' // sv: Truck.
136
+ | 'Special Vehicle'
137
+ | 'Tractor'
138
+ | 'Mobile Machinery'
139
+ | 'Off-road Vehicle'
140
+ | 'Motorcycle'
141
+ | 'L5' // Motor-vehicle with three wheels, sv: Trehjuligt motorfordon.
142
+ | 'Moped'
143
+ | 'Other'
144
+
145
+ export type TVehicleTransmissionType =
146
+ | '' // Unknown transmission type.
147
+ | 'Manual'
148
+ | 'Automatic'
149
+ | 'Continuously Variable' // Variomatic transmission type.
150
+
151
+ export type TVehicleDriveType =
152
+ | '' // Unknown drive type.
153
+ | 'Front Wheel Drive'
154
+ | 'Rear Wheel Drive'
155
+ | 'All Wheel Drive'
156
+
157
+ export interface VehicleUpdateResponse extends Vehicle {
158
+ extSysRegNumberUpdateMessage?: string
159
+ v4RegNumberUpdated?: boolean
160
+ }
@@ -0,0 +1,15 @@
1
+ import { IContractTemplateResponse } from './contractTemplate'
2
+ import { DurationOptions, TMileageDurationsMap } from './durationOptions'
3
+
4
+ // **TODO: Rename to Product Contracts
5
+ // export interface VehicleContracts {
6
+ // contracts: IContractTemplateResponse[]
7
+ // durations: DurationOptions[] | null // Structure for ContractFlowDurationMileageVer1 for contracts using old legacy pricing.
8
+ // durationMap: any // Structure for ContractFlowDurationMileageVer2 for V4PricingTool contracts.
9
+ // }
10
+
11
+ export interface VehicleContracts {
12
+ contracts: IContractTemplateResponse[]
13
+ durations: DurationOptions[] | null // Structure for ContractFlowDurationMileageVer1 for contracts using old legacy pricing.
14
+ mileageDurationsMap: TMileageDurationsMap | null // Structure for ContractFlowDurationMileageVer2 for V4PricingTool contracts.
15
+ }
@@ -0,0 +1,24 @@
1
+ import { Brand } from './brand'
2
+ import { FuelType } from './fuelType'
3
+ import { Model } from './model'
4
+ import { TVehicleDriveType, TVehicleTransmissionType, TVehicleType } from './vehicle'
5
+
6
+ // Note: Only vin is required, rest are optional.
7
+ export interface VehiclePartial {
8
+ id?: number
9
+ vin: string
10
+ regNumber?: string
11
+ regDate?: string
12
+ brand?: Brand
13
+ model?: Model
14
+ fuelType?: FuelType
15
+ modelYear?: number
16
+ versionModelType?: string
17
+ vehicleType?: TVehicleType // Note: Not same as type (now versionModelType).
18
+ engineMaxPower?: number // Maximum power in kW, integer or decimal number like 115.5 or 132. NOTE: For now, engineMaxPower is the highest power of any of the engines on a multi-engine vehicle.
19
+ originalEnginePowerKWFromLookup?: number // Since engineMaxPower can be overriden, this param originalEnginePowerKWFromLookup should contain the original from the lookup service.
20
+ cylinderVolume?: number // Engine size in cc or cm3.
21
+ transmissionType?: TVehicleTransmissionType
22
+ driveType?: TVehicleDriveType // Front, rear, or all wheel drive.
23
+ hasFourWheelDrive?: boolean // Aka 4x4 ("four by four" or 4WD).
24
+ }
@@ -0,0 +1,19 @@
1
+ import { ICountryResponse } from './country'
2
+ import { ITermsOfServiceRequest, ITermsOfServiceResponse } from './termsOfService'
3
+
4
+ export interface IWarrantyRequest {
5
+ warrantyId: number
6
+ warrantyType: string
7
+ applicationFee: number
8
+ countryId: number
9
+ termsOfService: ITermsOfServiceRequest
10
+ }
11
+
12
+ export interface IWarrantyResponse {
13
+ archived?: Date
14
+ warrantyId: number
15
+ warrantyType: string
16
+ applicationFee: number
17
+ country?: ICountryResponse
18
+ termsOfService?: ITermsOfServiceResponse
19
+ }