Skip to content

Instantly share code, notes, and snippets.

@dsibinski
Created July 9, 2022 15:43
Show Gist options
  • Save dsibinski/64cb91fade703c4bbf6ade4c6ad84d19 to your computer and use it in GitHub Desktop.
Save dsibinski/64cb91fade703c4bbf6ade4c6ad84d19 to your computer and use it in GitHub Desktop.
import { z } from "zod";
import { AddressViewModelSchema } from "./addressViewModel";
export const UserViewModelSchema = z.object({
id: z.string().uuid(),
name: z.string(),
lastName: z.string(),
login: z.string(),
isActive: z.boolean(),
loyaltyPoints: z.number(),
address: AddressViewModelSchema.nullable(),
});
export type UserViewModel = z.infer<typeof UserViewModelSchema>;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment