import { BaseEntity, BaseQueryParams, BaseResponse, PaginatedResponse, UserFields } from './project';

export interface UnitJobError {
  row: number;
  column: string;
  message: string;
};

export interface UnitJob extends BaseEntity {
  project: string;
  jobId: string;
  fileName: string;
  status: 'pending' | 'processing' | 'completed' | 'failed';
  progress: number;
  totalUnits: number;
  processedUnits: number;
  successfulUnits: number;
  failedUnits: number;
  errorRecords: UnitJobError[];
  filePath: string;
  propertyType: {
    id: string;
    name: string;
  };
  createdBy: UserFields | string;
  updatedBy: UserFields | string;
}

export interface GetUnitJobsParams extends BaseQueryParams {
  status?: string;
  createdBy?: string;
  jobId?: string;
  projectId: string;
}

export type GetUnitJobListResponse = BaseResponse<PaginatedResponse<UnitJob>>;
export type GetUnitJobByIdResponse = BaseResponse<UnitJob>;