Add conditional localized form definitions
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from datetime import datetime
|
||||
from typing import Any
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
@@ -21,8 +22,24 @@ class FormDefinitionHistoryResponse(BaseModel):
|
||||
revisions: list[dict[str, Any]]
|
||||
|
||||
|
||||
class FormPackageRequest(BaseModel):
|
||||
model_config = ConfigDict(extra="forbid")
|
||||
|
||||
fragment: dict[str, Any]
|
||||
|
||||
|
||||
class FormPackageImportRequest(FormPackageRequest):
|
||||
target_form_id: str | None = Field(default=None, min_length=1, max_length=255)
|
||||
target_key: str | None = Field(default=None, min_length=1, max_length=255)
|
||||
expected_revision: str | None = Field(default=None, min_length=1, max_length=255)
|
||||
change_reason: str = Field(min_length=1, max_length=1000)
|
||||
recorded_at: datetime
|
||||
|
||||
|
||||
__all__ = [
|
||||
"FormDefinitionHistoryResponse",
|
||||
"FormDefinitionListResponse",
|
||||
"FormDefinitionWriteRequest",
|
||||
"FormPackageImportRequest",
|
||||
"FormPackageRequest",
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user