import request from '/@/utils/request';

export interface PropertyManagementPayload {
  indicatorName: string;
  indicatorCode: string;
  indicatorDescription: string;
  enterpriseName: string;
  creditCode: string;
  registrationDate: string;
  stateOwnedEnterprise: string;
  changeSupervisor: string;
  mainInvestorName: string;
  mainInvestorCode: string;
  supervisorUnit: string;
  supervisorUnitCode: string;
  belongingDepartment: string;
  enterpriseCategory: string;
  registeredCapital: number;
  enterpriseClassification: string;
  regulatoryAgency: string;
  relationStateEnterprise: string;
  organizationForm: string;
  propertyLevel: string;
  operationStatus: string;
  propertyRegistrationCase: string;
  marketTransaction: string;
  isListedCompany: string;
  isConsolidated: string;
  isHoldingMainBusiness: string;
  isOverseasToDomestic: string;
  mainBusiness: string;
  auxiliaryBusiness: string;
  mainIndustry: string;
  operationScale: string;
  mixedReformSituation: string;
  registrationAddress: string;
  changeReason: string;
  decisionDocument: string;
  businessLicense: string;
  enterpriseCharter: string;
  latestAuditReport: string;
  assetAssessmentFiling: string;
  businessApplicationFile: string;
  otherMaterials: string;
  createBy: string;
  createTime: string;
  updateBy: string;
  updateTime: string;
  delFlag: string;
  processInstanceId: string;
  status: string;
  pushStatus: string;
}

export interface PropertyManagementQuery {
	page?: number;
	size?: number;
	companyName?: string;
	unifiedCode?: string;
}

export interface PropertyManagementItem extends PropertyManagementPayload {
	id: string;
}

export interface PropertyManagementPageResp {
	records: PropertyManagementItem[];
	total: number;
	page?: number;
	size?: number;
}

export const getPropertyManagementPageAPI = (data: PropertyManagementQuery) => {
	return request<PropertyManagementPageResp>({
		url: '/admin/propertyRights/page',
		method: 'post',
		data,
	});
};

export const getPropertyManagementDetailAPI = (id: string | number) => {
	return request<PropertyManagementItem>({
		url: '/admin/propertyRights/view',
		method: 'get',
		params: { id },
	});
};

export const addPropertyManagementAPI = (data: PropertyManagementPayload) => {
	return request({
		url: '/admin/propertyRights/add',
		method: 'post',
		data,
	});
};

export const updatePropertyManagementAPI = (data: PropertyManagementPayload) => {
	return request({
		url: '/admin/propertyRights/update',
		method: 'put',
		data,
	});
};

export const reportPropertyManagementAPI = (id: string | number) => {
	return request({
		url: '/admin/propertyRights/report',
		method: 'post',
		params: { id },
	});
};
