Skip to content

Commit

Permalink
feat: add lxr_cn_company_fund_collection_shareholders()
Browse files Browse the repository at this point in the history
  • Loading branch information
tanchangde committed Jan 18, 2024
1 parent 9d99655 commit 33f8ecb
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 1 deletion.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export(lxr_cn_company_fs_insurance)
export(lxr_cn_company_fs_non_financial)
export(lxr_cn_company_fs_other_financial)
export(lxr_cn_company_fs_security)
export(lxr_cn_company_fund_collection_shareholders)
export(lxr_cn_company_fund_shareholders)
export(lxr_cn_company_fundamental_statistics)
export(lxr_cn_company_indices)
Expand Down
8 changes: 8 additions & 0 deletions R/cn-company.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
#' information of the top ten circulating shareholders.
#' * `lxr_cn_company_fund_shareholders()` gets publicly offered fund
#' shareholding information.
#' * `lxr_cn_company_fund_collection_shareholders()` gets fund company's
#' shareholding information.
#'
#' @return A string of the API endpoint.
#' @rdname lxr_cn_company
Expand Down Expand Up @@ -188,3 +190,9 @@ lxr_cn_company_nolimit_shareholders <- function() {
lxr_cn_company_fund_shareholders <- function() {
"https://open.lixinger.com/api/cn/company/fund-shareholders"
}

#' @rdname lxr_cn_company
#' @export
lxr_cn_company_fund_collection_shareholders <- function() {
"https://open.lixinger.com/api/cn/company/fund-collection-shareholders"
}
3 changes: 2 additions & 1 deletion R/query-params.R
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ lxr_query_params <- function(endpoint) {
cn_company_inquiry = common_params,
cn_company_majority_shareholders = common_params,
cn_company_nolimit_shareholders = common_params,
cn_company_fund_shareholders = common_params
cn_company_fund_shareholders = common_params,
cn_company_fund_collection_shareholders = common_params
)
}
5 changes: 5 additions & 0 deletions man/lxr_cn_company.Rd

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

8 changes: 8 additions & 0 deletions tests/testthat/test-cn-company.R
Original file line number Diff line number Diff line change
Expand Up @@ -179,3 +179,11 @@ test_that("test cn_company_fund_shareholders", {
)
expect_s3_class(result, "tbl_df")
})

test_that("test cn_company_fund_collection_shareholders", {
result <- lxr_query(
endpoint = lxr_cn_company_fund_collection_shareholders(),
start_date = "2023-11-01", end_date = "2024-01-17", stock_code = "300750"
)
expect_s3_class(result, "tbl_df")
})

0 comments on commit 33f8ecb

Please sign in to comment.