Skip to content

Commit 1af09a7

Browse files
Merge pull request #797 from companieshouse/feature/siv-450-create-association-service
SIV-450 create association service
2 parents 821b635 + 7c10407 commit 1af09a7

File tree

6 files changed

+1507
-74
lines changed

6 files changed

+1507
-74
lines changed

src/client.ts

Lines changed: 77 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -36,84 +36,87 @@ import PscVerificationService from "./services/psc-verification-link/service";
3636
import { AccountsFilingService } from "./services/accounts-filing";
3737
import PscService from "./services/psc/service";
3838
import { LimitedPartnershipsService } from "./services/limited-partnerships"
39+
import AssociationsService from "./services/associations/service";
3940

4041
/**
4142
* ApiClient is the class that all service objects hang off.
4243
*/
4344
export default class ApiClient {
44-
public clientType: ClientType;
45-
public readonly lateFilingPenalties: LateFilingPenaltyService;
46-
public readonly companyOfficers: CompanyOfficersService;
47-
public readonly companyFilingHistory: CompanyFilingHistoryService;
48-
public readonly companyProfile: CompanyProfileService;
49-
public readonly companyMetrics: CompanyMetricsService;
50-
public readonly companyPsc: CompanyPscService;
51-
public readonly companyPscStatements: CompanyPscStatementsService;
52-
public readonly confirmationStatementService: ConfirmationStatementService;
53-
public readonly certificate: CertificateService;
54-
public readonly certifiedCopies: CertifiedCopiesService;
55-
public readonly basket: BasketService;
56-
public readonly payment: PaymentService;
57-
public readonly checkout: CheckoutService;
58-
public readonly checkoutItem: CheckoutItemService;
59-
public readonly order: OrderService;
60-
public readonly orderItem: OrderItemService;
61-
public readonly checkoutSearchService: CheckoutSearchService;
62-
public readonly mid : MidService;
63-
public readonly refreshToken: RefreshTokenService;
64-
public readonly alphabeticalSearch: AlphabeticalSearchService;
65-
public readonly dissolvedSearch: DissolvedSearchService;
66-
public readonly advancedSearch: AdvancedSearchService;
67-
public readonly pscDiscrepancies: PSCDiscrepancyService;
68-
public readonly pscDiscrepancyReport: PSCDiscrepanciesReportService;
69-
public readonly transaction: TransactionService;
70-
public readonly registeredEmailAddressService: RegisteredEmailAddressService;
71-
public readonly overseasEntity: OverseasEntityService;
72-
public readonly officerFiling: OfficerFilingService;
73-
public readonly acsp: AcspService;
74-
public readonly postCodeLookup: PostcodeLookupService;
75-
public readonly pscVerificationService: PscVerificationService;
76-
public readonly accountsFilingService: AccountsFilingService;
77-
public readonly pscService: PscService;
78-
public readonly limitedPartnershipsService: LimitedPartnershipsService;
45+
public clientType: ClientType;
46+
public readonly lateFilingPenalties: LateFilingPenaltyService;
47+
public readonly companyOfficers: CompanyOfficersService;
48+
public readonly companyFilingHistory: CompanyFilingHistoryService;
49+
public readonly companyProfile: CompanyProfileService;
50+
public readonly companyMetrics: CompanyMetricsService;
51+
public readonly companyPsc: CompanyPscService;
52+
public readonly companyPscStatements: CompanyPscStatementsService;
53+
public readonly confirmationStatementService: ConfirmationStatementService;
54+
public readonly certificate: CertificateService;
55+
public readonly certifiedCopies: CertifiedCopiesService;
56+
public readonly basket: BasketService;
57+
public readonly payment: PaymentService;
58+
public readonly checkout: CheckoutService;
59+
public readonly checkoutItem: CheckoutItemService;
60+
public readonly order: OrderService;
61+
public readonly orderItem: OrderItemService;
62+
public readonly checkoutSearchService: CheckoutSearchService;
63+
public readonly mid: MidService;
64+
public readonly refreshToken: RefreshTokenService;
65+
public readonly alphabeticalSearch: AlphabeticalSearchService;
66+
public readonly dissolvedSearch: DissolvedSearchService;
67+
public readonly advancedSearch: AdvancedSearchService;
68+
public readonly pscDiscrepancies: PSCDiscrepancyService;
69+
public readonly pscDiscrepancyReport: PSCDiscrepanciesReportService;
70+
public readonly transaction: TransactionService;
71+
public readonly registeredEmailAddressService: RegisteredEmailAddressService;
72+
public readonly overseasEntity: OverseasEntityService;
73+
public readonly officerFiling: OfficerFilingService;
74+
public readonly acsp: AcspService;
75+
public readonly postCodeLookup: PostcodeLookupService;
76+
public readonly pscVerificationService: PscVerificationService;
77+
public readonly accountsFilingService: AccountsFilingService;
78+
public readonly pscService: PscService;
79+
public readonly limitedPartnershipsService: LimitedPartnershipsService;
80+
public readonly associationsService: AssociationsService;
7981

80-
constructor (readonly apiClient: IHttpClient, readonly accountClient: IHttpClient) {
81-
// services on the api domain using the apiClient
82-
this.lateFilingPenalties = new LateFilingPenaltyService(apiClient);
83-
this.companyOfficers = new CompanyOfficersService(apiClient);
84-
this.companyFilingHistory = new CompanyFilingHistoryService(apiClient);
85-
this.companyProfile = new CompanyProfileService(apiClient);
86-
this.companyMetrics = new CompanyMetricsService(apiClient);
87-
this.companyPsc = new CompanyPscService(apiClient);
88-
this.companyPscStatements = new CompanyPscStatementsService(apiClient);
89-
this.confirmationStatementService = new ConfirmationStatementService(apiClient);
90-
this.certificate = new CertificateService(apiClient);
91-
this.certifiedCopies = new CertifiedCopiesService(apiClient);
92-
this.basket = new BasketService(apiClient);
93-
this.payment = new PaymentService(apiClient); // TODO split payments url/domain into a separate config item and http client
94-
this.checkout = new CheckoutService(apiClient);
95-
this.checkoutItem = new CheckoutItemService(apiClient);
96-
this.order = new OrderService(apiClient);
97-
this.orderItem = new OrderItemService(apiClient);
98-
this.officerFiling = new OfficerFilingService(apiClient);
99-
this.acsp = new AcspService(apiClient);
100-
this.checkoutSearchService = new CheckoutSearchService(apiClient);
101-
this.mid = new MidService(apiClient);
102-
this.alphabeticalSearch = new AlphabeticalSearchService(apiClient);
103-
this.dissolvedSearch = new DissolvedSearchService(apiClient);
104-
this.advancedSearch = new AdvancedSearchService(apiClient);
105-
this.overseasEntity = new OverseasEntityService(apiClient);
106-
// service on the account/identity domain using the accountClient
107-
// e.g. user profile service can be added here when required
108-
this.refreshToken = new RefreshTokenService(accountClient);
109-
this.pscDiscrepancies = new PSCDiscrepancyService(apiClient);
110-
this.pscDiscrepancyReport = new PSCDiscrepanciesReportService(apiClient);
111-
this.transaction = new TransactionService(apiClient);
112-
this.registeredEmailAddressService = new RegisteredEmailAddressService(apiClient);
113-
this.postCodeLookup = new PostcodeLookupService(apiClient);
114-
this.pscVerificationService = new PscVerificationService(apiClient);
115-
this.accountsFilingService = new AccountsFilingService(apiClient);
116-
this.pscService = new PscService(apiClient);
117-
this.limitedPartnershipsService = new LimitedPartnershipsService(apiClient);
118-
}
82+
constructor (readonly apiClient: IHttpClient, readonly accountClient: IHttpClient) {
83+
// services on the api domain using the apiClient
84+
this.lateFilingPenalties = new LateFilingPenaltyService(apiClient);
85+
this.companyOfficers = new CompanyOfficersService(apiClient);
86+
this.companyFilingHistory = new CompanyFilingHistoryService(apiClient);
87+
this.companyProfile = new CompanyProfileService(apiClient);
88+
this.companyMetrics = new CompanyMetricsService(apiClient);
89+
this.companyPsc = new CompanyPscService(apiClient);
90+
this.companyPscStatements = new CompanyPscStatementsService(apiClient);
91+
this.confirmationStatementService = new ConfirmationStatementService(apiClient);
92+
this.certificate = new CertificateService(apiClient);
93+
this.certifiedCopies = new CertifiedCopiesService(apiClient);
94+
this.basket = new BasketService(apiClient);
95+
this.payment = new PaymentService(apiClient); // TODO split payments url/domain into a separate config item and http client
96+
this.checkout = new CheckoutService(apiClient);
97+
this.checkoutItem = new CheckoutItemService(apiClient);
98+
this.order = new OrderService(apiClient);
99+
this.orderItem = new OrderItemService(apiClient);
100+
this.officerFiling = new OfficerFilingService(apiClient);
101+
this.acsp = new AcspService(apiClient);
102+
this.checkoutSearchService = new CheckoutSearchService(apiClient);
103+
this.mid = new MidService(apiClient);
104+
this.alphabeticalSearch = new AlphabeticalSearchService(apiClient);
105+
this.dissolvedSearch = new DissolvedSearchService(apiClient);
106+
this.advancedSearch = new AdvancedSearchService(apiClient);
107+
this.overseasEntity = new OverseasEntityService(apiClient);
108+
// service on the account/identity domain using the accountClient
109+
// e.g. user profile service can be added here when required
110+
this.refreshToken = new RefreshTokenService(accountClient);
111+
this.pscDiscrepancies = new PSCDiscrepancyService(apiClient);
112+
this.pscDiscrepancyReport = new PSCDiscrepanciesReportService(apiClient);
113+
this.transaction = new TransactionService(apiClient);
114+
this.registeredEmailAddressService = new RegisteredEmailAddressService(apiClient);
115+
this.postCodeLookup = new PostcodeLookupService(apiClient);
116+
this.pscVerificationService = new PscVerificationService(apiClient);
117+
this.accountsFilingService = new AccountsFilingService(apiClient);
118+
this.pscService = new PscService(apiClient);
119+
this.limitedPartnershipsService = new LimitedPartnershipsService(apiClient);
120+
this.associationsService = new AssociationsService(accountClient);
121+
}
119122
}

src/services/associations/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export * from "./types";
2+
export * from "./service";

0 commit comments

Comments
 (0)