weliant-types
Shared request, response and constant types for weliant-be, weliant-fe and weliant-landing. Consumers link this folder by local path and read the built dist/, so run npm run build after every change.
Conventions
-
Value enums are a type + const pair, never a TS
enum:export type ApplicationStatus = "PENDING" | "ACCEPTED" | "REJECTED"; export const ApplicationStatus = { PENDING: "PENDING", ACCEPTED: "ACCEPTED", REJECTED: "REJECTED", } as const satisfies { [K in ApplicationStatus]: K }; -
Responses carry every field. Nullable fields are
T | null, never?:. -
Dates are ISO-8601
strings, neverDate. -
Requests for create/edit forms are full replace: a new optional field is a required key typed
T | null, so "unset" is always explicit. -
Naming:
XResponse,XResponseList(list item),XCreateRequest,XEditRequest,XFilters. -
Folder shape:
src/<domain>/{enums,requests,responses,filters,constants}/index.ts, plussrc/<domain>/index.tsre-exporting the subfolders that exist. Every domain is exported fromsrc/index.ts. -
Doc comments state the meaning of
nulland any rule a consumer must not break. -
Double quotes, 2-space indentation.
Public careers API
src/publicCareers is a contract third parties (agency websites) code against. Keep it additive once shipped: add fields, never rename or remove them.