UNPKG

@iota-big3/sdk-gateway

Version:

Universal API Gateway with protocol translation, intelligent routing, rate limiting, health checking, and caching

683 lines 19.5 kB
/** * @fileoverview Comprehensive types for operational systems (HR, Devices, Cafeteria, Facilities) * @module @iota-big3/sdk-types/operational * @description * Provides strictly-typed definitions for operational management including: * - Human Resources (employees, payroll, benefits, performance) * - Device Management (inventory, assignments, maintenance) * - Cafeteria Operations (meals, nutrition, payments) * - Facilities Management (maintenance, space, utilities) * * Designed for AI/debugging friendliness with descriptive names and comprehensive documentation. * * @example * ```typescript * import type { Employee, Device, CafeteriaOrder, MaintenanceRequest } from '@iota-big3/sdk-types'; * * // HR Management * const employee: Employee = { * id: 'emp_123', * personalInfo: { * firstName: 'John', * lastName: 'Doe', * email: 'john.doe@company.com', * phone: '+1-555-0123' * }, * employmentInfo: { * employeeId: 'E12345', * department: 'Engineering', * position: 'Senior Developer', * reportsTo: 'emp_456', * hireDate: '2020-01-15', * employmentType: EmploymentType.FULL_TIME, * status: EmployeeStatus.ACTIVE * }, * compensation: { * salary: 120000n, // Using bigint for precision * currency: 'USD', * payFrequency: PayFrequency.BIWEEKLY, * bonusEligible: true, * equityGrants: [] * } * }; * ``` * * @since 1.0.0 */ import type { Brand } from './utilities'; /** * Employee identifier * @description Unique identifier for an employee in the HR system * @example "emp_abc123def456" */ export type EmployeeId = Brand<string, 'EmployeeId'>; /** * Device identifier * @description Unique identifier for a device in inventory * @example "dev_laptop_xyz789" */ export type DeviceId = Brand<string, 'DeviceId'>; /** * Meal plan identifier * @description Unique identifier for a cafeteria meal plan * @example "meal_plan_student_2024" */ export type MealPlanId = Brand<string, 'MealPlanId'>; /** * Facility identifier * @description Unique identifier for a facility or building * @example "fac_main_building_01" */ export type FacilityId = Brand<string, 'FacilityId'>; /** * Work order identifier * @description Unique identifier for maintenance work orders * @example "wo_2024_001234" */ export type WorkOrderId = Brand<string, 'WorkOrderId'>; /** * Employment types * @description Categories of employment relationships */ export declare enum EmploymentType { FULL_TIME = "FULL_TIME", PART_TIME = "PART_TIME", CONTRACT = "CONTRACT", TEMPORARY = "TEMPORARY", INTERN = "INTERN", VOLUNTEER = "VOLUNTEER", CONSULTANT = "CONSULTANT" } /** * Employee status * @description Current status of an employee */ export declare enum EmployeeStatus { ACTIVE = "ACTIVE", ON_LEAVE = "ON_LEAVE", SUSPENDED = "SUSPENDED", TERMINATED = "TERMINATED", RETIRED = "RETIRED", DECEASED = "DECEASED" } /** * Leave types * @description Types of employee leave */ export declare enum LeaveType { VACATION = "VACATION", SICK = "SICK", PERSONAL = "PERSONAL", MATERNITY = "MATERNITY", PATERNITY = "PATERNITY", BEREAVEMENT = "BEREAVEMENT", SABBATICAL = "SABBATICAL", UNPAID = "UNPAID", MILITARY = "MILITARY", JURY_DUTY = "JURY_DUTY" } /** * Pay frequency * @description How often an employee is paid */ export declare enum PayFrequency { WEEKLY = "WEEKLY", BIWEEKLY = "BIWEEKLY", SEMIMONTHLY = "SEMIMONTHLY", MONTHLY = "MONTHLY", QUARTERLY = "QUARTERLY", ANNUALLY = "ANNUALLY" } /** * Performance rating * @description Employee performance evaluation ratings */ export declare enum PerformanceRating { EXCEPTIONAL = "EXCEPTIONAL", EXCEEDS_EXPECTATIONS = "EXCEEDS_EXPECTATIONS", MEETS_EXPECTATIONS = "MEETS_EXPECTATIONS", NEEDS_IMPROVEMENT = "NEEDS_IMPROVEMENT", UNSATISFACTORY = "UNSATISFACTORY" } /** * Employee personal information * @description Personal details of an employee (PII - handle with care) */ export interface EmployeePersonalInfo { readonly firstName: string; readonly lastName: string; readonly middleName?: string; readonly preferredName?: string; readonly email: string; readonly phone: string; readonly emergencyContact: { readonly name: string; readonly relationship: string; readonly phone: string; readonly email?: string; }; readonly address?: { readonly street: string; readonly city: string; readonly state: string; readonly postalCode: string; readonly country: string; }; readonly dateOfBirth?: string; readonly ssn?: string; } /** * Employment information * @description Job-related information for an employee */ export interface EmploymentInfo { readonly employeeId: string; readonly department: string; readonly position: string; readonly reportsTo?: EmployeeId; readonly hireDate: string; readonly startDate: string; readonly endDate?: string; readonly employmentType: EmploymentType; readonly status: EmployeeStatus; readonly location: string; readonly workSchedule?: { readonly hoursPerWeek: number; readonly schedule: string; readonly isRemote: boolean; readonly remotePercentage?: number; }; } /** * Compensation details * @description Employee compensation and benefits information */ export interface Compensation { readonly salary: bigint; readonly currency: string; readonly payFrequency: PayFrequency; readonly effectiveDate: string; readonly bonusEligible: boolean; readonly bonusTarget?: number; readonly equityGrants?: Array<{ readonly grantDate: string; readonly vestingSchedule: string; readonly shares: number; readonly strikePrice?: bigint; }>; readonly benefits?: Array<{ readonly type: string; readonly provider: string; readonly enrollmentDate: string; readonly cost: bigint; }>; } /** * Employee record * @description Complete employee information */ export interface Employee { readonly id: EmployeeId; readonly personalInfo: EmployeePersonalInfo; readonly employmentInfo: EmploymentInfo; readonly compensation: Compensation; readonly performanceHistory?: Array<{ readonly reviewDate: string; readonly rating: PerformanceRating; readonly reviewer: EmployeeId; readonly comments?: string; }>; readonly leaveBalances?: Record<LeaveType, { readonly available: number; readonly used: number; readonly pending: number; }>; readonly training?: Array<{ readonly courseId: string; readonly courseName: string; readonly completionDate: string; readonly score?: number; readonly certificateUrl?: string; }>; readonly metadata?: { readonly createdAt: string; readonly updatedAt: string; readonly createdBy: string; readonly lastModifiedBy: string; }; } /** * Device types * @description Categories of devices in inventory */ export declare enum DeviceType { LAPTOP = "LAPTOP", DESKTOP = "DESKTOP", TABLET = "TABLET", PHONE = "PHONE", PRINTER = "PRINTER", SCANNER = "SCANNER", PROJECTOR = "PROJECTOR", MONITOR = "MONITOR", KEYBOARD = "KEYBOARD", MOUSE = "MOUSE", HEADSET = "HEADSET", CAMERA = "CAMERA", SERVER = "SERVER", NETWORK_DEVICE = "NETWORK_DEVICE", OTHER = "OTHER" } /** * Device status * @description Current status of a device */ export declare enum DeviceStatus { AVAILABLE = "AVAILABLE", ASSIGNED = "ASSIGNED", IN_REPAIR = "IN_REPAIR", LOST = "LOST", STOLEN = "STOLEN", RETIRED = "RETIRED", DISPOSED = "DISPOSED" } /** * Device condition * @description Physical condition of a device */ export declare enum DeviceCondition { NEW = "NEW", EXCELLENT = "EXCELLENT", GOOD = "GOOD", FAIR = "FAIR", POOR = "POOR", BROKEN = "BROKEN" } /** * Device specifications * @description Technical specifications of a device */ export interface DeviceSpecs { readonly manufacturer: string; readonly model: string; readonly serialNumber: string; readonly operatingSystem?: string; readonly processor?: string; readonly ram?: string; readonly storage?: string; readonly screenSize?: string; readonly otherSpecs?: Record<string, string>; } /** * Device assignment * @description Assignment details for a device */ export interface DeviceAssignment { readonly assignedTo: EmployeeId | string; readonly assignedDate: string; readonly expectedReturnDate?: string; readonly actualReturnDate?: string; readonly purpose?: string; readonly approvedBy: EmployeeId; } /** * Device record * @description Complete device information */ export interface Device { readonly id: DeviceId; readonly type: DeviceType; readonly name: string; readonly assetTag: string; readonly specs: DeviceSpecs; readonly status: DeviceStatus; readonly condition: DeviceCondition; readonly purchaseInfo: { readonly purchaseDate: string; readonly purchasePrice: bigint; readonly vendor: string; readonly warrantyExpiration?: string; readonly invoiceNumber?: string; }; readonly currentAssignment?: DeviceAssignment; readonly assignmentHistory?: DeviceAssignment[]; readonly maintenanceHistory?: Array<{ readonly date: string; readonly type: 'REPAIR' | 'UPGRADE' | 'PREVENTIVE'; readonly description: string; readonly cost: bigint; readonly performedBy: string; }>; readonly location?: { readonly building: string; readonly floor?: string; readonly room?: string; readonly shelf?: string; }; readonly metadata?: { readonly createdAt: string; readonly updatedAt: string; readonly lastInventoryCheck: string; }; } /** * Meal types * @description Types of meals served */ export declare enum MealType { BREAKFAST = "BREAKFAST", LUNCH = "LUNCH", DINNER = "DINNER", SNACK = "SNACK", BEVERAGE = "BEVERAGE" } /** * Dietary restrictions * @description Common dietary restrictions and preferences */ export declare enum DietaryRestriction { VEGETARIAN = "VEGETARIAN", VEGAN = "VEGAN", GLUTEN_FREE = "GLUTEN_FREE", DAIRY_FREE = "DAIRY_FREE", NUT_FREE = "NUT_FREE", KOSHER = "KOSHER", HALAL = "HALAL", LOW_SODIUM = "LOW_SODIUM", DIABETIC = "DIABETIC", KETO = "KETO" } /** * Allergen types * @description Common food allergens */ export declare enum Allergen { MILK = "MILK", EGGS = "EGGS", FISH = "FISH", SHELLFISH = "SHELLFISH", TREE_NUTS = "TREE_NUTS", PEANUTS = "PEANUTS", WHEAT = "WHEAT", SOYBEANS = "SOYBEANS", SESAME = "SESAME" } /** * Nutritional information * @description Nutritional facts for food items */ export interface NutritionalInfo { readonly calories: number; readonly protein: number; readonly carbohydrates: number; readonly fat: number; readonly fiber?: number; readonly sugar?: number; readonly sodium?: number; readonly vitamins?: Record<string, number>; readonly minerals?: Record<string, number>; } /** * Menu item * @description Individual food item on the menu */ export interface MenuItem { readonly id: string; readonly name: string; readonly description?: string; readonly category: string; readonly price: bigint; readonly nutritionalInfo?: NutritionalInfo; readonly allergens: Allergen[]; readonly dietaryInfo: DietaryRestriction[]; readonly ingredients?: string[]; readonly imageUrl?: string; readonly availability: { readonly isAvailable: boolean; readonly servingSize?: string; readonly maxOrderQuantity?: number; }; } /** * Meal plan * @description Cafeteria meal plan subscription */ export interface MealPlan { readonly id: MealPlanId; readonly name: string; readonly description: string; readonly price: bigint; readonly billingPeriod: 'WEEKLY' | 'MONTHLY' | 'SEMESTER' | 'ANNUAL'; readonly mealCredits: { readonly breakfast: number; readonly lunch: number; readonly dinner: number; readonly snack: number; readonly flex: number; }; readonly restrictions?: { readonly validDays?: string[]; readonly validHours?: Record<MealType, { start: string; end: string; }>; readonly blackoutDates?: string[]; }; } /** * Cafeteria order * @description Order placed in the cafeteria system */ export interface CafeteriaOrder { readonly id: string; readonly customerId: string; readonly orderDate: string; readonly mealType: MealType; readonly items: Array<{ readonly menuItem: MenuItem; readonly quantity: number; readonly specialInstructions?: string; readonly subtotal: bigint; }>; readonly totalAmount: bigint; readonly paymentMethod: 'MEAL_PLAN' | 'CASH' | 'CARD' | 'ACCOUNT'; readonly mealPlanId?: MealPlanId; readonly status: 'PENDING' | 'PREPARING' | 'READY' | 'COMPLETED' | 'CANCELLED'; readonly pickupTime?: string; readonly completedTime?: string; } /** * Facility types * @description Types of facilities/buildings */ export declare enum FacilityType { OFFICE = "OFFICE", CLASSROOM = "CLASSROOM", LABORATORY = "LABORATORY", CAFETERIA = "CAFETERIA", GYMNASIUM = "GYMNASIUM", AUDITORIUM = "AUDITORIUM", LIBRARY = "LIBRARY", DORMITORY = "DORMITORY", PARKING = "PARKING", WAREHOUSE = "WAREHOUSE", DATA_CENTER = "DATA_CENTER" } /** * Maintenance priority * @description Priority levels for maintenance requests */ export declare enum MaintenancePriority { EMERGENCY = "EMERGENCY",// Immediate response required HIGH = "HIGH",// Within 24 hours MEDIUM = "MEDIUM",// Within 1 week LOW = "LOW",// Within 1 month SCHEDULED = "SCHEDULED" } /** * Work order status * @description Status of maintenance work orders */ export declare enum WorkOrderStatus { DRAFT = "DRAFT", SUBMITTED = "SUBMITTED", APPROVED = "APPROVED", ASSIGNED = "ASSIGNED", IN_PROGRESS = "IN_PROGRESS", ON_HOLD = "ON_HOLD", COMPLETED = "COMPLETED", CANCELLED = "CANCELLED", CLOSED = "CLOSED" } /** * Utility types * @description Types of utilities monitored */ export declare enum UtilityType { ELECTRICITY = "ELECTRICITY", WATER = "WATER", GAS = "GAS", HEATING = "HEATING", COOLING = "COOLING", INTERNET = "INTERNET", PHONE = "PHONE" } /** * Space information * @description Details about a physical space */ export interface SpaceInfo { readonly id: string; readonly name: string; readonly type: string; readonly capacity: number; readonly area: number; readonly features: string[]; readonly isBookable: boolean; readonly currentOccupant?: string; } /** * Facility details * @description Complete facility information */ export interface Facility { readonly id: FacilityId; readonly name: string; readonly type: FacilityType; readonly address: { readonly street: string; readonly city: string; readonly state: string; readonly postalCode: string; readonly country: string; readonly coordinates?: { readonly latitude: number; readonly longitude: number; }; }; readonly details: { readonly yearBuilt?: number; readonly totalArea: number; readonly floors: number; readonly spaces: SpaceInfo[]; readonly parkingSpaces?: number; readonly accessibility: string[]; }; readonly management: { readonly manager: EmployeeId; readonly maintenanceTeam: EmployeeId[]; readonly securityTeam?: EmployeeId[]; readonly operatingHours: Record<string, { open: string; close: string; }>; readonly emergencyContacts: Array<{ readonly name: string; readonly role: string; readonly phone: string; }>; }; readonly utilities: Record<UtilityType, { readonly provider: string; readonly accountNumber: string; readonly monthlyAverage: bigint; }>; readonly certifications?: Array<{ readonly type: string; readonly level?: string; readonly issueDate: string; readonly expirationDate?: string; }>; } /** * Maintenance request * @description Request for facility maintenance */ export interface MaintenanceRequest { readonly id: WorkOrderId; readonly facilityId: FacilityId; readonly location: { readonly building: string; readonly floor?: string; readonly room?: string; readonly specificLocation?: string; }; readonly requestedBy: EmployeeId | string; readonly requestDate: string; readonly priority: MaintenancePriority; readonly category: string; readonly description: string; readonly attachments?: Array<{ readonly filename: string; readonly url: string; readonly uploadedAt: string; }>; readonly status: WorkOrderStatus; readonly assignedTo?: EmployeeId; readonly estimatedCost?: bigint; readonly actualCost?: bigint; readonly timeline: { readonly estimatedStart?: string; readonly estimatedCompletion?: string; readonly actualStart?: string; readonly actualCompletion?: string; }; readonly notes?: Array<{ readonly author: EmployeeId; readonly timestamp: string; readonly content: string; }>; } /** * Check if employee is active * @param employee - Employee to check * @returns True if employee is active */ export declare function isEmployeeActive(employee: Employee): boolean; /** * Calculate device depreciation * @param device - Device to calculate depreciation for * @param depreciationYears - Years over which to depreciate (default: 3) * @returns Current value in cents */ export declare function calculateDeviceDepreciation(device: Device, depreciationYears?: number): bigint; /** * Check if meal plan has available credits * @param plan - Meal plan to check * @param mealType - Type of meal * @param creditsUsed - Credits already used * @returns True if credits are available */ export declare function hasMealCredits(plan: MealPlan, mealType: MealType, creditsUsed: Record<string, number>): boolean; /** * Calculate maintenance response time requirement * @param priority - Maintenance priority * @returns Required response time in hours */ export declare function getMaintenanceResponseTime(priority: MaintenancePriority): number; export declare const operationalTypes: { readonly isEmployeeActive: typeof isEmployeeActive; readonly calculateDeviceDepreciation: typeof calculateDeviceDepreciation; readonly hasMealCredits: typeof hasMealCredits; readonly getMaintenanceResponseTime: typeof getMaintenanceResponseTime; }; //# sourceMappingURL=operational-types.d.ts.map