AyCode.Core/AyCode.Entities
Loretta fbe142c6f3 Add detailed README.md files for all projects and folders
Added comprehensive README.md documentation to every project and subfolder in the solution. Each README describes the purpose, key files, structure, dependencies, and design patterns for its area. This improves codebase navigability and maintainability, and includes a maintenance note to keep docs in sync with future code changes.
2026-03-28 17:24:56 +01:00
..
Addresses Add detailed README.md files for all projects and folders 2026-03-28 17:24:56 +01:00
Groups Add detailed README.md files for all projects and folders 2026-03-28 17:24:56 +01:00
Locations Add detailed README.md files for all projects and folders 2026-03-28 17:24:56 +01:00
LogItems Add detailed README.md files for all projects and folders 2026-03-28 17:24:56 +01:00
Messages Add detailed README.md files for all projects and folders 2026-03-28 17:24:56 +01:00
Profiles Add detailed README.md files for all projects and folders 2026-03-28 17:24:56 +01:00
ServiceProviders Add detailed README.md files for all projects and folders 2026-03-28 17:24:56 +01:00
Users Add detailed README.md files for all projects and folders 2026-03-28 17:24:56 +01:00
AcLogItemWriterBase.cs refactroing, improvements, fixes, etc... 2024-05-18 05:12:23 +02:00
AcModelDtoExtension.cs AcModelDtoExtension improvements 2025-09-12 13:36:11 +02:00
AyCode.Entities.csproj Add .targets file 2025-08-31 13:07:34 +02:00
PermissionContextMappingSubjectType.cs Add PermissionViewSql; fixes 2023-12-13 02:25:58 +01:00
README.md Add detailed README.md files for all projects and folders 2026-03-28 17:24:56 +01:00

README.md

AyCode.Entities

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

LLM Maintenance: If you modify code in this folder, update this README to reflect the changes. If you notice the README content does not match the current code, automatically update the README to match the code.