supported apps domain + some refactor of data types redundancy
This commit is contained in:
28
packages/logic/domains/supported-app/data.ts
Normal file
28
packages/logic/domains/supported-app/data.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import * as v from "valibot";
|
||||
|
||||
export const supportedAppSchema = v.object({
|
||||
id: v.number(),
|
||||
title: v.string(),
|
||||
packageName: v.string(),
|
||||
createdAt: v.date(),
|
||||
updatedAt: v.date(),
|
||||
});
|
||||
export type SupportedApp = v.InferOutput<typeof supportedAppSchema>;
|
||||
|
||||
export const createSupportedAppSchema = v.object({
|
||||
title: v.pipe(v.string(), v.minLength(1)),
|
||||
packageName: v.pipe(v.string(), v.minLength(1)),
|
||||
});
|
||||
export type CreateSupportedApp = v.InferOutput<
|
||||
typeof createSupportedAppSchema
|
||||
>;
|
||||
|
||||
export const updateSupportedAppSchema = v.partial(
|
||||
v.object({
|
||||
title: v.string(),
|
||||
packageName: v.string(),
|
||||
}),
|
||||
);
|
||||
export type UpdateSupportedApp = v.InferOutput<
|
||||
typeof updateSupportedAppSchema
|
||||
>;
|
||||
Reference in New Issue
Block a user