mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 21:08:12 +00:00
contrat nad booking modification
This commit is contained in:
@@ -72,6 +72,12 @@ export interface SubmitRateChangePayload {
|
||||
update: Record<string, unknown>;
|
||||
}
|
||||
|
||||
/** One selectable IAM position type, as returned by /approval-rules/position-types. */
|
||||
export interface ApprovalPositionType {
|
||||
label: string;
|
||||
value: string;
|
||||
}
|
||||
|
||||
const RESOURCE_BASE: Record<RuleEngineResourceSlug, string> = {
|
||||
"cargo-types": URL_CONSTANTS.RULE_ENGINE.CARGO_TYPES,
|
||||
"container-types": URL_CONSTANTS.RULE_ENGINE.CONTAINER_TYPES,
|
||||
@@ -368,6 +374,28 @@ export const ruleEngineService = {
|
||||
return unwrap(response.data) as RateChangeRequest;
|
||||
},
|
||||
|
||||
/**
|
||||
* IAM position types that an approval step can require/block. Replaces the
|
||||
* old hardcoded LINE_STAFF/DIRECTOR/CEO triple — the chain is configured from
|
||||
* whatever positions IAM actually defines.
|
||||
*/
|
||||
getApprovalPositionTypes: async (): Promise<ApprovalPositionType[]> => {
|
||||
const response = await client.get(
|
||||
URL_CONSTANTS.RULE_ENGINE.APPROVAL_RULES_POSITION_TYPES,
|
||||
);
|
||||
const body = unwrap(response.data) as unknown;
|
||||
if (Array.isArray(body)) return body as ApprovalPositionType[];
|
||||
if (
|
||||
body &&
|
||||
typeof body === "object" &&
|
||||
"data" in body &&
|
||||
Array.isArray((body as { data: unknown }).data)
|
||||
) {
|
||||
return (body as { data: ApprovalPositionType[] }).data;
|
||||
}
|
||||
return [];
|
||||
},
|
||||
|
||||
getApprovalChain: async (
|
||||
requiresDirectorApproval = true,
|
||||
): Promise<RuleEngineRecord[]> => {
|
||||
|
||||
Reference in New Issue
Block a user