-
Notifications
You must be signed in to change notification settings - Fork 0
/
boot.ex
38 lines (35 loc) · 2.42 KB
/
boot.ex
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
defmodule EXO.Boot do
require EXO
def clients() do
[] = :kvs.all '/exo/clients'
date = :calendar.now_to_datetime :erlang.timestamp
sample = [
EXO.client(id: :kvs.seq([],[]), names: "Максим", phone: "1", surnames: "Сохацький", type: :admin, status: :online, date: date),
EXO.client(id: :kvs.seq([],[]), names: "Антон", phone: "2", surnames: "Волошко", type: :admin, status: :online, date: date),
EXO.client(id: :kvs.seq([],[]), names: "МВС", phone: "3", surnames: "", type: :consumer, status: :online, date: date),
EXO.client(id: :kvs.seq([],[]), names: "ГСЦ", phone: "4", surnames: "", type: :consumer, status: :online, date: date),
EXO.client(id: :kvs.seq([],[]), names: "ЦІТ", phone: "5", surnames: "", type: :consumer, status: :online, date: date),
EXO.client(id: :kvs.seq([],[]), names: "ДНДІ", phone: "6", surnames: "", type: :consumer, status: :online, date: date),
]
:lists.map fn x -> :kvs.append x, '/exo/clients' end, sample
end
def programs() do
[] = :kvs.all '/exo/tariffs'
date = :calendar.now_to_datetime :erlang.timestamp
sample = [
EXO.program(id: :kvs.seq([],[]), name: "БАЗОВИЙ", type: :internet, date: date),
EXO.program(id: :kvs.seq([],[]), name: "СТАНДАРТ", type: :internet, date: date),
EXO.program(id: :kvs.seq([],[]), name: "РОЗРИШЕНИЙ", type: :internet, date: date),
EXO.program(id: :kvs.seq([],[]), name: "БАЗОВИЙ", type: :electricity, date: date),
EXO.program(id: :kvs.seq([],[]), name: "СТАНДАРТ", type: :electricity, date: date),
EXO.program(id: :kvs.seq([],[]), name: "РОЗРИШЕНИЙ", type: :electricity, date: date),
EXO.program(id: :kvs.seq([],[]), name: "БАЗОВИЙ", type: :gas, date: date),
EXO.program(id: :kvs.seq([],[]), name: "СТАНДАРТ", type: :gas, date: date),
EXO.program(id: :kvs.seq([],[]), name: "РОЗРИШЕНИЙ", type: :gas, date: date),
EXO.program(id: :kvs.seq([],[]), name: "БАЗОВИЙ", type: :oil, date: date),
EXO.program(id: :kvs.seq([],[]), name: "СТАНДАРТ", type: :oil, date: date),
EXO.program(id: :kvs.seq([],[]), name: "РОЗРИШЕНИЙ", type: :oil, date: date),
]
:lists.map fn x -> :kvs.append x, '/exo/tariffs' end, sample
end
end