Sfoglia il codice sorgente

docs(core): Add example of payment method and roles definition (#1203)

Closes #1202
Milan Zivkovic 4 anni fa
parent
commit
3460536121
1 ha cambiato i file con 48 aggiunte e 0 eliminazioni
  1. 48 0
      docs/content/developer-guide/importing-product-data.md

+ 48 - 0
docs/content/developer-guide/importing-product-data.md

@@ -84,6 +84,47 @@ As well as product data, other initialization data can be populated using the [`
 import { InitialData, LanguageCode } from '@vendure/core';
 
 export const initialData: InitialData = {
+    paymentMethods: [
+        {
+            name: 'Standard Payment',
+            handler: {
+                code: 'dummy-payment-handler',
+                arguments: [{ name: 'automaticSettle', value: 'false' }],
+            },
+        },
+    ],
+    roles: [
+        {
+            code: 'administrator',
+            description: 'Administrator',
+            permissions: [
+                Permission.CreateCatalog,
+                Permission.ReadCatalog,
+                Permission.UpdateCatalog,
+                Permission.DeleteCatalog,
+                Permission.CreateSettings,
+                Permission.ReadSettings,
+                Permission.UpdateSettings,
+                Permission.DeleteSettings,
+                Permission.CreateCustomer,
+                Permission.ReadCustomer,
+                Permission.UpdateCustomer,
+                Permission.DeleteCustomer,
+                Permission.CreateCustomerGroup,
+                Permission.ReadCustomerGroup,
+                Permission.UpdateCustomerGroup,
+                Permission.DeleteCustomerGroup,
+                Permission.CreateOrder,
+                Permission.ReadOrder,
+                Permission.UpdateOrder,
+                Permission.DeleteOrder,
+                Permission.CreateSystem,
+                Permission.ReadSystem,
+                Permission.UpdateSystem,
+                Permission.DeleteSystem,
+            ],
+        },
+    ],
     defaultLanguage: LanguageCode.en,
     countries: [
         { name: 'Austria', code: 'AT', zone: 'Europe' },
@@ -112,6 +153,13 @@ export const initialData: InitialData = {
 };
 ```
 
+* `paymentMethods`: Defines which payment methods are available.
+  * `name`: Name of the payment method.
+  * `handler`: Payment plugin handler information.
+* `roles`: Defines which user roles are available.
+  * `code`: Role code name.
+  * `description`: Role description.
+  * `permissions`: List of permissions to applied to the role.
 * `defaultLanguage`: Sets the language which will be used for all translatable entities created by the initial data e.g. Products, ProductVariants, Collections etc. Should correspond to the language used in your product csv file.
 * `countries`: Defines which countries are available.
   * `name`: The name of the country in the language specified by `defaultLanguage`