Repository: litestar-org/litestar

Issue:
Enhancement: `contrib.respository.on_app_init()` handler
### Summary

Callback to add to `on_app_init` that adds repository names to signature namespace.

### Basic Example

In `starlite-pg-redis-docker` I init the app with:

```py
        signature_namespace={
            "AsyncSession": AsyncSession,
            "FilterTypes": FilterTypes,
            "BeforeAfter": BeforeAfter,
            "CollectionFilter": CollectionFilter,
            "LimitOffset": LimitOffset,
            "UUID": UUID,
            "OrderBy": OrderBy,
            "SearchFilter": SearchFilter,
        },
```
These are names of things that would commonly be declared as handler or model parameter types when using the repository that are likely to get linted into an `if TYPE_CHECKING` block if using `__future__.annotations`.

E.g.,

```py
app = Litestar(..., on_app_init=[contrib.repository.on_app_init], ...)
```

### Drawbacks and Impact

It is opt in, so won't be any backward incompatible behavior.

A drawback is that it is a bit magical, but if we document it well, it might also be a good example of how to use the `signature_namespace` feature.

### Unresolved questions

_No response_


Discussion:
This could also be a method on the base repository which might make sense if we want to be able to customize behavior to each repository type. Would also probably make sense to make them an implementation of `InitPluginProtocol` in that case also. E.g., 

```py
app = Litestar(..., plugins=[contrib.sqlalchemy.repository.SQLAlchemyAsyncRepository.InitPlugin]
```

Weather the repository was actually also the plugin protocol or owns one is up for debate in this pattern I guess.
I think this is good, no issues from my end
Hi guys, could I work on that?

I'm going to add extra repo names in `signature_namespace` function in each config (`SQLAlchemyAsyncConfig`, `SQLAlchemySyncConfig`), or implement the common ones in `GenericSQLAlchemyConfig`, any thoughts on that?


> Hi guys, could I work on that?
> 
> 
> 
> I'm going to add extra repo names in `signature_namespace` function in each config (`SQLAlchemyAsyncConfig`, `SQLAlchemySyncConfig`), or implement the common ones in `GenericSQLAlchemyConfig`, any thoughts on that?
> 
> 
> 
> 

More than welcome to work on it @sonpro1296! 

I'm not sure we want the repository names added via the sqlalchemy configs - my thinking here is that the sqlalchemy plug-in can be used independent of the repository pattern and I don't know that we want to unnecessarily populate the namespace in that case. Happy to discuss.
That makes sense, but if that's the case, I think we will have to check if repository pattern is being used in order to add the namespace.  I'm not sure it's a good idea (because I don't know how xD), compare to adding via configs. 
It should just be something that the user opts into IMO.

E.g., 

```py
from litestar.contrib import repository

app = Litestar(..., on_app_init=[repository.on_app_init])
```

Resolving patch:
diff --git a/litestar/contrib/repository/handlers.py b/litestar/contrib/repository/handlers.py
new file mode 100644
--- /dev/null
+++ b/litestar/contrib/repository/handlers.py
@@ -0,0 +1,22 @@
+from typing import TYPE_CHECKING
+
+from litestar.contrib.repository.filters import BeforeAfter, CollectionFilter, LimitOffset, OrderBy, SearchFilter
+
+if TYPE_CHECKING:
+    from litestar.config.app import AppConfig
+
+
+signature_namespace_values = {
+    "BeforeAfter": BeforeAfter,
+    "CollectionFilter": CollectionFilter,
+    "LimitOffset": LimitOffset,
+    "OrderBy": OrderBy,
+    "SearchFilter": SearchFilter,
+}
+
+
+def on_app_init(app_config: "AppConfig") -> "AppConfig":
+    """Add custom filters for the application during signature modelling."""
+
+    app_config.signature_namespace.update(signature_namespace_values)
+    return app_config


Test patch:
diff --git a/tests/contrib/repository/test_handlers.py b/tests/contrib/repository/test_handlers.py
new file mode 100644
--- /dev/null
+++ b/tests/contrib/repository/test_handlers.py
@@ -0,0 +1,15 @@
+from litestar.app import Litestar
+from litestar.contrib.repository import handlers
+from litestar.contrib.repository.filters import BeforeAfter, CollectionFilter, LimitOffset, OrderBy, SearchFilter
+
+
+def test_app_debug_create_logger() -> None:
+    app = Litestar([], on_app_init=[handlers.on_app_init])
+
+    assert app.signature_namespace == {
+        "BeforeAfter": BeforeAfter,
+        "CollectionFilter": CollectionFilter,
+        "LimitOffset": LimitOffset,
+        "OrderBy": OrderBy,
+        "SearchFilter": SearchFilter,
+    }