aboutsummaryrefslogtreecommitdiff
path: root/src/definitions/commerce.ts
blob: dbe22f69949a22ca077a40df31d43f271ef37db5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import { allOf } from './utils';

/**
 * The possible definitions related to commerce.
 */
export interface CommerceDefinitions {
  /**
   * Human readable color names
   */
  color: string[];
  /**
   * Department names inside a shop.
   */
  department: string[];
  /**
   * Product name generation definitions.
   */
  product_name: CommerceProductNameDefinitions;
  /**
   * Descriptions for products.
   */
  product_description: string[];
}

/**
 * The possible definitions related to product name generation.
 */
export interface CommerceProductNameDefinitions {
  /**
   * Adjectives describing a product (e.g. tasty).
   */
  adjective: string[];
  /**
   * Materials describing a product (e.g. wood).
   */
  material: string[];
  /**
   * Types of products (e.g. chair).
   */
  product: string[];
}

/**
 * Internal: A list of all keys for the CommerceDefinitions.
 */
export const COMMERCE = allOf<keyof CommerceDefinitions>()(
  'color',
  'department',
  'product_name',
  'product_description'
);