Skip to content

Commit d741cf7

Browse files
committed
feat: add archived status and update form listing documentation
1 parent 31859aa commit d741cf7

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

src/forms/models.tsp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,13 @@ namespace CoreSystem.Forms {
140140
submitted: "SUBMITTED",
141141
}
142142

143-
@doc("The current status of form ")
143+
@doc("The current status of a form.")
144144
enum FormStatus {
145145
draft: "DRAFT",
146146
published: "PUBLISHED",
147+
148+
@doc("Archived: form is hidden from default listings but is still stored and can be accessed directly.")
149+
archived: "ARCHIVED",
147150
}
148151

149152
@doc("The visibility setting of a form. Public forms are visible to all logged-in users. Private forms require a direct link to access.")

src/forms/operations.tsp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ namespace CoreSystem.Forms {
2323
op getFormById(@path id: uuid): Form;
2424

2525
@summary("List Forms")
26-
@doc("List all existing forms.")
26+
@doc("List all existing forms. Archived forms are excluded by default.")
2727
@route("/forms")
2828
@get
2929
op listForms(): Form[];
@@ -89,6 +89,15 @@ namespace CoreSystem.Forms {
8989
@body response: FormPublishResponse;
9090
};
9191

92+
@summary("Archive Form")
93+
@doc("Archive a form. Set status to 'ARCHIVED'. Archived forms are hidden from default lists but can still be accessed directly by ID.")
94+
@route("/forms/{id}/archive")
95+
@post
96+
op archiveForm(@path id: uuid): {
97+
@statusCode statusCode: 200;
98+
@body response: Form;
99+
};
100+
92101
@summary("Get Google Sheet Email")
93102
@doc("Get the Gmail address that should be added to Google Sheet permissions. This address needs to be granted access to the Google Sheet so the system can modify the form.")
94103
@route("/forms/google-sheet-email")

0 commit comments

Comments
 (0)