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

[PM-13999] Show estimated tax for taxable countries (#5077)

This commit is contained in:
Jonas Hendrickx
2024-12-04 11:45:11 +01:00
committed by GitHub
parent 44b687922d
commit 94fdfa40e8
30 changed files with 1793 additions and 531 deletions

View File

@ -0,0 +1,18 @@
using System.ComponentModel.DataAnnotations;
namespace Bit.Core.Billing.Models.Api.Requests.Accounts;
public class PreviewIndividualInvoiceRequestBody
{
[Required]
public PasswordManagerRequestModel PasswordManager { get; set; }
[Required]
public TaxInformationRequestModel TaxInformation { get; set; }
}
public class PasswordManagerRequestModel
{
[Range(0, int.MaxValue)]
public int AdditionalStorage { get; set; }
}

View File

@ -0,0 +1,37 @@
using System.ComponentModel.DataAnnotations;
using Bit.Core.Billing.Enums;
namespace Bit.Core.Billing.Models.Api.Requests.Organizations;
public class PreviewOrganizationInvoiceRequestBody
{
public Guid OrganizationId { get; set; }
[Required]
public PasswordManagerRequestModel PasswordManager { get; set; }
public SecretsManagerRequestModel SecretsManager { get; set; }
[Required]
public TaxInformationRequestModel TaxInformation { get; set; }
}
public class PasswordManagerRequestModel
{
public PlanType Plan { get; set; }
[Range(0, int.MaxValue)]
public int Seats { get; set; }
[Range(0, int.MaxValue)]
public int AdditionalStorage { get; set; }
}
public class SecretsManagerRequestModel
{
[Range(0, int.MaxValue)]
public int Seats { get; set; }
[Range(0, int.MaxValue)]
public int AdditionalMachineAccounts { get; set; }
}

View File

@ -0,0 +1,14 @@
using System.ComponentModel.DataAnnotations;
namespace Bit.Core.Billing.Models.Api.Requests;
public class TaxInformationRequestModel
{
[Length(2, 2), Required]
public string Country { get; set; }
[Required]
public string PostalCode { get; set; }
public string TaxId { get; set; }
}

View File

@ -0,0 +1,7 @@
namespace Bit.Core.Billing.Models.Api.Responses;
public record PreviewInvoiceResponseModel(
decimal EffectiveTaxRate,
decimal TaxableBaseAmount,
decimal TaxAmount,
decimal TotalAmount);