refactor(FE): Update ProductFlagMapping types and related references

This commit is contained in:
rstubryan
2026-03-02 10:15:06 +07:00
parent ef9d820c0d
commit 56d4b8a5c9
2 changed files with 8 additions and 8 deletions
+2 -2
View File
@@ -6,7 +6,7 @@ import { SidebarMenuItem } from '@/components/molecules/SidebarMenu';
import { OptionType } from '@/components/input/SelectInput';
import {
ConstantsApiResponse,
ProductFlagMappingUI,
ProductFlagMapping,
TransformedConstants,
} from '@/types/api/constants/constants';
@@ -226,7 +226,7 @@ export function formatConstantLabel(value: string): string {
*/
export function transformProductFlagMapping(
mapping: ConstantsApiResponse['product_flag_mapping']
): ProductFlagMappingUI {
): ProductFlagMapping {
return {
flags: mapping.flags.map(toOption),
options: mapping.options.map((opt) => ({
+6 -6
View File
@@ -47,19 +47,19 @@ export type ConstantsApiResponse = {
stock_log: StockLogConfig;
};
export type ProductFlagMappingOptionUI = {
export type ProductFlagMappingItem = {
flag: OptionType;
sub_flags: OptionType[];
allow_without_sub_flag: boolean;
};
export type ProductFlagMappingUI = {
export type ProductFlagMapping = {
flags: OptionType[];
options: ProductFlagMappingOptionUI[];
options: ProductFlagMappingItem[];
sub_flag_to_flag: Record<string, string>;
};
export type ApprovalWorkflowUI = {
export type TransformedApprovalWorkflow = {
key: string;
steps: OptionType[];
};
@@ -75,9 +75,9 @@ export type TransformedConstants = {
PEMBELIAN: OptionType[];
};
};
approval_workflows: ApprovalWorkflowUI[];
approval_workflows: TransformedApprovalWorkflow[];
flags: OptionType[];
product_flag_mapping: ProductFlagMappingUI;
product_flag_mapping: ProductFlagMapping;
legacy_flag_aliases: OptionType[];
stock_log: {
log_types: OptionType[];