@fragus/sam-types 1.2.24 → 1.2.26

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.24",
2
+ "version": "1.2.26",
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",
@@ -6,6 +6,8 @@ export interface UserRoleProviderInfo {
6
6
  id: number
7
7
  administrativeName: string
8
8
  inactive?: boolean
9
+ /** True when other providers sit under this one in the provider tree. */
10
+ hasSubProviders?: boolean
9
11
  }
10
12
 
11
13
  export interface UserRoleRecord {
@@ -0,0 +1,34 @@
1
+ import { IContractProviderGroupListItem } from '../../contractProviderGroup'
2
+
3
+ /** Owners to add to and remove from a blacklist rule; it must keep at least one. */
4
+ export interface IBlacklistOwnersRequest {
5
+ providerIds: {
6
+ add: number[]
7
+ remove: number[]
8
+ }
9
+ contractProviderGroupIds: {
10
+ add: number[]
11
+ remove: number[]
12
+ }
13
+ }
14
+
15
+ /** A provider or a provider group a blacklist rule applies to. */
16
+ export interface IBlacklistOwner {
17
+ id: number
18
+ name: string
19
+ }
20
+
21
+ /** The `debug` of an ALREADY_EXISTS (409) response of either blacklist: the identical rule that exists. */
22
+ export interface IBlacklistConflict {
23
+ id: number
24
+ }
25
+
26
+ /** The `debug` of a BLACKLIST_OWNER_COVERED_BY_GROUP (400) response: providers a group owning the rule covers. */
27
+ export interface IBlacklistOwnerCoveredByGroup {
28
+ providerIds: number[]
29
+ }
30
+
31
+ /** A provider group as the blacklist forms pick it, with its members to show which providers it covers. */
32
+ export interface IBlacklistGroupOption extends IContractProviderGroupListItem {
33
+ memberProviderIds: number[]
34
+ }
@@ -1,3 +1,5 @@
1
+ import { IBlacklistOwner, IBlacklistOwnersRequest } from '../blacklist'
2
+
1
3
  /**
2
4
  * The vehicles a product is blacklisted for, matched like a vehicle blacklist entry: `*` in model or fuel type matches
3
5
  * any, and the model year range is inclusive with null meaning no limit.
@@ -24,40 +26,17 @@ export interface IBlacklistedProductRequest {
24
26
  contractProviderGroupIds: number[]
25
27
  }
26
28
 
27
- /** Owners to add to and remove from a rule; it must keep at least one. */
28
- export interface IBlacklistedProductOwnersRequest {
29
- providerIds: {
30
- add: number[]
31
- remove: number[]
32
- }
33
- contractProviderGroupIds: {
34
- add: number[]
35
- remove: number[]
36
- }
37
- }
38
-
39
- export interface IBlacklistedProductOwner {
40
- id: number
41
- name: string
42
- }
29
+ export type IBlacklistedProductOwnersRequest = IBlacklistOwnersRequest
43
30
 
44
31
  export interface IBlacklistedProductResponse {
45
32
  id: number
46
33
  productName: string | null
47
34
  v4ProductId: number | null
48
35
  vehicle: IBlacklistedProductVehicle | null
49
- providers: IBlacklistedProductOwner[]
50
- contractProviderGroups: IBlacklistedProductOwner[]
36
+ providers: IBlacklistOwner[]
37
+ contractProviderGroups: IBlacklistOwner[]
51
38
  }
52
39
 
53
- export interface IBlacklistedProductListRecord extends IBlacklistedProductResponse {
54
- /** True in a sub provider's list when the rule applies to it only through its parent. */
55
- parentRecord: boolean
56
- }
57
-
58
- /** The `debug` of a PRODUCT_BLACKLIST_ALREADY_EXISTS (409) response: the identical rule that exists. */
59
- export interface IBlacklistedProductConflict {
60
- id: number
61
- }
40
+ export type IBlacklistedProductListRecord = IBlacklistedProductResponse
62
41
 
63
42
  export type BlacklistedProductOrderByType = 'id' | 'productName' | 'v4ProductId'
@@ -1,3 +1,9 @@
1
+ import { IBlacklistOwner } from '../blacklist'
2
+
3
+ /**
4
+ * A vehicle blacklisted for its owners: the providers and groups, at least one in all. A rule cannot be changed once
5
+ * created, only its owners.
6
+ */
1
7
  export interface IBlacklistedVehicleRequest {
2
8
  brand: string
3
9
  model: string
@@ -5,14 +11,8 @@ export interface IBlacklistedVehicleRequest {
5
11
  /** Inclusive model year range; null on either end means no limit. */
6
12
  modelYearFrom?: number | null
7
13
  modelYearTo?: number | null
8
- providerIds: {
9
- add: number[]
10
- remove: number[]
11
- }
12
- contractProviderGroupIds?: {
13
- add: number[]
14
- remove: number[]
15
- }
14
+ providerIds: number[]
15
+ contractProviderGroupIds: number[]
16
16
  }
17
17
 
18
18
  export interface IBlacklistedVehicleResponse {
@@ -22,22 +22,10 @@ export interface IBlacklistedVehicleResponse {
22
22
  fuelType: string
23
23
  modelYearFrom: number | null
24
24
  modelYearTo: number | null
25
- parentRecord?: boolean
26
- groupRecord?: boolean
27
- }
28
-
29
- export interface IBlacklistedVehicleListRecord extends IBlacklistedVehicleResponse {
30
- // Null on a group-owned entry: the two owners are exclusive.
31
- providerId: number | null
32
- providerName: string | null
33
- contractProviderGroupId: number | null
34
- contractProviderGroupName: string | null
25
+ providers: IBlacklistOwner[]
26
+ contractProviderGroups: IBlacklistOwner[]
35
27
  }
36
28
 
37
- /** Which providers and groups a blacklisted vehicle is registered for. */
38
- export interface IBlacklistedVehicleScope {
39
- providerIds: number[]
40
- contractProviderGroupIds: number[]
41
- }
29
+ export type IBlacklistedVehicleListRecord = IBlacklistedVehicleResponse
42
30
 
43
31
  export type BlacklistedVehicleOrderByType = 'id' | 'brand' | 'model' | 'fuelType'
@@ -1,6 +1,8 @@
1
1
  export type VehcileBlacklistErrors =
2
- | 'DUPLICATE_RECORD'
3
- | 'VEHICLE_BLACKLIST_NOT_FOUND'
4
- | 'PRODUCT_BLACKLIST_NOT_FOUND'
5
- | 'PRODUCT_BLACKLIST_ALREADY_EXISTS'
6
- | 'CONTRACT_PRODUCT_BLACKLISTED'
2
+ | 'VEHICLE_BLACKLIST_NOT_FOUND'
3
+ | 'VEHICLE_BLACKLIST_ALREADY_EXISTS'
4
+ | 'PRODUCT_BLACKLIST_NOT_FOUND'
5
+ | 'PRODUCT_BLACKLIST_ALREADY_EXISTS'
6
+ | 'CONTRACT_PRODUCT_BLACKLISTED'
7
+ | 'BLACKLIST_LAST_OWNER'
8
+ | 'BLACKLIST_OWNER_COVERED_BY_GROUP'
@@ -1,2 +0,0 @@
1
- export type VehicleBlacklistErrors = 'DUPLICATE_RECORD'
2
- | 'VEHICLE_BLACKLIST_NOT_FOUND'