Merge pull request #1096 from Tria-plc/freight_feature/usermanagement

Freight feature/usermanagement
This commit is contained in:
marshal
2026-08-03 22:53:30 +03:00
committed by GitHub
21 changed files with 615 additions and 28 deletions

View File

@@ -25,7 +25,27 @@ export interface MyTradeAccess {
directions: TradeDirection[];
}
export interface StaffUser {
id: string;
/** Localized jsonb on iam.users — not a plain string. */
name: { en?: string; am?: string } | null;
username: string;
email: string | null;
}
export const userTradeAccessService = {
/**
* Employees to assign scopes to. Served by the freight API rather than IAM's
* `/users/filter`, which 400s on its own pagination params (its @Query() DTO
* omits skip/take/orderBy while the global whitelist pipe rejects them).
*/
employees: async (): Promise<{ items: StaffUser[] }> =>
(
await client.get("/staff/users", {
params: { userType: "employee", pageSize: 100 },
})
).data,
/** All configured per-user scopes (admin only). */
list: async (): Promise<UserTradeAccessRow[]> =>
(await client.get("/user-trade-access")).data,