AyCode.Core/AyCode.Entities
Loretta affa85e5c5 [LOADED_DOCS: 4 files, no new loads]
Refactor docs: topic folders, TOON, XCUT, protocol sync

- Migrated all topic documentation into dedicated folders with canonical `README.md`, `ISSUES.md`, and `TODO.md` per topic (e.g., `LOGGING/`, `SIGNALR/`, `BINARY/`, `TOON/`).
- Added comprehensive TOON serializer documentation: design, format, options, attributes, inference, issues, and TODOs.
- Introduced `XCUT` folder for cross-cutting issues and TODOs, with canonical entries and topic cross-references.
- Updated all references and navigation to use new folder-based doc paths; fixed links and clarified doc structure.
- Enhanced AI agent protocol: enforce session skill preloading, `[LOADED_DOCS: ...]` short-name prefix, and mandatory `docs-check` skill for doc/code sync.
- Updated `.csproj` to include all `README.md` files for IDE visibility.
- Improved and clarified SignalR, grid, and project-level documentation.
- Minor code/test tweaks and doc content corrections for consistency.
2026-04-24 21:54:04 +02:00
..
Addresses Document AcBinary wire format, sync docs, update conventions 2026-03-29 09:11:57 +02:00
Groups Document AcBinary wire format, sync docs, update conventions 2026-03-29 09:11:57 +02:00
Locations Document AcBinary wire format, sync docs, update conventions 2026-03-29 09:11:57 +02:00
LogItems [LOADED_DOCS: 4 files, no new loads] 2026-04-24 21:54:04 +02:00
Messages Document AcBinary wire format, sync docs, update conventions 2026-03-29 09:11:57 +02:00
Profiles Document AcBinary wire format, sync docs, update conventions 2026-03-29 09:11:57 +02:00
ServiceProviders Document AcBinary wire format, sync docs, update conventions 2026-03-29 09:11:57 +02:00
Users Document AcBinary wire format, sync docs, update conventions 2026-03-29 09:11:57 +02:00
AcLogItemWriterBase.cs
AcModelDtoExtension.cs AcModelDtoExtension improvements 2025-09-12 13:36:11 +02:00
AyCode.Entities.csproj [LOADED_DOCS: 4 files, no new loads] 2026-04-24 21:54:04 +02:00
PermissionContextMappingSubjectType.cs
README.md Add structured metadata blocks to all project/repo docs 2026-03-30 08:53:56 +02:00

README.md

AyCode.Entities

@project { type = "framework" }

Abstract base entity implementations for the AyCode domain model. All entities are abstract and generic — concrete implementations live in application-specific projects. Implements the interfaces defined in AyCode.Interfaces.

Folder Structure

Folder Purpose
Addresses/ AcAddress — address entity with lat/lng, validation flag
Groups/ GroupBase — base group entity with IsPublic flag
Locations/ LocationBase — read-only location (lat/lng/address)
LogItems/ AcLogItemClient — MessagePack-serializable log item DTO
Messages/ AcEmailMessage<T>, AcEmailRecipient<T> — email messaging system
Profiles/ AcProfile<TAddress> — user profile with name, media, address FK
ServiceProviders/ AcCompany<...> — company entity with owner, users, commission
Users/ AcUser<...>, AcUserToCompany<...>, AcUserTokenBase — user, junction table, auth tokens

Root Files

  • PermissionContextMappingSubjectType.cs — Enum: NotDefined(0), User(5), Group(10).
  • AcLogItemWriterBase.cs — Generic log writer AcLogItemWriterBase<TLogItem> extending AcLogWriterBase. Thread-safe via mutex. Abstract WriteLogItemCallback() for concrete implementations.
  • AcModelDtoExtension.cs — Extension methods for entity-to-DTO conversion via Activator.CreateInstance.

Key Design Patterns

  • Abstract + Generic — All entities are abstract with generic type parameters for navigation properties (e.g., AcCompany<TUser, TUserToCompany, TProfile, TAddress>). This allows different applications to compose concrete types.
  • Interface implementation — Each entity implements its corresponding AyCode.Interfaces interface.
  • Timestamps — All entities implement ITimeStampInfo (Created, Modified).
  • Guid PKs — Most entities use Guid Id as primary key; AcUserTokenBase uses int Id (auto-increment).

Dependencies

Dependency Purpose
AyCode.Interfaces Interface contracts this project implements
MessagePack.Annotations [MessagePackObject] on AcLogItemClient