feat: add type for create and update endpoint
This commit is contained in:
parent
9938dba0e1
commit
95463dfe7c
1 changed files with 40 additions and 1 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
import { Prisma } from "@prisma/client";
|
import { Prisma, Status } from "@prisma/client";
|
||||||
import {
|
import {
|
||||||
Body,
|
Body,
|
||||||
Controller,
|
Controller,
|
||||||
|
|
@ -18,6 +18,45 @@ import prisma from "../../db";
|
||||||
import HttpError from "../../interfaces/http-error";
|
import HttpError from "../../interfaces/http-error";
|
||||||
import HttpStatus from "../../interfaces/http-status";
|
import HttpStatus from "../../interfaces/http-status";
|
||||||
import { RequestWithUser } from "../../interfaces/user";
|
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")
|
@Route("api/branch")
|
||||||
@Tags("Branch")
|
@Tags("Branch")
|
||||||
@Security("keycloak")
|
@Security("keycloak")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue