summaryrefslogtreecommitdiff
path: root/src/common/types
diff options
context:
space:
mode:
authorRafi Zadanly <zadanlyr@gmail.com>2023-11-09 15:40:16 +0700
committerRafi Zadanly <zadanlyr@gmail.com>2023-11-09 15:40:16 +0700
commitbe0f537dc4fe384eef09436833c6407e6482c16d (patch)
tree194b1ad3f34396cb8149075bbbd38b854aedf361 /src/common/types
parent5d5401ae36e7e0c8eb38ccd943c1aa44a9573d35 (diff)
Initial commit
Diffstat (limited to 'src/common/types')
-rw-r--r--src/common/types/auth.ts6
-rw-r--r--src/common/types/select.ts4
-rw-r--r--src/common/types/stockOpname.ts33
-rw-r--r--src/common/types/team.ts7
4 files changed, 50 insertions, 0 deletions
diff --git a/src/common/types/auth.ts b/src/common/types/auth.ts
new file mode 100644
index 0000000..50d176f
--- /dev/null
+++ b/src/common/types/auth.ts
@@ -0,0 +1,6 @@
+import { Company, User } from "@prisma/client";
+
+export type Credential = User & {
+ company: Company;
+ token: string;
+};
diff --git a/src/common/types/select.ts b/src/common/types/select.ts
new file mode 100644
index 0000000..f61dc08
--- /dev/null
+++ b/src/common/types/select.ts
@@ -0,0 +1,4 @@
+export type SelectOption = {
+ value: string | number;
+ label: string;
+};
diff --git a/src/common/types/stockOpname.ts b/src/common/types/stockOpname.ts
new file mode 100644
index 0000000..762722a
--- /dev/null
+++ b/src/common/types/stockOpname.ts
@@ -0,0 +1,33 @@
+import { Location, Team, User } from "@prisma/client";
+
+export type DetailTeam = {
+ [key in keyof typeof Team]: {
+ quantity?: number;
+ user?: User;
+ };
+};
+
+export type StockOpnameRequest = {
+ location: number;
+ product: number;
+ quantity: number;
+};
+
+export type StockOpnameRes = {
+ result: {
+ id: number;
+ name: string;
+ itemCode: string;
+ barcode: string;
+ onhandQty: number;
+ differenceQty: number;
+ isDifferent: boolean;
+ quantity: {
+ [key in keyof typeof Team]: number | null;
+ };
+ };
+ page: number;
+ totalPage: number;
+};
+
+export type StockOpnameLocationRes = Location & DetailTeam;
diff --git a/src/common/types/team.ts b/src/common/types/team.ts
new file mode 100644
index 0000000..0989337
--- /dev/null
+++ b/src/common/types/team.ts
@@ -0,0 +1,7 @@
+import { Team } from "@prisma/client";
+
+export type TeamAliases = {
+ [key in keyof typeof Team]: {
+ name: string;
+ };
+};