@fragus/sam-types 1.2.20 → 1.2.22
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 +1 -0
- package/types/admin/customer/customer.d.ts +2 -0
- package/types/admin/vehicleBlacklist/index.d.ts +0 -5
- package/types/contract/contractList.d.ts +2 -0
- package/types/contractProviderGroup.d.ts +1 -0
- package/types/index.d.ts +1 -0
- package/types/index.ts +1 -0
- package/types/myPage/deleteMyData.d.ts +20 -0
- package/types/myPage/index.d.ts +1 -0
- package/types/priceSign.d.ts +176 -0
- package/types/responseErrors/index.d.ts +2 -0
- package/types/responseErrors/priceSignResponseErrors.d.ts +5 -0
- package/types/responseErrors/userAndCustomerErrors.d.ts +1 -1
- package/types/responseErrors/userAndCustomerErrors.ts +1 -0
- package/types/responseErrors/vehcileBlacklistErrors.d.ts +0 -2
- package/types/admin/productBlacklist/index.d.ts +0 -52
package/package.json
CHANGED
|
@@ -18,6 +18,8 @@ export interface IAdminCustomer {
|
|
|
18
18
|
ean?: string
|
|
19
19
|
companyName?: string
|
|
20
20
|
vatLookup?: VatLookup
|
|
21
|
+
/** Set when the customer's data has been anonymised (by the archive cron or from MyPage); it is then read-only. */
|
|
22
|
+
dataDeleted?: boolean
|
|
21
23
|
}
|
|
22
24
|
|
|
23
25
|
export interface CustomerUpdateResponse extends IAdminCustomer {
|
|
@@ -2,9 +2,6 @@ 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
|
|
8
5
|
providerIds: {
|
|
9
6
|
add: number[]
|
|
10
7
|
remove: number[]
|
|
@@ -20,8 +17,6 @@ export interface IBlacklistedVehicleResponse {
|
|
|
20
17
|
brand: string
|
|
21
18
|
model: string
|
|
22
19
|
fuelType: string
|
|
23
|
-
modelYearFrom: number | null
|
|
24
|
-
modelYearTo: number | null
|
|
25
20
|
parentRecord?: boolean
|
|
26
21
|
groupRecord?: boolean
|
|
27
22
|
}
|
|
@@ -14,6 +14,8 @@ export interface IContractListRecord {
|
|
|
14
14
|
contractTemplateDescription: string
|
|
15
15
|
customerName: string
|
|
16
16
|
customerCompanyName: string
|
|
17
|
+
/** Set when the customer's data has been anonymised; the name columns then hold placeholders. */
|
|
18
|
+
customerDataDeleted?: boolean
|
|
17
19
|
registrationNumber?: string
|
|
18
20
|
serialNumber?: string
|
|
19
21
|
itemNumber?: string
|
package/types/index.d.ts
CHANGED
package/types/index.ts
CHANGED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ContractState } from '../index'
|
|
2
|
+
|
|
3
|
+
export interface IDeleteMyDataOpenContract {
|
|
4
|
+
prettyIdentifier: string
|
|
5
|
+
contractState: ContractState
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Whether the customer may anonymise their own data from MyPage. Refused while any contract is in a state that can
|
|
10
|
+
* still charge, refund or mail the customer; those contracts are listed in `openContracts`.
|
|
11
|
+
*/
|
|
12
|
+
export interface IDeleteMyDataStatusResponse {
|
|
13
|
+
allowed: boolean
|
|
14
|
+
openContracts: IDeleteMyDataOpenContract[]
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/** Body of the MyPage delete-my-data endpoint; the customer confirms with their current password. */
|
|
18
|
+
export interface IDeleteMyDataRequest {
|
|
19
|
+
password: string
|
|
20
|
+
}
|
package/types/myPage/index.d.ts
CHANGED
|
@@ -0,0 +1,176 @@
|
|
|
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
|
+
}
|
|
@@ -9,6 +9,7 @@ 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'
|
|
12
13
|
import { paymentResponseErrors } from './paymentResponseErrors'
|
|
13
14
|
import { RateLimitErrors } from './rateLimitErrors'
|
|
14
15
|
import { UserAndCustomerErrors } from './userAndCustomerErrors'
|
|
@@ -32,3 +33,4 @@ export type ResponseErrors =
|
|
|
32
33
|
| VatLookupResponseErrors
|
|
33
34
|
| VehcileBlacklistErrors
|
|
34
35
|
| InvoiceErrors
|
|
36
|
+
| PriceSignResponseErrors
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare type UserAndCustomerErrors = 'GENERIC_CONTACT_PERSON_NOT_FOUND' | 'GENERIC_CUSTOMER_ALREADY_EXISTS' | 'GENERIC_CUSTOMER_EMAIL_ALREADY_EXISTS_AS_USER' | 'GENERIC_CUSTOMER_NOT_FOUND' | 'GENERIC_FORBIDDEN_ROLE' | 'REPORTS_USER_NO_ADMIN_LOGIN' | 'GENERIC_NODE_ROLE_NOT_FOUND' | 'GENERIC_USER_ALREADY_EXISTS' | 'GENERIC_USER_CONFIGURATION_NOT_FOUND' | 'GENERIC_USER_NOT_FOUND' | 'GENERIC_USERNAME_OR_PASSWORD_NOT_FOUND';
|
|
1
|
+
export declare type UserAndCustomerErrors = 'GENERIC_CONTACT_PERSON_NOT_FOUND' | 'GENERIC_CUSTOMER_ALREADY_EXISTS' | 'GENERIC_CUSTOMER_EMAIL_ALREADY_EXISTS_AS_USER' | 'GENERIC_CUSTOMER_NOT_FOUND' | 'CUSTOMER_HAS_OPEN_CONTRACTS' | 'GENERIC_FORBIDDEN_ROLE' | 'REPORTS_USER_NO_ADMIN_LOGIN' | 'GENERIC_NODE_ROLE_NOT_FOUND' | 'GENERIC_USER_ALREADY_EXISTS' | 'GENERIC_USER_CONFIGURATION_NOT_FOUND' | 'GENERIC_USER_NOT_FOUND' | 'GENERIC_USERNAME_OR_PASSWORD_NOT_FOUND';
|
|
@@ -3,6 +3,7 @@ export type UserAndCustomerErrors =
|
|
|
3
3
|
| 'GENERIC_CUSTOMER_ALREADY_EXISTS'
|
|
4
4
|
| 'GENERIC_CUSTOMER_EMAIL_ALREADY_EXISTS_AS_USER' // The customer's email already exists as a (Seller/Admin/SuperAdmin/...) -User.
|
|
5
5
|
| 'GENERIC_CUSTOMER_NOT_FOUND'
|
|
6
|
+
| 'CUSTOMER_HAS_OPEN_CONTRACTS' // MyPage delete-my-data refused: a contract can still charge, refund or mail the customer.
|
|
6
7
|
| 'GENERIC_FORBIDDEN_ROLE'
|
|
7
8
|
| 'REPORTS_USER_NO_ADMIN_LOGIN' // Admin login refused: the user only has the reports role, used through the report API.
|
|
8
9
|
| 'GENERIC_NODE_ROLE_NOT_FOUND'
|
|
@@ -1,52 +0,0 @@
|
|
|
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'
|