@fragus/sam-types 1.2.21 → 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 CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.2.21",
2
+ "version": "1.2.22",
3
3
  "name": "@fragus/sam-types",
4
4
  "description": "Typescript interfaces for all types used to communicate between SAM client(s) and the SAM API",
5
5
  "author": "Fragus",
@@ -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
@@ -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
+ }
@@ -1 +1,2 @@
1
1
  export * from './payment'
2
+ export * from './deleteMyData'
@@ -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,5 +1,3 @@
1
1
  export type VehcileBlacklistErrors =
2
2
  | 'DUPLICATE_RECORD'
3
3
  | 'VEHICLE_BLACKLIST_NOT_FOUND'
4
- | 'PRODUCT_BLACKLIST_NOT_FOUND'
5
- | 'CONTRACT_PRODUCT_BLACKLISTED'
@@ -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'