- HouseView gagne adminId/inviteCode/members (HouseMemberView) - createHouseSchema, joinHouseSchema - deleteAccountSchema (nouveau packages/shared/src/schemas/account.ts) - ErrorCode: ALREADY_HAS_HOUSE, NOT_HOUSE_ADMIN, INVITE_CODE_NOT_FOUND
15 lines
649 B
TypeScript
15 lines
649 B
TypeScript
import { z } from "zod";
|
|
|
|
// See schemas/auth.ts for the shared client/server validation rationale.
|
|
|
|
/**
|
|
* Payload accepted by `DELETE /auth/me`. Deleting an account is
|
|
* irreversible, so it's gated behind re-entering the current password —
|
|
* same idea as `loginSchema`'s password field (presence only, the API does
|
|
* the real `argon2.verify`), not a fresh set of complexity rules.
|
|
*/
|
|
export const deleteAccountSchema = z.object({
|
|
password: z.string().min(1, "Le mot de passe est requis"),
|
|
});
|
|
/** Inferred TS type for {@link deleteAccountSchema}'s validated output. */
|
|
export type DeleteAccountInput = z.infer<typeof deleteAccountSchema>;
|