refactor(data): merge DTO models into schemas
This commit is contained in:
@@ -4,6 +4,11 @@
|
||||
*/
|
||||
import { z } from "zod";
|
||||
|
||||
import {
|
||||
createSchemaModel,
|
||||
type SchemaModel,
|
||||
} from "../../schema_model";
|
||||
|
||||
import {
|
||||
booleanOrFalse,
|
||||
numberOrZero,
|
||||
@@ -20,3 +25,15 @@ export const PwaEventSchema = z.object({
|
||||
|
||||
export type PwaEventInput = z.input<typeof PwaEventSchema>;
|
||||
export type PwaEventData = z.output<typeof PwaEventSchema>;
|
||||
|
||||
type PwaEventPublicKey =
|
||||
| "deviceId"
|
||||
| "deviceType"
|
||||
| "timestamp"
|
||||
| "pwaInstalled"
|
||||
| "pwaSupported";
|
||||
export type PwaEvent = SchemaModel<typeof PwaEventSchema, PwaEventPublicKey>;
|
||||
export const PwaEvent = createSchemaModel<
|
||||
typeof PwaEventSchema,
|
||||
PwaEventPublicKey
|
||||
>(PwaEventSchema);
|
||||
|
||||
Reference in New Issue
Block a user