mirror of
https://github.com/bitwarden/server.git
synced 2025-07-02 00:22:50 -05:00
database adjustments and storage for attachments
This commit is contained in:
@ -27,6 +27,9 @@ namespace Bit.Core.Models.Table
|
||||
public string Key { get; set; }
|
||||
public string PublicKey { get; set; }
|
||||
public string PrivateKey { get; set; }
|
||||
public bool Premium { get; set; }
|
||||
public long? Storage { get; set; }
|
||||
public short? MaxStorageGb { get; set; }
|
||||
public DateTime CreationDate { get; internal set; } = DateTime.UtcNow;
|
||||
public DateTime RevisionDate { get; internal set; } = DateTime.UtcNow;
|
||||
|
||||
@ -99,5 +102,21 @@ namespace Bit.Core.Models.Table
|
||||
|
||||
return providers[provider];
|
||||
}
|
||||
|
||||
public long StorageBytesRemaining()
|
||||
{
|
||||
if(!MaxStorageGb.HasValue)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
var maxStorageBytes = MaxStorageGb.Value * 1073741824L;
|
||||
if(!Storage.HasValue)
|
||||
{
|
||||
return maxStorageBytes;
|
||||
}
|
||||
|
||||
return maxStorageBytes - Storage.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user