Skip to content

Commit

Permalink
Merge pull request #327 from nofrixion/feature/MOOV-3134-statement-re…
Browse files Browse the repository at this point in the history
…factor

MOOV-3134: Added transaction statement models
  • Loading branch information
agranillonf authored May 13, 2024
2 parents f5f4f29 + 027537e commit 6569ed2
Show file tree
Hide file tree
Showing 5 changed files with 124 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/NoFrixion.MoneyMoov/Enums/StatementGenerationStatusEnum.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// -----------------------------------------------------------------------------
// Filename: StatementGenerationStatusEnum.cs
//
// Description: Enum for the status of a transaction statement generation.
//
// Author(s):
// Axel Granillo ([email protected])
//
// History:
// 09 05 2024 Axel Granillo Created, Remote, Mexico City, Mexico.
//
// License:
// Proprietary NoFrixion.
// -----------------------------------------------------------------------------

namespace NoFrixion.MoneyMoov.Enums;

public enum StatementGenerationStatusEnum
{
Unknown,
Generating,
Ready
}
22 changes: 22 additions & 0 deletions src/NoFrixion.MoneyMoov/Enums/TransactionStatementFormat.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// -----------------------------------------------------------------------------
// Filename: TransactionStatementFormat.cs
//
// Description: Enum for the format of a transaction statement.
//
// Author(s):
// Axel Granillo ([email protected])
//
// History:
// 03 05 2024 Axel Granillo Created, Mexico City, Mexico.
//
// License:
// Proprietary NoFrixion.
// -----------------------------------------------------------------------------

namespace NoFrixion.MoneyMoov.Enums;

public enum TransactionStatementFormat
{
Pdf,
Csv
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// -----------------------------------------------------------------------------
// Filename: GenerateStatementRequest.cs
//
// Description: Model for generating a transaction statement.
//
// Author(s):
// Axel Granillo ([email protected])
//
// History:
// 03 05 2024 Axel Granillo Created, Mexico City, Mexico.
//
// License:
// MIT.
// -----------------------------------------------------------------------------

using NoFrixion.MoneyMoov.Enums;

namespace NoFrixion.MoneyMoov.Models;

/// <summary>
/// Model for generating a transaction statement.
/// </summary>
public class GenerateStatementRequest
{
/// <summary>
/// ID of the account.
/// </summary>
public Guid AccountID { get; set; }

/// <summary>
/// Minimum transaction date for the statement.
/// </summary>
public DateTimeOffset FromDate { get; set; }

/// <summary>
/// Maximum transaction date for the statement.
/// </summary>
public DateTimeOffset ToDate { get; set; }

/// <summary>
/// File format to save the statement as. Defaults to PDF.
/// </summary>
public TransactionStatementFormat Format { get; set; } = TransactionStatementFormat.Pdf;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// -----------------------------------------------------------------------------
// Filename: GenerateStatementResponse.cs
//
// Description: Response model when generating a transaction statement.
//
// Author(s):
// Axel Granillo ([email protected])
//
// History:
// 03 05 2024 Axel Granillo Created, Mexico City, Mexico.
//
// License:
// Proprietary NoFrixion.
// -----------------------------------------------------------------------------

using NoFrixion.MoneyMoov.Enums;

namespace NoFrixion.MoneyMoov.Models;

public class GenerateStatementResponse
{
public Guid ID { get; set; }
public StatementGenerationStatusEnum Status { get; set; } = StatementGenerationStatusEnum.Unknown;
public string StatementUrl { get; set; } = "";
}
10 changes: 10 additions & 0 deletions src/NoFrixion.MoneyMoov/MoneyMoovUrlBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -362,4 +362,14 @@ public static string BeneficiaryGroupsGetAllApiUrl(string moneyMoovBaseUrl, Guid

return url;
}

public static string StatementsApiUrl(string moneyMoovBaseUrl)
{
return $"{moneyMoovBaseUrl}/statements";
}

public static string BusinessHubUrl(string moneyMoovBaseUrl)
{
return $"{moneyMoovBaseUrl}/signalr/business";
}
}

0 comments on commit 6569ed2

Please sign in to comment.