FHO and Forward Integration
sainw이(가) 3 년 전에 이 페이지를 수정함

Index

Hosts
FHO API
Products(Interface)
ProductRequest(Message)
ProductsReply(Message)
PriceSchedulesRequest(Message)
PriceSchedulesReply(Message)
PriceChangeHistoriesRequest(Message)
PriceChangeHistoriesReply(Message)

Hosts

  • FHO Production : fho.seinmaungengineering.com
  • FHO Test : fho-test.seinmaungengineering.com
  • Production : fhoapi.seinmaungengineering.com
  • Test : fhoapi-test.seinmaungengineering.com

FHO API

FHO API can be called using gRPC client of any language. This document will use golang programming language to demonstrate the integration using golang gRPC client.

  1. Once the station is connected with FHO, product list must be acquired from FHO. Products must not be updated at the station.
  2. The product retail prices updating should only be allowed when there is no connection to FHO.
  3. Loyalty levels & B2B product prices must not be updated at the station.

Products (Interface)

GetProducts
rpc GetProducts(ProductsRequest) returns (ProductsReply)
Listens changes of products.
GetPriceSchedules
rpc GetPriceSchedules(PriceSchedulesRequest) returns (PriceSchedulesReply)
Listens changes of retail price schedules for the station.
SavePriceChangeHistories
rpc SavePriceChangeHistories(PriceChangeHistoriesRequest) returns (PriceChangeHistoriesReply)
Streams batches of retail price changes of the station.

ProductRequest (Message)

Fields
token string
station token

ProductsReply (Message)

Fields
products[] Product
list of products

Product

Represents a single product in a business

Fields
id string
unique id of the product
name string
name of the product
color string
color of the product in hexadecimal color specified with #RRGGBB

PriceSchedulesRequest (Message)

Fields
token string
station token

PriceSchedulesReply (Message)

Fields
schedules[] Schedule
list of schedules

Schedule

Represents a price schedule update

Fields
id string
unique id of a schedule
schedule_type ScheduleType
schedule_time Timestamp
time to apply price in UTC
product_prices[] ProductPrice
product prices for the station

ProductPrice

Represents a single product price in a business

Fields
id string
product id
price int64
product price

ScheduleType

The supported schedule type.

Enum
SCHEDULE_TYPE_UNSPECIFIED The schedule type is unspecified. Not a valid option.
IMMEDIATE The price update is immediate.
AFTER_SHIFT_CHANGE The price update is after shfit change.

PriceChangeHistoriesRequest (Message)

Fields
token string
station token
price_change_histories[] PriceChangeHistory
list of price change histories

PriceChangeHistoriesReply (Message)

Fields
status Status
grpc status

PriceChangeHistory

Represents a price change history

Fields
id string
unique id of a price change
schedule_id string
original schedule id
change_time Timestamp
price change time in UTC
time_zone int64
time zone in minutes, example (390 for Myanmar timezone, 480 for Singapore timezone)
product_prices[] ProductPrice
changed product prices
status PriceChangeStatus
price change status

PriceChangeStatus

The supported price change status.

Enum
SCHEDULE_TYPE_UNSPECIFIED The schedule type is unspecified. Not a valid option.
VOIDED price change is voided.
SUCCESSFUL price change is successful.