mirror of
https://github.com/hex248/sprint.git
synced 2026-02-08 02:33:01 +00:00
customise organisation issue types
This commit is contained in:
@@ -116,6 +116,21 @@ export const IssuesReplaceStatusRequestSchema = z.object({
|
||||
|
||||
export type IssuesReplaceStatusRequest = z.infer<typeof IssuesReplaceStatusRequestSchema>;
|
||||
|
||||
export const IssuesTypeCountQuerySchema = z.object({
|
||||
organisationId: z.coerce.number().int().positive("organisationId must be a positive integer"),
|
||||
type: z.string().min(1, "Type is required").max(ISSUE_TYPE_MAX_LENGTH),
|
||||
});
|
||||
|
||||
export type IssuesTypeCountQuery = z.infer<typeof IssuesTypeCountQuerySchema>;
|
||||
|
||||
export const IssuesReplaceTypeRequestSchema = z.object({
|
||||
organisationId: z.number().int().positive("organisationId must be a positive integer"),
|
||||
oldType: z.string().min(1, "oldType is required").max(ISSUE_TYPE_MAX_LENGTH),
|
||||
newType: z.string().min(1, "newType is required").max(ISSUE_TYPE_MAX_LENGTH),
|
||||
});
|
||||
|
||||
export type IssuesReplaceTypeRequest = z.infer<typeof IssuesReplaceTypeRequestSchema>;
|
||||
|
||||
export const IssueCommentCreateRequestSchema = z.object({
|
||||
issueId: z.number().int().positive("issueId must be a positive integer"),
|
||||
body: z.string().min(1, "Comment is required").max(ISSUE_COMMENT_MAX_LENGTH),
|
||||
@@ -175,6 +190,14 @@ export const OrgUpdateRequestSchema = z.object({
|
||||
"Features must include all default features",
|
||||
)
|
||||
.optional(),
|
||||
issueTypes: z
|
||||
.record(z.object({ icon: z.string(), color: z.string() }))
|
||||
.refine((obj) => Object.keys(obj).length > 0, "Issue types must have at least one entry")
|
||||
.refine(
|
||||
(obj) => Object.keys(obj).every((key) => key.length <= ISSUE_TYPE_MAX_LENGTH),
|
||||
`Issue type keys must be <= ${ISSUE_TYPE_MAX_LENGTH} characters`,
|
||||
)
|
||||
.optional(),
|
||||
});
|
||||
|
||||
export type OrgUpdateRequest = z.infer<typeof OrgUpdateRequestSchema>;
|
||||
@@ -504,6 +527,18 @@ export const ReplaceStatusResponseSchema = z.object({
|
||||
|
||||
export type ReplaceStatusResponse = z.infer<typeof ReplaceStatusResponseSchema>;
|
||||
|
||||
export const TypeCountResponseSchema = z.object({
|
||||
count: z.number(),
|
||||
});
|
||||
|
||||
export type TypeCountResponse = z.infer<typeof TypeCountResponseSchema>;
|
||||
|
||||
export const ReplaceTypeResponseSchema = z.object({
|
||||
rowCount: z.number(),
|
||||
});
|
||||
|
||||
export type ReplaceTypeResponse = z.infer<typeof ReplaceTypeResponseSchema>;
|
||||
|
||||
// general
|
||||
|
||||
export const SuccessResponseSchema = z.object({
|
||||
|
||||
@@ -10,7 +10,9 @@ export type {
|
||||
IssueResponseType,
|
||||
IssuesByProjectQuery,
|
||||
IssuesReplaceStatusRequest,
|
||||
IssuesReplaceTypeRequest,
|
||||
IssuesStatusCountQuery,
|
||||
IssuesTypeCountQuery,
|
||||
IssueUpdateRequest,
|
||||
LoginRequest,
|
||||
OrgAddMemberRequest,
|
||||
@@ -31,6 +33,7 @@ export type {
|
||||
ProjectUpdateRequest,
|
||||
RegisterRequest,
|
||||
ReplaceStatusResponse,
|
||||
ReplaceTypeResponse,
|
||||
SprintCreateRequest,
|
||||
SprintDeleteRequest,
|
||||
SprintResponseType,
|
||||
@@ -42,6 +45,7 @@ export type {
|
||||
TimerGetQuery,
|
||||
TimerStateType,
|
||||
TimerToggleRequest,
|
||||
TypeCountResponse,
|
||||
UserByUsernameQuery,
|
||||
UserResponse,
|
||||
UserUpdateRequest,
|
||||
@@ -61,7 +65,9 @@ export {
|
||||
IssueResponseSchema,
|
||||
IssuesByProjectQuerySchema,
|
||||
IssuesReplaceStatusRequestSchema,
|
||||
IssuesReplaceTypeRequestSchema,
|
||||
IssuesStatusCountQuerySchema,
|
||||
IssuesTypeCountQuerySchema,
|
||||
IssueUpdateRequestSchema,
|
||||
LoginRequestSchema,
|
||||
OrgAddMemberRequestSchema,
|
||||
@@ -85,6 +91,7 @@ export {
|
||||
ProjectUpdateRequestSchema,
|
||||
RegisterRequestSchema,
|
||||
ReplaceStatusResponseSchema,
|
||||
ReplaceTypeResponseSchema,
|
||||
SprintCreateRequestSchema,
|
||||
SprintDeleteRequestSchema,
|
||||
SprintRecordSchema,
|
||||
@@ -96,6 +103,7 @@ export {
|
||||
TimerGetQuerySchema,
|
||||
TimerStateSchema,
|
||||
TimerToggleRequestSchema,
|
||||
TypeCountResponseSchema,
|
||||
UserByUsernameQuerySchema,
|
||||
UserResponseSchema,
|
||||
UserUpdateRequestSchema,
|
||||
@@ -105,6 +113,7 @@ export {
|
||||
ISSUE_DESCRIPTION_MAX_LENGTH,
|
||||
ISSUE_STATUS_MAX_LENGTH,
|
||||
ISSUE_TITLE_MAX_LENGTH,
|
||||
ISSUE_TYPE_MAX_LENGTH,
|
||||
ORG_DESCRIPTION_MAX_LENGTH,
|
||||
ORG_NAME_MAX_LENGTH,
|
||||
ORG_SLUG_MAX_LENGTH,
|
||||
@@ -145,6 +154,7 @@ export type {
|
||||
} from "./schema";
|
||||
export {
|
||||
DEFAULT_FEATURES,
|
||||
DEFAULT_ISSUE_TYPES,
|
||||
DEFAULT_SPRINT_COLOUR,
|
||||
DEFAULT_STATUS_COLOUR,
|
||||
DEFAULT_STATUS_COLOURS,
|
||||
|
||||
Reference in New Issue
Block a user