2017-03-03 06:07:11 +01:00
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using Bit.Core.Models.Business;
|
2017-03-09 03:45:08 +01:00
|
|
|
|
using Bit.Core.Models.Table;
|
2017-03-03 06:07:11 +01:00
|
|
|
|
using System;
|
2017-03-10 05:58:43 +01:00
|
|
|
|
using System.Collections.Generic;
|
2017-04-10 17:49:53 +02:00
|
|
|
|
using Bit.Core.Enums;
|
2017-05-11 20:52:35 +02:00
|
|
|
|
using Bit.Core.Models.Data;
|
2017-03-03 06:07:11 +01:00
|
|
|
|
|
|
|
|
|
namespace Bit.Core.Services
|
|
|
|
|
{
|
|
|
|
|
public interface IOrganizationService
|
|
|
|
|
{
|
2019-02-26 18:45:34 +01:00
|
|
|
|
Task ReplacePaymentMethodAsync(Guid organizationId, string paymentToken, PaymentMethodType paymentMethodType);
|
2018-12-31 19:34:02 +01:00
|
|
|
|
Task CancelSubscriptionAsync(Guid organizationId, bool? endOfPeriod = null);
|
2017-04-11 00:20:21 +02:00
|
|
|
|
Task ReinstateSubscriptionAsync(Guid organizationId);
|
2019-08-10 05:56:26 +02:00
|
|
|
|
Task<Tuple<bool, string>> UpgradePlanAsync(Guid organizationId, OrganizationUpgrade upgrade);
|
2019-08-10 18:59:32 +02:00
|
|
|
|
Task<string> AdjustStorageAsync(Guid organizationId, short storageAdjustmentGb);
|
2019-08-12 16:03:50 +02:00
|
|
|
|
Task<string> AdjustSeatsAsync(Guid organizationId, int seatAdjustment);
|
2017-08-14 15:23:54 +02:00
|
|
|
|
Task VerifyBankAsync(Guid organizationId, int amount1, int amount2);
|
2017-03-03 06:07:11 +01:00
|
|
|
|
Task<Tuple<Organization, OrganizationUser>> SignUpAsync(OrganizationSignup organizationSignup);
|
2017-08-31 03:25:46 +02:00
|
|
|
|
Task<Tuple<Organization, OrganizationUser>> SignUpAsync(OrganizationLicense license, User owner,
|
|
|
|
|
string ownerKey, string collectionName);
|
2017-08-15 04:05:37 +02:00
|
|
|
|
Task UpdateLicenseAsync(Guid organizationId, OrganizationLicense license);
|
2017-04-11 16:52:28 +02:00
|
|
|
|
Task DeleteAsync(Organization organization);
|
2019-08-10 05:56:26 +02:00
|
|
|
|
Task EnableAsync(Guid organizationId, DateTime? expirationDate);
|
2017-08-13 04:16:42 +02:00
|
|
|
|
Task DisableAsync(Guid organizationId, DateTime? expirationDate);
|
|
|
|
|
Task UpdateExpirationDateAsync(Guid organizationId, DateTime? expirationDate);
|
2017-04-26 22:14:15 +02:00
|
|
|
|
Task EnableAsync(Guid organizationId);
|
2017-04-11 01:07:38 +02:00
|
|
|
|
Task UpdateAsync(Organization organization, bool updateBilling = false);
|
2018-04-03 05:18:26 +02:00
|
|
|
|
Task UpdateTwoFactorProviderAsync(Organization organization, TwoFactorProviderType type);
|
|
|
|
|
Task DisableTwoFactorProviderAsync(Organization organization, TwoFactorProviderType type);
|
2017-12-12 19:21:15 +01:00
|
|
|
|
Task<OrganizationUser> InviteUserAsync(Guid organizationId, Guid? invitingUserId, string email,
|
2017-05-16 06:11:21 +02:00
|
|
|
|
OrganizationUserType type, bool accessAll, string externalId, IEnumerable<SelectionReadOnly> collections);
|
2020-02-19 20:56:16 +01:00
|
|
|
|
Task<List<OrganizationUser>> InviteUserAsync(Guid organizationId, Guid? invitingUserId,
|
|
|
|
|
IEnumerable<string> emails, OrganizationUserType type, bool accessAll, string externalId,
|
|
|
|
|
IEnumerable<SelectionReadOnly> collections);
|
2019-10-07 22:23:38 +02:00
|
|
|
|
Task ResendInviteAsync(Guid organizationId, Guid? invitingUserId, Guid organizationUserId);
|
2020-02-19 20:56:16 +01:00
|
|
|
|
Task<OrganizationUser> AcceptUserAsync(Guid organizationUserId, User user, string token,
|
|
|
|
|
IUserService userService);
|
|
|
|
|
Task<OrganizationUser> ConfirmUserAsync(Guid organizationId, Guid organizationUserId, string key,
|
2020-03-09 20:13:40 +01:00
|
|
|
|
Guid confirmingUserId, IUserService userService);
|
2019-03-06 05:24:14 +01:00
|
|
|
|
Task SaveUserAsync(OrganizationUser user, Guid? savingUserId, IEnumerable<SelectionReadOnly> collections);
|
2017-12-12 19:21:15 +01:00
|
|
|
|
Task DeleteUserAsync(Guid organizationId, Guid organizationUserId, Guid? deletingUserId);
|
2017-04-12 16:07:27 +02:00
|
|
|
|
Task DeleteUserAsync(Guid organizationId, Guid userId);
|
2017-12-01 22:00:30 +01:00
|
|
|
|
Task UpdateUserGroupsAsync(OrganizationUser organizationUser, IEnumerable<Guid> groupIds);
|
2017-08-15 22:11:08 +02:00
|
|
|
|
Task<OrganizationLicense> GenerateLicenseAsync(Guid organizationId, Guid installationId);
|
2017-08-30 17:23:55 +02:00
|
|
|
|
Task<OrganizationLicense> GenerateLicenseAsync(Organization organization, Guid installationId);
|
2017-05-16 06:11:21 +02:00
|
|
|
|
Task ImportAsync(Guid organizationId, Guid importingUserId, IEnumerable<ImportedGroup> groups,
|
2019-05-07 03:31:20 +02:00
|
|
|
|
IEnumerable<ImportedOrganizationUser> newUsers, IEnumerable<string> removeUserExternalIds,
|
|
|
|
|
bool overwriteExisting);
|
2019-03-04 15:52:43 +01:00
|
|
|
|
Task RotateApiKeyAsync(Organization organization);
|
2017-03-03 06:07:11 +01:00
|
|
|
|
}
|
|
|
|
|
}
|