|
1
|
import { model } from "@medusajs/framework/utils" |
|
2
|
|
|
3
|
/** |
|
4
|
* @since 2.12.4 |
|
5
|
*/ |
|
6
|
const Settings = model |
|
7
|
.define("translation_settings", { |
|
8
|
id: model.id({ prefix: "trset" }).primaryKey(), |
|
9
|
/** |
|
10
|
* The entity type that these settings apply to (e.g., "product", "product_variant"). |
|
11
|
*/ |
|
12
|
entity_type: model.text().searchable(), |
|
13
|
/** |
|
14
|
* The translatable fields for this entity type. |
|
15
|
* Array of field names that can be translated. |
|
16
|
* |
|
17
|
* @example |
|
18
|
* ["title", "description", "material"] |
|
19
|
*/ |
|
20
|
fields: model.json(), |
|
21
|
/** |
|
22
|
* Wether the entity translatable status is enabled. |
|
23
|
* |
|
24
|
* @since 2.13.0 |
|
25
|
*/ |
|
26
|
is_active: model.boolean().default(true), |
|
27
|
}) |
|
28
|
.indexes([ |
|
29
|
{ |
|
30
|
on: ["entity_type"], |
|
31
|
unique: true, |
|
32
|
}, |
|
33
|
]) |
|
34
|
|
|
35
|
export default Settings |