{
    "name": "post",
    "description": "entity 훅 예제 — after_get/after_list 시 관련 엔티티 데이터를 자동 주입",
    "fields": {
        "author_seq": {
            "index": true,
            "comment": "작성자 user seq",
            "required": true
        },
        "title": {
            "index": true,
            "comment": "제목",
            "required": true
        },
        "status": {
            "index": true,
            "comment": "상태",
            "type": [
                "draft",
                "published",
                "hidden"
            ],
            "default": "draft"
        },
        "comment_count": {
            "index": true,
            "comment": "댓글 수 (*_count → INT 자동 추론)"
        },
        "like_count": {
            "index": true,
            "comment": "좋아요 수 (*_count → INT 자동 추론)"
        },
        "published_at": {
            "index": true,
            "comment": "게시일시 (*_at → DATETIME 자동 추론)"
        }
    },
    "hooks": {
        "after_get": [
            {
                "comment": "게시글 조회 시 작성자 프로필 자동 주입",
                "type": "entity",
                "entity": "user",
                "action": "get",
                "conditions": {
                    "seq": "${new.author_seq}"
                },
                "assign_to": "author"
            },
            {
                "comment": "게시글 조회 시 최근 댓글 10개 자동 주입",
                "type": "entity",
                "entity": "comment",
                "action": "list",
                "conditions": {
                    "post_seq": "${new.seq}",
                    "status": "visible"
                },
                "assign_to": "comments"
            }
        ],
        "after_list": [
            {
                "comment": "목록 조회 시 각 게시글에 작성자 이름 주입",
                "type": "entity",
                "entity": "user",
                "action": "get",
                "conditions": {
                    "seq": "${new.author_seq}"
                },
                "assign_to": "author"
            }
        ]
    }
}
