mirror of
https://github.com/azaion/admin.git
synced 2026-04-22 13:16:33 +00:00
[AZ-189] [AZ-190] [AZ-191] [AZ-192] [AZ-193] [AZ-194] [AZ-195] Add e2e blackbox test suite
Made-with: Cursor
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
# Module: Azaion.Common.Database.AzaionDbSchemaHolder
|
||||
|
||||
## Purpose
|
||||
Static holder for the linq2db `MappingSchema` that maps C# entities to PostgreSQL table/column naming conventions and handles custom type conversions.
|
||||
|
||||
## Public Interface
|
||||
|
||||
| Member | Type | Description |
|
||||
|--------|------|-------------|
|
||||
| `MappingSchema` | `static readonly MappingSchema` | Pre-built schema with column name and type mappings |
|
||||
|
||||
## Internal Logic
|
||||
Static constructor:
|
||||
1. Creates a `MappingSchema` with a global callback that converts all column names to snake_case via `StringExtensions.ToSnakeCase`.
|
||||
2. Uses `FluentMappingBuilder` to configure the `User` entity:
|
||||
- Table name: `"users"`
|
||||
- `Id`: primary key, `DataType.Guid`
|
||||
- `Role`: stored as text, with custom conversion to/from `RoleEnum` via `Enum.Parse`
|
||||
- `UserConfig`: stored as nullable JSON text, serialized/deserialized via `Newtonsoft.Json`
|
||||
|
||||
## Dependencies
|
||||
- `User`, `RoleEnum` entities
|
||||
- `StringExtensions.ToSnakeCase`
|
||||
- linq2db `MappingSchema`, `FluentMappingBuilder`
|
||||
- `Newtonsoft.Json`
|
||||
|
||||
## Consumers
|
||||
- `DbFactory.LoadOptions` — passes `MappingSchema` to `DataOptions.UseMappingSchema()`
|
||||
|
||||
## Data Models
|
||||
Defines the ORM mapping for the `users` table.
|
||||
|
||||
## Configuration
|
||||
None — all mappings are compile-time.
|
||||
|
||||
## External Integrations
|
||||
None directly; mappings are used when queries execute against PostgreSQL.
|
||||
|
||||
## Security
|
||||
None.
|
||||
|
||||
## Tests
|
||||
None.
|
||||
Reference in New Issue
Block a user