Refactor FinancialInvoice class to simplify properties
Removed `SmsCode`, `FinancialStatementId`, and `FinancialStatement` properties, along with their associated methods (`SetFinancialStatement` and `SetNewSmsCode`). Added a new `InvoiceId` property of type `Guid` to serve as a unique identifier for invoices. Updated the constructor to initialize `InvoiceId` and removed the `SmsCode` initialization logic. These changes streamline the `FinancialInvoice` class and improve its alignment with application requirements.
This commit is contained in:
@@ -13,9 +13,8 @@ public class FinancialInvoice:EntityBase
|
||||
public FinancialInvoiceStatus Status { get; private set; }
|
||||
public DateTime? PaidAt { get; private set; }
|
||||
public double Amount { get; private set; }
|
||||
public string SmsCode { get; private set; }
|
||||
public long? FinancialStatementId { get; private set; }
|
||||
public FinancialStatment FinancialStatement { get; private set; }
|
||||
public Guid InvoiceId { get; private set; }
|
||||
|
||||
|
||||
public FinancialInvoice(int month, int year, FinancialInvoiceStatus status, double amount)
|
||||
{
|
||||
@@ -23,11 +22,7 @@ public class FinancialInvoice:EntityBase
|
||||
Year = year;
|
||||
Status = status;
|
||||
Amount = amount;
|
||||
SmsCode = Guid.NewGuid().ToString("N");
|
||||
}
|
||||
public void SetFinancialStatement(long financialStatementId)
|
||||
{
|
||||
FinancialStatementId = financialStatementId;
|
||||
InvoiceId = Guid.NewGuid();
|
||||
}
|
||||
public void SetPaid(DateTime paidAt)
|
||||
{
|
||||
@@ -49,10 +44,6 @@ public class FinancialInvoice:EntityBase
|
||||
Status = FinancialInvoiceStatus.Refunded;
|
||||
PaidAt = null;
|
||||
}
|
||||
public void SetNewSmsCode()
|
||||
{
|
||||
SmsCode = Guid.NewGuid().ToString("N");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user