@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
package/README.md ADDED
@@ -0,0 +1,75 @@
1
+ # SAM-types
2
+
3
+ SAM types is used to collect and share all interfaces (types) that one or more repositories have in
4
+ common. To facilitate and ensure that repositories use the same types when communicating with each other.
5
+ In most cases, if not all, this is between SAM-api and one or more of the frontend clients like the SAM-admin.
6
+
7
+ ## Conventions
8
+
9
+ ### Request/Response interfaces
10
+ TODO: Fill this out
11
+
12
+ ### Versioning
13
+
14
+ We use standard [semantic versioning](https://semver.org/)
15
+
16
+ ## Development
17
+ ### Dependencies
18
+ The project only has one dependency: `Typescript`
19
+
20
+ This is to have `tsc` available.
21
+
22
+ ### Compiling
23
+
24
+ To compile the `index.d.ts` file and the `index.js` file, run `npm run tsc` (or `yarn tsc`). This cleans all existing `.js` files and updates the `index.d.ts` file and the `index.js` file.
25
+
26
+ ### Adding new interfaces, types, and enums
27
+
28
+ Write your interface or type like you normally would. In order to export it, you need to add it to the `index.ts` file which holds all exported interfaces, types, and enums. The enums (for now) need to be put directly in the `index.ts` file. To fix this we need to setup some Webpack configuration etc.
29
+
30
+ ### Local development
31
+
32
+ ### Using npm
33
+ To use the types locally in an application, add the line below as a dependency in your `package.json` file:
34
+
35
+ `"sam-types": "file:../SAM-types"`
36
+
37
+ The path is the relative path to the SAM-types project.
38
+ ### Using yarn
39
+ To use the types locally you can use `yarn link`. See docs [here](https://yarnpkg.com/lang/en/docs/cli/link/).
40
+
41
+ `cd` to the SAM-types folder and type: `yarn link`
42
+
43
+ Then `cd` to your application and type `yarn link "sam-types"`. Now your application uses your local SAM-types project (using a symlink). To unlink, type `yarn unlink "sam-types"`
44
+
45
+ This means that you do not have to change anything in your `package.json` file.
46
+
47
+ ### Regular dependency
48
+ To use SAM-types in a project, add the line below as a dependency in your `package.json` file:
49
+
50
+ `"sam-types": "OmniCar/SAM-types#0.0.1"`
51
+
52
+ If you need to target something other than a specific release, consider targeting a branch or a commit as shown below:
53
+
54
+ * `"sam-types": "OmniCar/SAM-types#4727d357ea"`
55
+ * `"sam-types": "OmniCar/SAM-types#feature\/branch"`
56
+
57
+ ## Releasing
58
+
59
+ ### Using GitHub
60
+
61
+ * Go to [releases](https://github.com/OmniCar/SAM-types/releases) on GitHub
62
+ * Press "Create a new release"
63
+ * Set the "Tag version" to the appropriate version number (see versioning above)
64
+ * Set the "Release title" to "Version <version_number>"
65
+ * Describe the changes. What's new? are there any breaking changes? etc.
66
+ * If you want you can see the changes on `master` compared to a release (for example version `0.0.1`) by typing: `git diff tags/0.0.1 master`
67
+ * Press "Publish release"
68
+
69
+ ### Using [hub cli](https://github.com/github/hub)
70
+
71
+ If you have installed the hub cli (see link above), you can create a new release with the below command. Please note that it defaults to targeting the main (`master`) branch unless you use the `-t` option (more options [here](https://github.com/github/hub/blob/master/commands/release.go))
72
+
73
+ `git release create -o -m "Release 0.0.2" "0.0.2"`
74
+
75
+ If you did not set up the alias for `git = hub` you should write `hub` instead of `git` in the command above.
package/package.json ADDED
@@ -0,0 +1,24 @@
1
+ {
2
+ "version": "1.0.0",
3
+ "name": "@fragus/sam-types",
4
+ "description": "Typescript interfaces for all types used to communicate between SAM client(s) and the SAM API",
5
+ "author": "Fragus",
6
+ "types": "types/index.d.ts",
7
+ "files": [
8
+ "types"
9
+ ],
10
+ "main": "types/index.js",
11
+ "scripts": {
12
+ "clean-js": "/bin/bash tools/npm-scripts.sh cleanJS",
13
+ "clean-js-win": "sh tools/npm-scripts.sh cleanJS",
14
+ "tsc": "npm run clean-js && npx tsc -p ./tsconfig.json",
15
+ "tsc-win": "npm run clean-js-win && npx tsc -p ./tsconfig.json"
16
+ },
17
+ "devDependencies": {
18
+ "@ianvs/prettier-plugin-sort-imports": "^4.2.1",
19
+ "husky": "^8.0.3",
20
+ "lint-staged": "^13.2.0",
21
+ "prettier": "^2.8.7",
22
+ "typescript": "3.3.3"
23
+ }
24
+ }
File without changes
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=SettlementPaymentType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SettlementPaymentType.js","sourceRoot":"","sources":["SettlementPaymentType.ts"],"names":[],"mappings":""}
File without changes
@@ -0,0 +1,12 @@
1
+ import { AccessKeyPermission, AccessKeyService } from '../index'
2
+
3
+ export interface IAccessKey {
4
+ accessKeyId: number
5
+ apiKey: string
6
+ keyPermission: AccessKeyPermission
7
+ service: AccessKeyService
8
+ createdByUserEmail?: string
9
+ representativeUserEmail?: string
10
+ contractProviderIds: number[]
11
+ allProvidersAllowed: boolean
12
+ }
@@ -0,0 +1,18 @@
1
+ import { ICountry, ICountryRequest } from './country'
2
+
3
+ export interface IAddressRequest {
4
+ address1: string
5
+ address2?: string
6
+ city: string
7
+ postalCode: string
8
+ country: ICountry
9
+ }
10
+
11
+ export interface IAddressResponse {
12
+ addressId: number
13
+ address1: string
14
+ address2?: string
15
+ city: string
16
+ postalCode: string
17
+ country: ICountry
18
+ }
@@ -0,0 +1,2 @@
1
+ export * from './login'
2
+ export * from './roles'
@@ -0,0 +1,28 @@
1
+ import { IsoLocale } from '../../locale'
2
+ import { IContractProviderInfo } from '../contractProvider'
3
+ import { IAdminCustomer } from '../customer'
4
+ import { IAdminUserInfo } from '../user/user'
5
+ import { UserRole, UserRoleRecord } from './roles'
6
+
7
+ export interface ILoginRequest {
8
+ username: string
9
+ password: string
10
+ }
11
+
12
+ export interface ILoginResponse {
13
+ username: boolean
14
+ password: boolean
15
+ role?: UserRole
16
+ roles?: UserRoleRecord[]
17
+ token?: string
18
+ userInfo?: IAdminUserInfo
19
+ customerInfo?: IAdminCustomer
20
+ providerInfo?: IContractProviderInfo
21
+ stripePublicKey?: string
22
+ webCalcEnabled?: boolean
23
+ disableContractTemplates?: boolean
24
+ isSuperAdmin?: boolean
25
+ isDev?: boolean
26
+ refreshToken?: string
27
+ defaultLocale?: IsoLocale
28
+ }
@@ -0,0 +1,10 @@
1
+ export type UserRole = 'system' | 'superadmin' | 'admin' | 'seller' | 'customer' | 'reports' | 'observer'
2
+
3
+ export interface UserRoleRecord {
4
+ role: UserRole
5
+ contractProvider: {
6
+ id: number
7
+ administrativeName: string
8
+ inactive?: boolean
9
+ }
10
+ }
@@ -0,0 +1,70 @@
1
+ import { IContractFilterDate, PriceSpecification } from '../..'
2
+ import { IChartDateValue, IChartInvoiceValue } from '../../chart'
3
+ import { ContractState } from '../../index'
4
+
5
+ export interface IPaymentChart {
6
+ seriesExpectedEarnings: IChartDateValue[] // chart series.
7
+ seriesEarnings: IChartInvoiceValue[] // chart series.
8
+ seriesCosts: IChartDateValue[] // chart series.
9
+ totalExpectedEarnings: PriceSpecification // summary.
10
+ totalEarnings: PriceSpecification // summary.
11
+ totalCosts: PriceSpecification // summary.
12
+ totalBalance: PriceSpecification // summary.
13
+ contractStartDate: Date | string // chart legend.
14
+ contractEndDate: Date | string // chart legend.
15
+ duration: {
16
+ // chart legend.
17
+ total: number
18
+ current: number
19
+ }
20
+ // number of expected payments to current or closing date
21
+ expectedPaymentsToDate: number
22
+ // number of failed/unpaid payments
23
+ failedPaymentsToDate: number
24
+ // total sum of failed/unpaid payments
25
+ totalFailedPayments: PriceSpecification
26
+ }
27
+
28
+ export interface IMileageChart {
29
+ seriesExpectedMileage: IChartDateValue[] // chart series.
30
+ seriesMileage: IChartDateValue[] // chart series.
31
+ totalExpectedMileage: number // summary.
32
+ totalMileage: number // summary.
33
+ totalBalance: number // summary.
34
+ contractStartDate: Date | string // chart legend.
35
+ contractEndDate: Date | string // chart legend.
36
+ duration: {
37
+ // chart legend.
38
+ total: number
39
+ current: number
40
+ }
41
+ }
42
+
43
+ export interface IValueChart {
44
+ seriesExpectedValue: IChartDateValue[] // chart series.
45
+ seriesValue: IChartDateValue[] // chart series.
46
+ totalExpectedValue: number // summary.
47
+ totalValue: number // summary.
48
+ totalBalance: number // summary.
49
+ contractStartDate: Date | string // chart legend.
50
+ contractEndDate: Date | string // chart legend.
51
+ contractEndValue?: number
52
+ duration: {
53
+ // chart legend.
54
+ total: number
55
+ current: number
56
+ }
57
+ }
58
+
59
+ export interface IPaymentMileageCharts {
60
+ paymentChart: IPaymentChart
61
+ mileageChart: IMileageChart
62
+ valueChart: IValueChart
63
+ }
64
+
65
+ export interface IContractChartsFilterParams {
66
+ contractStates: ContractState[]
67
+ templates: number[]
68
+ sellers: number[]
69
+ created: IContractFilterDate
70
+ }
@@ -0,0 +1,57 @@
1
+ import { IContractFilterDate } from '../..'
2
+ import { IChartDateValue, ITopSellerChart } from '../../chart'
3
+
4
+ export interface IChartCollection {
5
+ name: string
6
+ total: number
7
+ months: IChartDateValue[]
8
+ }
9
+
10
+ export interface IBalanceChart {
11
+ seriesInvoiced: IChartCollection
12
+ seriesCosts: IChartCollection
13
+ valuation: { totalContractValue: number; date: Date | string }
14
+ }
15
+
16
+ export interface IDashboardCharts {
17
+ activeContractsChartCollection: IChartCollection[]
18
+ sellerChart: ITopSellerChart
19
+ balanceChart: IBalanceChart
20
+ monthlyBalanceChart: IBalanceChart
21
+ }
22
+
23
+ export interface IDashboardQueryParams<Filtering = undefined> {
24
+ filtering?: Filtering
25
+ }
26
+
27
+ export interface IDashboardContractChartsResponse<Result, Filtering> {
28
+ result: Result
29
+ filtering?: Filtering
30
+ }
31
+
32
+ export interface ICellDataPoint {
33
+ x: Date
34
+ y: number
35
+ }
36
+
37
+ export interface IContractCharts {
38
+ sellerId?: number
39
+ sellerName?: string | any
40
+ startDate: Date
41
+ endDate: Date
42
+ chartsData: ICellDataPoint[]
43
+ }
44
+
45
+ export interface IDashboardContractCharts {
46
+ chartType: string
47
+ chartName: string
48
+ charts: IContractCharts[]
49
+ }
50
+
51
+ export interface IDashboardContractChartViews {
52
+ contract: IDashboardContractCharts[]
53
+ }
54
+
55
+ export interface IDashboardFilterParams {
56
+ dateRange: IContractFilterDate
57
+ }
@@ -0,0 +1,12 @@
1
+ export { IPaymentChart, IMileageChart, IValueChart, IPaymentMileageCharts, IContractChartsFilterParams } from './contractCharts'
2
+ export {
3
+ IChartCollection,
4
+ IBalanceChart,
5
+ IDashboardCharts,
6
+ IDashboardQueryParams,
7
+ IDashboardContractChartsResponse,
8
+ ICellDataPoint,
9
+ IDashboardContractChartViews,
10
+ IDashboardContractCharts,
11
+ IContractCharts,
12
+ } from './dashboardCharts'
@@ -0,0 +1,9 @@
1
+ export interface IContactInformation {
2
+ id?: number
3
+ email: string
4
+ phone: string
5
+ url: string
6
+ isoName: string
7
+ }
8
+
9
+ export type ContactInformation = keyof IContactInformation
@@ -0,0 +1,37 @@
1
+ import { PriceSpecification } from '../../index'
2
+
3
+ export interface ISettlementInvoicesBalance {
4
+ stripePayment: PriceSpecification
5
+ cashPayment: PriceSpecification
6
+ providerPayment: PriceSpecification
7
+ cashPayout: PriceSpecification
8
+ }
9
+
10
+ export interface IContractBalanceStatistics {
11
+ calculatedUnits: number
12
+ calculationMethod: number
13
+ closingDate: string
14
+ monthsAtClosing: number
15
+ remainingMonths: number
16
+ remainingCharge: PriceSpecification
17
+ workshopCosts: PriceSpecification
18
+ paidInvoicesTotalSum: PriceSpecification
19
+ contractBalance: PriceSpecification
20
+ settlementInvoices: ISettlementInvoicesBalance
21
+ settlementInvoicesTotalSum: PriceSpecification
22
+ settlementInfo?: ISettlementInfo
23
+ underOverUnitsBalance?: IUnderOverUnitsInfo
24
+ pendingInvoicesTotalSum?: PriceSpecification
25
+ }
26
+
27
+ export interface IUnderOverUnitsInfo {
28
+ units: number
29
+ cost: PriceSpecification
30
+ underUnitsLimit: number
31
+ }
32
+
33
+ export interface ISettlementInfo {
34
+ settlementDate: Date
35
+ userName: string
36
+ autoSettlement: boolean
37
+ }
@@ -0,0 +1,21 @@
1
+ import { PriceSource } from '../../contractTemplate'
2
+ import { ContractState, ContractType, IIncludedContractOption, PaymentGateway, TV4PTProductType } from '../../index'
3
+ import { IContractHealth } from './health'
4
+
5
+ export interface IBasicContractInfo {
6
+ contractState: ContractState
7
+ contractStateName: string
8
+ contractType: ContractType
9
+ contractProductType: null | TV4PTProductType
10
+ priceSource: PriceSource | null
11
+ extendedFromId: number | null
12
+ extendedToId: number | null
13
+ paymentGateway: PaymentGateway
14
+ contractName: string // Contract (template) name.
15
+ templateDescription: string
16
+ additionalOptions: IIncludedContractOption[]
17
+ health: IContractHealth[]
18
+ productHasWarranty: boolean
19
+ productContract: boolean
20
+ offerExpirationDate?: string
21
+ }
@@ -0,0 +1,82 @@
1
+ import { TV4PTProductType } from '../../v4PricingTool'
2
+ import { ContractType, ContractValueType, ServiceContractFlag } from './../../admin/contractCreation'
3
+ import { IContactPersonResponse } from './../../contactPerson'
4
+ import { IContractResponse } from './../../contract/contract'
5
+ import { PriceSource } from './../../contractTemplate'
6
+ import { IIncludedContractOption } from './../../includedContractOption'
7
+ import { PaymentGateway } from './../../payment'
8
+ import { PriceSpecification } from './../../priceSpecification'
9
+
10
+ export interface IContractDetailsRecord {
11
+ serviceContractId?: number // Note: Do not expose this id for non-Devs/normal users, use the pretty-id for those. For debugging purposes, etc.
12
+ contractType: ContractType
13
+ contractProductType: null | TV4PTProductType
14
+ contractPdfUrl: string
15
+ duration: number // Duration [months].
16
+ startMileage?: number // Current meter/odometer-reading [km].
17
+ mileage: number // Allowed mileage/distance [km] to drive during contract duration [months].
18
+ startValue?: number
19
+ startValueType: ContractValueType
20
+ endValue?: number
21
+ maxEndValue?: number
22
+ endMileage: number // End-mileage [km] at end of duration [months].
23
+ maxEndMileage?: number // Absolute maximum end-mileage [km] for product - Hard mileage cap/limit.
24
+ expirationDate: Date | string
25
+ extendedFrom: IContractResponse | null
26
+ includedOptions: IIncludedContractOption[] | null
27
+ value?: number
28
+ valueType: ContractValueType
29
+ monthlyTemplatePrice: PriceSpecification
30
+ monthlyPrice: PriceSpecification
31
+ paymentMethod: PaymentGateway
32
+ prettyIdentifierShort: string
33
+ prettyIdentifier: string
34
+ providerPayments: number
35
+ providerShare: PriceSpecification
36
+ reference: string
37
+ warrantyReference?: string
38
+ seller?: IContactPersonResponse
39
+ startDate: Date | string
40
+ termsPdfUrl: string
41
+ termsOfTradePdfUrl: string
42
+ filesContainerAlongContract: null | IFileItem[] // Optional extra files, except the TOS file.
43
+ totalPrice: PriceSpecification
44
+ contractTemplateId: null | number
45
+ contractName: string // Contract (template) name.
46
+ priceSource: null | PriceSource
47
+ contractTemplateDescription: string
48
+ contractTemplateMinPaymentsCount: number | null
49
+ contractTemplateIsArchived: boolean
50
+ isProduct: boolean
51
+ serviceVariantId: string
52
+ flags: ServiceContractFlag[]
53
+ stripeCustomerLink: string | null
54
+ stripeSubscriptionLink: string | null
55
+ customTerms?: string
56
+ adjustedFrom?: string
57
+ adjustedTo?: string
58
+ createdByProvider?: string
59
+ provider?: string
60
+ settledUnits?: number | null
61
+ overdrivenCharge?: number
62
+ underdrivenCharge?: number
63
+ calculationMethod?: number
64
+ overHoursCharge?: number
65
+ underHoursCharge?: number
66
+ overServicesCharge?: number
67
+ underServicesCharge?: number
68
+ }
69
+
70
+ export interface IAdminCustomTermsRecord {
71
+ customTerms: string
72
+ }
73
+
74
+ export interface IUnitsListResponse {
75
+ units: number
76
+ date: Date | string
77
+ }
78
+
79
+ export interface IFileItem {
80
+ name: string
81
+ v4URL: string
82
+ }
@@ -0,0 +1 @@
1
+ export type IContractHealth = 'RISK_OF_OVERMILEAGE' | 'NEGATIVE_BALANCE' | 'RISK_OF_OVERHOURS' | 'RISK_OF_OVERSERVICES'
@@ -0,0 +1,6 @@
1
+ export * from './basicInfo'
2
+ export * from './contractDetails'
3
+ export * from './health'
4
+ export * from './templateLookup'
5
+ export * from './balanceStatistics'
6
+ export * from './settleContract'
@@ -0,0 +1,23 @@
1
+ export interface IInternalContractNoteResponse {
2
+ internalContractNoteId: number
3
+ note: string
4
+ date: Date
5
+ writtenByUser?: string
6
+ contractPrettyIdentifier?: string
7
+ writtenByCurrentUser?: boolean
8
+ attachments: Attachment[]
9
+ }
10
+
11
+ export interface IInternalContractNoteRequest {
12
+ internalContractNoteId?: number
13
+ note: string
14
+ date?: Date
15
+ attachments?: Attachment[]
16
+ }
17
+
18
+ export interface Attachment {
19
+ fileName: string
20
+ originalFileName: string
21
+ url: string
22
+ fileType: string
23
+ }
@@ -0,0 +1,3 @@
1
+ export interface ISettleContractRequest {
2
+ attachments?: File
3
+ }
@@ -0,0 +1,20 @@
1
+ import { ContractType, TVehicleDriveType, TVehicleTransmissionType, TVehicleType } from '../../../types'
2
+
3
+ // TODO: To be switched over to the line below (extending IVehicleInfo)
4
+ // export interface ITemplateLookupRequest extends IVehicleInfo{
5
+ export interface ITemplateLookupRequest {
6
+ contractType: ContractType
7
+ regNo?: string
8
+ vin?: string
9
+ brand: string
10
+ model: string
11
+ fuelType: string
12
+ regDate: string
13
+ modelYear?: number
14
+ engineMaxPower: number | null
15
+ vehicleType: TVehicleType
16
+ cylinderVolume: number
17
+ transmissionType: TVehicleTransmissionType
18
+ driveType: TVehicleDriveType
19
+ hasFourWheelDrive?: boolean
20
+ }
@@ -0,0 +1,20 @@
1
+ export interface IFueltypeCollection {
2
+ name: string
3
+ id: number
4
+ }
5
+
6
+ export interface IModelCollection {
7
+ name: string
8
+ id: number
9
+ fuelTypes: IFueltypeCollection[]
10
+ }
11
+
12
+ export interface IBrandCollection {
13
+ name: string
14
+ id: number
15
+ models: IModelCollection[]
16
+ }
17
+
18
+ export interface ICarCollection {
19
+ brands: IBrandCollection[]
20
+ }