diff --git a/src/controllers/branch/branch-controller.ts b/src/controllers/branch/branch-controller.ts index 99e78b2..ef032bd 100644 --- a/src/controllers/branch/branch-controller.ts +++ b/src/controllers/branch/branch-controller.ts @@ -1,4 +1,4 @@ -import { Prisma } from "@prisma/client"; +import { Prisma, Status } from "@prisma/client"; import { Body, Controller, @@ -18,6 +18,45 @@ import prisma from "../../db"; import HttpError from "../../interfaces/http-error"; import HttpStatus from "../../interfaces/http-status"; import { RequestWithUser } from "../../interfaces/user"; + +type BranchCreate = { + code: string; + taxNo: string; + nameEN: string; + nameTH: string; + addressEN: string; + addressTH: string; + zipCode: string; + email: string; + telephoneNo: string; + longitude: string; + latitude: string; + + subDistrictId?: string | null; + districtId?: string | null; + provinceId?: string | null; + headOfficeId?: string | null; +}; + +type BranchUpdate = { + code?: string; + taxNo?: string; + nameEN?: string; + nameTH?: string; + addressEN?: string; + addressTH?: string; + zipCode?: string; + email?: string; + telephoneNo?: string; + longitude?: string; + latitude?: string; + + subDistrictId?: string | null; + districtId?: string | null; + provinceId?: string | null; + headOfficeId?: string | null; +}; + @Route("api/branch") @Tags("Branch") @Security("keycloak")