@fragus/sam-types 1.1.4 → 1.1.5
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/accessKey/index.d.ts +5 -0
- package/types/admin/vehicleBlacklist/index.d.ts +16 -2
- package/types/contractProviderFlags.d.ts +7 -3
- package/types/contractProviderGroup.d.ts +58 -0
- package/types/dashboardBanner.d.ts +24 -17
- package/types/emailCampaign.d.ts +7 -0
- package/types/emailCampaign.ts +6 -2
- package/types/index.d.ts +1 -0
- package/types/index.ts +1 -0
- package/types/providerDocument.d.ts +4 -1
- package/types/responseErrors/contractProviderGroupErrors.d.ts +1 -0
- package/types/responseErrors/index.d.ts +2 -0
package/package.json
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { AccessKeyPermission, AccessKeyService, TIsoCountry } from '../index'
|
|
2
2
|
|
|
3
|
+
/** How an access key chooses its providers: country-scoped, manually scoped, or group-scoped. */
|
|
4
|
+
export type TAccessKeyScopeMode = 'all' | 'manual' | 'group'
|
|
5
|
+
|
|
3
6
|
export interface IAccessKey {
|
|
4
7
|
accessKeyId: number
|
|
5
8
|
apiKey: string
|
|
@@ -10,5 +13,7 @@ export interface IAccessKey {
|
|
|
10
13
|
contractProviderIds: number[]
|
|
11
14
|
allProvidersAllowed: boolean
|
|
12
15
|
isoCountries: TIsoCountry[] // scope for allProvidersAllowed; non-empty when it is true
|
|
16
|
+
scopeMode: TAccessKeyScopeMode
|
|
17
|
+
contractProviderGroupId: number | null // set only in 'group' mode; resolved live at request time
|
|
13
18
|
description?: string
|
|
14
19
|
}
|
|
@@ -6,6 +6,10 @@ export interface IBlacklistedVehicleRequest {
|
|
|
6
6
|
add: number[]
|
|
7
7
|
remove: number[]
|
|
8
8
|
}
|
|
9
|
+
contractProviderGroupIds?: {
|
|
10
|
+
add: number[]
|
|
11
|
+
remove: number[]
|
|
12
|
+
}
|
|
9
13
|
}
|
|
10
14
|
|
|
11
15
|
export interface IBlacklistedVehicleResponse {
|
|
@@ -14,11 +18,21 @@ export interface IBlacklistedVehicleResponse {
|
|
|
14
18
|
model: string
|
|
15
19
|
fuelType: string
|
|
16
20
|
parentRecord?: boolean
|
|
21
|
+
groupRecord?: boolean
|
|
17
22
|
}
|
|
18
23
|
|
|
19
24
|
export interface IBlacklistedVehicleListRecord extends IBlacklistedVehicleResponse {
|
|
20
|
-
|
|
21
|
-
|
|
25
|
+
// Null on a group-owned entry: the two owners are exclusive.
|
|
26
|
+
providerId: number | null
|
|
27
|
+
providerName: string | null
|
|
28
|
+
contractProviderGroupId: number | null
|
|
29
|
+
contractProviderGroupName: string | null
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** Which providers and groups a blacklisted vehicle is registered for. */
|
|
33
|
+
export interface IBlacklistedVehicleScope {
|
|
34
|
+
providerIds: number[]
|
|
35
|
+
contractProviderGroupIds: number[]
|
|
22
36
|
}
|
|
23
37
|
|
|
24
38
|
export type BlacklistedVehicleOrderByType = 'id' | 'brand' | 'model' | 'fuelType'
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
export type TContractProviderFlagKey = 'RENAULT_UNIQ_PDF_FORMAT'
|
|
2
2
|
|
|
3
|
+
/** Exactly one of the two ids is sent: a flag row is owned by a provider or by a group. */
|
|
3
4
|
export interface ContractProviderFlagRequest {
|
|
4
|
-
contractProviderId
|
|
5
|
+
contractProviderId?: number
|
|
6
|
+
contractProviderGroupId?: number
|
|
5
7
|
}
|
|
6
8
|
|
|
7
9
|
export interface ContractProviderFlagResponse {
|
|
8
10
|
id: number
|
|
9
11
|
featureKey: TContractProviderFlagKey
|
|
10
|
-
contractProviderId: number
|
|
11
|
-
contractProviderName: string
|
|
12
|
+
contractProviderId: number | null
|
|
13
|
+
contractProviderName: string | null
|
|
14
|
+
contractProviderGroupId: number | null
|
|
15
|
+
contractProviderGroupName: string | null
|
|
12
16
|
updatedByUser: string
|
|
13
17
|
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { ProviderState } from './contractProvider'
|
|
2
|
+
import { EmailCampaignStatus } from './emailCampaign'
|
|
3
|
+
|
|
4
|
+
export interface IContractProviderGroupMember {
|
|
5
|
+
contractProviderId: number
|
|
6
|
+
administrativeName: string
|
|
7
|
+
isoName: string // country
|
|
8
|
+
state: ProviderState // lets every picker count Inactive members
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface IProviderGroupTag {
|
|
12
|
+
providerGroupTagId: number
|
|
13
|
+
name: string
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface IContractProviderGroupListItem {
|
|
17
|
+
contractProviderGroupId: number
|
|
18
|
+
name: string
|
|
19
|
+
description: string | null
|
|
20
|
+
tags: IProviderGroupTag[]
|
|
21
|
+
memberCount: number
|
|
22
|
+
inactiveMemberCount: number
|
|
23
|
+
archivedAt: string | null // ISO
|
|
24
|
+
updatedByEmail: string // 'USER NOT FOUND' when the acting user is gone
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export type IContractProviderGroupDetail = IContractProviderGroupListItem & {
|
|
28
|
+
members: IContractProviderGroupMember[]
|
|
29
|
+
createdAt: string // ISO
|
|
30
|
+
updatedAt: string // ISO
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface IContractProviderGroupUsage {
|
|
34
|
+
accessKeys: { accessKeyId: number; description: string | null }[]
|
|
35
|
+
emailCampaigns: { id: number; name: string; status: EmailCampaignStatus }[]
|
|
36
|
+
blacklistEntryCount: number
|
|
37
|
+
documentCount: number
|
|
38
|
+
dashboardBannerCount: number
|
|
39
|
+
featureFlagCount: number
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface IUpsertContractProviderGroupRequest {
|
|
43
|
+
name: string
|
|
44
|
+
description: string | null
|
|
45
|
+
tags: string[]
|
|
46
|
+
contractProviderIds: number[]
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// The provider-side view of membership: every joinable group, plus any archived group this provider is
|
|
50
|
+
// still in (archived groups can be left but not joined).
|
|
51
|
+
export interface IContractProviderGroupMembership {
|
|
52
|
+
groups: IContractProviderGroupListItem[]
|
|
53
|
+
memberGroupIds: number[]
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface ISetContractProviderGroupsRequest {
|
|
57
|
+
contractProviderGroupIds: number[] // the full set for one provider; the api diffs it against what is stored
|
|
58
|
+
}
|
|
@@ -1,32 +1,39 @@
|
|
|
1
|
-
import { TIsoCountry } from './country'
|
|
1
|
+
import { TIsoCountry } from './country'
|
|
2
|
+
|
|
2
3
|
/**
|
|
3
4
|
* Request body for creating or updating a dashboard banner (Superadmin)
|
|
4
5
|
*/
|
|
5
6
|
export interface DashboardBannerRequest {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
7
|
+
text: string
|
|
8
|
+
/**
|
|
9
|
+
* Exactly one of the two targets the banner: a whole country, or the members of one provider group.
|
|
10
|
+
* A group banner takes precedence over a country one.
|
|
11
|
+
*/
|
|
12
|
+
countryIso?: TIsoCountry | null
|
|
13
|
+
contractProviderGroupId?: number | null
|
|
14
|
+
/**
|
|
15
|
+
* ISO date string (YYYY-MM-DD) for the start date of the banner
|
|
16
|
+
*/
|
|
17
|
+
startDate: string
|
|
18
|
+
/**
|
|
19
|
+
* ISO date string (YYYY-MM-DD) for the end date of the banner
|
|
20
|
+
*/
|
|
21
|
+
endDate: string
|
|
16
22
|
}
|
|
17
23
|
/**
|
|
18
24
|
* Response body for retrieving a dashboard banner (Superadmin)
|
|
19
25
|
*/
|
|
20
26
|
export interface DashboardBannerResponse extends DashboardBannerRequest {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
27
|
+
id: number
|
|
28
|
+
contractProviderGroupName: string | null
|
|
29
|
+
/**
|
|
30
|
+
* Email of the user who last updated the banner
|
|
31
|
+
*/
|
|
32
|
+
updatedByUser: string
|
|
26
33
|
}
|
|
27
34
|
/**
|
|
28
35
|
* Response body for retrieving dashboard banner text in Admin
|
|
29
36
|
*/
|
|
30
37
|
export interface ProviderDashboardBannerResponse {
|
|
31
|
-
|
|
38
|
+
text: string
|
|
32
39
|
}
|
package/types/emailCampaign.d.ts
CHANGED
|
@@ -10,12 +10,19 @@ export declare enum EmailCampaignStatus {
|
|
|
10
10
|
}
|
|
11
11
|
export declare type EmailCampaignRole = 'admin' | 'seller';
|
|
12
12
|
export declare type EmailCampaignSelectionMode = 'all' | 'subset';
|
|
13
|
+
export declare type EmailCampaignProviderMode = EmailCampaignSelectionMode | 'group';
|
|
13
14
|
export declare type EmailCampaignProviderSelection = {
|
|
14
15
|
providerMode: 'all';
|
|
15
16
|
selectedProviderIds: null;
|
|
17
|
+
selectedGroupIds: null;
|
|
16
18
|
} | {
|
|
17
19
|
providerMode: 'subset';
|
|
18
20
|
selectedProviderIds: number[];
|
|
21
|
+
selectedGroupIds: null;
|
|
22
|
+
} | {
|
|
23
|
+
providerMode: 'group';
|
|
24
|
+
selectedProviderIds: null;
|
|
25
|
+
selectedGroupIds: number[];
|
|
19
26
|
};
|
|
20
27
|
export declare type EmailCampaignRecipientSelection = {
|
|
21
28
|
recipientMode: 'all';
|
package/types/emailCampaign.ts
CHANGED
|
@@ -21,11 +21,15 @@ export type EmailCampaignRole = 'admin' | 'seller'
|
|
|
21
21
|
// How a pool (providers or recipients) is narrowed: 'all' = every match, 'subset' = explicit ids.
|
|
22
22
|
export type EmailCampaignSelectionMode = 'all' | 'subset'
|
|
23
23
|
|
|
24
|
+
// The provider dimension has a third mode the recipient dimension does not: 'group'.
|
|
25
|
+
export type EmailCampaignProviderMode = EmailCampaignSelectionMode | 'group'
|
|
26
|
+
|
|
24
27
|
// Provider dimension: mode is discriminated against its selection, so an invalid combination can't type-check.
|
|
25
28
|
// The candidate-pool filter (`filters`) is carried separately on the request/detail DTOs.
|
|
26
29
|
export type EmailCampaignProviderSelection =
|
|
27
|
-
| { providerMode: 'all'; selectedProviderIds: null }
|
|
28
|
-
| { providerMode: 'subset'; selectedProviderIds: number[] }
|
|
30
|
+
| { providerMode: 'all'; selectedProviderIds: null; selectedGroupIds: null }
|
|
31
|
+
| { providerMode: 'subset'; selectedProviderIds: number[]; selectedGroupIds: null }
|
|
32
|
+
| { providerMode: 'group'; selectedProviderIds: null; selectedGroupIds: number[] }
|
|
29
33
|
|
|
30
34
|
// Recipient dimension: mode is discriminated against its user picks.
|
|
31
35
|
export type EmailCampaignRecipientSelection =
|
package/types/index.d.ts
CHANGED
package/types/index.ts
CHANGED
|
@@ -16,9 +16,12 @@ export interface IProviderDocument {
|
|
|
16
16
|
// Admin sees the document and its upload date only — no internal staff names.
|
|
17
17
|
export interface IProviderDocumentAdminView extends IProviderDocument {}
|
|
18
18
|
|
|
19
|
-
// Superadmin
|
|
19
|
+
// Superadmin also sees the acting support users, the tombstone state, and the sharing group. The group
|
|
20
|
+
// fields are null on a provider-owned row.
|
|
20
21
|
export interface IProviderDocumentSuperadminView extends IProviderDocument {
|
|
21
22
|
uploadedByName: string | null
|
|
22
23
|
deletedAt: string | null
|
|
23
24
|
deletedByName: string | null
|
|
25
|
+
contractProviderGroupId: number | null
|
|
26
|
+
contractProviderGroupName: string | null
|
|
24
27
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type ContractProviderGroupErrors = 'CONTRACT_PROVIDER_GROUP_NAME_TAKEN' | 'CONTRACT_PROVIDER_GROUP_IN_USE'
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { AdjustmentRequestResponseErrors } from './adjustmentRequestResponseErrors'
|
|
2
2
|
import { AdminPaymentErrors } from './adminPaymentErrors'
|
|
3
3
|
import { CalculatorResponseErrors } from './calculatorResponseErrors'
|
|
4
|
+
import { ContractProviderGroupErrors } from './contractProviderGroupErrors'
|
|
4
5
|
import { ContractResponseErrors } from './contractResponseErrors'
|
|
5
6
|
import { GenericResponseErrors } from './genericResponseTypes'
|
|
6
7
|
import { ImportErrors } from './importErrors'
|
|
@@ -17,6 +18,7 @@ export type ResponseErrors =
|
|
|
17
18
|
| AdjustmentRequestResponseErrors
|
|
18
19
|
| AdminPaymentErrors
|
|
19
20
|
| CalculatorResponseErrors
|
|
21
|
+
| ContractProviderGroupErrors
|
|
20
22
|
| ContractResponseErrors
|
|
21
23
|
| GenericResponseErrors
|
|
22
24
|
| ImportErrors
|