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 { export interface Attributes {
additional: { additional: (PropString | PropNumber | PropDate | PropOptions)[];
fieldName: string | null;
type: AdditionalType | null;
ability?: Record<AdditionalType, Ability[AdditionalType]>;
}[];
} }
export interface Ability { type PropString = {
string?: { type: 'string';
phoneNumber: { fieldName: string;
length: number; isPhoneNumber: boolean;
}; phoneNumberLength: number;
}; };
number?: {
comma?: boolean;
decimal?: {
point: number;
};
};
date?: string | null;
array?: string[] | null;
}
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 // Product