This repository was archived by the owner on Feb 20, 2024. It is now read-only.
File tree Expand file tree Collapse file tree
src/lib/api_app/src/api/routes Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -34,7 +34,10 @@ pub mod testbed;
3434 testbed:: productizers:: person:: basic_information:: get_basic_information,
3535 testbed:: productizers:: person:: basic_information:: write_basic_information,
3636 testbed:: productizers:: person:: job_applicant_profile:: get_job_applicant_profile,
37- testbed:: productizers:: person:: job_applicant_profile:: write_job_applicant_profile
37+ testbed:: productizers:: person:: job_applicant_profile:: write_job_applicant_profile,
38+ testbed:: productizers:: non_listed_company:: establishment:: write_establishment,
39+ testbed:: productizers:: non_listed_company:: beneficial_owners:: get_beneficial_owners,
40+ testbed:: productizers:: non_listed_company:: signatory_rights:: get_signatory_rights
3841 ) ,
3942 components( schemas( // @TODO: would be very nice to auto-generate schemas
4043 testbed:: ProxyRequestInput ,
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ pub mod figure;
88pub mod job;
99pub mod person;
1010pub mod user;
11+ pub mod non_listed_company;
1112
1213/**
1314 * Parses the authorization headers from the input request
Original file line number Diff line number Diff line change 1+ use app:: {
2+ responses:: APIResponse ,
3+ router:: ParsedRequest
4+ } ;
5+
6+ #[ utoipa:: path(
7+ post,
8+ path = "/testbed/productizer/non-listed-company/beneficial-owners" ,
9+ request_body(
10+ content = Object ,
11+ description = "Get beneficial owners information" ,
12+ examples( ( "Success" = (
13+ summary = "JSON example" ,
14+ value = json!( "Loading..." ) ,
15+ external_value = "https://raw.githubusercontent.com/Virtual-Finland/definitions/main/DataProducts/draft/NSG/Agent/LegalEntity/NonListedCompany/BeneficialOwners.json"
16+ ) ) )
17+ ) ,
18+ responses( (
19+ status = 200 ,
20+ body = Object ,
21+ description = "Beneficial owners response" ,
22+ examples( ( "Success" = (
23+ summary = "JSON example" ,
24+ value = json!( "Loading..." ) ,
25+ external_value = "https://raw.githubusercontent.com/Virtual-Finland/definitions/main/DataProducts/draft/NSG/Agent/LegalEntity/NonListedCompany/BeneficialOwners.json"
26+ ) ) )
27+ ) ) ,
28+ security( ( "BearerAuth" = [ ] ) )
29+ ) ]
30+ pub async fn get_beneficial_owners ( request : ParsedRequest ) -> APIResponse {
31+ let data_product = "draft/NSG/Agent/LegalEntity/NonListedCompany/BeneficialOwners" ;
32+ let data_source = "virtualfinland" ;
33+ let result = super :: post_data_product ( data_product, data_source, request) . await ?;
34+ Ok ( result)
35+ }
Original file line number Diff line number Diff line change 1+ use app:: {
2+ responses:: APIResponse ,
3+ router:: ParsedRequest
4+ } ;
5+
6+ #[ utoipa:: path(
7+ post,
8+ path = "/testbed/productizer/non-listed-company/establishment" ,
9+ request_body(
10+ content = Object ,
11+ description = "Write company establishment information" ,
12+ examples( ( "Success" = (
13+ summary = "JSON example" ,
14+ value = json!( "Loading..." ) ,
15+ external_value = "https://raw.githubusercontent.com/Virtual-Finland/definitions/main/DataProducts/draft/NSG/Agent/LegalEntity/NonListedCompany/Establishment/Write.json"
16+ ) ) )
17+ ) ,
18+ responses( (
19+ status = 200 ,
20+ body = Object ,
21+ description = "Company establishment response" ,
22+ examples( ( "Success" = (
23+ summary = "JSON example" ,
24+ value = json!( "Loading..." ) ,
25+ external_value = "https://raw.githubusercontent.com/Virtual-Finland/definitions/main/DataProducts/draft/NSG/Agent/LegalEntity/NonListedCompany/Establishment/Write.json"
26+ ) ) )
27+ ) ) ,
28+ security( ( "BearerAuth" = [ ] ) )
29+ ) ]
30+ pub async fn write_establishment ( request : ParsedRequest ) -> APIResponse {
31+ let data_product = "draft/NSG/Agent/LegalEntity/NonListedCompany/Establishment/Write" ;
32+ let data_source = "virtualfinland" ;
33+ let result = super :: post_data_product ( data_product, data_source, request) . await ?;
34+ Ok ( result)
35+ }
Original file line number Diff line number Diff line change 1+ use serde_json:: { json, Value as JSONValue } ;
2+
3+ use app:: {
4+ requests:: post_json_request,
5+ responses:: APIResponse ,
6+ router:: ParsedRequest
7+ } ;
8+
9+ use super :: { build_data_product_uri, parse_testbed_request_headers} ;
10+
11+ pub mod signatory_rights;
12+ pub mod establishment;
13+ pub mod beneficial_owners;
14+
15+ pub async fn post_data_product (
16+ data_product : & str ,
17+ data_source : & str ,
18+ request : ParsedRequest ,
19+ ) -> APIResponse {
20+ let request_input: JSONValue =
21+ serde_json:: from_str ( request. body . as_str ( ) ) . unwrap_or_else ( |_| json ! ( { } ) ) ;
22+ let request_headers = parse_testbed_request_headers ( request) ?;
23+ let response = post_json_request :: < JSONValue , JSONValue > (
24+ build_data_product_uri ( data_product, data_source) ,
25+ & request_input,
26+ request_headers,
27+ )
28+ . await ?;
29+ Ok ( response)
30+ }
Original file line number Diff line number Diff line change 1+ use app:: {
2+ responses:: APIResponse ,
3+ router:: ParsedRequest
4+ } ;
5+
6+ #[ utoipa:: path(
7+ post,
8+ path = "/testbed/productizer/non-listed-company/signatory-rights" ,
9+ request_body(
10+ content = Object ,
11+ description = "Get beneficial owners information" ,
12+ examples( ( "Success" = (
13+ summary = "JSON example" ,
14+ value = json!( "Loading..." ) ,
15+ external_value = "https://raw.githubusercontent.com/Virtual-Finland/definitions/main/DataProducts/draft/NSG/Agent/LegalEntity/NonListedCompany/SignatoryRights.json"
16+ ) ) )
17+ ) ,
18+ responses( (
19+ status = 200 ,
20+ body = Object ,
21+ description = "Beneficial owners response" ,
22+ examples( ( "Success" = (
23+ summary = "JSON example" ,
24+ value = json!( "Loading..." ) ,
25+ external_value = "https://raw.githubusercontent.com/Virtual-Finland/definitions/main/DataProducts/draft/NSG/Agent/LegalEntity/NonListedCompany/SignatoryRights.json"
26+ ) ) )
27+ ) ) ,
28+ security( ( "BearerAuth" = [ ] ) )
29+ ) ]
30+ pub async fn get_signatory_rights ( request : ParsedRequest ) -> APIResponse {
31+ let data_product = "draft/NSG/Agent/LegalEntity/NonListedCompany/SignatoryRights" ;
32+ let data_source = "virtualfinland" ;
33+ let result = super :: post_data_product ( data_product, data_source, request) . await ?;
34+ Ok ( result)
35+ }
You can’t perform that action at this time.
0 commit comments