mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 22:18:12 +00:00
fix ui
This commit is contained in:
@@ -1,149 +1,149 @@
|
||||
import { FilterEnum } from "@/shared/services/organizationsService";
|
||||
|
||||
// create-user.dto.ts
|
||||
export interface MultilingualText {
|
||||
am: string;
|
||||
en: string;
|
||||
}
|
||||
export interface CreateUserDto {
|
||||
email: string;
|
||||
username: string;
|
||||
phoneNumber: string;
|
||||
userType: string;
|
||||
name: {
|
||||
am: string;
|
||||
en: string;
|
||||
};
|
||||
}
|
||||
export interface FayidaUserDto {
|
||||
code: string;
|
||||
redirectUri?: string;
|
||||
}
|
||||
|
||||
// create-letter.interface.ts
|
||||
|
||||
export interface FileInfo {
|
||||
fileName: string;
|
||||
contentType: string;
|
||||
size: number;
|
||||
originalname: string;
|
||||
}
|
||||
|
||||
export interface CreateLetterDto {
|
||||
fileInfo: FileInfo;
|
||||
subject: string;
|
||||
unitIds: string[];
|
||||
letterNumber: string;
|
||||
preferredLanguage: "am" | "en";
|
||||
}
|
||||
|
||||
export interface FileInfoDto {
|
||||
size: number;
|
||||
bucket: string;
|
||||
fileName: string;
|
||||
contentType: string;
|
||||
originalname: string;
|
||||
}
|
||||
|
||||
export interface LetterRecordDto {
|
||||
amharicCreatedAt: any;
|
||||
createdAt: any;
|
||||
id: string;
|
||||
fileInfo: FileInfoDto;
|
||||
referenceNumber: string | null;
|
||||
letterNumber: string; // ✅ newly added
|
||||
dispatchedDate: string; // ISO string
|
||||
amharicDispatchedDate: string;
|
||||
statusKey: "Dispatched" | "Submitted" | "Draft" | "Rejected" | string;
|
||||
initiationType: "self" | "external" | string;
|
||||
//
|
||||
receivingUnits: {
|
||||
id: string;
|
||||
unit: {
|
||||
id: string;
|
||||
name: {
|
||||
am: string;
|
||||
en: string;
|
||||
};
|
||||
};
|
||||
}[];
|
||||
|
||||
content: {
|
||||
id: string;
|
||||
subject: string;
|
||||
}[];
|
||||
}
|
||||
|
||||
export interface DocumentPayloadDto {
|
||||
fileInfo: FileInfo;
|
||||
documentId: string;
|
||||
type: FilterEnum;
|
||||
}
|
||||
|
||||
export type DocumentStatus = "pending" | "approved" | "rejected";
|
||||
|
||||
export interface DocumentResponseDto {
|
||||
id: string;
|
||||
userId: string;
|
||||
documentId: string;
|
||||
createdAt: string; // ISO datetime string
|
||||
updatedAt: string; // ISO datetime string
|
||||
uploadedSuccessfully: boolean;
|
||||
isCurrent: boolean;
|
||||
status: "pending" | "approved" | "rejected";
|
||||
fileInfo: {
|
||||
size: number;
|
||||
bucket: string;
|
||||
fileName: string;
|
||||
bucketName?: string; // optional if not always present
|
||||
contentType: string;
|
||||
originalname: string;
|
||||
};
|
||||
presigned: string; // Pre-signed URL for download/view
|
||||
}
|
||||
|
||||
export interface DocumentRequirementDto {
|
||||
title: {
|
||||
am: string;
|
||||
en: string;
|
||||
};
|
||||
description: {
|
||||
am: string;
|
||||
en: string;
|
||||
};
|
||||
isOptional: boolean;
|
||||
order: number;
|
||||
key: string;
|
||||
type: string;
|
||||
}
|
||||
|
||||
export interface FilesInfoDto {
|
||||
size: number;
|
||||
bucket: string;
|
||||
fileName: string;
|
||||
bucketName: string;
|
||||
contentType: string;
|
||||
originalname: string;
|
||||
}
|
||||
|
||||
export interface DocumentRequirementResponseDto {
|
||||
id: string;
|
||||
title: MultilingualText;
|
||||
description: MultilingualText;
|
||||
key: string;
|
||||
order: number;
|
||||
isActive: boolean;
|
||||
isOptional: boolean;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
}
|
||||
|
||||
export interface DocumentRequirementsResponse {
|
||||
count: number;
|
||||
items: DocumentRequirementResponseDto[];
|
||||
}
|
||||
|
||||
export interface ResponseActionDto {
|
||||
status: string;
|
||||
remark?: string;
|
||||
}
|
||||
import { FilterEnum } from "@/shared/services/organizationsService";
|
||||
|
||||
// create-user.dto.ts
|
||||
export interface MultilingualText {
|
||||
am: string;
|
||||
en: string;
|
||||
}
|
||||
export interface CreateUserDto {
|
||||
email: string;
|
||||
username: string;
|
||||
phoneNumber: string;
|
||||
userType: string;
|
||||
name: {
|
||||
am: string;
|
||||
en: string;
|
||||
};
|
||||
}
|
||||
export interface FayidaUserDto {
|
||||
code: string;
|
||||
redirectUri?: string;
|
||||
}
|
||||
|
||||
// create-letter.interface.ts
|
||||
|
||||
export interface FileInfo {
|
||||
fileName: string;
|
||||
contentType: string;
|
||||
size: number;
|
||||
originalname: string;
|
||||
}
|
||||
|
||||
export interface CreateLetterDto {
|
||||
fileInfo: FileInfo;
|
||||
subject: string;
|
||||
unitIds: string[];
|
||||
letterNumber: string;
|
||||
preferredLanguage: "am" | "en";
|
||||
}
|
||||
|
||||
export interface FileInfoDto {
|
||||
size: number;
|
||||
bucket: string;
|
||||
fileName: string;
|
||||
contentType: string;
|
||||
originalname: string;
|
||||
}
|
||||
|
||||
export interface LetterRecordDto {
|
||||
amharicCreatedAt: any;
|
||||
createdAt: any;
|
||||
id: string;
|
||||
fileInfo: FileInfoDto;
|
||||
referenceNumber: string | null;
|
||||
letterNumber: string; // ✅ newly added
|
||||
dispatchedDate: string; // ISO string
|
||||
amharicDispatchedDate: string;
|
||||
statusKey: "Dispatched" | "Submitted" | "Draft" | "Rejected" | string;
|
||||
initiationType: "self" | "external" | string;
|
||||
//
|
||||
receivingUnits: {
|
||||
id: string;
|
||||
unit: {
|
||||
id: string;
|
||||
name: {
|
||||
am: string;
|
||||
en: string;
|
||||
};
|
||||
};
|
||||
}[];
|
||||
|
||||
content: {
|
||||
id: string;
|
||||
subject: string;
|
||||
}[];
|
||||
}
|
||||
|
||||
export interface DocumentPayloadDto {
|
||||
fileInfo: FileInfo;
|
||||
documentId: string;
|
||||
type: FilterEnum;
|
||||
}
|
||||
|
||||
export type DocumentStatus = "pending" | "approved" | "rejected";
|
||||
|
||||
export interface DocumentResponseDto {
|
||||
id: string;
|
||||
userId: string;
|
||||
documentId: string;
|
||||
createdAt: string; // ISO datetime string
|
||||
updatedAt: string; // ISO datetime string
|
||||
uploadedSuccessfully: boolean;
|
||||
isCurrent: boolean;
|
||||
status: "pending" | "approved" | "rejected";
|
||||
fileInfo: {
|
||||
size: number;
|
||||
bucket: string;
|
||||
fileName: string;
|
||||
bucketName?: string; // optional if not always present
|
||||
contentType: string;
|
||||
originalname: string;
|
||||
};
|
||||
presigned: string; // Pre-signed URL for download/view
|
||||
}
|
||||
|
||||
export interface DocumentRequirementDto {
|
||||
title: {
|
||||
am: string;
|
||||
en: string;
|
||||
};
|
||||
description: {
|
||||
am: string;
|
||||
en: string;
|
||||
};
|
||||
isOptional: boolean;
|
||||
order: number;
|
||||
key: string;
|
||||
type: string;
|
||||
}
|
||||
|
||||
export interface FilesInfoDto {
|
||||
size: number;
|
||||
bucket: string;
|
||||
fileName: string;
|
||||
bucketName: string;
|
||||
contentType: string;
|
||||
originalname: string;
|
||||
}
|
||||
|
||||
export interface DocumentRequirementResponseDto {
|
||||
id: string;
|
||||
title: MultilingualText;
|
||||
description: MultilingualText;
|
||||
key: string;
|
||||
order: number;
|
||||
isActive: boolean;
|
||||
isOptional: boolean;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
}
|
||||
|
||||
export interface DocumentRequirementsResponse {
|
||||
count: number;
|
||||
items: DocumentRequirementResponseDto[];
|
||||
}
|
||||
|
||||
export interface ResponseActionDto {
|
||||
status: string;
|
||||
remark?: string;
|
||||
}
|
||||
|
||||
@@ -1,41 +1,41 @@
|
||||
// UserName interface for multilingual support
|
||||
interface UserName {
|
||||
am: string;
|
||||
en: string;
|
||||
}
|
||||
|
||||
// User DTO
|
||||
export interface UserDto {
|
||||
createdAt: string; // ISO Date string
|
||||
updatedAt: string;
|
||||
id: string;
|
||||
name: UserName;
|
||||
username: string;
|
||||
email: string;
|
||||
userType: "employee" | string;
|
||||
sharepointId: string | null;
|
||||
status: "pending" | "active" | string;
|
||||
isActive: boolean;
|
||||
hasSetPassword: boolean;
|
||||
phoneNumber: string;
|
||||
}
|
||||
|
||||
export interface AssignedAdminsDto {
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
id: string;
|
||||
name: UserName;
|
||||
username: string;
|
||||
phoneNumber: string;
|
||||
email: string;
|
||||
userType: "employee" | string;
|
||||
sharepointId: string | null;
|
||||
status: "accepted" | "pending" | "active" | string;
|
||||
isActive: boolean;
|
||||
hasSetPassword: boolean;
|
||||
approvedById: string | null;
|
||||
approvedAt: string | null;
|
||||
localeApprovedAt: string | null;
|
||||
isPhoneNumberVerified: boolean;
|
||||
verifiedBy: string;
|
||||
}
|
||||
// UserName interface for multilingual support
|
||||
interface UserName {
|
||||
am: string;
|
||||
en: string;
|
||||
}
|
||||
|
||||
// User DTO
|
||||
export interface UserDto {
|
||||
createdAt: string; // ISO Date string
|
||||
updatedAt: string;
|
||||
id: string;
|
||||
name: UserName;
|
||||
username: string;
|
||||
email: string;
|
||||
userType: "employee" | string;
|
||||
sharepointId: string | null;
|
||||
status: "pending" | "active" | string;
|
||||
isActive: boolean;
|
||||
hasSetPassword: boolean;
|
||||
phoneNumber: string;
|
||||
}
|
||||
|
||||
export interface AssignedAdminsDto {
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
id: string;
|
||||
name: UserName;
|
||||
username: string;
|
||||
phoneNumber: string;
|
||||
email: string;
|
||||
userType: "employee" | string;
|
||||
sharepointId: string | null;
|
||||
status: "accepted" | "pending" | "active" | string;
|
||||
isActive: boolean;
|
||||
hasSetPassword: boolean;
|
||||
approvedById: string | null;
|
||||
approvedAt: string | null;
|
||||
localeApprovedAt: string | null;
|
||||
isPhoneNumberVerified: boolean;
|
||||
verifiedBy: string;
|
||||
}
|
||||
|
||||
@@ -1,48 +1,48 @@
|
||||
export interface OrganizationName {
|
||||
am: string;
|
||||
en: string;
|
||||
}
|
||||
|
||||
export interface OrganizationDto {
|
||||
id: string;
|
||||
name: OrganizationName;
|
||||
key: string;
|
||||
parentId: string | null;
|
||||
organizationTypeId: string;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
isAssigned: boolean;
|
||||
status: "Active" | "Deactive" | "Inactive";
|
||||
activeEmployeeCount?: number;
|
||||
adminsCount?: number;
|
||||
isGovernmentOrganization: boolean;
|
||||
}
|
||||
export interface OrganizationAdminsDto {
|
||||
id: string;
|
||||
name: OrganizationName;
|
||||
key: string;
|
||||
parentId: string | null;
|
||||
organizationTypeId: string;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
isAssigned: boolean;
|
||||
status: "Active" | "Deactive" | "Inactive";
|
||||
adminsCount: number;
|
||||
org_admin_count: number;
|
||||
activeEmployeeCount?: number;
|
||||
}
|
||||
|
||||
export interface OrganizationDetailDTO {
|
||||
createdAt: string; // ISO date string
|
||||
updatedAt: string; // ISO date string
|
||||
id: string; // UUID
|
||||
name: {
|
||||
am: string; // Amharic name
|
||||
en: string; // English name
|
||||
};
|
||||
key: string; // Unique key
|
||||
isGovernmentOrganization: boolean;
|
||||
status: "Active" | "Inactive";
|
||||
parentId: string | null; // Parent organization ID if applicable
|
||||
organizationTypeId: string; // UUID for organization type
|
||||
}
|
||||
export interface OrganizationName {
|
||||
am: string;
|
||||
en: string;
|
||||
}
|
||||
|
||||
export interface OrganizationDto {
|
||||
id: string;
|
||||
name: OrganizationName;
|
||||
key: string;
|
||||
parentId: string | null;
|
||||
organizationTypeId: string;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
isAssigned: boolean;
|
||||
status: "Active" | "Deactive" | "Inactive";
|
||||
activeEmployeeCount?: number;
|
||||
adminsCount?: number;
|
||||
isGovernmentOrganization: boolean;
|
||||
}
|
||||
export interface OrganizationAdminsDto {
|
||||
id: string;
|
||||
name: OrganizationName;
|
||||
key: string;
|
||||
parentId: string | null;
|
||||
organizationTypeId: string;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
isAssigned: boolean;
|
||||
status: "Active" | "Deactive" | "Inactive";
|
||||
adminsCount: number;
|
||||
org_admin_count: number;
|
||||
activeEmployeeCount?: number;
|
||||
}
|
||||
|
||||
export interface OrganizationDetailDTO {
|
||||
createdAt: string; // ISO date string
|
||||
updatedAt: string; // ISO date string
|
||||
id: string; // UUID
|
||||
name: {
|
||||
am: string; // Amharic name
|
||||
en: string; // English name
|
||||
};
|
||||
key: string; // Unique key
|
||||
isGovernmentOrganization: boolean;
|
||||
status: "Active" | "Inactive";
|
||||
parentId: string | null; // Parent organization ID if applicable
|
||||
organizationTypeId: string; // UUID for organization type
|
||||
}
|
||||
|
||||
@@ -1,211 +1,211 @@
|
||||
export interface UserName {
|
||||
am: string;
|
||||
en: string;
|
||||
}
|
||||
|
||||
export interface Role {
|
||||
id: string;
|
||||
key: string;
|
||||
}
|
||||
|
||||
export interface Permission {
|
||||
id: string;
|
||||
key: string;
|
||||
}
|
||||
export interface PositionTypePermissionDto {
|
||||
id: string;
|
||||
permissionId: string;
|
||||
positionTypeId: string;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
permission: {
|
||||
id: string;
|
||||
key: string;
|
||||
name: {
|
||||
am: string;
|
||||
en: string;
|
||||
};
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
};
|
||||
}
|
||||
|
||||
export interface PositionTypeDto {
|
||||
id: string;
|
||||
key: string;
|
||||
name: {
|
||||
am: string;
|
||||
en: string;
|
||||
};
|
||||
unitId: string;
|
||||
isSystem: boolean;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
positionTypePermissions: PositionTypePermissionDto[];
|
||||
}
|
||||
|
||||
export interface EmployeeAssociation {
|
||||
id: string;
|
||||
name: UserName;
|
||||
employeePositionId?: string;
|
||||
organizationId: string;
|
||||
unitId: string | null;
|
||||
positions: {
|
||||
id: string;
|
||||
employeePositionId: string;
|
||||
name: {
|
||||
am: string;
|
||||
en: string;
|
||||
};
|
||||
key: string;
|
||||
rank: number;
|
||||
projectId?: string | null;
|
||||
isDelegate: boolean;
|
||||
delegatorId: string | null;
|
||||
parentPositionId: string | null;
|
||||
permissions: Permission[];
|
||||
hasDelegated: boolean;
|
||||
hasPendingDelegation: boolean;
|
||||
positionType?: {
|
||||
id: string;
|
||||
key: string;
|
||||
name: { am: string; en: string };
|
||||
canReceiveRecord: boolean;
|
||||
canCreateBankRecord?: boolean;
|
||||
canAssignRecord: boolean;
|
||||
} | null;
|
||||
delegationDeadline: string | null;
|
||||
delegationStartDate: string | null;
|
||||
}[];
|
||||
}
|
||||
export enum EPositionTypeKey {
|
||||
EMPLOYEE = "employee",
|
||||
TEAM_LEADER = "team-leader",
|
||||
DIRECTOR = "director",
|
||||
DEPUTY = "deputy",
|
||||
OFFICE_HEAD = "office-head",
|
||||
RECORD_OFFICER = "record-officer",
|
||||
BUDGET_PLAN = "budget-and-plan",
|
||||
}
|
||||
|
||||
// Aliases for position-type keys returned by the backend in different
|
||||
// casings/separators. Used by the matcher in positionTypeUtils so the FE
|
||||
// stays correct whether the backend returns "team-leader", "teamLeader",
|
||||
// or "team_leader". Also covers org-specific role labels (e.g. "expert",
|
||||
// "fetami-balmuya") that semantically map to one of the canonical types.
|
||||
export const POSITION_TYPE_ALIASES: Record<EPositionTypeKey, string[]> = {
|
||||
[EPositionTypeKey.EMPLOYEE]: [
|
||||
"employee",
|
||||
"expert",
|
||||
"performance_expert",
|
||||
"performanceExpert",
|
||||
"fetami-balmuya",
|
||||
"fetamiBalmuya",
|
||||
"fetami_balmuya",
|
||||
"adwa_victory_vemorial_museum/fetami-balmuya",
|
||||
"adwa_victory_vemorial_museum/performance_expert",
|
||||
],
|
||||
[EPositionTypeKey.TEAM_LEADER]: [
|
||||
"team-leader",
|
||||
"teamleader",
|
||||
"teamLeader",
|
||||
"team_leader",
|
||||
"performance_team_leader",
|
||||
"performance_team-leader",
|
||||
"performance_teamleader",
|
||||
"performanceTeamLeader",
|
||||
"Performance_teamleader",
|
||||
],
|
||||
[EPositionTypeKey.DIRECTOR]: [
|
||||
"director",
|
||||
"performance_director",
|
||||
"performance-director",
|
||||
"performanceDirector",
|
||||
"Performance_Director",
|
||||
"adwa_victory_vemorial_museum/director",
|
||||
],
|
||||
[EPositionTypeKey.DEPUTY]: ["deputy"],
|
||||
[EPositionTypeKey.OFFICE_HEAD]: ["office-head", "officeHead", "office_head"],
|
||||
[EPositionTypeKey.RECORD_OFFICER]: [
|
||||
"record-officer",
|
||||
"recordOfficer",
|
||||
"record_officer",
|
||||
],
|
||||
[EPositionTypeKey.BUDGET_PLAN]: [
|
||||
"budget-and-plan",
|
||||
"budgetAndPlan",
|
||||
"budget_and_plan",
|
||||
],
|
||||
};
|
||||
|
||||
export interface MeDto {
|
||||
id: string;
|
||||
email: string;
|
||||
name: UserName;
|
||||
userType: "employee" | string;
|
||||
sharepointId: string | null;
|
||||
status: string;
|
||||
username: string;
|
||||
roles: Role[];
|
||||
permissions: Permission[];
|
||||
employee: EmployeeAssociation[];
|
||||
phoneNumber: string;
|
||||
hasSetPassword: boolean;
|
||||
hasFinishedRegistration: boolean;
|
||||
hasFinishedDMSOnboarding: boolean;
|
||||
mfaRequired?: boolean;
|
||||
}
|
||||
|
||||
// Name interface
|
||||
export interface Name {
|
||||
am: string;
|
||||
en: string;
|
||||
}
|
||||
|
||||
// Permission interface
|
||||
export interface Permission {
|
||||
id: string;
|
||||
key: string;
|
||||
}
|
||||
|
||||
// Position interface
|
||||
export interface Position {
|
||||
id: string;
|
||||
employeePositionId: string;
|
||||
name: Name;
|
||||
key: string;
|
||||
rank: number;
|
||||
isDelegate: boolean;
|
||||
projectId: string | null;
|
||||
delegatorId: string | null;
|
||||
parentPositionId: string | null;
|
||||
permissions: Permission[];
|
||||
hasDelegated: boolean;
|
||||
positionType: string | null;
|
||||
delegationDeadline: string | null;
|
||||
delegationStartDate: string | null;
|
||||
}
|
||||
|
||||
// Employee interface
|
||||
export interface Employee {
|
||||
id: string;
|
||||
organizationId: string;
|
||||
unitId: string;
|
||||
name: Name;
|
||||
positions: Position[];
|
||||
}
|
||||
|
||||
// User interface (main DTO)
|
||||
export interface UserDto {
|
||||
id: string;
|
||||
email: string;
|
||||
name: Name;
|
||||
userType: string;
|
||||
sharepointId: string | null;
|
||||
status: string;
|
||||
username: string;
|
||||
hasSetPassword: boolean;
|
||||
roles: string[];
|
||||
permissions: Permission[];
|
||||
employees: Employee[];
|
||||
}
|
||||
export interface UserName {
|
||||
am: string;
|
||||
en: string;
|
||||
}
|
||||
|
||||
export interface Role {
|
||||
id: string;
|
||||
key: string;
|
||||
}
|
||||
|
||||
export interface Permission {
|
||||
id: string;
|
||||
key: string;
|
||||
}
|
||||
export interface PositionTypePermissionDto {
|
||||
id: string;
|
||||
permissionId: string;
|
||||
positionTypeId: string;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
permission: {
|
||||
id: string;
|
||||
key: string;
|
||||
name: {
|
||||
am: string;
|
||||
en: string;
|
||||
};
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
};
|
||||
}
|
||||
|
||||
export interface PositionTypeDto {
|
||||
id: string;
|
||||
key: string;
|
||||
name: {
|
||||
am: string;
|
||||
en: string;
|
||||
};
|
||||
unitId: string;
|
||||
isSystem: boolean;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
positionTypePermissions: PositionTypePermissionDto[];
|
||||
}
|
||||
|
||||
export interface EmployeeAssociation {
|
||||
id: string;
|
||||
name: UserName;
|
||||
employeePositionId?: string;
|
||||
organizationId: string;
|
||||
unitId: string | null;
|
||||
positions: {
|
||||
id: string;
|
||||
employeePositionId: string;
|
||||
name: {
|
||||
am: string;
|
||||
en: string;
|
||||
};
|
||||
key: string;
|
||||
rank: number;
|
||||
projectId?: string | null;
|
||||
isDelegate: boolean;
|
||||
delegatorId: string | null;
|
||||
parentPositionId: string | null;
|
||||
permissions: Permission[];
|
||||
hasDelegated: boolean;
|
||||
hasPendingDelegation: boolean;
|
||||
positionType?: {
|
||||
id: string;
|
||||
key: string;
|
||||
name: { am: string; en: string };
|
||||
canReceiveRecord: boolean;
|
||||
canCreateBankRecord?: boolean;
|
||||
canAssignRecord: boolean;
|
||||
} | null;
|
||||
delegationDeadline: string | null;
|
||||
delegationStartDate: string | null;
|
||||
}[];
|
||||
}
|
||||
export enum EPositionTypeKey {
|
||||
EMPLOYEE = "employee",
|
||||
TEAM_LEADER = "team-leader",
|
||||
DIRECTOR = "director",
|
||||
DEPUTY = "deputy",
|
||||
OFFICE_HEAD = "office-head",
|
||||
RECORD_OFFICER = "record-officer",
|
||||
BUDGET_PLAN = "budget-and-plan",
|
||||
}
|
||||
|
||||
// Aliases for position-type keys returned by the backend in different
|
||||
// casings/separators. Used by the matcher in positionTypeUtils so the FE
|
||||
// stays correct whether the backend returns "team-leader", "teamLeader",
|
||||
// or "team_leader". Also covers org-specific role labels (e.g. "expert",
|
||||
// "fetami-balmuya") that semantically map to one of the canonical types.
|
||||
export const POSITION_TYPE_ALIASES: Record<EPositionTypeKey, string[]> = {
|
||||
[EPositionTypeKey.EMPLOYEE]: [
|
||||
"employee",
|
||||
"expert",
|
||||
"performance_expert",
|
||||
"performanceExpert",
|
||||
"fetami-balmuya",
|
||||
"fetamiBalmuya",
|
||||
"fetami_balmuya",
|
||||
"adwa_victory_vemorial_museum/fetami-balmuya",
|
||||
"adwa_victory_vemorial_museum/performance_expert",
|
||||
],
|
||||
[EPositionTypeKey.TEAM_LEADER]: [
|
||||
"team-leader",
|
||||
"teamleader",
|
||||
"teamLeader",
|
||||
"team_leader",
|
||||
"performance_team_leader",
|
||||
"performance_team-leader",
|
||||
"performance_teamleader",
|
||||
"performanceTeamLeader",
|
||||
"Performance_teamleader",
|
||||
],
|
||||
[EPositionTypeKey.DIRECTOR]: [
|
||||
"director",
|
||||
"performance_director",
|
||||
"performance-director",
|
||||
"performanceDirector",
|
||||
"Performance_Director",
|
||||
"adwa_victory_vemorial_museum/director",
|
||||
],
|
||||
[EPositionTypeKey.DEPUTY]: ["deputy"],
|
||||
[EPositionTypeKey.OFFICE_HEAD]: ["office-head", "officeHead", "office_head"],
|
||||
[EPositionTypeKey.RECORD_OFFICER]: [
|
||||
"record-officer",
|
||||
"recordOfficer",
|
||||
"record_officer",
|
||||
],
|
||||
[EPositionTypeKey.BUDGET_PLAN]: [
|
||||
"budget-and-plan",
|
||||
"budgetAndPlan",
|
||||
"budget_and_plan",
|
||||
],
|
||||
};
|
||||
|
||||
export interface MeDto {
|
||||
id: string;
|
||||
email: string;
|
||||
name: UserName;
|
||||
userType: "employee" | string;
|
||||
sharepointId: string | null;
|
||||
status: string;
|
||||
username: string;
|
||||
roles: Role[];
|
||||
permissions: Permission[];
|
||||
employee: EmployeeAssociation[];
|
||||
phoneNumber: string;
|
||||
hasSetPassword: boolean;
|
||||
hasFinishedRegistration: boolean;
|
||||
hasFinishedDMSOnboarding: boolean;
|
||||
mfaRequired?: boolean;
|
||||
}
|
||||
|
||||
// Name interface
|
||||
export interface Name {
|
||||
am: string;
|
||||
en: string;
|
||||
}
|
||||
|
||||
// Permission interface
|
||||
export interface Permission {
|
||||
id: string;
|
||||
key: string;
|
||||
}
|
||||
|
||||
// Position interface
|
||||
export interface Position {
|
||||
id: string;
|
||||
employeePositionId: string;
|
||||
name: Name;
|
||||
key: string;
|
||||
rank: number;
|
||||
isDelegate: boolean;
|
||||
projectId: string | null;
|
||||
delegatorId: string | null;
|
||||
parentPositionId: string | null;
|
||||
permissions: Permission[];
|
||||
hasDelegated: boolean;
|
||||
positionType: string | null;
|
||||
delegationDeadline: string | null;
|
||||
delegationStartDate: string | null;
|
||||
}
|
||||
|
||||
// Employee interface
|
||||
export interface Employee {
|
||||
id: string;
|
||||
organizationId: string;
|
||||
unitId: string;
|
||||
name: Name;
|
||||
positions: Position[];
|
||||
}
|
||||
|
||||
// User interface (main DTO)
|
||||
export interface UserDto {
|
||||
id: string;
|
||||
email: string;
|
||||
name: Name;
|
||||
userType: string;
|
||||
sharepointId: string | null;
|
||||
status: string;
|
||||
username: string;
|
||||
hasSetPassword: boolean;
|
||||
roles: string[];
|
||||
permissions: Permission[];
|
||||
employees: Employee[];
|
||||
}
|
||||
|
||||
@@ -1,56 +1,56 @@
|
||||
export interface UserName {
|
||||
am: string;
|
||||
en: string;
|
||||
}
|
||||
|
||||
export interface User {
|
||||
id: string;
|
||||
name: UserName;
|
||||
username: string;
|
||||
email: string;
|
||||
phoneNumber:string
|
||||
userType: "employee" | string;
|
||||
sharepointId: string | null;
|
||||
status: "accepted" | "pending" | "rejected" | string;
|
||||
createdAt:string
|
||||
}
|
||||
|
||||
export interface OrganizationUserDto {
|
||||
organizationId: string;
|
||||
user: User;
|
||||
}
|
||||
|
||||
|
||||
|
||||
export interface EmployeeDTO {
|
||||
id: string;
|
||||
isCurrent: boolean;
|
||||
status: string;
|
||||
name: {
|
||||
am: string;
|
||||
en: string;
|
||||
};
|
||||
userId:string;
|
||||
}
|
||||
|
||||
export interface ItemDTO {
|
||||
id: string;
|
||||
isDelegate: boolean;
|
||||
isCurrent: boolean;
|
||||
startDate: string;
|
||||
amharicStartDate: string;
|
||||
endDate: string;
|
||||
amharicEndDate: string;
|
||||
unitId: string;
|
||||
status: string;
|
||||
name: {
|
||||
am: string;
|
||||
en: string;
|
||||
};
|
||||
userId: string;
|
||||
}
|
||||
|
||||
export interface RootDTO {
|
||||
count: number;
|
||||
items: ItemDTO[];
|
||||
}
|
||||
export interface UserName {
|
||||
am: string;
|
||||
en: string;
|
||||
}
|
||||
|
||||
export interface User {
|
||||
id: string;
|
||||
name: UserName;
|
||||
username: string;
|
||||
email: string;
|
||||
phoneNumber:string
|
||||
userType: "employee" | string;
|
||||
sharepointId: string | null;
|
||||
status: "accepted" | "pending" | "rejected" | string;
|
||||
createdAt:string
|
||||
}
|
||||
|
||||
export interface OrganizationUserDto {
|
||||
organizationId: string;
|
||||
user: User;
|
||||
}
|
||||
|
||||
|
||||
|
||||
export interface EmployeeDTO {
|
||||
id: string;
|
||||
isCurrent: boolean;
|
||||
status: string;
|
||||
name: {
|
||||
am: string;
|
||||
en: string;
|
||||
};
|
||||
userId:string;
|
||||
}
|
||||
|
||||
export interface ItemDTO {
|
||||
id: string;
|
||||
isDelegate: boolean;
|
||||
isCurrent: boolean;
|
||||
startDate: string;
|
||||
amharicStartDate: string;
|
||||
endDate: string;
|
||||
amharicEndDate: string;
|
||||
unitId: string;
|
||||
status: string;
|
||||
name: {
|
||||
am: string;
|
||||
en: string;
|
||||
};
|
||||
userId: string;
|
||||
}
|
||||
|
||||
export interface RootDTO {
|
||||
count: number;
|
||||
items: ItemDTO[];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user