From 1f5cb3063a025c761d492abbf9696f6f1ba0f567 Mon Sep 17 00:00:00 2001 From: kay Date: Sat, 13 Jun 2026 19:40:37 +0800 Subject: [PATCH] add close form api --- src/form/models.tsp | 3 +++ src/form/operations.tsp | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/src/form/models.tsp b/src/form/models.tsp index efb8618a..d4e79344 100644 --- a/src/form/models.tsp +++ b/src/form/models.tsp @@ -240,6 +240,9 @@ namespace CoreSystem.Forms { @doc("Archived: form is hidden from default listings but is still stored and can be accessed directly.") archived: "ARCHIVED", + + @doc("Closed: form is no longer accepting responses, but remains visible or accessible depending on visibility.") + closed: "CLOSED", } @doc("The visibility setting of a form. Public forms are visible to all logged-in users. Private forms require a direct link to access.") diff --git a/src/form/operations.tsp b/src/form/operations.tsp index a4ea1a09..c8a7aa78 100644 --- a/src/form/operations.tsp +++ b/src/form/operations.tsp @@ -55,6 +55,15 @@ namespace CoreSystem.Forms { @body response: FormResponse; }; + @summary("Close Form") + @doc("Close a form. Set status to 'CLOSED'. Closed forms are no longer accepting responses.") + @route("/forms/{formId}/close") + @post + op closeForm(@path formId: uuid): { + @statusCode statusCode: 200; + @body response: FormResponse; + }; + // === Cover Image Operations === @summary("Get Form Cover Image") @doc("Get the cover image binary data. Returns the image in WebP format.")