2023-11-05 17:26:51 -08:00
|
|
|
import { ObjectWithId } from './object-with-id'
|
|
|
|
|
|
2023-12-19 22:36:35 -08:00
|
|
|
export enum CustomFieldDataType {
|
2023-11-05 17:26:51 -08:00
|
|
|
String = 'string',
|
|
|
|
|
Url = 'url',
|
|
|
|
|
Date = 'date',
|
|
|
|
|
Boolean = 'boolean',
|
|
|
|
|
Integer = 'integer',
|
|
|
|
|
Float = 'float',
|
|
|
|
|
Monetary = 'monetary',
|
2023-12-05 08:16:56 -08:00
|
|
|
DocumentLink = 'documentlink',
|
2024-07-09 07:57:07 -07:00
|
|
|
Select = 'select',
|
2023-11-05 17:26:51 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const DATA_TYPE_LABELS = [
|
|
|
|
|
{
|
2023-12-19 22:36:35 -08:00
|
|
|
id: CustomFieldDataType.Boolean,
|
2023-11-05 17:26:51 -08:00
|
|
|
name: $localize`Boolean`,
|
|
|
|
|
},
|
|
|
|
|
{
|
2023-12-19 22:36:35 -08:00
|
|
|
id: CustomFieldDataType.Date,
|
2023-11-05 17:26:51 -08:00
|
|
|
name: $localize`Date`,
|
|
|
|
|
},
|
|
|
|
|
{
|
2023-12-19 22:36:35 -08:00
|
|
|
id: CustomFieldDataType.Integer,
|
2023-11-05 17:26:51 -08:00
|
|
|
name: $localize`Integer`,
|
|
|
|
|
},
|
|
|
|
|
{
|
2023-12-19 22:36:35 -08:00
|
|
|
id: CustomFieldDataType.Float,
|
2023-11-05 17:26:51 -08:00
|
|
|
name: $localize`Number`,
|
|
|
|
|
},
|
|
|
|
|
{
|
2023-12-19 22:36:35 -08:00
|
|
|
id: CustomFieldDataType.Monetary,
|
2023-11-05 17:26:51 -08:00
|
|
|
name: $localize`Monetary`,
|
|
|
|
|
},
|
|
|
|
|
{
|
2023-12-19 22:36:35 -08:00
|
|
|
id: CustomFieldDataType.String,
|
2023-11-05 17:26:51 -08:00
|
|
|
name: $localize`Text`,
|
|
|
|
|
},
|
|
|
|
|
{
|
2023-12-19 22:36:35 -08:00
|
|
|
id: CustomFieldDataType.Url,
|
2023-11-05 17:26:51 -08:00
|
|
|
name: $localize`Url`,
|
|
|
|
|
},
|
2023-12-05 08:16:56 -08:00
|
|
|
{
|
2023-12-19 22:36:35 -08:00
|
|
|
id: CustomFieldDataType.DocumentLink,
|
2023-12-05 08:16:56 -08:00
|
|
|
name: $localize`Document Link`,
|
|
|
|
|
},
|
2024-07-09 07:57:07 -07:00
|
|
|
{
|
|
|
|
|
id: CustomFieldDataType.Select,
|
|
|
|
|
name: $localize`Select`,
|
|
|
|
|
},
|
2023-11-05 17:26:51 -08:00
|
|
|
]
|
|
|
|
|
|
2023-12-19 22:36:35 -08:00
|
|
|
export interface CustomField extends ObjectWithId {
|
|
|
|
|
data_type: CustomFieldDataType
|
2023-11-05 17:26:51 -08:00
|
|
|
name: string
|
|
|
|
|
created?: Date
|
2024-07-09 07:57:07 -07:00
|
|
|
extra_data?: {
|
2024-12-01 20:15:38 -08:00
|
|
|
select_options?: Array<{ label: string; id: string }>
|
2024-08-05 17:02:03 -07:00
|
|
|
default_currency?: string
|
2024-07-09 07:57:07 -07:00
|
|
|
}
|
2024-10-03 23:00:28 -07:00
|
|
|
document_count?: number
|
2023-11-05 17:26:51 -08:00
|
|
|
}
|