From fdf0eb989be49e6f5d8215f2eac1da275923f427 Mon Sep 17 00:00:00 2001 From: Matt Gibson Date: Fri, 30 Jul 2021 08:11:12 -0500 Subject: [PATCH] Provide owner with Provider client org create requst (#444) --- common/src/abstractions/api.service.ts | 3 ++- .../request/provider/providerOrganizationCreateRequest.ts | 5 +++++ common/src/services/api.service.ts | 3 ++- 3 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 common/src/models/request/provider/providerOrganizationCreateRequest.ts diff --git a/common/src/abstractions/api.service.ts b/common/src/abstractions/api.service.ts index 2c7e1e922c..b4541856a0 100644 --- a/common/src/abstractions/api.service.ts +++ b/common/src/abstractions/api.service.ts @@ -52,6 +52,7 @@ import { PaymentRequest } from '../models/request/paymentRequest'; import { PolicyRequest } from '../models/request/policyRequest'; import { PreloginRequest } from '../models/request/preloginRequest'; import { ProviderAddOrganizationRequest } from '../models/request/provider/providerAddOrganizationRequest'; +import { ProviderOrganizationCreateRequest } from '../models/request/provider/providerOrganizationCreateRequest'; import { ProviderSetupRequest } from '../models/request/provider/providerSetupRequest'; import { ProviderUpdateRequest } from '../models/request/provider/providerUpdateRequest'; import { ProviderUserAcceptRequest } from '../models/request/provider/providerUserAcceptRequest'; @@ -407,7 +408,7 @@ export abstract class ApiService { deleteManyProviderUsers: (providerId: string, request: ProviderUserBulkRequest) => Promise>; getProviderClients: (providerId: string) => Promise>; postProviderAddOrganization: (providerId: string, request: ProviderAddOrganizationRequest) => Promise; - postProviderCreateOrganization: (providerId: string, request: OrganizationCreateRequest) => Promise; + postProviderCreateOrganization: (providerId: string, request: ProviderOrganizationCreateRequest) => Promise; deleteProviderOrganization: (providerId: string, organizationId: string) => Promise; getEvents: (start: string, end: string, token: string) => Promise>; diff --git a/common/src/models/request/provider/providerOrganizationCreateRequest.ts b/common/src/models/request/provider/providerOrganizationCreateRequest.ts new file mode 100644 index 0000000000..e116de6afa --- /dev/null +++ b/common/src/models/request/provider/providerOrganizationCreateRequest.ts @@ -0,0 +1,5 @@ +import { OrganizationCreateRequest } from '../organizationCreateRequest'; + +export class ProviderOrganizationCreateRequest { + constructor(public clientOwnerEmail: string, public organizationCreateRequest: OrganizationCreateRequest) { } +} diff --git a/common/src/services/api.service.ts b/common/src/services/api.service.ts index 156baf2044..d86fefd974 100644 --- a/common/src/services/api.service.ts +++ b/common/src/services/api.service.ts @@ -54,6 +54,7 @@ import { PaymentRequest } from '../models/request/paymentRequest'; import { PolicyRequest } from '../models/request/policyRequest'; import { PreloginRequest } from '../models/request/preloginRequest'; import { ProviderAddOrganizationRequest } from '../models/request/provider/providerAddOrganizationRequest'; +import { ProviderOrganizationCreateRequest } from '../models/request/provider/providerOrganizationCreateRequest'; import { ProviderSetupRequest } from '../models/request/provider/providerSetupRequest'; import { ProviderUpdateRequest } from '../models/request/provider/providerUpdateRequest'; import { ProviderUserAcceptRequest } from '../models/request/provider/providerUserAcceptRequest'; @@ -1305,7 +1306,7 @@ export class ApiService implements ApiServiceAbstraction { return this.send('POST', '/providers/' + providerId + '/organizations/add', request, true, false); } - async postProviderCreateOrganization(providerId: string, request: OrganizationCreateRequest): Promise { + async postProviderCreateOrganization(providerId: string, request: ProviderOrganizationCreateRequest): Promise { const r = await this.send('POST', '/providers/' + providerId + '/organizations', request, true, true); return new ProviderOrganizationResponse(r); }