feat: route bounded hierarchy postbox copies
This commit is contained in:
@@ -110,6 +110,54 @@ export type PostboxOrganizationUnit = {
|
||||
functions: PostboxOrganizationFunction[];
|
||||
};
|
||||
|
||||
export type PostboxOrganizationRelationType = {
|
||||
id: string;
|
||||
slug: string;
|
||||
name: string;
|
||||
structure_id?: string | null;
|
||||
is_hierarchical: boolean;
|
||||
status: string;
|
||||
};
|
||||
|
||||
export type PostboxOrganizationStructure = {
|
||||
id: string;
|
||||
slug: string;
|
||||
name: string;
|
||||
structure_kind: string;
|
||||
status: string;
|
||||
relation_types: PostboxOrganizationRelationType[];
|
||||
};
|
||||
|
||||
export type PostboxOrganizationTargets = {
|
||||
units: PostboxOrganizationUnit[];
|
||||
structures: PostboxOrganizationStructure[];
|
||||
};
|
||||
|
||||
export type PostboxRoutingPolicy = {
|
||||
linked_copy: {
|
||||
enabled: boolean;
|
||||
structure_id?: string | null;
|
||||
relation_type_ids: string[];
|
||||
max_depth: number;
|
||||
stop_unit_id?: string | null;
|
||||
stop_unit_type_id?: string | null;
|
||||
target_function_type_id?: string | null;
|
||||
target_template_id?: string | null;
|
||||
fanout: "nearest" | "all";
|
||||
allowed_classifications: string[];
|
||||
allowed_producer_modules: string[];
|
||||
require_expiry: boolean;
|
||||
max_retention_days?: number | null;
|
||||
};
|
||||
attention: {
|
||||
mode: "none" | "vacancy_escalation";
|
||||
delay_minutes?: number | null;
|
||||
};
|
||||
shared_visibility: {
|
||||
mode: "none";
|
||||
};
|
||||
};
|
||||
|
||||
export type PostboxTemplateRevision = {
|
||||
id: string;
|
||||
revision: number;
|
||||
@@ -122,7 +170,7 @@ export type PostboxTemplateRevision = {
|
||||
allow_vacant_delivery: boolean;
|
||||
encryption_profile: string;
|
||||
history_policy: Record<string, unknown>;
|
||||
routing_policy: Record<string, unknown>;
|
||||
routing_policy: PostboxRoutingPolicy;
|
||||
retention_policy: Record<string, unknown>;
|
||||
published_at?: string | null;
|
||||
created_at: string;
|
||||
@@ -151,6 +199,7 @@ export type PostboxTemplateRevisionPayload = Pick<
|
||||
| "address_pattern"
|
||||
| "classification"
|
||||
| "allow_vacant_delivery"
|
||||
| "routing_policy"
|
||||
>;
|
||||
|
||||
export type PostboxTemplateCreatePayload = PostboxTemplateRevisionPayload & {
|
||||
@@ -269,12 +318,11 @@ export async function listAdminPostboxes(settings: ApiSettings): Promise<Postbox
|
||||
|
||||
export async function listPostboxOrganizationTargets(
|
||||
settings: ApiSettings
|
||||
): Promise<PostboxOrganizationUnit[]> {
|
||||
const response = await apiFetch<{ units: PostboxOrganizationUnit[] }>(
|
||||
): Promise<PostboxOrganizationTargets> {
|
||||
return apiFetch<PostboxOrganizationTargets>(
|
||||
settings,
|
||||
"/api/v1/postbox/admin/organization-targets"
|
||||
);
|
||||
return response.units;
|
||||
}
|
||||
|
||||
export function createExactPostbox(
|
||||
|
||||
Reference in New Issue
Block a user