mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-09-16 21:55:37 -05:00
Refactor frontend data models
This commit is contained in:
53
src-ui/src/app/data/custom-field.ts
Normal file
53
src-ui/src/app/data/custom-field.ts
Normal file
@@ -0,0 +1,53 @@
|
||||
import { ObjectWithId } from './object-with-id'
|
||||
|
||||
export enum CustomFieldDataType {
|
||||
String = 'string',
|
||||
Url = 'url',
|
||||
Date = 'date',
|
||||
Boolean = 'boolean',
|
||||
Integer = 'integer',
|
||||
Float = 'float',
|
||||
Monetary = 'monetary',
|
||||
DocumentLink = 'documentlink',
|
||||
}
|
||||
|
||||
export const DATA_TYPE_LABELS = [
|
||||
{
|
||||
id: CustomFieldDataType.Boolean,
|
||||
name: $localize`Boolean`,
|
||||
},
|
||||
{
|
||||
id: CustomFieldDataType.Date,
|
||||
name: $localize`Date`,
|
||||
},
|
||||
{
|
||||
id: CustomFieldDataType.Integer,
|
||||
name: $localize`Integer`,
|
||||
},
|
||||
{
|
||||
id: CustomFieldDataType.Float,
|
||||
name: $localize`Number`,
|
||||
},
|
||||
{
|
||||
id: CustomFieldDataType.Monetary,
|
||||
name: $localize`Monetary`,
|
||||
},
|
||||
{
|
||||
id: CustomFieldDataType.String,
|
||||
name: $localize`Text`,
|
||||
},
|
||||
{
|
||||
id: CustomFieldDataType.Url,
|
||||
name: $localize`Url`,
|
||||
},
|
||||
{
|
||||
id: CustomFieldDataType.DocumentLink,
|
||||
name: $localize`Document Link`,
|
||||
},
|
||||
]
|
||||
|
||||
export interface CustomField extends ObjectWithId {
|
||||
data_type: CustomFieldDataType
|
||||
name: string
|
||||
created?: Date
|
||||
}
|
Reference in New Issue
Block a user