1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-01 08:02:49 -05:00

billing info when self hosted with no gateway info

This commit is contained in:
Kyle Spearrin
2017-08-11 23:23:50 -04:00
parent 67edcd035c
commit a020a7268e
2 changed files with 16 additions and 6 deletions

View File

@ -23,6 +23,14 @@ namespace Bit.Core.Models.Api
License = new UserLicense(user, billing, licenseService);
}
public BillingResponseModel(User user)
: base("billing")
{
StorageName = user.Storage.HasValue ? Utilities.CoreHelpers.ReadableBytesSize(user.Storage.Value) : null;
StorageGb = user.Storage.HasValue ? Math.Round(user.Storage.Value / 1073741824D, 2) : 0; // 1 GB
MaxStorageGb = user.MaxStorageGb;
}
public string StorageName { get; set; }
public double? StorageGb { get; set; }
public short? MaxStorageGb { get; set; }