Fosi Fossil Service
Small teams. Open source. Built on Fossil.

IaC / SwiftFlow

High-performance WMS with wave picking, smart routing, and real-time inventory visibility.

Public | Owner: IaC | Default branch: trunk | Last update: 2026-10-23 14:37

Artifact e8b6825a45450f737fb826142b5752e998b378e2703cdd7905c1a2a84bc7126b:


import gleam/option.{type Option}
import ql361api/auth
import ql361api/client
import ql361api/goods
import ql361api/models
import ql361api/orders
import ql361api/purchases
import ql361api/store

pub type Client =
  client.Client

pub type ApiSession =
  models.ApiSession

pub type ApiError =
  models.ApiError

pub type QlWarehouse =
  models.QlWarehouse

pub type GoodsItem =
  models.GoodsItem

pub type SalesOrderSummary =
  models.SalesOrderSummary

pub type SalesOrder =
  models.SalesOrder

pub type SalesOrderItem =
  models.SalesOrderItem

pub type PurchaseOrderSummary =
  models.PurchaseOrderSummary

pub type PurchaseOrder =
  models.PurchaseOrder

pub type PurchaseOrderItem =
  models.PurchaseOrderItem

pub type LoginResult =
  models.LoginResult

pub type Page(item) =
  models.Page(item)

pub fn new_client(base_url: String) -> Client {
  client.new(base_url)
}

pub fn default_client() -> Client {
  client.default_client()
}

pub fn with_session(client: Client, session: ApiSession) -> Client {
  client.with_session(client, session)
}

pub fn with_base_url(client: Client, base_url: String) -> Client {
  client.with_base_url(client, base_url)
}

pub fn default_base_url() -> String {
  client.default_base_url
}

pub fn login(
  username username: String,
  password password: String,
) -> Result(#(Client, LoginResult), ApiError) {
  auth.login(username: username, password: password)
}

pub fn check_login_status(client: Client) -> Result(Bool, ApiError) {
  auth.check_login_status(client)
}

pub fn fetch_warehouses(client: Client) -> Result(List(QlWarehouse), ApiError) {
  store.fetch_warehouses(client)
}

pub fn fetch_sales_orders(
  client: Client,
  begin_date: String,
  end_date: String,
  status: Option(Int),
) -> Result(List(SalesOrderSummary), ApiError) {
  orders.fetch_sales_orders(client, begin_date, end_date, status)
}

pub fn fetch_pending_picking_orders(
  client: Client,
  begin_date: String,
  end_date: String,
) -> Result(List(SalesOrderSummary), ApiError) {
  orders.fetch_pending_picking_orders(client, begin_date, end_date)
}

pub fn fetch_order_detail(
  client: Client,
  bill_id: Int,
) -> Result(SalesOrder, ApiError) {
  orders.fetch_order_detail(client, bill_id)
}

pub fn fetch_sales_order_page(
  client: Client,
  begin_date: String,
  end_date: String,
  status: Option(Int),
  page: Int,
  page_size: Int,
) -> Result(Page(SalesOrderSummary), ApiError) {
  orders.fetch_sales_order_page(
    client,
    begin_date,
    end_date,
    status,
    page,
    page_size,
  )
}

pub fn fetch_purchase_order_page(
  client: Client,
  begin_date: String,
  end_date: String,
  status: Option(Int),
  page: Int,
  page_size: Int,
) -> Result(Page(PurchaseOrderSummary), ApiError) {
  purchases.fetch_purchase_order_page(
    client,
    begin_date,
    end_date,
    status,
    page,
    page_size,
  )
}

pub fn fetch_purchase_order_detail(
  client: Client,
  bill_id: Int,
) -> Result(PurchaseOrder, ApiError) {
  purchases.fetch_purchase_order_detail(client, bill_id)
}

pub fn fetch_purchase_receipt_page(
  client: Client,
  begin_date: String,
  end_date: String,
  page: Int,
  page_size: Int,
) -> Result(Page(PurchaseOrderSummary), ApiError) {
  purchases.fetch_purchase_receipt_page(
    client,
    begin_date,
    end_date,
    page,
    page_size,
  )
}

pub fn fetch_purchase_receipt_detail(
  client: Client,
  bill_id: Int,
) -> Result(PurchaseOrder, ApiError) {
  purchases.fetch_purchase_receipt_detail(client, bill_id)
}

pub fn fetch_goods_page(
  client: Client,
  page: Int,
  page_size: Int,
  modified_from: String,
  modified_to: String,
) -> Result(Page(GoodsItem), ApiError) {
  goods.fetch_goods_page(client, page, page_size, modified_from, modified_to)
}

pub fn describe_ql361_error(error: ApiError) -> String {
  orders.describe_error(error)
}


Clone

You can clone this repository with the following command:

fossil clone https://fosi.dev/IaC/SwiftFlow

Contribute

The best way to contribute is through e-mail. See the project documentation for more details.