Skip to content

Application and Application.Contracts layer for the content kernel #4

Closed

Description

@duguankui

P0 delivered the Domain and EntityFrameworkCore layers. The Dignite.Sites.Application / .Application.Contracts projects (and the Admin / Public / Common variants) are still template scaffold.

Scope

  • DTOs for Page, ContentType (including its field arrangement), Field, FieldGroup, Content.
  • Application services wrapping the existing domain managers — PageManager, ContentTypeManager, FieldManager, ContentManager — which already hold the invariants, so the app layer should stay thin.
  • Permission definitions and checks.
  • Object mapping (the solution is set up for Mapperly).
  • A DTO shape for flex field values that round-trips the value bag without leaking FlexFieldDictionary into the contract.

Watch out for

  • A content's field values arrive as a loose IDictionary<string, object?>. ContentManager already drops keys the content type does not declare, and validation already runs through the field types. The app layer should not duplicate either.
  • The field rename flow has a mandatory ordering (see FieldManager.RenameAsync). App services must go through the manager and never touch Field.SetName directly, or every stored value for that field becomes unreachable.

References

  • src/Dignite.Sites.Domain/**/*Manager.cs
  • Design doc §2

Activity

  1. added this to the P0 Content kernel milestone on Aug 4, 2026
  2. added
    phase: P0Content kernel - landed, these are follow-ups
    group: 1-interfaceApplication + HttpApi - the gate everything downstream waits on
    on Aug 4, 2026
  3. duguankui commented on Aug 4, 2026

    @duguankui
    MemberAuthor

    Done in 33c8cfd.

    • Common.Application.Contracts: read DTOs for Page/ContentType(+field arrangement)/Field/FieldGroup/Content, shared between Admin and Public.
    • Admin.Application(.Contracts): write DTOs, full CRUD services, permissions. Field rename is its own endpoint/permission (data migration, not a property edit). ContentType delete is guarded against contents still using it.
    • Public.Application(.Contracts): read-only, Page limited to active, Content limited to published-as-of-now. No FieldGroup (admin-only concept).
    • Flex-field value DTO is a plain IDictionary<string, object?>, same shape on read and write, so a GET's FieldValues posts straight back through an UPDATE unchanged.
    • Mapperly mappers per module (ABP's per-module DI scanning doesn't share across assemblies); dictionary/value-object conversions hand-written in Common.Application.
    • Explicit Admin/Public HttpApi controllers (not Auto API Controllers) under /api/site-admin/... and /api/site-public/...; Host wired to the unified Application + HttpApi modules.
    • 122 tests passing (57 domain + 65 EF Core/application integration, including round-trip, rename-migration, delete-guard and flex-field-query-condition coverage).
  4. added a commit that references this issue on Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: content-kernelPage / ContentType / Content / Fieldgroup: 1-interfaceApplication + HttpApi - the gate everything downstream waits onphase: P0Content kernel - landed, these are follow-ups

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions