Skip to content

Implement Type Autocreation Option #34

@FerdinandSu

Description

@FerdinandSu

Description / 描述

English:
Currently, when inserting an entry with an undefined type, the API throws TypeUndefinedException. Add an option to automatically create types when they don't exist:

  • Add autoCreateType parameter to insert entry endpoint
  • If enabled, automatically create the type with the provided category
  • Return appropriate response indicating type was auto-created

中文:
目前,当插入具有未定义类型的条目时,API 会抛出 TypeUndefinedException。添加一个选项,在类型不存在时自动创建类型:

  • 向插入条目端点添加 autoCreateType 参数
  • 如果启用,则自动使用提供的类别创建类型
  • 返回适当的响应,指示类型已自动创建

Difficulty / 难度

Easy-Medium / 简单-中等

Estimated Time / 预计时间

2-3 hours

Acceptance Criteria / 验收标准

  • Add autoCreateType parameter to Entry model
  • Modify DirectLedgerManager.Insert() logic
  • Return metadata about created type in response
  • Update API documentation
  • Add unit tests for autocreation logic

Before starting, please comment on this issue to let us know you're working on it!
开始前请在此 issue 下评论,让我们知道你正在处理它!

See CONTRIBUTING.md for contribution guidelines.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions