def _create_last_known_details(self, person, last_known_details_data, request):
        """Create Last Known Details with optional document uploads (tolerant to partial data)"""
        print("\n=== STARTING _create_last_known_details ===")
        print(f"Person ID: {person.id}")

        last_known_detail_instances = []
        document_objs = []
        all_documents_meta = []

        for index, details in enumerate(last_known_details_data):
            if not isinstance(details, dict):
                print(f"Skipping index {index}: not a valid dict.")
                continue

            # Extract and store document metadata separately
            documents_meta = details.pop('documents', [])
            all_documents_meta.append(documents_meta)

            # Proceed only if at least one field (other than documents) is present
            meaningful_fields = {k: v for k, v in details.items() if v not in (None, '', [], {})}
            if not meaningful_fields:
                print(f"Skipping index {index}: all fields empty.")
                continue

            try:
                # Create LastKnownDetails instance with safe access
                detail_instance = LastKnownDetails(
                    person=person,
                    missing_date=details.get('missing_date'),
                    missing_time=details.get('missing_time'),
                    last_seen_location=details.get('last_seen_location'),
                    missing_location_details=details.get('missing_location_details'),
                    # Add any other optional fields here using .get(...)
                )
                detail_instance.save()
                last_known_detail_instances.append(detail_instance)
            except Exception as e:
                print(f"Failed to save LastKnownDetail at index {index}: {e}")
                continue

        # Handle document uploads if any
        if request.FILES:
            for index, detail_instance in enumerate(last_known_detail_instances):
                documents_meta = all_documents_meta[index] if index < len(all_documents_meta) else []

                for doc_idx, doc_meta in enumerate(documents_meta):
                    file_field_key = f'last_known_details[{index}].documents[{doc_idx}].document'
                    file = request.FILES.get(file_field_key)

                    if file:
                        try:
                            document_objs.append(Document(
                                last_known_detail=detail_instance,
                                person_type='missing person',
                                document_type=doc_meta.get('document_type', ''),
                                description=doc_meta.get('description', ''),
                                document=file,
                                created_by=request.user
                            ))
                        except Exception as e:
                            print(f"Failed to prepare document object at index {index}, doc {doc_idx}: {e}")
                            continue

        # Bulk create all document records
        if document_objs:
            try:
                Document.objects.bulk_create(document_objs)
            except Exception as e:
                print(f"Bulk document save failed: {e}")

        print("=== COMPLETED _create_last_known_details ===\n")

debug and give me flow