Skip to content

Commit

Permalink
replaced serviceRequest DTOs with autogenerated types
Browse files Browse the repository at this point in the history
  • Loading branch information
emmahuangg committed Oct 21, 2023
1 parent 1112594 commit 5df89a2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 20 deletions.
6 changes: 4 additions & 2 deletions backend/typescript/services/interfaces/serviceRequest.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CreateServiceRequestDTO, ServiceRequestDTO } from "../../types";
import { Prisma } from "@prisma/client";

interface IServiceRequest {
// get method here
Expand All @@ -10,7 +10,9 @@ interface IServiceRequest {
* @returns a ServiceRequestDTO with the created serviceRequest's information
* @throws Error if serviceRequest creation fails
*/
postServiceRequest(serviceRequest: CreateServiceRequestDTO): Promise<ServiceRequestDTO>;
postServiceRequest(
serviceRequest: Prisma.serviceRequestCreateInput,
): Promise<Prisma.serviceRequestCreateInput>;

/**
* Delete a serviceRequest by id
Expand Down
19 changes: 1 addition & 18 deletions backend/typescript/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,4 @@ export type NodemailerConfig = {
};
};

export type SignUpMethod = "PASSWORD" | "GOOGLE";

export type ServiceRequestDTO = {
id: string;
requestName: string;
requesterId: string;
location: string;
shiftTime?: Date;
description?: string;
meal?: string;
cookingMethod: string;
frequency: string;
requestType: ServiceRequestType;
};

export type CreateServiceRequestDTO = Omit<ServiceRequestDTO, "id">;

export type ServiceRequestType = "SITE" | "KITCHEN";
export type SignUpMethod = "PASSWORD" | "GOOGLE";

0 comments on commit 5df89a2

Please sign in to comment.