diff --git a/src/stores/product-service/types.ts b/src/stores/product-service/types.ts index 6324a9e4..8e00262b 100644 --- a/src/stores/product-service/types.ts +++ b/src/stores/product-service/types.ts @@ -66,30 +66,32 @@ export interface ServiceCreate { } export interface Attributes { - additional: { - fieldName: string | null; - type: AdditionalType | null; - ability?: Record; - }[]; + additional: (PropString | PropNumber | PropDate | PropOptions)[]; } -export interface Ability { - string?: { - phoneNumber: { - length: number; - }; - }; - number?: { - comma?: boolean; - decimal?: { - point: number; - }; - }; - date?: string | null; - array?: string[] | null; -} +type PropString = { + type: 'string'; + fieldName: string; + isPhoneNumber: boolean; + phoneNumberLength: number; +}; -export type AdditionalType = 'string' | 'number' | 'date' | 'array'; +type PropNumber = { + type: 'number'; + fieldName: string; + comma: boolean; + decimalPlace: number; +}; + +type PropDate = { + type: 'date'; + fieldName: string; +}; + +type PropOptions = { + type: 'array'; + fieldName: string; +}; // Product