public function saveAttendee(array $entity): array
    {
        $response = [
            'status' => false,
            'errors' => [],
            'entity' => null,
        ];

        if (empty($entity['id'])) {
            unset($entity['id']);
        }

        $query = $this->find()
            ->where([
                'source' => $entity['source'],
                'source_id' => $entity['source_id'],
                'contact_details' => $entity['contact_details'],
            ]);

        $query->execute();

        if (!$query->count()) {
            $item = $this->newEntity();
            $item = $this->patchEntity($item, $entity);
        } else {
            $item = $query->firstOrFail();
            if (!($item instanceof EntityInterface)) {
                throw new RuntimeException('Expected instance of EntityInterface');
            }
            $item = $this->patchEntity($item, $entity);
        }

        $saved = $this->save($item);

        if ($saved) {
            $response['status'] = true;
            $response['entity'] = $saved;
        } else {
            $response['errors'] = $item->getErrors();
        }

        return $response;
    }