@fragus/sam-types 1.2.18 → 1.2.20
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/contractProvider/index.d.ts +0 -1
- package/types/admin/productBlacklist/index.d.ts +52 -0
- package/types/admin/vehicleBlacklist/index.d.ts +5 -0
- package/types/contractProviderGroup.d.ts +0 -1
- package/types/index.d.ts +0 -1
- package/types/index.ts +0 -1
- package/types/responseErrors/index.d.ts +0 -2
- package/types/responseErrors/vehcileBlacklistErrors.d.ts +2 -0
- package/types/priceSign.d.ts +0 -176
- package/types/responseErrors/priceSignResponseErrors.d.ts +0 -5
package/package.json
CHANGED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The vehicles a warranty product is blacklisted for, matched like a vehicle blacklist entry: `*` in model or fuel type
|
|
3
|
+
* matches any, and the model year range is inclusive with null meaning no limit.
|
|
4
|
+
*/
|
|
5
|
+
export interface IBlacklistedProductVehicle {
|
|
6
|
+
brand: string
|
|
7
|
+
model: string
|
|
8
|
+
fuelType: string
|
|
9
|
+
modelYearFrom: number | null
|
|
10
|
+
modelYearTo: number | null
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/** A warranty product blacklisted by its exact name (case-insensitive) or its V4 product id; exactly one is set. */
|
|
14
|
+
export interface IBlacklistedProductRequest {
|
|
15
|
+
warrantyName: string | null
|
|
16
|
+
v4ProductId: number | null
|
|
17
|
+
/** Only for these vehicles; missing or null blacklists the product for every vehicle. */
|
|
18
|
+
vehicle?: IBlacklistedProductVehicle | null
|
|
19
|
+
providerIds: {
|
|
20
|
+
add: number[]
|
|
21
|
+
remove: number[]
|
|
22
|
+
}
|
|
23
|
+
contractProviderGroupIds?: {
|
|
24
|
+
add: number[]
|
|
25
|
+
remove: number[]
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface IBlacklistedProductResponse {
|
|
30
|
+
id: number
|
|
31
|
+
warrantyName: string | null
|
|
32
|
+
v4ProductId: number | null
|
|
33
|
+
vehicle: IBlacklistedProductVehicle | null
|
|
34
|
+
parentRecord?: boolean
|
|
35
|
+
groupRecord?: boolean
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface IBlacklistedProductListRecord extends IBlacklistedProductResponse {
|
|
39
|
+
// Null on a group-owned entry: the two owners are exclusive.
|
|
40
|
+
providerId: number | null
|
|
41
|
+
providerName: string | null
|
|
42
|
+
contractProviderGroupId: number | null
|
|
43
|
+
contractProviderGroupName: string | null
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** Which providers and groups a blacklisted product is registered for. */
|
|
47
|
+
export interface IBlacklistedProductScope {
|
|
48
|
+
providerIds: number[]
|
|
49
|
+
contractProviderGroupIds: number[]
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export type BlacklistedProductOrderByType = 'id' | 'warrantyName' | 'v4ProductId'
|
|
@@ -2,6 +2,9 @@ export interface IBlacklistedVehicleRequest {
|
|
|
2
2
|
brand: string
|
|
3
3
|
model: string
|
|
4
4
|
fuelType: string
|
|
5
|
+
/** Inclusive model year range; null on either end means no limit. */
|
|
6
|
+
modelYearFrom?: number | null
|
|
7
|
+
modelYearTo?: number | null
|
|
5
8
|
providerIds: {
|
|
6
9
|
add: number[]
|
|
7
10
|
remove: number[]
|
|
@@ -17,6 +20,8 @@ export interface IBlacklistedVehicleResponse {
|
|
|
17
20
|
brand: string
|
|
18
21
|
model: string
|
|
19
22
|
fuelType: string
|
|
23
|
+
modelYearFrom: number | null
|
|
24
|
+
modelYearTo: number | null
|
|
20
25
|
parentRecord?: boolean
|
|
21
26
|
groupRecord?: boolean
|
|
22
27
|
}
|
package/types/index.d.ts
CHANGED
package/types/index.ts
CHANGED
|
@@ -9,7 +9,6 @@ import { ImportErrors } from './importErrors'
|
|
|
9
9
|
import { InvalidProductTypeErrors } from './invalidProductTypeErrors'
|
|
10
10
|
import { InvoiceErrors } from './invoiceErrors'
|
|
11
11
|
import { PasswordErrors } from './passwordResponseErrors'
|
|
12
|
-
import { PriceSignResponseErrors } from './priceSignResponseErrors'
|
|
13
12
|
import { paymentResponseErrors } from './paymentResponseErrors'
|
|
14
13
|
import { RateLimitErrors } from './rateLimitErrors'
|
|
15
14
|
import { UserAndCustomerErrors } from './userAndCustomerErrors'
|
|
@@ -33,4 +32,3 @@ export type ResponseErrors =
|
|
|
33
32
|
| VatLookupResponseErrors
|
|
34
33
|
| VehcileBlacklistErrors
|
|
35
34
|
| InvoiceErrors
|
|
36
|
-
| PriceSignResponseErrors
|
package/types/priceSign.d.ts
DELETED
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
import { TIsoCountry } from './country'
|
|
2
|
-
|
|
3
|
-
export type TPriceSignFormat = 'pdf' | 'png' | 'jpeg'
|
|
4
|
-
|
|
5
|
-
/** Limits the api enforces on templates and setups; Superadmin builds its forms from them. */
|
|
6
|
-
export interface IPriceSignLimits {
|
|
7
|
-
minMonths: number
|
|
8
|
-
maxMonths: number
|
|
9
|
-
maxHpTiers: number
|
|
10
|
-
minPeriods: number
|
|
11
|
-
maxPeriods: number
|
|
12
|
-
/** Max periods on a sign with `maxHpTiers` HP tiers. */
|
|
13
|
-
maxPeriodsWithMaxTiers: number
|
|
14
|
-
countries: TIsoCountry[]
|
|
15
|
-
/** Durations offered as one-click picks; any other whole month in range can still be added. */
|
|
16
|
-
quickPickMonths: number[]
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export interface IPriceSignPeriod {
|
|
20
|
-
months: number
|
|
21
|
-
suggestedPrice: string
|
|
22
|
-
suggestedSupplements: string[]
|
|
23
|
-
excludedTiers: number[]
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export interface IPriceSignBenefit {
|
|
27
|
-
title: string
|
|
28
|
-
body: string
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export interface IPriceSignDealerPrice {
|
|
32
|
-
months: number
|
|
33
|
-
price: string
|
|
34
|
-
supplements: string[]
|
|
35
|
-
hidden: boolean
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export interface IPriceSignTemplate {
|
|
39
|
-
templateId: number
|
|
40
|
-
country: TIsoCountry
|
|
41
|
-
templateName: string
|
|
42
|
-
visible: boolean
|
|
43
|
-
name: string
|
|
44
|
-
nameAccent: string
|
|
45
|
-
years: string
|
|
46
|
-
km: string
|
|
47
|
-
deductible: string
|
|
48
|
-
repairLimit: string
|
|
49
|
-
/** Ascending HP thresholds; each starts a supplement tier. */
|
|
50
|
-
tiers: number[]
|
|
51
|
-
periods: IPriceSignPeriod[]
|
|
52
|
-
intro: string
|
|
53
|
-
coverageIntro: string
|
|
54
|
-
bullets: string[]
|
|
55
|
-
footnote: string
|
|
56
|
-
updatedBy: string | null
|
|
57
|
-
updatedAt: string
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export interface IPriceSignSharedContent {
|
|
61
|
-
country: TIsoCountry
|
|
62
|
-
familyName: string
|
|
63
|
-
repairLimitLabel: string
|
|
64
|
-
repairLimitNote: string
|
|
65
|
-
benefits: IPriceSignBenefit[]
|
|
66
|
-
coverageHeading: string
|
|
67
|
-
periodsHeading: string
|
|
68
|
-
vatNote: string
|
|
69
|
-
supplementLabel: string
|
|
70
|
-
tierHeading: string
|
|
71
|
-
tierLabel: string
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export interface IPriceSignSetupTemplate {
|
|
75
|
-
templateId: number
|
|
76
|
-
/** null follows the template's tiers. */
|
|
77
|
-
tiers: number[] | null
|
|
78
|
-
/** Only the periods that differ from the template. */
|
|
79
|
-
periods: IPriceSignPeriod[]
|
|
80
|
-
/** Dealers of this setup with their own prices for this template; a tier change clears them. */
|
|
81
|
-
dealerPriceCount: number
|
|
82
|
-
updatedBy: string | null
|
|
83
|
-
updatedAt: string
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
/** A setup belongs to one provider or one group and grants its members price signs. */
|
|
87
|
-
export interface IPriceSignSetupSummary {
|
|
88
|
-
setupId: number
|
|
89
|
-
contractProviderId: number | null
|
|
90
|
-
providerName: string | null
|
|
91
|
-
contractProviderGroupId: number | null
|
|
92
|
-
groupName: string | null
|
|
93
|
-
groupArchived: boolean
|
|
94
|
-
templateCount: number
|
|
95
|
-
createdBy: string | null
|
|
96
|
-
createdAt: string
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
export interface IPriceSignSetup extends IPriceSignSetupSummary {
|
|
100
|
-
templates: IPriceSignSetupTemplate[]
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
export interface IPriceSignSetupTemplateRequest {
|
|
104
|
-
templateId: number
|
|
105
|
-
tiers: number[] | null
|
|
106
|
-
/** Full periods as edited; the api keeps only those that differ from the template. */
|
|
107
|
-
periods: IPriceSignPeriod[]
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
/** The owner is set on create only: exactly one of the two ids. */
|
|
111
|
-
export interface IPriceSignSetupRequest {
|
|
112
|
-
contractProviderId?: number
|
|
113
|
-
contractProviderGroupId?: number
|
|
114
|
-
templates: IPriceSignSetupTemplateRequest[]
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
export interface IPriceSignSetupCandidates {
|
|
118
|
-
providers: { contractProviderId: number; name: string }[]
|
|
119
|
-
groups: { contractProviderGroupId: number; name: string }[]
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
export interface IPriceSignTemplateUsage {
|
|
123
|
-
groups: number
|
|
124
|
-
providers: number
|
|
125
|
-
/** Dealers with their own prices for this template. */
|
|
126
|
-
dealerPrices: number
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
export interface IPriceSignDealerPrices {
|
|
130
|
-
templateId: number
|
|
131
|
-
/** Effective rows: the dealer's own values over the setup's. */
|
|
132
|
-
prices: IPriceSignDealerPrice[]
|
|
133
|
-
updatedAt: string | null
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
export interface IPriceSignDealerPricesRequest {
|
|
137
|
-
templateId: number
|
|
138
|
-
prices: IPriceSignDealerPrice[]
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
export interface IPriceSignCatalog {
|
|
142
|
-
shared: IPriceSignSharedContent
|
|
143
|
-
/** Visible templates with the dealer's setup applied. */
|
|
144
|
-
templates: IPriceSignTemplate[]
|
|
145
|
-
groupName: string | null
|
|
146
|
-
logoUrl: string | null
|
|
147
|
-
logoUsable: boolean
|
|
148
|
-
downloadAvailable: boolean
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
export interface IPriceSignRenderRequest {
|
|
152
|
-
/** One page per template, in this order. */
|
|
153
|
-
templateIds: number[]
|
|
154
|
-
logo: 'provider' | 'none' | { dataUrl: string }
|
|
155
|
-
/** Aligned with `templateIds`. */
|
|
156
|
-
prices?: IPriceSignDealerPrice[][]
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
/** Body of a template create or update; the api sets the id and the audit fields. */
|
|
160
|
-
export type TPriceSignTemplateRequest = Pick<
|
|
161
|
-
IPriceSignTemplate,
|
|
162
|
-
Exclude<keyof IPriceSignTemplate, 'templateId' | 'updatedBy' | 'updatedAt'>
|
|
163
|
-
>
|
|
164
|
-
|
|
165
|
-
/** Body of a shared content save; the country comes from the url. */
|
|
166
|
-
export type TPriceSignSharedContentRequest = Pick<
|
|
167
|
-
IPriceSignSharedContent,
|
|
168
|
-
Exclude<keyof IPriceSignSharedContent, 'country'>
|
|
169
|
-
>
|
|
170
|
-
|
|
171
|
-
export interface IPriceSignEditorPreviewRequest {
|
|
172
|
-
template: TPriceSignTemplateRequest & { templateId?: number }
|
|
173
|
-
shared?: IPriceSignSharedContent
|
|
174
|
-
setup?: Pick<IPriceSignSetupTemplateRequest, 'tiers' | 'periods'>
|
|
175
|
-
prices?: IPriceSignDealerPrice[]
|
|
176
|
-
}
|