From 741884ac296b837625f16de0aacf4e7702c04039 Mon Sep 17 00:00:00 2001 From: rstubryan Date: Tue, 3 Mar 2026 14:02:06 +0700 Subject: [PATCH] feat(FE): Add filter schemas and types for master data components --- .../pages/master-data/kandang/filter/KandangFilter.ts | 11 +++++++++++ .../master-data/location/filter/LocationFilter.ts | 9 +++++++++ .../pages/master-data/product/filter/ProductFilter.ts | 9 +++++++++ .../filter/ProductionStandardFilter.ts | 9 +++++++++ .../master-data/supplier/filter/SupplierFilter.ts | 11 +++++++++++ .../master-data/warehouse/filter/WarehouseFilter.ts | 11 +++++++++++ 6 files changed, 60 insertions(+) create mode 100644 src/components/pages/master-data/kandang/filter/KandangFilter.ts create mode 100644 src/components/pages/master-data/location/filter/LocationFilter.ts create mode 100644 src/components/pages/master-data/product/filter/ProductFilter.ts create mode 100644 src/components/pages/master-data/production-standard/filter/ProductionStandardFilter.ts create mode 100644 src/components/pages/master-data/supplier/filter/SupplierFilter.ts create mode 100644 src/components/pages/master-data/warehouse/filter/WarehouseFilter.ts diff --git a/src/components/pages/master-data/kandang/filter/KandangFilter.ts b/src/components/pages/master-data/kandang/filter/KandangFilter.ts new file mode 100644 index 00000000..30132611 --- /dev/null +++ b/src/components/pages/master-data/kandang/filter/KandangFilter.ts @@ -0,0 +1,11 @@ +import { string, object } from 'yup'; + +export const KandangFilterSchema = object().shape({ + location_id: string().nullable(), + pic_id: string().nullable(), +}); + +export type KandangFilterType = { + location_id: string | null; + pic_id: string | null; +}; diff --git a/src/components/pages/master-data/location/filter/LocationFilter.ts b/src/components/pages/master-data/location/filter/LocationFilter.ts new file mode 100644 index 00000000..1235d782 --- /dev/null +++ b/src/components/pages/master-data/location/filter/LocationFilter.ts @@ -0,0 +1,9 @@ +import { string, object } from 'yup'; + +export const LocationFilterSchema = object().shape({ + area_id: string().nullable(), +}); + +export type LocationFilterType = { + area_id: string | null; +}; diff --git a/src/components/pages/master-data/product/filter/ProductFilter.ts b/src/components/pages/master-data/product/filter/ProductFilter.ts new file mode 100644 index 00000000..365dc5de --- /dev/null +++ b/src/components/pages/master-data/product/filter/ProductFilter.ts @@ -0,0 +1,9 @@ +import { string, object } from 'yup'; + +export const ProductFilterSchema = object().shape({ + product_category_id: string().nullable(), +}); + +export type ProductFilterType = { + product_category_id: string | null; +}; diff --git a/src/components/pages/master-data/production-standard/filter/ProductionStandardFilter.ts b/src/components/pages/master-data/production-standard/filter/ProductionStandardFilter.ts new file mode 100644 index 00000000..cec77dda --- /dev/null +++ b/src/components/pages/master-data/production-standard/filter/ProductionStandardFilter.ts @@ -0,0 +1,9 @@ +import { string, object } from 'yup'; + +export const ProductionStandardFilterSchema = object().shape({ + project_category: string().nullable(), +}); + +export type ProductionStandardFilterType = { + project_category: string | null; +}; diff --git a/src/components/pages/master-data/supplier/filter/SupplierFilter.ts b/src/components/pages/master-data/supplier/filter/SupplierFilter.ts new file mode 100644 index 00000000..4eaa3a1f --- /dev/null +++ b/src/components/pages/master-data/supplier/filter/SupplierFilter.ts @@ -0,0 +1,11 @@ +import { string, boolean, object } from 'yup'; + +export const SupplierFilterSchema = object().shape({ + category_id: string().nullable(), + flag: boolean().nullable(), +}); + +export type SupplierFilterType = { + category_id: string | null; + flag: boolean | null; +}; diff --git a/src/components/pages/master-data/warehouse/filter/WarehouseFilter.ts b/src/components/pages/master-data/warehouse/filter/WarehouseFilter.ts new file mode 100644 index 00000000..1a9a5593 --- /dev/null +++ b/src/components/pages/master-data/warehouse/filter/WarehouseFilter.ts @@ -0,0 +1,11 @@ +import { string, boolean, object } from 'yup'; + +export const WarehouseFilterSchema = object().shape({ + area_id: string().nullable(), + active_project_flock: boolean().nullable(), +}); + +export type WarehouseFilterType = { + area_id: string | null; + active_project_flock: boolean | null; +};