Skip to content

Commit d69e109

Browse files
fix: example form uuid
1 parent 6b0804a commit d69e109

6 files changed

Lines changed: 52 additions & 13 deletions

File tree

packages/sdk/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"email": "contact@sdc.nycu.club",
1515
"url": "https://sdc.nycu.club"
1616
},
17+
"type": "module",
1718
"main": "dist/index.js",
1819
"types": "dist/index.d.ts",
1920
"files": [

src/form/answer/models.tsp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,11 @@ namespace CoreSystem.Responses {
102102

103103
@doc("Response model for the uploaded files and auto-created answer")
104104
@example(#{
105-
id: "a12b3c4d-5e6f-7g8h-9i0j-k1l2m3n4o5p6",
105+
id: "a12b3c4d-5e6f-7a8b-9c0d-e1f2a3b4c5d6",
106106
answer: #{
107107
createdAt: utcDateTime.fromISO("2025-02-15T10:00:00Z"),
108108
updatedAt: utcDateTime.fromISO("2025-02-17T16:45:00Z"),
109-
responseId: "a12b3c4d-5e6f-7g8h-9i0j-k1l2m3n4o5p6",
109+
responseId: "a12b3c4d-5e6f-7a8b-9c0d-e1f2a3b4c5d6",
110110
answer: #{ questionId: "ee894524-4bd8-4a64-8fd2-a53b39ca94cd", questionType: CoreSystem.Forms.QuestionTypes.shortText, value: "John Doe" },
111111
displayValue: "John Doe",
112112
},
@@ -120,11 +120,11 @@ namespace CoreSystem.Responses {
120120
}
121121

122122
@example(#{
123-
id: "a12b3c4d-5e6f-7g8h-9i0j-k1l2m3n4o5p6",
123+
id: "a12b3c4d-5e6f-7a8b-9c0d-e1f2a3b4c5d6",
124124
answer: #{
125125
createdAt: utcDateTime.fromISO("2025-02-15T10:00:00Z"),
126126
updatedAt: utcDateTime.fromISO("2025-02-17T16:45:00Z"),
127-
responseId: "a12b3c4d-5e6f-7g8h-9i0j-k1l2m3n4o5p6",
127+
responseId: "a12b3c4d-5e6f-7a8b-9c0d-e1f2a3b4c5d6",
128128
answer: #{ questionId: "ee894524-4bd8-4a64-8fd2-a53b39ca94cd", questionType: CoreSystem.Forms.QuestionTypes.shortText, value: "John Doe" },
129129
displayValue: "John Doe",
130130
},
@@ -151,7 +151,7 @@ namespace CoreSystem.Responses {
151151
payload: #{
152152
createdAt: utcDateTime.fromISO("2025-02-15T10:00:00Z"),
153153
updatedAt: utcDateTime.fromISO("2025-02-17T16:45:00Z"),
154-
responseId: "a12b3c4d-5e6f-7g8h-9i0j-k1l2m3n4o5p6",
154+
responseId: "a12b3c4d-5e6f-7a8b-9c0d-e1f2a3b4c5d6",
155155
answer: #{ questionId: "ee894524-4bd8-4a64-8fd2-a53b39ca94cd", questionType: CoreSystem.Forms.QuestionTypes.shortText, value: "John Doe" },
156156
displayValue: "John Doe",
157157
},
@@ -168,7 +168,7 @@ namespace CoreSystem.Responses {
168168
@example(#{
169169
createdAt: utcDateTime.fromISO("2025-02-15T10:00:00Z"),
170170
updatedAt: utcDateTime.fromISO("2025-02-17T16:45:00Z"),
171-
responseId: "a12b3c4d-5e6f-7g8h-9i0j-k1l2m3n4o5p6",
171+
responseId: "a12b3c4d-5e6f-7a8b-9c0d-e1f2a3b4c5d6",
172172
answer: #{ questionId: "ee894524-4bd8-4a64-8fd2-a53b39ca94cd", questionType: CoreSystem.Forms.QuestionTypes.shortText, value: "John Doe" },
173173
displayValue: "John Doe",
174174
})

src/form/models.tsp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ namespace CoreSystem.Forms {
6060
publishTime: utcDateTime.fromISO("2025-02-01T00:00:00Z"),
6161
messageAfterSubmission: "Thank you for your application! We'll get back to you soon.",
6262
dressing: #{ color: "#0066cc", headerFont: "LINESeedTW", questionFont: "LINESeedTW", textFont: "LINESeedTW" },
63-
coverImage: "https://example.com/images/form-cover.webp",
63+
coverImage: "https://placehold.co/1800x600/0066cc/white.webp?text=SDC+2025+Recruitment",
6464
googleSheetUrl: "https://docs.google.com/spreadsheets/d/1ABC123/edit",
6565
visibility: FormVisibility.public,
6666
createdAt: utcDateTime.fromISO("2025-01-15T10:00:00Z"),

src/form/response/models.tsp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ using Http;
22

33
namespace CoreSystem.Responses {
44
@doc("Response model for creating a form response")
5-
@example(#{ id: "a12b3c4d-5e6f-7g8h-9i0j-k1l2m3n4o5p6" })
5+
@example(#{ id: "a12b3c4d-5e6f-7a8b-9c0d-e1f2a3b4c5d6" })
66
model CreateResponse {
77
@doc("The response's unique identifier.")
88
id: uuid;
99
}
1010

1111
@doc("Response model for updating a form response")
1212
@example(#{
13-
id: "a12b3c4d-5e6f-7g8h-9i0j-k1l2m3n4o5p6",
13+
id: "a12b3c4d-5e6f-7a8b-9c0d-e1f2a3b4c5d6",
1414
updatedAt: utcDateTime.fromISO("2025-02-17T16:45:00Z"),
1515
answers: #[],
1616
})
@@ -27,7 +27,7 @@ namespace CoreSystem.Responses {
2727

2828
@doc("Response model for a single response in list view")
2929
@example(#{
30-
id: "a12b3c4d-5e6f-7g8h-9i0j-k1l2m3n4o5p6",
30+
id: "a12b3c4d-5e6f-7a8b-9c0d-e1f2a3b4c5d6",
3131
submittedBy: "3c5fa073-7b97-43a3-bc44-ddc98f390a08",
3232
createdAt: utcDateTime.fromISO("2025-02-15T10:00:00Z"),
3333
updatedAt: utcDateTime.fromISO("2025-02-17T16:45:00Z"),
@@ -58,7 +58,7 @@ namespace CoreSystem.Responses {
5858

5959
@doc("Response model for getting a specific form response")
6060
@example(#{
61-
id: "a12b3c4d-5e6f-7g8h-9i0j-k1l2m3n4o5p6",
61+
id: "a12b3c4d-5e6f-7a8b-9c0d-e1f2a3b4c5d6",
6262
formId: "9a843aa0-8451-4e3b-b6a0-8c0e994e9040",
6363
progress: ResponseProgress.draft,
6464
sections: #[],

src/org/form/models.tsp

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,25 @@ namespace CoreSystem.Unit {
77
}
88

99
@doc("Response model for listing user forms with status")
10+
@example(#{
11+
id: "5a1b2c3d-4e5f-6789-0abc-def123456789",
12+
title: "Annual Survey 2026",
13+
deadline: utcDateTime.fromISO("2026-03-31T23:59:59Z"),
14+
status: UserFormStatus.not_started,
15+
})
1016
@example(#{
1117
id: "9a843aa0-8451-4e3b-b6a0-8c0e994e9040",
1218
title: "SDC 2025 Recruitment Form",
1319
deadline: utcDateTime.fromISO("2025-03-31T23:59:59Z"),
1420
status: UserFormStatus.in_progress,
15-
responseIds: #["a12b3c4d-5e6f-7g8h-9i0j-k1l2m3n4o5p6"],
21+
responseIds: #["a12b3c4d-5e6f-7a8b-9c0d-e1f2a3b4c5d6"],
22+
})
23+
@example(#{
24+
id: "7f6e5d4c-3b2a-1098-7654-321fedcba098",
25+
title: "Member Information Update 2025",
26+
deadline: utcDateTime.fromISO("2025-02-15T23:59:59Z"),
27+
status: UserFormStatus.completed,
28+
responseIds: #["b23c4d5e-6f7a-8b9c-0d1e-f2a3b4c5d6e7", "c34d5e6f-7a8b-9c0d-1e2f-a3b4c5d6e7f8"],
1629
})
1730
model UserForm {
1831
@doc("The unique identifier of the form")
@@ -30,4 +43,29 @@ namespace CoreSystem.Unit {
3043
@doc("The unique identifiers of the user's responses to the form, if they exist")
3144
responseIds?: uuid[];
3245
}
46+
47+
@doc("Response model for listing all forms of current user")
48+
@example(#[
49+
#{
50+
id: "5a1b2c3d-4e5f-6789-0abc-def123456789",
51+
title: "Annual Survey 2026",
52+
deadline: utcDateTime.fromISO("2026-03-31T23:59:59Z"),
53+
status: UserFormStatus.not_started,
54+
},
55+
#{
56+
id: "9a843aa0-8451-4e3b-b6a0-8c0e994e9040",
57+
title: "SDC 2025 Recruitment Form",
58+
deadline: utcDateTime.fromISO("2025-03-31T23:59:59Z"),
59+
status: UserFormStatus.in_progress,
60+
responseIds: #["a12b3c4d-5e6f-7a8b-9c0d-e1f2a3b4c5d6"],
61+
},
62+
#{
63+
id: "7f6e5d4c-3b2a-1098-7654-321fedcba098",
64+
title: "Member Information Update 2025",
65+
deadline: utcDateTime.fromISO("2025-02-15T23:59:59Z"),
66+
status: UserFormStatus.completed,
67+
responseIds: #["b23c4d5e-6f7a-8b9c-0d1e-f2a3b4c5d6e7", "c34d5e6f-7a8b-9c0d-1e2f-a3b4c5d6e7f8"],
68+
},
69+
])
70+
model UserFormListResponse is UserForm[];
3371
}

src/org/operations.tsp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,5 +77,5 @@ namespace CoreSystem.Unit {
7777
@doc("List all forms of current user")
7878
@route("/forms/me")
7979
@get
80-
op listFormsOfCurrentUser(): UserForm[];
80+
op listFormsOfCurrentUser(): UserFormListResponse;
8181
}

0 commit comments

Comments
 (0)