Backend developed with golang pre-created with Starport script from tendermint. For all timestamp included in each transaction are created by Backend via Time module.
...In case you looking for list of all command and api
Our Backend consist of 4 types
This type represent Check in and Check out log which stored address of the generated user, place and timestamp in order to track where the user is and compare if they are at risk.
Log {
Creator sdk.AccAddress,
ID string,
LogID string,
PlaceID string,
CreatedAt time.Time,
Action string,
}
The action is
CHECKINorCHECKOUT
| Command | API | Argument/Body | Description |
|---|---|---|---|
| create-log | POST /log | logID, placeID, action | create log tx with required information |
| list-log | GET /log | - | list all log |
| list-spec-log | POST /log/list | address(s) | list log created with specify address |
Quarantine type represent quarantine block which specify who has to isolate from when to when. This block is auto-generated after Covid block reported and will use start time as when the transaction was created. For end time we will just add start time with 14 days.
Quarantine {
Creator sdk.AccAddress,
ID string,
UserAddress sdk.AccAddress,
StartAt time.Time,
EndAt time.Time,
}
| Command | API | Argument/Body | Description |
|---|---|---|---|
| create-quarantine | POST /quarantine | address | create quarantine tx with required information |
| list-quarantine | GET /quarantine | - | list all quarantine |
| list-spec-quarantine | POST /quarantine/list | address(s) | list quarantine that specify address need to be isolate |
Covid type represent who affect with COVID-19, will be created after user press the report button. Then the address(s) specified will use for query log block and find who has to isolate via create quarantine transaction.
Covid {
Creator sdk.AccAddress,
ID string,
CovidID string,
CreatedAt time.Time,
Status string,
PubKey []string,
}
The status is
PENDING,APPROVEDorREJECTED
APPROVEDandREJECTEDcan be created with verified doctor only. The doctors will create this status when they commit approve or reject the pending covid transaction.
| Command | API | Argument/Body | Description |
|---|---|---|---|
| create-covid | POST /covid | covidID, status, address(s) | create covid tx with required information and query with provided address(s) |
| list-covid | GET /covid | - | list all covid |
| list-spec-covid | POST /covid/list | address(s) | list covid that specify address affected by COVID-19 |
| list-pending-covid | POST /covid/pending | - | list all covid transaction with status PENDING |
Doctor type represent who is verified doctor.
Doctor {
Creator sdk.AccAddress
ID string
Address string
IsDoctor string
}
isDoctor is
TrueorFalseTrue for verified and False for unverified.
| Command | API | Argument/Body | Description |
|---|---|---|---|
| create-doctor | POST /doctor | address, isDoctor | create doctor tx with required information |
| list-doctor | GET /doctor | - | list all doctor |
User can request to be a doctor by click request in the doctor page.