mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-23 14:55:44 +00:00
feat(FE): Add constants transformation utilities and API service
This commit is contained in:
+86
@@ -0,0 +1,86 @@
|
||||
import { OptionType } from '@/components/input/SelectInput';
|
||||
|
||||
export type ApprovalWorkflowStep = {
|
||||
step_number: number;
|
||||
step_name: string;
|
||||
};
|
||||
|
||||
export type ApprovalWorkflow = {
|
||||
key: string;
|
||||
steps: ApprovalWorkflowStep[];
|
||||
};
|
||||
|
||||
export type ProductFlagMappingOption = {
|
||||
flag: string;
|
||||
sub_flags: string[];
|
||||
allow_without_sub_flag: boolean;
|
||||
};
|
||||
|
||||
export type ProductFlagMappingApiResponse = {
|
||||
flags: string[];
|
||||
options: ProductFlagMappingOption[];
|
||||
sub_flag_to_flag: Record<string, string>;
|
||||
};
|
||||
|
||||
export type AdjustmentTransactionSubtypes = {
|
||||
RECORDING: string[];
|
||||
PENJUALAN: string[];
|
||||
PEMBELIAN: string[];
|
||||
};
|
||||
|
||||
export type StockLogConfig = {
|
||||
log_types: string[];
|
||||
transaction_types: string[];
|
||||
};
|
||||
|
||||
export type ConstantsApiResponse = {
|
||||
warehouse_types: string[];
|
||||
supplier_categories: string[];
|
||||
customer_supplier_types: string[];
|
||||
adjustment: {
|
||||
transaction_subtypes: AdjustmentTransactionSubtypes;
|
||||
};
|
||||
approval_workflows: ApprovalWorkflow[];
|
||||
flags: string[];
|
||||
product_flag_mapping: ProductFlagMappingApiResponse;
|
||||
legacy_flag_aliases: Record<string, string>;
|
||||
stock_log: StockLogConfig;
|
||||
};
|
||||
|
||||
export type ProductFlagMappingOptionUI = {
|
||||
flag: OptionType;
|
||||
sub_flags: OptionType[];
|
||||
allow_without_sub_flag: boolean;
|
||||
};
|
||||
|
||||
export type ProductFlagMappingUI = {
|
||||
flags: OptionType[];
|
||||
options: ProductFlagMappingOptionUI[];
|
||||
sub_flag_to_flag: Record<string, string>;
|
||||
};
|
||||
|
||||
export type ApprovalWorkflowUI = {
|
||||
key: string;
|
||||
steps: OptionType[];
|
||||
};
|
||||
|
||||
export type TransformedConstants = {
|
||||
warehouse_types: OptionType[];
|
||||
supplier_categories: OptionType[];
|
||||
customer_supplier_types: OptionType[];
|
||||
adjustment: {
|
||||
transaction_subtypes: {
|
||||
RECORDING: OptionType[];
|
||||
PENJUALAN: OptionType[];
|
||||
PEMBELIAN: OptionType[];
|
||||
};
|
||||
};
|
||||
approval_workflows: ApprovalWorkflowUI[];
|
||||
flags: OptionType[];
|
||||
product_flag_mapping: ProductFlagMappingUI;
|
||||
legacy_flag_aliases: OptionType[];
|
||||
stock_log: {
|
||||
log_types: OptionType[];
|
||||
transaction_types: OptionType[];
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user