fix: edit type Attributes

This commit is contained in:
Net 2024-07-25 16:38:58 +07:00
parent 417e47d597
commit ed8dda6c0c

View file

@ -66,30 +66,32 @@ export interface ServiceCreate {
}
export interface Attributes {
additional: {
fieldName: string | null;
type: AdditionalType | null;
ability?: Record<AdditionalType, Ability[AdditionalType]>;
}[];
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