style: satisfy housekeeping biome gate
This commit is contained in:
1 parent
d1160eb65a
commit
08358b8aa4
62 files changed
+2024
-773
No files matched your search
@@ -11,10 +11,7 @@ import {
|
||||
WebsiteTicketMessage,
|
||||
WebsiteTicketTemplate,
|
||||
} from "@/lib/db";
|
||||
import type {
|
||||
AuditEntry,
|
||||
HousekeepingAuditWriter,
|
||||
} from "@/lib/services/audit";
|
||||
import type { AuditEntry, HousekeepingAuditWriter } from "@/lib/services/audit";
|
||||
import type {
|
||||
HousekeepingCapabilityContext,
|
||||
HousekeepingErrorCode,
|
||||
@@ -62,10 +59,7 @@ export interface PeopleSupportMutationDependencies {
|
||||
snapshot: PeopleSupportMutationSnapshot,
|
||||
outcome: AuditOutcome,
|
||||
) => AuditEntry;
|
||||
readonly failure: (
|
||||
code: HousekeepingErrorCode,
|
||||
messageKey: string,
|
||||
) => Error;
|
||||
readonly failure: (code: HousekeepingErrorCode, messageKey: string) => Error;
|
||||
readonly record: (input: unknown) => Record<string, unknown>;
|
||||
readonly positiveInteger: (value: unknown) => number;
|
||||
readonly nonNegativeInteger: (value: unknown) => number;
|
||||
@@ -74,9 +68,7 @@ export interface PeopleSupportMutationDependencies {
|
||||
max: number,
|
||||
required?: boolean,
|
||||
) => string;
|
||||
readonly canonicalTicketId: (
|
||||
value: string | number | bigint,
|
||||
) => bigint;
|
||||
readonly canonicalTicketId: (value: string | number | bigint) => bigint;
|
||||
readonly auditTargetId: (value: bigint) => number | undefined;
|
||||
}
|
||||
|
||||
@@ -299,19 +291,14 @@ export function createPeopleSupportMutationExecutor(
|
||||
}
|
||||
|
||||
async function executeHelpTicketMutation(
|
||||
operation: Extract<
|
||||
PeopleSupportMutationOperation,
|
||||
`help-ticket.${string}`
|
||||
>,
|
||||
operation: Extract<PeopleSupportMutationOperation, `help-ticket.${string}`>,
|
||||
input: unknown,
|
||||
context: PeopleSupportMutationContext,
|
||||
): Promise<PeopleSupportMutationSnapshot> {
|
||||
const data = record(input);
|
||||
let ticketId: bigint;
|
||||
try {
|
||||
ticketId = canonicalTicketId(
|
||||
data.ticketId as string | number | bigint,
|
||||
);
|
||||
ticketId = canonicalTicketId(data.ticketId as string | number | bigint);
|
||||
} catch {
|
||||
throw failure("VALIDATION", "errors.housekeeping.validation");
|
||||
}
|
||||
@@ -354,11 +341,7 @@ export function createPeopleSupportMutationExecutor(
|
||||
} else if (operation === "help-ticket.status") {
|
||||
const status = normalizedText(data.status, 16);
|
||||
const open =
|
||||
status === "reopen"
|
||||
? true
|
||||
: status === "close"
|
||||
? false
|
||||
: null;
|
||||
status === "reopen" ? true : status === "close" ? false : null;
|
||||
if (open === null) {
|
||||
throw failure("VALIDATION", "errors.housekeeping.validation");
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user