Crate nsg

Source
Expand description

Nsg is a library for interacting with Portal. It provides read-only methods for basic search, view request, work schedule and brief request

Note: This library is written to work only with users with the role of “Монтажник (все)” It may not work properly with other roles

use chrono::Utc;
use nsg::Nsg;

let nsg = Nsg::from_creds(
    "login".to_string(),
    "password_hash".to_string(),
    "https://net-stroy.itnet.lviv.ua".to_string(),
    "client".to_string(),
    "x.y".to_string(),
)
.await?;

// Fetch orders from Work Schedule for today
let work_schedule = nsg.work_schedule(Utc::now().date_naive()).await;
println!("{:?}", work_schedule.0);

§Terminology

  • Internal order id: Kyivstar assigns unique identifiers to its orders. When orders are processed by the Portal, it creates its own record of the order in its database, thus creating an internal identifier for the request
  • Data pillar: Portal’s endpoint or the way to access data from Portal. There are 4 data pillars: BasicSearch, BriefRequest, ViewRequest and WorkSchedule
  • Portal: Refers to “Нет-Строй”’s “IC Портал-К”
  • Kyivstar’s version: Kyivstar’s data is not always 100% right. It’s really apparent in the client’s full name

Modules§

basic_search
Basic search parser (collection of SearchEntrys)
brief_request
Brief request parser
data
Essential types for representing order’s data
error
Nsg error
serializable_int_error_kind
IntErrorKind with derived Serialize and Deserialize implementations
serializable_parse_error_kind
ParseErrorKind with derived Serialize and Deserialize implementations
view_request
View request parser
work_schedule
Work schedule parser (collection of Orders)

Structs§

Nsg
Wrapper around data pillar parsers and Portal