Current section
Files
Jump to
Current section
Files
src/boot/erp_boot.erl
-module(erp_boot).
-compile(export_all).
-include("organization.hrl").
-include("location.hrl").
-include("person.hrl").
-include("product.hrl").
-include("branch.hrl").
-include_lib("kvs/include/kvs.hrl").
-include_lib("kvs/include/metainfo.hrl").
-include_lib("kvs/include/cursors.hrl").
boot() ->
GroupOrgs = [ #'Organization'{name="Quanterall", url="quanterall.com"} ],
HeadBranches = [ #'Branch'{ loc = #'Loc'{ city = "Varna", country = "BG" } },
#'Branch'{ loc = #'Loc'{ city = "Sophia", country = "BG" } },
#'Branch'{ loc = #'Loc'{ city = "Plovdiv", country = "BG" } } ],
PartnersOrgs = [ #'Organization'{name="NYNJA, Inc.", url="nynja.io"},
#'Organization'{name="Catalx Exchange Inc.", url="catalx.io"},
#'Organization'{name="FinaTech", url="finatech.se"},
#'Organization'{name="3Stars", url=[]},
#'Organization'{name="SwissEMX", url=[]},
#'Organization'{name="HistoricalPark", url=[]},
#'Organization'{name="Intralinks", url=[]} ],
Structure = [ {"/erp/group", GroupOrgs},
{"/erp/partners", PartnersOrgs},
{"/erp/quanterall", HeadBranches}],
lists:foreach(fun({Feed, Data}) ->
case kvs:get(writer, Feed) of
{ok,_} -> skip;
{error,_} -> lists:map(fun(X) ->
kvs:append(X,Feed) end, Data) end
end, Structure).