@fragus/sam-types 1.2.23 → 1.2.24

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.23",
2
+ "version": "1.2.24",
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",
@@ -1,6 +1,6 @@
1
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.
2
+ * The vehicles a product is blacklisted for, matched like a vehicle blacklist entry: `*` in model or fuel type matches
3
+ * any, and the model year range is inclusive with null meaning no limit.
4
4
  */
5
5
  export interface IBlacklistedProductVehicle {
6
6
  brand: string
@@ -10,43 +10,54 @@ export interface IBlacklistedProductVehicle {
10
10
  modelYearTo: number | null
11
11
  }
12
12
 
13
- /** A warranty product blacklisted by its exact name (case-insensitive) or its V4 product id; exactly one is set. */
13
+ /**
14
+ * A product blacklisted by its exact name, ignoring case (a warranty, or a service agreement by its internal or
15
+ * external name), or by its V4 product id; exactly one is set. The owners are the providers and groups, at least one in
16
+ * all. A rule cannot be changed once created, only its owners.
17
+ */
14
18
  export interface IBlacklistedProductRequest {
15
- warrantyName: string | null
19
+ productName: string | null
16
20
  v4ProductId: number | null
17
21
  /** Only for these vehicles; missing or null blacklists the product for every vehicle. */
18
22
  vehicle?: IBlacklistedProductVehicle | null
23
+ providerIds: number[]
24
+ contractProviderGroupIds: number[]
25
+ }
26
+
27
+ /** Owners to add to and remove from a rule; it must keep at least one. */
28
+ export interface IBlacklistedProductOwnersRequest {
19
29
  providerIds: {
20
30
  add: number[]
21
31
  remove: number[]
22
32
  }
23
- contractProviderGroupIds?: {
33
+ contractProviderGroupIds: {
24
34
  add: number[]
25
35
  remove: number[]
26
36
  }
27
37
  }
28
38
 
39
+ export interface IBlacklistedProductOwner {
40
+ id: number
41
+ name: string
42
+ }
43
+
29
44
  export interface IBlacklistedProductResponse {
30
45
  id: number
31
- warrantyName: string | null
46
+ productName: string | null
32
47
  v4ProductId: number | null
33
48
  vehicle: IBlacklistedProductVehicle | null
34
- parentRecord?: boolean
35
- groupRecord?: boolean
49
+ providers: IBlacklistedProductOwner[]
50
+ contractProviderGroups: IBlacklistedProductOwner[]
36
51
  }
37
52
 
38
53
  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
54
+ /** True in a sub provider's list when the rule applies to it only through its parent. */
55
+ parentRecord: boolean
44
56
  }
45
57
 
46
- /** Which providers and groups a blacklisted product is registered for. */
47
- export interface IBlacklistedProductScope {
48
- providerIds: number[]
49
- contractProviderGroupIds: number[]
58
+ /** The `debug` of a PRODUCT_BLACKLIST_ALREADY_EXISTS (409) response: the identical rule that exists. */
59
+ export interface IBlacklistedProductConflict {
60
+ id: number
50
61
  }
51
62
 
52
- export type BlacklistedProductOrderByType = 'id' | 'warrantyName' | 'v4ProductId'
63
+ export type BlacklistedProductOrderByType = 'id' | 'productName' | 'v4ProductId'
@@ -2,4 +2,5 @@ export type VehcileBlacklistErrors =
2
2
  | 'DUPLICATE_RECORD'
3
3
  | 'VEHICLE_BLACKLIST_NOT_FOUND'
4
4
  | 'PRODUCT_BLACKLIST_NOT_FOUND'
5
+ | 'PRODUCT_BLACKLIST_ALREADY_EXISTS'
5
6
  | 'CONTRACT_PRODUCT_BLACKLISTED'