summaryrefslogtreecommitdiff
path: root/src-migrate/common/types
diff options
context:
space:
mode:
authorIT Fixcomart <it@fixcomart.co.id>2023-11-21 06:10:12 +0000
committerIT Fixcomart <it@fixcomart.co.id>2023-11-21 06:10:12 +0000
commit0fc062268c71d53f8777c358b31e2a540d60d404 (patch)
tree0183a00dcfb14583c7dfa80da082c21630afe375 /src-migrate/common/types
parent6ebe202147269100cd63ef125e877e8f693a27a1 (diff)
parent6a6ce21e5a552b0dc6cd541710a87fd0a0fd9d20 (diff)
Merged in refactor/all (pull request #116)
Refactor/all
Diffstat (limited to 'src-migrate/common/types')
-rw-r--r--src-migrate/common/types/auth.ts58
-rw-r--r--src-migrate/common/types/nav.ts4
-rw-r--r--src-migrate/common/types/odoo.ts6
-rw-r--r--src-migrate/common/types/pageContent.ts5
4 files changed, 73 insertions, 0 deletions
diff --git a/src-migrate/common/types/auth.ts b/src-migrate/common/types/auth.ts
new file mode 100644
index 00000000..65fd06c7
--- /dev/null
+++ b/src-migrate/common/types/auth.ts
@@ -0,0 +1,58 @@
+import { registerSchema } from '../validations/auth';
+import { OdooApiProps } from './odoo';
+import { z } from 'zod';
+
+export type AuthProps = {
+ id: number;
+ parent_id: number;
+ parent_name: string;
+ partner_id: number;
+ name: string;
+ email: string;
+ phone: string;
+ mobile: string;
+ external: boolean;
+ company: boolean;
+ pricelist: string | null;
+ token: string;
+};
+
+export type AuthApiProps = OdooApiProps & { result: AuthProps };
+
+export type RegisterProps = z.infer<typeof registerSchema>;
+
+export type RegisterResApiProps = {
+ register: boolean;
+ reason: 'EMAIL_USED' | 'NOT_ACTIVE' | null;
+};
+
+type ActivationResProps = {
+ activation: boolean;
+ user: AuthProps | null;
+};
+
+export type ActivationTokenProps = {
+ token: string;
+};
+
+export type ActivationTokenResApiProps = ActivationResProps & {
+ reason: 'INVALID_TOKEN' | null;
+};
+
+export type ActivationOtpProps = {
+ email: string;
+ otp: string;
+};
+
+export type ActivationOtpResApiProps = ActivationResProps & {
+ reason: 'INVALID_OTP' | null;
+};
+
+export type ActivationReqProps = {
+ email: string;
+};
+
+export type ActivationReqResApiProps = {
+ activation_request: boolean;
+ reason: 'NOT_FOUND' | 'ACTIVE' | null;
+};
diff --git a/src-migrate/common/types/nav.ts b/src-migrate/common/types/nav.ts
new file mode 100644
index 00000000..ba97b1bf
--- /dev/null
+++ b/src-migrate/common/types/nav.ts
@@ -0,0 +1,4 @@
+export type SecondaryNavItemProps = {
+ label: string
+ href: string
+}
diff --git a/src-migrate/common/types/odoo.ts b/src-migrate/common/types/odoo.ts
new file mode 100644
index 00000000..b34bc667
--- /dev/null
+++ b/src-migrate/common/types/odoo.ts
@@ -0,0 +1,6 @@
+export type OdooApiProps = {
+ status: {
+ code: number;
+ description: string;
+ };
+};
diff --git a/src-migrate/common/types/pageContent.ts b/src-migrate/common/types/pageContent.ts
new file mode 100644
index 00000000..4361deb7
--- /dev/null
+++ b/src-migrate/common/types/pageContent.ts
@@ -0,0 +1,5 @@
+export type PageContentProps = {
+ id: number;
+ url_path: string;
+ content: string;
+} | null;