refactor(data): merge DTO models into schemas
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
export const FEEDBACK_CATEGORIES = [
|
||||
"problem",
|
||||
"suggestion",
|
||||
"payment",
|
||||
"other",
|
||||
] as const;
|
||||
|
||||
export type FeedbackCategory = (typeof FEEDBACK_CATEGORIES)[number];
|
||||
|
||||
export interface FeedbackContext {
|
||||
appVersion: string;
|
||||
platform: string;
|
||||
browser: string;
|
||||
viewport: string;
|
||||
}
|
||||
|
||||
export interface SubmitFeedbackInput {
|
||||
category: FeedbackCategory;
|
||||
content: string;
|
||||
context: FeedbackContext;
|
||||
images: readonly File[];
|
||||
}
|
||||
@@ -1 +1,6 @@
|
||||
/**
|
||||
* @file Automatically generated by barrelsby.
|
||||
*/
|
||||
|
||||
export * from "./feedback_submission";
|
||||
export * from "./response";
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
import { z } from "zod";
|
||||
|
||||
import {
|
||||
createSchemaModel,
|
||||
type SchemaModel,
|
||||
} from "../../schema_model";
|
||||
|
||||
export const FeedbackSubmitResponseSchema = z.object({
|
||||
feedbackId: z.string().min(1),
|
||||
});
|
||||
@@ -10,3 +15,12 @@ export type FeedbackSubmitResponseInput = z.input<
|
||||
export type FeedbackSubmitResponseData = z.output<
|
||||
typeof FeedbackSubmitResponseSchema
|
||||
>;
|
||||
|
||||
export type FeedbackSubmitResponse = SchemaModel<
|
||||
typeof FeedbackSubmitResponseSchema,
|
||||
"feedbackId"
|
||||
>;
|
||||
export const FeedbackSubmitResponse = createSchemaModel<
|
||||
typeof FeedbackSubmitResponseSchema,
|
||||
"feedbackId"
|
||||
>(FeedbackSubmitResponseSchema);
|
||||
|
||||
@@ -1 +1,5 @@
|
||||
/**
|
||||
* @file Automatically generated by barrelsby.
|
||||
*/
|
||||
|
||||
export * from "./feedback_submit_response";
|
||||
|
||||
Reference in New Issue
Block a user