Skip to content

Commit

Permalink
feat(hk-company): obtain rights issue information
Browse files Browse the repository at this point in the history
  • Loading branch information
tanchangde committed Feb 3, 2024
1 parent 886fdc2 commit a6d2781
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 1 deletion.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export(lxr_cn_company_shareholders_num)
export(lxr_cn_company_suppliers)
export(lxr_cn_company_trading_abnormal)
export(lxr_hk_company)
export(lxr_hk_company_allotment)
export(lxr_hk_company_announcement)
export(lxr_hk_company_candlestick)
export(lxr_hk_company_dividend)
Expand Down
7 changes: 7 additions & 0 deletions R/hk-company.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#' information of domestic fund companies."
#' * `lxr_hk_company_dividend()` get dividend information.
#' * `lxr_hk_company_split()` get split data.
#' * `lxr_hk_company_allotment()` obtain rights issue information.
#'
#' @return A string of the API endpoint.

Expand Down Expand Up @@ -113,3 +114,9 @@ lxr_hk_company_dividend <- function() {
lxr_hk_company_split <- function() {
"https://open.lixinger.com/api/hk/company/split"
}

#' @rdname lxr_hk_company
#' @export
lxr_hk_company_allotment <- function() {
"https://open.lixinger.com/api/hk/company/allotment"
}
3 changes: 2 additions & 1 deletion R/query-params.R
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ lxr_query_params <- function(endpoint) {
hk_company_fund_shareholders = common_params,
hk_company_fund_collection_shareholders = common_params,
hk_company_dividend = common_params,
hk_company_split = common_params
hk_company_split = common_params,
hk_company_allotment = common_params
)
}
4 changes: 4 additions & 0 deletions man/lxr_hk_company.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions tests/testthat/test-hk-company.R
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,14 @@ test_that("test hk_company_split", {
expect_s3_class(result, "tbl_df")
expect_true(nrow(result) > 0)
})

test_that("test hk_company_allotment", {
result <- lxr_query(
endpoint = lxr_hk_company_allotment(),
start_date = "2015-01-03",
end_date = "2024-02-03",
stock_code = "02016"
)
expect_s3_class(result, "tbl_df")
expect_true(nrow(result) > 0)
})

0 comments on commit a6d2781

Please sign in to comment.