exports.handleFiles = (files, newUserId) => {
	const fileRecords = [];

	if (files.listingImgs && files.listingImgs.length > 0) {
		const listingImgRecords = files.listingImgs.map((file) => ({
			host_registration_id: newUserId,
			file_type: 'Listing Images',
			file: file.filename,
		}));
		fileRecords.push(...listingImgRecords);
	}

	if (files.supportingDocs && files.supportingDocs.length > 0) {
		const supportingDocRecords = files.supportingDocs.map((file) => ({
			host_registration_id: newUserId,
			file_type: 'Supporting Documents',
			file: file.filename,
		}));
		fileRecords.push(...supportingDocRecords);
	}

	return fileRecords;
};
