@fragus/sam-types 1.0.82 → 1.0.83
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.
- package/package.json +1 -1
- package/types/admin/chart/contractCharts.d.ts +0 -1
- package/types/admin/contract/basicInfo.d.ts +20 -0
- package/types/admin/contract/contractDetails.d.ts +60 -75
- package/types/admin/contract/index.d.ts +1 -0
- package/types/admin/contractCreation/contractCreation.d.ts +6 -0
- package/types/contract/contractFilter.d.ts +9 -9
- package/types/locale.d.ts +12 -0
package/package.json
CHANGED
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
productContract: boolean
|
|
19
|
+
offerExpirationDate?: string
|
|
20
|
+
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ContractState } from '../../index'
|
|
2
1
|
import { TV4PTProductType } from '../../v4PricingTool'
|
|
3
2
|
import { ContractType, ContractValueType, ServiceContractFlag } from './../../admin/contractCreation'
|
|
4
3
|
import { IContactPersonResponse } from './../../contactPerson'
|
|
@@ -8,91 +7,77 @@ import { IIncludedContractOption } from './../../includedContractOption'
|
|
|
8
7
|
import { PaymentGateway } from './../../payment'
|
|
9
8
|
import { PriceSpecification } from './../../priceSpecification'
|
|
10
9
|
|
|
11
|
-
export interface
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export interface IFileItem {
|
|
16
|
-
name: string
|
|
17
|
-
v4URL: string
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* This interface is used for contract settlement page in Admin.
|
|
22
|
-
* Contains calculated value of mileage | hours | services for contract.
|
|
23
|
-
*/
|
|
24
|
-
export interface IEstimatedContractValue {
|
|
25
|
-
estimatedValue: number
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* This interface is used for contract details page in Admin.
|
|
30
|
-
* It contains all the necessary/basic information about the contract for header, and shared data for tabs.
|
|
31
|
-
*/
|
|
32
|
-
export interface IContractDetailsBasic {
|
|
33
|
-
prettyIdentifier: string
|
|
34
|
-
contractState: ContractState
|
|
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.
|
|
35
12
|
contractType: ContractType
|
|
36
13
|
contractProductType: null | TV4PTProductType
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
offerExpiresAt: Date
|
|
42
|
-
customerTotalCost: number
|
|
43
|
-
serviceVariantName?: string
|
|
44
|
-
settledUnits: number | null
|
|
45
|
-
contractTemplateMinPaymentsCount: number | null
|
|
46
|
-
expirationDate: Date
|
|
47
|
-
isExtendedFromAnotherContract: boolean
|
|
48
|
-
|
|
49
|
-
valueType: ContractValueType
|
|
50
|
-
startValueType: ContractValueType
|
|
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].
|
|
51
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
|
|
52
27
|
value?: number
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
28
|
+
valueType: ContractValueType
|
|
29
|
+
monthlyTemplatePrice: PriceSpecification
|
|
30
|
+
monthlyPrice: PriceSpecification
|
|
31
|
+
paymentMethod: PaymentGateway
|
|
32
|
+
cardWallet: string | null // wallet name, e.g. 'apple_pay', 'google_pay', 'link', used for card payment
|
|
33
|
+
prettyIdentifierShort: string
|
|
34
|
+
prettyIdentifier: string
|
|
35
|
+
providerPayments: number
|
|
36
|
+
providerShare: PriceSpecification
|
|
37
|
+
reference: string
|
|
38
|
+
warrantyReference?: string
|
|
39
|
+
seller?: IContactPersonResponse
|
|
56
40
|
startDate: Date | string
|
|
57
|
-
|
|
41
|
+
termsPdfUrl: string
|
|
42
|
+
termsOfTradePdfUrl: string
|
|
43
|
+
filesContainerAlongContract: null | IFileItem[] // Optional extra files, except the TOS file.
|
|
58
44
|
totalPrice: PriceSpecification
|
|
59
|
-
|
|
45
|
+
contractTemplateId: null | number
|
|
46
|
+
contractName: string // Contract (template) name.
|
|
47
|
+
priceSource: null | PriceSource
|
|
48
|
+
contractTemplateDescription: string
|
|
49
|
+
contractTemplateMinPaymentsCount: number | null
|
|
50
|
+
contractTemplateIsArchived: boolean
|
|
51
|
+
isProduct: boolean
|
|
52
|
+
serviceVariantId: string
|
|
53
|
+
flags: ServiceContractFlag[]
|
|
54
|
+
stripeCustomerLink: string | null
|
|
55
|
+
stripeSubscriptionLink: string | null
|
|
56
|
+
customTerms?: string
|
|
57
|
+
adjustedFrom?: string
|
|
58
|
+
adjustedTo?: string
|
|
59
|
+
createdByProvider?: string
|
|
60
|
+
provider?: string
|
|
61
|
+
settledUnits?: number | null
|
|
62
|
+
overdrivenCharge?: number
|
|
60
63
|
underdrivenCharge?: number
|
|
61
|
-
|
|
64
|
+
calculationMethod?: number
|
|
62
65
|
overHoursCharge?: number
|
|
66
|
+
underHoursCharge?: number
|
|
63
67
|
overServicesCharge?: number
|
|
64
|
-
|
|
68
|
+
underServicesCharge?: number
|
|
69
|
+
}
|
|
65
70
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
providerShare: PriceSpecification
|
|
71
|
+
export interface IAdminCustomTermsRecord {
|
|
72
|
+
customTerms: string
|
|
73
|
+
}
|
|
70
74
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
warrantyReference?: string
|
|
75
|
+
export interface IUnitsListResponse {
|
|
76
|
+
units: number
|
|
77
|
+
date: Date | string
|
|
75
78
|
}
|
|
76
79
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
* There is joined data from different tables, so it is separated from basic response.
|
|
81
|
-
*/
|
|
82
|
-
export interface IContractDetailsSpecifics {
|
|
83
|
-
includedOptions: IIncludedContractOption[] | null
|
|
84
|
-
termsPdfUrl: string
|
|
85
|
-
termsOfTradePdfUrl: string
|
|
86
|
-
stripeSubscriptionLink: string | null
|
|
87
|
-
stripeCustomerLink: string | null
|
|
88
|
-
seller: { name: string; email: string }
|
|
89
|
-
providerName: string
|
|
90
|
-
extendedFrom?: string
|
|
91
|
-
adjustedTo?: string
|
|
92
|
-
customTerms?: string
|
|
93
|
-
createdByProvider: string
|
|
94
|
-
contractTemplateId: number | null
|
|
95
|
-
contractPdfUrl: string
|
|
96
|
-
cardWallet: string | null
|
|
97
|
-
filesContainerAlongContract: null | IFileItem[]
|
|
80
|
+
export interface IFileItem {
|
|
81
|
+
name: string
|
|
82
|
+
v4URL: string
|
|
98
83
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IContractDetailsRecord } from '..'
|
|
1
2
|
import { DurationOptions, IContractOptionResponse, TMileageDurationsMap, TV4PTProductType } from '../..'
|
|
2
3
|
import { IContractTemplateResponse, IGenericContractTemplateResponse, PriceSource } from '../../contractTemplate'
|
|
3
4
|
import { PaymentGateway, PaymentType } from '../../payment'
|
|
@@ -9,6 +10,7 @@ import { PriceSpecification } from './../../priceSpecification'
|
|
|
9
10
|
import { ICarCollection } from './carData'
|
|
10
11
|
import { IContractCalculationResponse } from './priceCalculation'
|
|
11
12
|
|
|
13
|
+
|
|
12
14
|
export type ContractType = 'STANDARD' | 'CUSTOM' | 'EXTERNAL'
|
|
13
15
|
|
|
14
16
|
export type ServiceContractFlag = 'DISTRIBUTE_DOWNPAYMENT' | 'NULLIFY_DOWNPAYMENT'
|
|
@@ -267,6 +269,10 @@ export interface IAdminContractActivationRequest {
|
|
|
267
269
|
creditCardToken?: string
|
|
268
270
|
}
|
|
269
271
|
|
|
272
|
+
export interface IAdminContractActivationResponse {
|
|
273
|
+
serviceContract: IContractDetailsRecord
|
|
274
|
+
}
|
|
275
|
+
|
|
270
276
|
export interface IAdminContractResponse {
|
|
271
277
|
type: ContractType
|
|
272
278
|
contractName: string
|
|
@@ -27,15 +27,6 @@ export interface IContractFilterOptions {
|
|
|
27
27
|
activeTypes: TContractObject[]
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
export interface IContractStatusCount {
|
|
31
|
-
contractState: ContractState
|
|
32
|
-
count: number
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export interface IContractProductTypeCountResponse {
|
|
36
|
-
[contractObjectType: string]: number
|
|
37
|
-
}
|
|
38
|
-
|
|
39
30
|
export interface IContractFilterParams {
|
|
40
31
|
contractStates: ContractState[]
|
|
41
32
|
contractObjectType: TContractObject // Renamed from contractProduct.
|
|
@@ -56,3 +47,12 @@ export interface IWarrantyFilterParams {
|
|
|
56
47
|
created: IContractFilterDate
|
|
57
48
|
expired: IContractFilterDate
|
|
58
49
|
}
|
|
50
|
+
|
|
51
|
+
export interface IContractCountersResponse {
|
|
52
|
+
/** Count of contracts grouped by state (excludes Draft) */
|
|
53
|
+
perState: Partial<Record<ContractState, number>>
|
|
54
|
+
/** Number of Active contracts expiring within 90 days */
|
|
55
|
+
expiring: number
|
|
56
|
+
/** Number of Expired/Terminated contracts ready for settlement (action > 30 days ago) */
|
|
57
|
+
forSettlement: number
|
|
58
|
+
}
|
package/types/locale.d.ts
CHANGED
|
@@ -22,3 +22,15 @@ export interface Locale {
|
|
|
22
22
|
* @deprecated 'en-GB'
|
|
23
23
|
*/
|
|
24
24
|
export type IsoLocale = 'da-DK' | 'sv-SE' | 'fi-FI' | 'nb-NO' | 'en' | 'en-GB' // NOTE: 'en-GB' is deprecated.
|
|
25
|
+
|
|
26
|
+
export interface LocaleRecord {
|
|
27
|
+
name: string
|
|
28
|
+
nameLocal: string
|
|
29
|
+
defaultFormat: {
|
|
30
|
+
currency?: string
|
|
31
|
+
date?: string
|
|
32
|
+
mileage?: string
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export type LocaleRecords = Record<IsoLocale, LocaleRecord>
|