minimax-client
Version:
TypeScript client library for the Minimax accounting API (https://moj.minimax.rs/RS/API/)
146 lines (145 loc) • 3.02 kB
TypeScript
/**
* Employees module
*
* Module for interacting with employees in the Minimax API
*/
import { BaseResource, ListResponse } from './base-resource';
/**
* Employee resource
*/
export interface Employee {
/**
* Employee ID
*/
ID: string;
/**
* First name
*/
FirstName: string;
/**
* Last name
*/
LastName: string;
/**
* Full name
*/
FullName: string;
/**
* Email
*/
Email?: string;
/**
* Phone
*/
Phone?: string;
/**
* Address
*/
Address?: string;
/**
* Position
*/
Position?: string;
/**
* Department
*/
Department?: string;
/**
* Status (Active/Inactive)
*/
Status: string;
/**
* Employment date
*/
EmploymentDate?: string;
/**
* Termination date
*/
TerminationDate?: string;
/**
* Record modified date
*/
RecordDtModified?: string;
/**
* Concurrency control token
*/
RowVersion: string;
}
/**
* Employees list response
*/
export type EmployeesListResponse = ListResponse<Employee>;
/**
* Employee filter options
*/
export interface EmployeeFilterOptions {
/**
* Filter by status
*/
status?: 'Active' | 'Inactive';
/**
* Filter by department
*/
department?: string;
/**
* Maximum number of results to return
*/
limit?: number;
/**
* Number of results to skip
*/
offset?: number;
/**
* Whether to include the total count
*/
count?: boolean;
}
/**
* Employees module
*/
export declare class EmployeesModule extends BaseResource {
/**
* Base endpoint for employees
* The actual endpoint will be constructed as api/orgs/{organizationId}/employees
*/
protected readonly endpoint = "employees";
/**
* Get all employees
*
* @param options Filter options
* @returns Promise resolving to an array of employees
*/
getAll(options?: EmployeeFilterOptions): Promise<Employee[]>;
/**
* Get an employee by ID
*
* @param id Employee ID
* @returns Promise resolving to the employee
*/
get(id: string): Promise<Employee>;
/**
* Create a new employee
*
* @param data Employee data
* @returns Promise resolving to the created employee
*/
create(data: Omit<Employee, 'ID' | 'RowVersion'>): Promise<Employee>;
/**
* Update an employee
*
* @param id Employee ID
* @param data Employee data with RowVersion
* @returns Promise resolving to the updated employee
*/
update(id: string, data: Partial<Employee> & {
RowVersion: string;
}): Promise<Employee>;
/**
* Delete an employee
*
* @param id Employee ID
* @param rowVersion RowVersion for concurrency control
* @returns Promise resolving when the employee is deleted
*/
delete(id: string, rowVersion: string): Promise<void>;
}