init method

dynamic init(
  1. ComponentConstructor cartComponentConstructorDefault,
  2. ComponentEditorConstructor cartComponentEditorConstructor,
  3. ComponentConstructor orderOverviewComponentConstructorDefault,
  4. ComponentEditorConstructor orderOverviewComponentEditorConstructor,
  5. ComponentConstructor payComponentConstructorDefault,
  6. ComponentEditorConstructor payComponentEditorConstructor,
  7. ComponentConstructor payConfirmationComponentConstructorDefault,
  8. ComponentEditorConstructor payConfirmationComponentEditorConstructor,
  9. ComponentConstructor productDisplayComponentConstructorDefault,
  10. ComponentEditorConstructor productDisplayComponentEditorConstructor,
  11. ComponentConstructor shopFrontComponentConstructorDefault,
  12. ComponentEditorConstructor shopFrontComponentEditorConstructor,
)

Implementation

init(
  ComponentConstructor cartComponentConstructorDefault,
  ComponentEditorConstructor cartComponentEditorConstructor,
  ComponentConstructor orderOverviewComponentConstructorDefault,
  ComponentEditorConstructor orderOverviewComponentEditorConstructor,
  ComponentConstructor payComponentConstructorDefault,
  ComponentEditorConstructor payComponentEditorConstructor,
  ComponentConstructor payConfirmationComponentConstructorDefault,
  ComponentEditorConstructor payConfirmationComponentEditorConstructor,
  ComponentConstructor productDisplayComponentConstructorDefault,
  ComponentEditorConstructor productDisplayComponentEditorConstructor,
  ComponentConstructor shopFrontComponentConstructorDefault,
  ComponentEditorConstructor shopFrontComponentEditorConstructor,
) {
  Apis.apis().getRegistryApi().addInternalComponents('eliud_pkg_shop_model', [
    "carts",
    "orders",
    "orderOverviews",
    "pays",
    "payConfirmations",
    "products",
    "productDisplays",
    "shops",
    "shopFronts",
  ]);

  Apis.apis()
      .getRegistryApi()
      .addDropDownSupporter("carts", DropdownButtonComponentFactory());
  Apis.apis().getRegistryApi().register(
      componentName: "carts",
      componentConstructor: cartComponentConstructorDefault);
  Apis.apis().getRegistryApi().addDropDownSupporter(
      "orderOverviews", DropdownButtonComponentFactory());
  Apis.apis().getRegistryApi().register(
      componentName: "orderOverviews",
      componentConstructor: orderOverviewComponentConstructorDefault);
  Apis.apis()
      .getRegistryApi()
      .addDropDownSupporter("pays", DropdownButtonComponentFactory());
  Apis.apis().getRegistryApi().register(
      componentName: "pays",
      componentConstructor: payComponentConstructorDefault);
  Apis.apis().getRegistryApi().addDropDownSupporter(
      "payConfirmations", DropdownButtonComponentFactory());
  Apis.apis().getRegistryApi().register(
      componentName: "payConfirmations",
      componentConstructor: payConfirmationComponentConstructorDefault);
  Apis.apis().getRegistryApi().addDropDownSupporter(
      "productDisplays", DropdownButtonComponentFactory());
  Apis.apis().getRegistryApi().register(
      componentName: "productDisplays",
      componentConstructor: productDisplayComponentConstructorDefault);
  Apis.apis()
      .getRegistryApi()
      .addDropDownSupporter("shopFronts", DropdownButtonComponentFactory());
  Apis.apis().getRegistryApi().register(
      componentName: "shopFronts",
      componentConstructor: shopFrontComponentConstructorDefault);
  Apis.apis()
      .getRegistryApi()
      .addComponentSpec('eliud_pkg_shop_model', 'shop', [
    ComponentSpec(
        'carts',
        cartComponentConstructorDefault,
        CartComponentSelector(),
        cartComponentEditorConstructor,
        ({String? appId}) => cartRepository(appId: appId)!),
    ComponentSpec(
        'orderOverviews',
        orderOverviewComponentConstructorDefault,
        OrderOverviewComponentSelector(),
        orderOverviewComponentEditorConstructor,
        ({String? appId}) => orderOverviewRepository(appId: appId)!),
    ComponentSpec(
        'pays',
        payComponentConstructorDefault,
        PayComponentSelector(),
        payComponentEditorConstructor,
        ({String? appId}) => payRepository(appId: appId)!),
    ComponentSpec(
        'payConfirmations',
        payConfirmationComponentConstructorDefault,
        PayConfirmationComponentSelector(),
        payConfirmationComponentEditorConstructor,
        ({String? appId}) => payConfirmationRepository(appId: appId)!),
    ComponentSpec(
        'productDisplays',
        productDisplayComponentConstructorDefault,
        ProductDisplayComponentSelector(),
        productDisplayComponentEditorConstructor,
        ({String? appId}) => productDisplayRepository(appId: appId)!),
    ComponentSpec(
        'shopFronts',
        shopFrontComponentConstructorDefault,
        ShopFrontComponentSelector(),
        shopFrontComponentEditorConstructor,
        ({String? appId}) => shopFrontRepository(appId: appId)!),
  ]);
  Apis.apis().getRegistryApi().registerRetrieveRepository(
      'eliud_pkg_shop_model',
      'carts',
      ({String? appId}) => cartRepository(appId: appId)!);
  Apis.apis().getRegistryApi().registerRetrieveRepository(
      'eliud_pkg_shop_model',
      'memberCarts',
      ({String? appId}) => memberCartRepository(appId: appId)!);
  Apis.apis().getRegistryApi().registerRetrieveRepository(
      'eliud_pkg_shop_model',
      'orders',
      ({String? appId}) => orderRepository(appId: appId)!);
  Apis.apis().getRegistryApi().registerRetrieveRepository(
      'eliud_pkg_shop_model',
      'orderOverviews',
      ({String? appId}) => orderOverviewRepository(appId: appId)!);
  Apis.apis().getRegistryApi().registerRetrieveRepository(
      'eliud_pkg_shop_model',
      'pays',
      ({String? appId}) => payRepository(appId: appId)!);
  Apis.apis().getRegistryApi().registerRetrieveRepository(
      'eliud_pkg_shop_model',
      'payConfirmations',
      ({String? appId}) => payConfirmationRepository(appId: appId)!);
  Apis.apis().getRegistryApi().registerRetrieveRepository(
      'eliud_pkg_shop_model',
      'products',
      ({String? appId}) => productRepository(appId: appId)!);
  Apis.apis().getRegistryApi().registerRetrieveRepository(
      'eliud_pkg_shop_model',
      'productDisplays',
      ({String? appId}) => productDisplayRepository(appId: appId)!);
  Apis.apis().getRegistryApi().registerRetrieveRepository(
      'eliud_pkg_shop_model',
      'shops',
      ({String? appId}) => shopRepository(appId: appId)!);
  Apis.apis().getRegistryApi().registerRetrieveRepository(
      'eliud_pkg_shop_model',
      'shopFronts',
      ({String? appId}) => shopFrontRepository(appId: appId)!);
}