Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
200 commits
Select commit Hold shift + click to select a range
d978ec7
Recharges
jSylvestre Sep 15, 2025
28c4f55
Adds invoice type to invoices and teams
jSylvestre Sep 15, 2025
156e9a6
Renames InvoiceTypes to AllowedInvoiceTypes
jSylvestre Sep 15, 2025
2a65b2e
Adds invoice type to invoices and teams
jSylvestre Sep 15, 2025
175348f
Adds EF Core migrations history table
jSylvestre Sep 18, 2025
52d9315
Merge remote-tracking branch 'origin/master' into JCS/RechargesDbChan…
jSylvestre Sep 18, 2025
acb5fec
Validates and standardizes invoice types
jSylvestre Sep 18, 2025
195438d
Configures default invoice types for new teams
jSylvestre Sep 18, 2025
968a9dd
Adds type and allowed invoice type to tests
jSylvestre Sep 26, 2025
62d65ed
Merge pull request #427 from ucdavis/JCS/RechargesDbChanges20250915
jSylvestre Sep 26, 2025
73a382f
Adds database migrations on startup
jSylvestre Sep 26, 2025
0defdfc
Merge pull request #430 from ucdavis/JCS/AutoMigrate
jSylvestre Sep 26, 2025
f5b73de
Adds invoice type selection to teams
jSylvestre Sep 26, 2025
c31935d
Improves form checkbox spacing
jSylvestre Sep 26, 2025
5dab9de
not needed
jSylvestre Sep 26, 2025
703aa9f
Displays allowed invoice type in team details
jSylvestre Sep 26, 2025
05265ab
Restricts invoice type editing to admins.
jSylvestre Sep 26, 2025
8f518ea
Restricts invoice type modification to admins
jSylvestre Sep 26, 2025
ed4590e
Merge pull request #431 from ucdavis/JCS/ManageTeamRecharge20250926
jSylvestre Sep 26, 2025
d01bde9
Adds RechargeAccount entity
jSylvestre Sep 29, 2025
faa64c0
Adds recharge accounts to invoice
jSylvestre Sep 29, 2025
f93bcf1
Adds recharge account tests
jSylvestre Sep 29, 2025
c86c8e4
Adds recharge account entity
jSylvestre Sep 29, 2025
fb00289
Adds user tracking fields
jSylvestre Sep 29, 2025
f711917
Adds fields for recharge account audit
jSylvestre Oct 1, 2025
72f79d8
Adds script to create migrations
jSylvestre Oct 1, 2025
b382e92
Adds recharge account approval fields
jSylvestre Oct 1, 2025
4ef08de
Adds Recharge Accounts to Invoices
jSylvestre Oct 1, 2025
acbfda4
First pass at selecting invoice type
jSylvestre Oct 1, 2025
90360ee
Replaces button-group with toggle for invoice type
jSylvestre Oct 1, 2025
ebf75f2
Enhances invoice type toggle appearance
jSylvestre Oct 1, 2025
2a01182
Moves invoice type toggle styles to SCSS
jSylvestre Oct 1, 2025
91d7ca9
Merge pull request #436 from ucdavis/JCS/UIToggle
jSylvestre Oct 1, 2025
18406eb
Adds invoice type validation
jSylvestre Oct 1, 2025
9b0b22b
Adds fields to RechargeAccount tests
jSylvestre Oct 1, 2025
0ca92af
Merge branch 'JCS/TrackEntryApproval' into JCS/Validation20251001
jSylvestre Oct 1, 2025
2b0c9aa
Extracts model errors from ModelState
jSylvestre Oct 1, 2025
9383514
Updates invoice details page title
jSylvestre Oct 1, 2025
f87c4dc
Hides discount/tax for Recharge invoices
jSylvestre Oct 1, 2025
97abfd3
Merge pull request #437 from ucdavis/JCS/Validation20251001
jSylvestre Oct 1, 2025
f3a2a8d
Merge pull request #435 from ucdavis/JCS/ServerSide20251001
jSylvestre Oct 1, 2025
f3212e1
Merge pull request #434 from ucdavis/JCS/TrackEntryApproval
jSylvestre Oct 1, 2025
b72c70d
Merge pull request #433 from ucdavis/JCS/RechargeDbNewTable
jSylvestre Oct 1, 2025
3f3a68d
AE Validation for Recharges
jSylvestre Oct 2, 2025
bd58f90
Implements recharge account validation
jSylvestre Oct 2, 2025
1291e1b
Refactors account validation logic.
jSylvestre Oct 2, 2025
7a4dd5e
Adds approvers to recharge account validation
jSylvestre Oct 2, 2025
ae0c739
Adds recharge account validation logic
jSylvestre Oct 3, 2025
ead1a25
Approvers list
jSylvestre Oct 3, 2025
fa127af
Merge pull request #438 from ucdavis/JCS/RechargeValidation
jSylvestre Oct 6, 2025
e170e01
Adds Recharge Account Item Model
jSylvestre Oct 6, 2025
da1966a
WIP
jSylvestre Oct 6, 2025
f36bcef
AI stuff
jSylvestre Oct 6, 2025
ce7e5e4
Ignores Invoice property during serialization
jSylvestre Oct 6, 2025
c541da3
Adds recharge account support to invoices
jSylvestre Oct 6, 2025
c7fcf1b
Improves layout of recharge account entries.
jSylvestre Oct 6, 2025
637ecdd
Enhances invoice recharge account display
jSylvestre Oct 6, 2025
1075b5a
Adds CCOA picker functionality to invoice creation
jSylvestre Oct 6, 2025
0372e47
Adjusts layout of recharge accounts table
jSylvestre Oct 6, 2025
81ce600
Validates account amounts on recharge
jSylvestre Oct 6, 2025
e51060e
Fixes recharge account creation logic.
jSylvestre Oct 6, 2025
4642df6
Adds recharge accounts control
jSylvestre Oct 6, 2025
6f7bb6d
Validation is still a little funky. Green checkmark appears...
jSylvestre Oct 6, 2025
66ca075
fix test
jSylvestre Oct 7, 2025
a81024c
Improves Recharge Accounts Control styling
jSylvestre Oct 7, 2025
6bcbf49
Adds success alert for valid chart strings
jSylvestre Oct 7, 2025
4d9ec37
Validates form before opening send modal
jSylvestre Oct 7, 2025
38ace94
Fixes circular updates in recharge accounts
jSylvestre Oct 7, 2025
bd0bd6f
Improves chart string validation and UX
jSylvestre Oct 7, 2025
1198cdf
Recalculates percentages when invoice total changes
jSylvestre Oct 7, 2025
22964ae
Validates credit/debit totals against invoice total
jSylvestre Oct 7, 2025
8b9dcd0
Merge pull request #440 from ucdavis/JCS/AiWorkNeedsReview
jSylvestre Oct 7, 2025
a4afee5
Merge pull request #439 from ucdavis/JCS/Recharge20251006
jSylvestre Oct 7, 2025
aabb883
WIP Details page
jSylvestre Oct 7, 2025
6032094
Improves invoice total validation for recharge accounts
jSylvestre Oct 7, 2025
9476abc
Merge pull request #441 from ucdavis/JCS/Recharge20251007
jSylvestre Oct 7, 2025
254afbe
Merge remote-tracking branch 'origin/JCS/Recharge2025' into JCS/Recha…
jSylvestre Oct 7, 2025
f15d0be
Merge pull request #442 from ucdavis/JCS/FixDebitRechargeValidation
jSylvestre Oct 7, 2025
3dbd1c7
Merge remote-tracking branch 'origin/JCS/Recharge2025' into JCS/Recha…
jSylvestre Oct 7, 2025
5645e33
Displays recharge account details in a table
jSylvestre Oct 7, 2025
e44a1ba
Enhances invoice type display in list
jSylvestre Oct 7, 2025
19234f1
Merge pull request #443 from ucdavis/JCS/Recharge20251007
jSylvestre Oct 7, 2025
4219063
Adds recharge invoice payment functionality
jSylvestre Oct 9, 2025
8241e9b
Removes unnecessary style rule
jSylvestre Oct 9, 2025
fb29365
Updates invoice email for recharge invoices
jSylvestre Oct 9, 2025
fbecbb5
Updates state immutably in account controls
jSylvestre Oct 13, 2025
f23a84d
Sanitizes chart string validation messages
jSylvestre Oct 13, 2025
cd14f48
Much better.
jSylvestre Oct 13, 2025
fb1c547
Merge pull request #446 from ucdavis/JCS/RechargeFixes20251013
jSylvestre Oct 13, 2025
d272eb5
Will need new statuses
jSylvestre Oct 13, 2025
e1319d4
Merge remote-tracking branch 'origin/JCS/Recharge2025' into JCS/Recha…
jSylvestre Oct 13, 2025
f28e619
Update test
jSylvestre Oct 13, 2025
7231dfb
Merge pull request #444 from ucdavis/JCS/Recharge20251009
jSylvestre Oct 13, 2025
6fb2a84
WIP
jSylvestre Oct 14, 2025
123781b
Merge remote-tracking branch 'origin/master' into JCS/Recharge20251014
jSylvestre Oct 14, 2025
ce8fc22
WIP, Recharge Pay page
jSylvestre Oct 14, 2025
d0c0ec2
stub
jSylvestre Oct 14, 2025
88ee62a
Adds recharge invoice payment feature
jSylvestre Oct 15, 2025
53d77e5
Supports debit-only invoice payments
jSylvestre Oct 15, 2025
5621dde
Simplifies debit account mapping
jSylvestre Oct 15, 2025
8919039
Improves invoice payment validation process
jSylvestre Oct 15, 2025
e7f6f03
Improves recharge accounts UI and functionality
jSylvestre Oct 16, 2025
97af1d4
Adds noreferrer to finjector links
jSylvestre Oct 16, 2025
1bef930
Opens Finjector link in new tab
jSylvestre Oct 16, 2025
d47ef1a
Looks like it is working payment side, need to check edit invoice
jSylvestre Oct 16, 2025
0bcf38f
Endpoint for a preview page
jSylvestre Oct 21, 2025
3e45c9c
WIP Preview Page
jSylvestre Oct 21, 2025
7234cb3
Enables preview of Recharge invoices
jSylvestre Oct 21, 2025
447e58e
Adds interactive recharge preview
jSylvestre Oct 29, 2025
280deb5
Merge pull request #450 from ucdavis/JCS/RechargePreviewPage
jSylvestre Oct 30, 2025
8eada8b
Merge pull request #448 from ucdavis/JCS/RechargeVibe20251015
jSylvestre Oct 30, 2025
59fdde6
Validates recharge invoice data
jSylvestre Oct 30, 2025
41b9403
Restricts coupons and taxes for recharge invoices
jSylvestre Oct 30, 2025
962d1c1
Enhances recharge invoice validation and processing
jSylvestre Oct 30, 2025
b25639f
Validates recharge accounts server-side.
jSylvestre Oct 30, 2025
f09f0a6
Includes RechargeAccounts in invoice queries
jSylvestre Oct 30, 2025
fbcc8be
Make the download match existing look.
jSylvestre Oct 30, 2025
9bd376c
wip
jSylvestre Oct 30, 2025
3dbb4e3
Improves invoice payment workflow
jSylvestre Oct 30, 2025
96ddec4
Improves recharge payment workflow
jSylvestre Oct 30, 2025
3c64f67
wip
jSylvestre Oct 30, 2025
5650344
Implements recharge account payment processing
jSylvestre Oct 31, 2025
09bfe65
Adds recharge paid by customer history event
jSylvestre Oct 31, 2025
0490750
Improves recharge paid history message
jSylvestre Oct 31, 2025
f3527df
Adds support for expandable history details
jSylvestre Oct 31, 2025
94e9740
Improves invoice history details display
jSylvestre Oct 31, 2025
3d3cd8f
Adds recharge account details to invoice history
jSylvestre Oct 31, 2025
ac7bb2d
WIP
jSylvestre Oct 31, 2025
73d4800
todos
jSylvestre Oct 31, 2025
56c9914
Sets PaidAt and Status for auto approvals
jSylvestre Oct 31, 2025
4407177
WIP
jSylvestre Nov 3, 2025
9f26b89
Merge branch 'JCS/RechargeServerSide20251029' into JCS/ApproversEmail
jSylvestre Nov 3, 2025
eee193a
Adds financial approver email
jSylvestre Nov 3, 2025
136df1b
Adds string truncation helper
jSylvestre Nov 4, 2025
9cf602e
Merge pull request #452 from ucdavis/JCS/ApproversEmail
jSylvestre Nov 4, 2025
5373a92
Truncates memo field in financial approval email
jSylvestre Nov 4, 2025
2202f5e
Adds recharge sent to financial approvers history
jSylvestre Nov 4, 2025
c87c39d
Adds tooltips to account validation statuses
jSylvestre Nov 4, 2025
43e5a03
cleanup
jSylvestre Nov 4, 2025
ee3a16b
Merge pull request #451 from ucdavis/JCS/RechargeServerSide20251029
jSylvestre Nov 4, 2025
f67cb7a
Adds recharge invoice approval workflow
jSylvestre Nov 4, 2025
7098c60
test
jSylvestre Nov 4, 2025
c511810
Adds support for financial approval view
jSylvestre Nov 4, 2025
84e495b
Adds recharge rejection functionality
jSylvestre Nov 5, 2025
e1beffd
Adds financial approver recharge approval
jSylvestre Nov 5, 2025
c7b9c6b
Adds approver check to recharge validation
jSylvestre Nov 6, 2025
dc9a429
Merge pull request #455 from ucdavis/JCS/Recharge20251104
jSylvestre Nov 6, 2025
ea5355c
Adds financial recharge approval
jSylvestre Nov 6, 2025
139cece
Renames action parameter for recharge approval
jSylvestre Nov 6, 2025
1d8e6ed
Removes redundant debit chart string display
jSylvestre Nov 6, 2025
75ce065
Adds recharge account validation
jSylvestre Nov 6, 2025
b65852d
Adds recharge accounts correctly
jSylvestre Nov 6, 2025
37311d9
React cleanup
jSylvestre Nov 7, 2025
2858c8e
Improves button cursor on disabled state.
jSylvestre Nov 7, 2025
5e9db48
Merge pull request #458 from ucdavis/JCS/RechargeReactChanges20251107
jSylvestre Nov 7, 2025
9baf656
Prevents self-approval of recharge accounts
jSylvestre Nov 7, 2025
addc076
Adds user creation during emulation
jSylvestre Nov 7, 2025
3252c89
Enhances Recharge Invoice Approval Process
jSylvestre Nov 7, 2025
a91b976
Merge pull request #456 from ucdavis/JCS/RechargeApproval20251106
jSylvestre Nov 7, 2025
f57c222
Adds checkApprover parameter to recharge validation
jSylvestre Nov 12, 2025
c5971ba
Merge pull request #459 from ucdavis/JCS/Recharge20251112
jSylvestre Nov 12, 2025
9582e4c
Sloth money movement
jSylvestre Nov 12, 2025
0c50132
Excludes recharge invoices from money movement job
jSylvestre Nov 12, 2025
ebeda39
Adds recharge invoice processing
jSylvestre Nov 12, 2025
927ee9d
Bumps assembly version to 2.0.0.0
jSylvestre Nov 12, 2025
1bc79c6
Adds Approved status to Invoice
jSylvestre Nov 12, 2025
6739456
Adds recharge money movement job
jSylvestre Nov 12, 2025
7fb61c4
Cleans up MoneyMovementJob and configures PaymentsApi
jSylvestre Nov 13, 2025
3288e8d
Enables recharge validation and improves job logging
jSylvestre Nov 13, 2025
318e693
Allows resending of Recharge invoices
jSylvestre Nov 13, 2025
e67c4e9
Handles Sloth transaction errors better
jSylvestre Nov 13, 2025
a975ef5
Updates recharge sloth integration
jSylvestre Nov 13, 2025
3c3e7f5
This will not compile.
jSylvestre Nov 13, 2025
9ce92ec
Updates recharge process to use sloth transactions
jSylvestre Nov 13, 2025
e2b3a15
Merge pull request #460 from ucdavis/JCS/RechargeSloth
jSylvestre Nov 13, 2025
bcb81e2
Updates receipt link
jSylvestre Nov 14, 2025
2d40d66
Adds recharge invoice functionality
jSylvestre Nov 14, 2025
cb6992e
Merge pull request #461 from ucdavis/JCS/Recharge20251114
jSylvestre Nov 14, 2025
ff992ed
Adds recharge auto-approval functionality
jSylvestre Nov 14, 2025
9710a99
Adds auto-approve job for recharge invoices
jSylvestre Nov 14, 2025
2db486a
Adds auto-approve job to the pipeline
jSylvestre Nov 14, 2025
98daf29
Removes AggieEnterprise settings
jSylvestre Nov 14, 2025
e06471f
Downgrades AutoApprove job to net6.0
jSylvestre Nov 14, 2025
623dde2
Updates app name for auto-approve job
jSylvestre Nov 14, 2025
ce128ff
Updates AutoApprove job project path
jSylvestre Nov 14, 2025
d4bf652
Removes unnecessary database save
jSylvestre Nov 14, 2025
85b9935
Improves recharge invoice approval flow
jSylvestre Nov 17, 2025
f07666f
Merge pull request #463 from ucdavis/JCS/Recharge20251117
jSylvestre Nov 17, 2025
4454488
Streamlines recharge invoice approval
jSylvestre Nov 17, 2025
a04ee70
Merge pull request #464 from ucdavis/JCS/Recharge20251117
jSylvestre Nov 17, 2025
51b0143
Adds recharge approval history
jSylvestre Nov 18, 2025
1a64af7
Not used from here
jSylvestre Nov 19, 2025
6953dc6
Enables recharge financial segment validation
jSylvestre Nov 19, 2025
2b7ddbf
Merge pull request #462 from ucdavis/JCS/RechargeAutoApproveJob
jSylvestre Nov 19, 2025
f35b8c9
oops
jSylvestre Nov 19, 2025
f078efe
Hides payment details for recharge invoices
jSylvestre Nov 19, 2025
0539364
Processes recharge invoices for Sloth upload
jSylvestre Nov 19, 2025
ee461fa
Improves chart string validation display
jSylvestre Nov 19, 2025
dc32a1d
Merge pull request #467 from ucdavis/JCS/RechargeSanatize
jSylvestre Nov 19, 2025
42a9768
Merge pull request #466 from ucdavis/JCS/Recharge20251119
jSylvestre Nov 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions Payments.Jobs.AutoApprove/Payments.Jobs.AutoApprove.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\src\Payments.Core\Payments.Core.csproj" />
<ProjectReference Include="..\src\Payments.Jobs.Core\Payments.Jobs.Core.csproj" />
</ItemGroup>

<ItemGroup>
<None Update="appsettings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</None>
<None Update="run.cmd">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="settings.job">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>
113 changes: 113 additions & 0 deletions Payments.Jobs.AutoApprove/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using Payments.Core.Data;
using Payments.Core.Domain;
using Payments.Core.Jobs;
using Payments.Core.Models.Configuration;
using Payments.Core.Models.History;
using Payments.Core.Services;
using Payments.Jobs.Core;
using Serilog;
using System;

namespace Payments.Jobs.MoneyMovement
{
Comment on lines +15 to +16
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Fix incorrect namespace.

The namespace is Payments.Jobs.MoneyMovement but this is the AutoApprove job. This copy-paste error could cause confusion and potential namespace conflicts.

Apply this diff:

-namespace Payments.Jobs.MoneyMovement
+namespace Payments.Jobs.AutoApprove
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
namespace Payments.Jobs.MoneyMovement
{
namespace Payments.Jobs.AutoApprove
{
🤖 Prompt for AI Agents
In Payments.Jobs.AutoApprove/Program.cs around lines 15 to 16, the declared
namespace is incorrectly set to Payments.Jobs.MoneyMovement; change it to
Payments.Jobs.AutoApprove to match the job's folder/name. Update the namespace
declaration line only, and ensure any internal references or usings remain valid
after the rename (adjust project files or folder-based namespace expectations if
necessary).

public class Program : JobBase
{
private static ILogger _log;

public static void Main(string[] args)
{
// setup env
Configure();


_log = Log.Logger
.ForContext("jobname", "AutoApprove");

var assembyName = typeof(Program).Assembly.GetName();
_log.Information("Running {job} build {build}", assembyName.Name, assembyName.Version);
_log.Information("AutoApprove Version 1");

// setup di
var provider = ConfigureServices();
var dbContext = provider.GetService<ApplicationDbContext>();


try
{
if(dbContext == null)
{
throw new InvalidOperationException("Failed to obtain ApplicationDbContext from service provider.");
}
var financeSettings = provider.GetService<IOptions<FinanceSettings>>()?.Value;
if (financeSettings == null)
{
throw new InvalidOperationException("FinanceSettings configuration is missing or invalid.");
}
var daysToAutoApprove = financeSettings.RechargeAutoApproveDays;
var dateThreshold = DateTime.UtcNow.AddDays(-daysToAutoApprove);

var invoices = dbContext.Invoices
.Include(i => i.RechargeAccounts)
.Where(a => a.Type == Invoice.InvoiceTypes.Recharge && a.Status == Invoice.StatusCodes.PendingApproval &&
a.PaidAt != null && a.PaidAt <= dateThreshold).ToList();
_log.Information("Found {count} invoices to auto-approve", invoices.Count);
foreach (var invoice in invoices)
{
invoice.Status = Invoice.StatusCodes.Approved;
foreach (var ra in invoice.RechargeAccounts.Where(a => a.Direction == RechargeAccount.CreditDebit.Debit && string.IsNullOrWhiteSpace( a.ApprovedByKerb)))
{
ra.ApprovedByKerb = "Automated";
ra.ApprovedByName = "System";
}

invoice.Paid = true;

var approvalAction = new History()
{
Type = HistoryActionTypes.RechargeApprovedByFinancialApprover.TypeCode,
ActionDateTime = DateTime.UtcNow,
Actor = "System",
Data = "All debit recharge accounts have been approved."
};

invoice.History.Add(approvalAction);
dbContext.Invoices.Update(invoice);
_log.Information("Auto-approved invoice {invoiceId}", invoice.Id);

dbContext.SaveChanges();
}
}
catch (Exception ex)
{

_log.Error("Error running AutoApprove job", ex);
throw;
}

_log.Information("AutoApprove job completed");

}

private static ServiceProvider ConfigureServices()
{
IServiceCollection services = new ServiceCollection();

// options files
services.Configure<FinanceSettings>(Configuration.GetSection("Finance"));


// db service
services.AddDbContext<ApplicationDbContext>(options =>
options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection"))
);



return services.BuildServiceProvider();
}
}
}
10 changes: 10 additions & 0 deletions Payments.Jobs.AutoApprove/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"profiles": {
"Payments.Jobs.AutoApprove": {
"commandName": "Project",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
18 changes: 18 additions & 0 deletions Payments.Jobs.AutoApprove/appsettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"ConnectionStrings": {
"DefaultConnection": "Data Source=.\\SQLExpress;Initial Catalog=Payments;Integrated Security=True;MultipleActiveResultSets=True"
},
"Logging": {
"LogLevel": {
"Default": "Warning"
}
},
"Finance": {
"RechargeAutoApproveDays": 7
},
"Stackify": {
"AppName": "payments.jobs.autoapprove",
"ApiKey": "[External]",
"Environment": "[External]"
}
}
3 changes: 3 additions & 0 deletions Payments.Jobs.AutoApprove/run.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@echo off

dotnet Payments.Jobs.AutoApprove.dll
3 changes: 3 additions & 0 deletions Payments.Jobs.AutoApprove/settings.job
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"schedule": "0 0 6 * * *"
}
19 changes: 17 additions & 2 deletions Payments.sln
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29326.143
# Visual Studio Version 17
VisualStudioVersion = 17.14.36705.20 d17.14
MinimumVisualStudioVersion = 15.0.26124.0
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{D1C93383-2244-4990-B2E9-5EF966F0E5A5}"
EndProject
Expand All @@ -25,6 +25,8 @@ Project("{00D1A9C2-B5F0-4AF3-8072-F6C62B433612}") = "Payments.Sql", "src\Payment
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Payments.Emails", "src\Payments.Emails\Payments.Emails.csproj", "{7A4BE093-ED90-4464-BF9C-9B5F748D5F10}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Payments.Jobs.AutoApprove", "Payments.Jobs.AutoApprove\Payments.Jobs.AutoApprove.csproj", "{67C14AEE-809F-4F73-8425-FFB06A35D678}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -121,6 +123,18 @@ Global
{7A4BE093-ED90-4464-BF9C-9B5F748D5F10}.Release|x64.Build.0 = Release|Any CPU
{7A4BE093-ED90-4464-BF9C-9B5F748D5F10}.Release|x86.ActiveCfg = Release|Any CPU
{7A4BE093-ED90-4464-BF9C-9B5F748D5F10}.Release|x86.Build.0 = Release|Any CPU
{67C14AEE-809F-4F73-8425-FFB06A35D678}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{67C14AEE-809F-4F73-8425-FFB06A35D678}.Debug|Any CPU.Build.0 = Debug|Any CPU
{67C14AEE-809F-4F73-8425-FFB06A35D678}.Debug|x64.ActiveCfg = Debug|Any CPU
{67C14AEE-809F-4F73-8425-FFB06A35D678}.Debug|x64.Build.0 = Debug|Any CPU
{67C14AEE-809F-4F73-8425-FFB06A35D678}.Debug|x86.ActiveCfg = Debug|Any CPU
{67C14AEE-809F-4F73-8425-FFB06A35D678}.Debug|x86.Build.0 = Debug|Any CPU
{67C14AEE-809F-4F73-8425-FFB06A35D678}.Release|Any CPU.ActiveCfg = Release|Any CPU
{67C14AEE-809F-4F73-8425-FFB06A35D678}.Release|Any CPU.Build.0 = Release|Any CPU
{67C14AEE-809F-4F73-8425-FFB06A35D678}.Release|x64.ActiveCfg = Release|Any CPU
{67C14AEE-809F-4F73-8425-FFB06A35D678}.Release|x64.Build.0 = Release|Any CPU
{67C14AEE-809F-4F73-8425-FFB06A35D678}.Release|x86.ActiveCfg = Release|Any CPU
{67C14AEE-809F-4F73-8425-FFB06A35D678}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -133,6 +147,7 @@ Global
{02AA0336-4F06-40C8-98A9-E29F510E3E57} = {515AA768-8E83-4026-AF1B-CAF89624E938}
{1C67A279-CA98-494D-B9A6-DD5D99FD1A8F} = {D1C93383-2244-4990-B2E9-5EF966F0E5A5}
{7A4BE093-ED90-4464-BF9C-9B5F748D5F10} = {D1C93383-2244-4990-B2E9-5EF966F0E5A5}
{67C14AEE-809F-4F73-8425-FFB06A35D678} = {D1C93383-2244-4990-B2E9-5EF966F0E5A5}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {34045125-52CB-46C0-BEBC-371EB2F0DFEB}
Expand Down
9 changes: 9 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,15 @@ stages:
projects: "./src/Payments.Jobs.MoneyMovement/Payments.Jobs.MoneyMovement.csproj"
arguments: "--configuration $(buildConfiguration) --output $(Build.ArtifactStagingDirectory)/app_data/jobs/triggered"

- task: DotNetCoreCLI@2
displayName: "Publish Payments.Jobs.AutoApprove"
inputs:
command: "publish"
publishWebProjects: false
zipAfterPublish: false
projects: "./src/Payments.Jobs.AutoApprove/Payments.Jobs.AutoApprove.csproj"
arguments: "--configuration $(buildConfiguration) --output $(Build.ArtifactStagingDirectory)/app_data/jobs/triggered"

- task: PublishBuildArtifacts@1
condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
displayName: "Publish Build Artifacts for master branch builds"
Expand Down
31 changes: 31 additions & 0 deletions src/Payments.Core/Attributes/ValidInvoiceTypeAttribute.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using System;
using System.ComponentModel.DataAnnotations;
using Payments.Core.Domain;

namespace Payments.Core.Attributes
{
/// <summary>
/// Validates that the invoice type is one of the valid invoice types defined in Invoice.InvoiceTypes
/// </summary>
public class ValidInvoiceTypeAttribute : ValidationAttribute
{
public override bool IsValid(object value)
{
if (value == null)
{
return false; // Required attribute should handle null values
}

var stringValue = value.ToString();

// Check against the constants defined in Invoice.InvoiceTypes
return stringValue == Invoice.InvoiceTypes.CreditCard ||
stringValue == Invoice.InvoiceTypes.Recharge;
}

public override string FormatErrorMessage(string name)
{
return $"The {name} field must be either '{Invoice.InvoiceTypes.CreditCard}' or '{Invoice.InvoiceTypes.Recharge}'.";
}
}
}
11 changes: 11 additions & 0 deletions src/Payments.Core/CreateMigration.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@echo off
REM Check for exactly one argument
REM from package manager console .\CreateMigration.bat MigrationName
IF "%~1"=="" (
echo 1 argument required, 0 provided. Usage: CreateMigration.bat MigrationName
exit /b 1
)

dotnet ef migrations add %1 --context ApplicationDbContext --output-dir Migrations --startup-project ../Payments.Mvc --project ../Payments.Core

echo All done
4 changes: 4 additions & 0 deletions src/Payments.Core/Data/ApplicationDbContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options)

public virtual DbSet<TaxReportJobRecord> TaxReportJobRecords { get; set; }

public virtual DbSet<RechargeAccount> RechargeAccounts { get; set; }

protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
base.OnConfiguring(optionsBuilder);
Expand All @@ -58,6 +60,8 @@ protected override void OnModelCreating(ModelBuilder builder)
LogMessage.OnModelCreating(builder);
MoneyMovementJobRecord.OnModelCreating(builder);
TaxReportJobRecord.OnModelCreating(builder);
Team.OnModelCreating(builder);
RechargeAccount.OnModelCreating(builder);
}
}
}
8 changes: 7 additions & 1 deletion src/Payments.Core/Domain/History.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.ComponentModel.DataAnnotations;
using Payments.Core.Models.History;

Expand Down Expand Up @@ -32,5 +32,11 @@ public string GetMessage()
var actionType = HistoryActionTypes.GetHistoryActionType(this.Type);
return actionType.GetMessage(Data);
}

public string GetDetails()
{
var actionType = HistoryActionTypes.GetHistoryActionType(this.Type);
return actionType.GetDetails(Data);
}
}
}
Loading
Loading