Scaffold v6 solution, frontend, CI, and Docker
CI / docker (push) Has been cancelled
CI / build-and-test (push) Has been cancelled

Section 1 complete (tasks 1.1-1.7):
- .NET 8 solution with 8 projects (Common, Basic, Database, Logic, Api,
  Backend, Migration, Tests) and correct dependency graph
- NuGet deps: MySqlConnector, NBitcoin, Microsoft.Extensions.Hosting,
  xunit, coverlet
- Common layer: IHasIdentity, enums (Permission, FinancialAccountType,
  DocumentType, CryptoChain, ExpenseClaimStatus, InvoiceStatus,
  PayoutStatus, FinancialDependencyType)
- React + TypeScript + Vite frontend with MUI, react-router, react-i18next
- Localization: EN, SV, DE translation files
- Vite builds to src/UsingCash.Api/wwwroot for static serving
- Multi-stage Dockerfile: Node build + .NET build -> aspnet runtime
- Gitea Actions CI: build, test, lint, Docker image
- appsettings.json with read/write/admin DB credential structure

Also updates data-migration spec/design for mysqldump-based workflow.

Made-with: Cursor
This commit is contained in:
2026-04-08 16:21:00 +02:00
parent 212f19ac19
commit 8aafe681b1
46 changed files with 4927 additions and 19 deletions
+4
View File
@@ -0,0 +1,4 @@
owner=rick
task=v6-rewrite
branch=agent/v6-rewrite
created_at=2026-04-08T14:08:09Z
+8
View File
@@ -0,0 +1,8 @@
**/bin
**/obj
**/node_modules
**/.git
**/.worktree
**/Boneyard
**/External Libraries
**/.vs
+58
View File
@@ -0,0 +1,58 @@
name: CI
on:
push:
branches: [master, 'agent/*']
pull_request:
branches: [master]
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: frontend/package-lock.json
- name: Restore .NET dependencies
run: dotnet restore src/UsingCash.sln
- name: Build .NET
run: dotnet build src/UsingCash.sln --no-restore -c Release
- name: Run .NET tests
run: dotnet test src/UsingCash.sln --no-build -c Release --verbosity normal
- name: Install frontend dependencies
run: npm ci
working-directory: frontend
- name: Lint frontend
run: npm run lint
working-directory: frontend
- name: Build frontend
run: npm run build
working-directory: frontend
docker:
needs: build-and-test
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v4
- name: Build Docker image
run: docker build -t using-cash:${{ github.sha }} -t using-cash:latest .
# Push to registry can be added when a registry is configured
+31
View File
@@ -0,0 +1,31 @@
FROM node:20-slim AS frontend-build
WORKDIR /app/frontend
COPY frontend/package.json frontend/package-lock.json ./
RUN npm ci
COPY frontend/ ./
RUN npm run build
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS backend-build
WORKDIR /app
COPY src/*.sln src/
COPY src/UsingCash.Common/*.csproj src/UsingCash.Common/
COPY src/UsingCash.Basic/*.csproj src/UsingCash.Basic/
COPY src/UsingCash.Database/*.csproj src/UsingCash.Database/
COPY src/UsingCash.Logic/*.csproj src/UsingCash.Logic/
COPY src/UsingCash.Api/*.csproj src/UsingCash.Api/
COPY src/UsingCash.Backend/*.csproj src/UsingCash.Backend/
COPY src/UsingCash.Migration/*.csproj src/UsingCash.Migration/
COPY src/UsingCash.Tests/*.csproj src/UsingCash.Tests/
RUN dotnet restore src/UsingCash.sln
COPY src/ src/
COPY --from=frontend-build /app/src/UsingCash.Api/wwwroot src/UsingCash.Api/wwwroot/
RUN dotnet publish src/UsingCash.Api/UsingCash.Api.csproj -c Release -o /app/publish --no-restore
RUN dotnet publish src/UsingCash.Migration/UsingCash.Migration.csproj -c Release -o /app/migration --no-restore
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS runtime
WORKDIR /app
COPY --from=backend-build /app/publish .
COPY --from=backend-build /app/migration /app/migration/
EXPOSE 5000
ENV ASPNETCORE_URLS=http://+:5000
ENTRYPOINT ["dotnet", "UsingCash.Api.dll"]
+12
View File
@@ -0,0 +1,12 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>using.cash</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
+4102
View File
File diff suppressed because it is too large Load Diff
+37
View File
@@ -0,0 +1,37 @@
{
"name": "using-cash-frontend",
"private": true,
"version": "6.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc -b && vite build",
"lint": "eslint .",
"preview": "vite preview",
"test": "echo \"No tests yet\" && exit 0"
},
"dependencies": {
"@emotion/react": "^11.13.0",
"@emotion/styled": "^11.13.0",
"@mui/icons-material": "^6.0.0",
"@mui/material": "^6.0.0",
"i18next": "^24.0.0",
"react": "^18.3.0",
"react-dom": "^18.3.0",
"react-i18next": "^15.0.0",
"react-router-dom": "^7.0.0"
},
"devDependencies": {
"@eslint/js": "^9.0.0",
"@types/react": "^18.3.0",
"@types/react-dom": "^18.3.0",
"@vitejs/plugin-react": "^4.3.0",
"eslint": "^9.0.0",
"eslint-plugin-react-hooks": "^5.0.0",
"eslint-plugin-react-refresh": "^0.4.0",
"globals": "^15.0.0",
"typescript": "~5.6.0",
"typescript-eslint": "^8.0.0",
"vite": "^6.0.0"
}
}
+27
View File
@@ -0,0 +1,27 @@
import { Routes, Route } from 'react-router-dom'
import { Typography, Container, Box } from '@mui/material'
import { useTranslation } from 'react-i18next'
function Dashboard() {
const { t } = useTranslation()
return (
<Container maxWidth="lg">
<Box sx={{ mt: 4 }}>
<Typography variant="h3" gutterBottom>
{t('dashboard.title', 'using.cash')}
</Typography>
<Typography variant="body1" color="text.secondary">
{t('dashboard.subtitle', 'Accounting made simple.')}
</Typography>
</Box>
</Container>
)
}
export default function App() {
return (
<Routes>
<Route path="/*" element={<Dashboard />} />
</Routes>
)
}
+19
View File
@@ -0,0 +1,19 @@
import i18n from 'i18next'
import { initReactI18next } from 'react-i18next'
import en from './locales/en.json'
import sv from './locales/sv.json'
import de from './locales/de.json'
i18n.use(initReactI18next).init({
resources: {
en: { translation: en },
sv: { translation: sv },
de: { translation: de },
},
lng: 'en',
fallbackLng: 'en',
interpolation: { escapeValue: false },
})
export default i18n
+13
View File
@@ -0,0 +1,13 @@
{
"dashboard": {
"title": "using.cash",
"subtitle": "Buchhaltung leicht gemacht."
},
"nav": {
"dashboard": "Übersicht",
"ledgers": "Hauptbuch",
"financial": "Finanzen",
"crypto": "Krypto-Tresor",
"admin": "Verwaltung"
}
}
+13
View File
@@ -0,0 +1,13 @@
{
"dashboard": {
"title": "using.cash",
"subtitle": "Accounting made simple."
},
"nav": {
"dashboard": "Dashboard",
"ledgers": "Ledgers",
"financial": "Financial",
"crypto": "Crypto Treasury",
"admin": "Administration"
}
}
+13
View File
@@ -0,0 +1,13 @@
{
"dashboard": {
"title": "using.cash",
"subtitle": "Bokföring på ett enkelt sätt."
},
"nav": {
"dashboard": "Översikt",
"ledgers": "Huvudbok",
"financial": "Ekonomi",
"crypto": "Kryptokassa",
"admin": "Administration"
}
}
+24
View File
@@ -0,0 +1,24 @@
import React from 'react'
import ReactDOM from 'react-dom/client'
import { BrowserRouter } from 'react-router-dom'
import { ThemeProvider, createTheme, CssBaseline } from '@mui/material'
import App from './App'
import './i18n'
const theme = createTheme({
palette: {
primary: { main: '#1976d2' },
secondary: { main: '#388e3c' },
},
})
ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>
<BrowserRouter>
<ThemeProvider theme={theme}>
<CssBaseline />
<App />
</ThemeProvider>
</BrowserRouter>
</React.StrictMode>,
)
+1
View File
@@ -0,0 +1 @@
/// <reference types="vite/client" />
+21
View File
@@ -0,0 +1,21 @@
{
"compilerOptions": {
"target": "ES2020",
"useDefineForClassFields": true,
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"module": "ESNext",
"skipLibCheck": true,
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"isolatedModules": true,
"moduleDetection": "force",
"noEmit": true,
"jsx": "react-jsx",
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
"resolveJsonModule": true
},
"include": ["src"]
}
+16
View File
@@ -0,0 +1,16 @@
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
export default defineConfig({
plugins: [react()],
build: {
outDir: '../src/UsingCash.Api/wwwroot',
emptyOutDir: true,
},
server: {
proxy: {
'/api': 'http://localhost:5000',
'/ws': { target: 'ws://localhost:5000', ws: true },
},
},
})
+11 -4
View File
@@ -79,11 +79,18 @@ FinancialRepository : RepositoryBase
The frontend communicates with the backend exclusively through the REST API and WebSocket — no server-side rendering, no ASPX page lifecycle.
### D5: Clean v6 schema via ETL migration
### D5: Clean v6 schema via ETL migration from mysqldump
**Decision:** v6 creates its own MySQL database with a clean schema. A migration tool reads the v5 database and populates v6 tables. The v5 database is never modified.
**Decision:** v6 creates its own MySQL database with a clean schema. A migration tool reads v5 data from a mysqldump file (loaded into a temporary MySQL instance) and populates v6 tables. The tool never connects to the live v5 production database.
**Rationale:** The v5 schema carries 76 incremental upgrades, unused columns from cut features (geography, governance, memberships), naming inconsistencies, and stored procedures for deleted functionality. A clean schema lets v6 start with only the tables and procedures it needs.
**Rationale:** The v5 schema carries 76 incremental upgrades, unused columns from cut features (geography, governance, memberships), naming inconsistencies, and stored procedures for deleted functionality. A clean schema lets v6 start with only the tables and procedures it needs. Using a mysqldump as the migration source provides a frozen point-in-time snapshot that is reproducible, archivable, and safe — the dump file itself becomes the legally immutable archival record of the v5 data. CI can test migration against the same dump hundreds of times.
**Migration workflow:**
1. `mysqldump --single-transaction` from v5 production → `v5-snapshot.sql` (checksum and archive this file)
2. Load dump into a temporary MySQL instance (Docker container or local)
3. Run migration tool pointing at temp instance (read) and v6 database (write)
4. Run verification pass
5. If good: archive dump, go live on v6. If not: fix migration, re-run from step 2
**Migration tool responsibilities:**
1. Read v5 `FinancialAccounts`, `FinancialTransactions`, `FinancialTransactionRows`, tags, budgets → write to v6 equivalents
@@ -288,7 +295,7 @@ ExchangeRateService
22. Database seeding / bootstrap (first admin user + org on fresh deployment)
### Rollback strategy
The v5 database is never modified. If v6 deployment fails, the v5 system (once buildable again, or from the last known working state) can be restored against the original database. The v6 database can be dropped and re-migrated.
The v5 production database is never touched — not even read during migration. The archived mysqldump file is the frozen source of truth. If v6 deployment fails, the v6 database can be dropped and re-migrated from the same dump. The dump file plus its checksum constitute the legal archival record.
## Open Questions
@@ -1,15 +1,19 @@
## ADDED Requirements
### Requirement: One-time ETL migration tool
The system SHALL include a migration tool that reads from a v5 Swarmops MySQL database and populates a v6 UsingCash MySQL database. The v5 database MUST NOT be modified by the migration. The tool runs as a standalone CLI application.
The system SHALL include a migration tool that reads from a v5 Swarmops MySQL database and populates a v6 UsingCash MySQL database. The migration source SHALL be a mysqldump file loaded into a temporary MySQL instance — the tool MUST NOT connect to a live v5 production database. The dump file serves as the legally immutable archival record of the v5 data at the point of migration. The tool runs as a standalone CLI application.
#### Scenario: Run migration
- **WHEN** an administrator runs the migration tool pointing to v5 and v6 database connection strings
- **THEN** the tool reads v5 data, transforms it to v6 schema, and writes to the v6 database
#### Scenario: Run migration from dump
- **WHEN** an administrator provides a mysqldump file and a v6 database connection string
- **THEN** the tool loads the dump into a temporary MySQL instance (or connects to a pre-loaded instance), reads v5 data from it, transforms to v6 schema, and writes to the v6 database
#### Scenario: v5 database untouched
- **WHEN** the migration completes
- **THEN** the v5 database has zero modifications (no rows inserted, updated, or deleted)
#### Scenario: Dump file is the archival artifact
- **WHEN** the migration completes successfully
- **THEN** the original mysqldump file is preserved as-is with its checksum recorded, serving as the legal source of truth for the v5 data snapshot
#### Scenario: Reproducible migration
- **WHEN** the migration tool is run multiple times against the same dump file
- **THEN** it produces identical results in the v6 database each time
### Requirement: Financial data migration
The tool SHALL migrate: financial accounts (chart of accounts with OwnerUserId), financial transactions and transaction rows (including foreign currency amounts from `FinancialTransactionRowsNativeCurrency`), transaction tags and tag sets, budget allocations, expense claims, inbound invoices, outbound invoices (including credit-link optional data), payouts, payments, payment groups, refunds, and continuation transaction dependency chains. All monetary amounts SHALL be preserved exactly (Int64 cents/satoshis, no rounding). OrganizationSequenceId values SHALL be preserved exactly.
+8 -8
View File
@@ -1,12 +1,12 @@
## 1. Solution Scaffolding & CI
- [ ] 1.1 Create .NET 8 SDK-style solution with projects: UsingCash.Common, UsingCash.Basic, UsingCash.Database, UsingCash.Logic, UsingCash.Api, UsingCash.Backend, UsingCash.Migration, UsingCash.Tests
- [ ] 1.2 Set up project references: Common ← Basic ← Database ← Logic ← Api/Backend/Migration; Tests → Common, Basic, Database, Logic, Api, Migration
- [ ] 1.3 Add NuGet dependencies: MySqlConnector, NBitcoin, System.Text.Json; remove all checked-in DLLs from External Libraries
- [ ] 1.4 Scaffold React + TypeScript + Vite frontend project in `frontend/` with MUI, react-router, react-i18next dependencies
- [ ] 1.5 Create multi-stage Dockerfile (build .NET + build frontend → runtime image serving both)
- [ ] 1.6 Create Gitea Actions workflow: dotnet restore → build → analyze/lint → test → npm ci → npm run lint → npm run build → docker build → push image
- [ ] 1.7 Add `appsettings.json` / `appsettings.Development.json` with database config section preserving read/write/admin credential structure, SMTP config, storage root path, dev-mode flag
- [x] 1.1 Create .NET 8 SDK-style solution with projects: UsingCash.Common, UsingCash.Basic, UsingCash.Database, UsingCash.Logic, UsingCash.Api, UsingCash.Backend, UsingCash.Migration, UsingCash.Tests
- [x] 1.2 Set up project references: Common ← Basic ← Database ← Logic ← Api/Backend/Migration; Tests → Common, Basic, Database, Logic, Api, Migration
- [x] 1.3 Add NuGet dependencies: MySqlConnector, NBitcoin, System.Text.Json; remove all checked-in DLLs from External Libraries
- [x] 1.4 Scaffold React + TypeScript + Vite frontend project in `frontend/` with MUI, react-router, react-i18next dependencies
- [x] 1.5 Create multi-stage Dockerfile (build .NET + build frontend → runtime image serving both)
- [x] 1.6 Create Gitea Actions workflow: dotnet restore → build → analyze/lint → test → npm ci → npm run lint → npm run build → docker build → push image
- [x] 1.7 Add `appsettings.json` / `appsettings.Development.json` with database config section preserving read/write/admin credential structure, SMTP config, storage root path, dev-mode flag
## 2. Database Schema — Core Tables
@@ -89,7 +89,7 @@
## 8. Data Migration (UsingCash.Migration) — gates API/frontend work
- [ ] 8.1 Implement CLI tool structure: connection string args for v5 (read-only) and v6 (write), run/verify/audit modes
- [ ] 8.1 Implement CLI tool structure: accepts mysqldump file path (or pre-loaded v5 instance connection string) and v6 connection string, with run/verify/audit modes; records dump file checksum on successful migration
- [ ] 8.2 Implement ObjectOptionalData audit: read all v5 EAV rows, classify each key as keep/drop per D16 mapping, report any unmapped keys
- [ ] 8.3 Implement organization migration: read v5 Organizations + ObjectOptionalData → write v6 Organizations (flat, denormalized settings, drop ParentOrganizationId and geography)
- [ ] 8.4 Implement user migration: read v5 People + ObjectOptionalData → write v6 Users (name, email, bank details, bitcoin payout, preferred culture, require-password-reset flag)
+8
View File
@@ -0,0 +1,8 @@
bin/
obj/
*.user
*.suo
.vs/
*.DotSettings.user
node_modules/
dist/
+13
View File
@@ -0,0 +1,13 @@
var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();
app.MapGet("/api/health", () => Results.Ok(new { status = "healthy" }));
app.UseDefaultFiles();
app.UseStaticFiles();
app.MapFallbackToFile("index.html");
app.Run();
public partial class Program { }
@@ -0,0 +1,31 @@
{
"$schema": "http://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:50697",
"sslPort": 0
}
},
"profiles": {
"http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"launchUrl": "swagger",
"applicationUrl": "http://localhost:5222",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "swagger",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
+18
View File
@@ -0,0 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RootNamespace>UsingCash.Api</RootNamespace>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\UsingCash.Common\UsingCash.Common.csproj" />
<ProjectReference Include="..\UsingCash.Basic\UsingCash.Basic.csproj" />
<ProjectReference Include="..\UsingCash.Database\UsingCash.Database.csproj" />
<ProjectReference Include="..\UsingCash.Logic\UsingCash.Logic.csproj" />
<ProjectReference Include="..\UsingCash.Backend\UsingCash.Backend.csproj" />
</ItemGroup>
</Project>
+6
View File
@@ -0,0 +1,6 @@
@UsingCash.Api_HostAddress = http://localhost:5222
GET {{UsingCash.Api_HostAddress}}/weatherforecast/
Accept: application/json
###
@@ -0,0 +1,35 @@
{
"Logging": {
"LogLevel": {
"Default": "Debug",
"Microsoft.AspNetCore": "Information"
}
},
"Database": {
"Read": {
"Server": "localhost",
"Database": "usingcash_dev",
"Username": "root",
"Password": "",
"SslMode": "None"
},
"Write": {
"Server": "localhost",
"Database": "usingcash_dev",
"Username": "root",
"Password": "",
"SslMode": "None"
},
"Admin": {
"Server": "localhost",
"Database": "usingcash_dev",
"Username": "root",
"Password": "",
"SslMode": "None"
}
},
"Storage": {
"DocumentRoot": "./dev-uploads"
},
"DevMode": true
}
+41
View File
@@ -0,0 +1,41 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"Database": {
"Read": {
"Server": "localhost",
"Database": "usingcash",
"Username": "uc_read",
"Password": "",
"SslMode": "Preferred"
},
"Write": {
"Server": "localhost",
"Database": "usingcash",
"Username": "uc_write",
"Password": "",
"SslMode": "Preferred"
},
"Admin": {
"Server": "localhost",
"Database": "usingcash",
"Username": "uc_admin",
"Password": "",
"SslMode": "Preferred"
}
},
"Smtp": {
"Host": "localhost",
"Port": 25,
"Username": "",
"Password": ""
},
"Storage": {
"DocumentRoot": "/var/lib/usingcash/upload"
},
"DevMode": false
}
@@ -0,0 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RootNamespace>UsingCash.Backend</RootNamespace>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\UsingCash.Common\UsingCash.Common.csproj" />
<ProjectReference Include="..\UsingCash.Basic\UsingCash.Basic.csproj" />
<ProjectReference Include="..\UsingCash.Database\UsingCash.Database.csproj" />
<ProjectReference Include="..\UsingCash.Logic\UsingCash.Logic.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="8.*" />
</ItemGroup>
</Project>
@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RootNamespace>UsingCash.Basic</RootNamespace>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\UsingCash.Common\UsingCash.Common.csproj" />
</ItemGroup>
</Project>
@@ -0,0 +1,7 @@
namespace UsingCash.Common.Enums;
public enum CryptoChain
{
Unknown = 0,
BitcoinCash
}
@@ -0,0 +1,16 @@
namespace UsingCash.Common.Enums;
public enum DocumentType
{
Unknown = 0,
ExpenseReceipt,
InboundInvoice,
OutboundInvoice,
FinancialTransactionSupport,
FinancialAccountDocument,
BankStatement,
BankTransactionData,
BankPaymentData,
OrganizationLogo,
TemporaryUpload
}
@@ -0,0 +1,13 @@
namespace UsingCash.Common.Enums;
public enum ExpenseClaimStatus
{
Unknown = 0,
Created,
Attested,
Validated,
Approved,
PaidOut,
Denied,
Refunded
}
@@ -0,0 +1,10 @@
namespace UsingCash.Common.Enums;
public enum FinancialAccountType
{
Unknown = 0,
Asset,
Debt,
Income,
Cost
}
@@ -0,0 +1,14 @@
namespace UsingCash.Common.Enums;
public enum FinancialDependencyType
{
Unknown = 0,
ExpenseClaim,
InboundInvoice,
OutboundInvoice,
Salary,
CashAdvance,
Payout,
FinancialTransaction,
VatReport
}
@@ -0,0 +1,11 @@
namespace UsingCash.Common.Enums;
public enum InvoiceStatus
{
Unknown = 0,
Created,
Attested,
Paid,
Closed,
Denied
}
@@ -0,0 +1,9 @@
namespace UsingCash.Common.Enums;
public enum PayoutStatus
{
Unknown = 0,
Created,
Executed,
Confirmed
}
+24
View File
@@ -0,0 +1,24 @@
namespace UsingCash.Common.Enums;
public enum Permission
{
Unknown = 0,
CanViewLedgers,
CanEditTransactions,
CanAttestExpenses,
CanValidateReceipts,
CanManagePayouts,
CanManageCrypto,
CanManageBudgets,
CanManageAccounts,
CanUploadDocuments,
CanViewDocuments,
CanSendMail,
CanAdminOrg,
CanAdminSystem,
CanManageUsers,
CanManageRoles,
CanCloseLedgers,
CanCreateInvoices,
CanManageInvoices
}
+11
View File
@@ -0,0 +1,11 @@
namespace UsingCash.Common;
public interface IHasIdentity
{
int Identity { get; }
}
public interface IHasIdentities
{
IEnumerable<int> Identities { get; }
}
@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RootNamespace>UsingCash.Common</RootNamespace>
</PropertyGroup>
</Project>
@@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RootNamespace>UsingCash.Database</RootNamespace>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\UsingCash.Common\UsingCash.Common.csproj" />
<ProjectReference Include="..\UsingCash.Basic\UsingCash.Basic.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="MySqlConnector" Version="2.*" />
</ItemGroup>
</Project>
@@ -0,0 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RootNamespace>UsingCash.Logic</RootNamespace>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\UsingCash.Common\UsingCash.Common.csproj" />
<ProjectReference Include="..\UsingCash.Basic\UsingCash.Basic.csproj" />
<ProjectReference Include="..\UsingCash.Database\UsingCash.Database.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="NBitcoin" Version="7.*" />
</ItemGroup>
</Project>
+18
View File
@@ -0,0 +1,18 @@
namespace UsingCash.Migration;
public class Program
{
public static int Main(string[] args)
{
Console.WriteLine("UsingCash Migration Tool");
Console.WriteLine("Usage: UsingCash.Migration --v5-conn <connstr> --v6-conn <connstr> [--verify] [--audit]");
if (args.Length == 0)
{
Console.WriteLine("No arguments provided. Exiting.");
return 1;
}
return 0;
}
}
@@ -0,0 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RootNamespace>UsingCash.Migration</RootNamespace>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\UsingCash.Common\UsingCash.Common.csproj" />
<ProjectReference Include="..\UsingCash.Basic\UsingCash.Basic.csproj" />
<ProjectReference Include="..\UsingCash.Database\UsingCash.Database.csproj" />
<ProjectReference Include="..\UsingCash.Logic\UsingCash.Logic.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="MySqlConnector" Version="2.*" />
</ItemGroup>
</Project>
+1
View File
@@ -0,0 +1 @@
global using Xunit;
+14
View File
@@ -0,0 +1,14 @@
namespace UsingCash.Tests;
public class SolutionBuildTest
{
[Fact]
public void AllProjectsReferenceCorrectly()
{
var commonType = typeof(Common.IHasIdentity);
var enumType = typeof(Common.Enums.FinancialAccountType);
Assert.NotNull(commonType);
Assert.NotNull(enumType);
}
}
@@ -0,0 +1,28 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RootNamespace>UsingCash.Tests</RootNamespace>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\UsingCash.Common\UsingCash.Common.csproj" />
<ProjectReference Include="..\UsingCash.Basic\UsingCash.Basic.csproj" />
<ProjectReference Include="..\UsingCash.Database\UsingCash.Database.csproj" />
<ProjectReference Include="..\UsingCash.Logic\UsingCash.Logic.csproj" />
<ProjectReference Include="..\UsingCash.Api\UsingCash.Api.csproj" />
<ProjectReference Include="..\UsingCash.Migration\UsingCash.Migration.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="coverlet.collector" Version="6.*" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.*" />
<PackageReference Include="xunit" Version="2.*" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.*" />
</ItemGroup>
</Project>
+64
View File
@@ -0,0 +1,64 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UsingCash.Common", "UsingCash.Common\UsingCash.Common.csproj", "{FC8F60E0-4B8F-4396-B76C-D0DAB5443563}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UsingCash.Basic", "UsingCash.Basic\UsingCash.Basic.csproj", "{D2ECBE37-9634-4D69-84A8-628CD8B029DA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UsingCash.Database", "UsingCash.Database\UsingCash.Database.csproj", "{2749E72C-3FF3-423E-B306-2F5CEB90D867}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UsingCash.Logic", "UsingCash.Logic\UsingCash.Logic.csproj", "{205464FC-E082-489F-9D08-505C00405609}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UsingCash.Api", "UsingCash.Api\UsingCash.Api.csproj", "{2655741C-7AF7-4452-85F9-1A027603F3DB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UsingCash.Backend", "UsingCash.Backend\UsingCash.Backend.csproj", "{ACF1E0ED-2BE2-4627-BA7B-5AD5BF05185E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UsingCash.Migration", "UsingCash.Migration\UsingCash.Migration.csproj", "{984B0C84-CECC-4B6B-88FA-C8085888CCCF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UsingCash.Tests", "UsingCash.Tests\UsingCash.Tests.csproj", "{412BFD43-6B22-41C1-AA3C-22C5939BBC82}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{FC8F60E0-4B8F-4396-B76C-D0DAB5443563}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FC8F60E0-4B8F-4396-B76C-D0DAB5443563}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FC8F60E0-4B8F-4396-B76C-D0DAB5443563}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FC8F60E0-4B8F-4396-B76C-D0DAB5443563}.Release|Any CPU.Build.0 = Release|Any CPU
{D2ECBE37-9634-4D69-84A8-628CD8B029DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D2ECBE37-9634-4D69-84A8-628CD8B029DA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D2ECBE37-9634-4D69-84A8-628CD8B029DA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D2ECBE37-9634-4D69-84A8-628CD8B029DA}.Release|Any CPU.Build.0 = Release|Any CPU
{2749E72C-3FF3-423E-B306-2F5CEB90D867}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2749E72C-3FF3-423E-B306-2F5CEB90D867}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2749E72C-3FF3-423E-B306-2F5CEB90D867}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2749E72C-3FF3-423E-B306-2F5CEB90D867}.Release|Any CPU.Build.0 = Release|Any CPU
{205464FC-E082-489F-9D08-505C00405609}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{205464FC-E082-489F-9D08-505C00405609}.Debug|Any CPU.Build.0 = Debug|Any CPU
{205464FC-E082-489F-9D08-505C00405609}.Release|Any CPU.ActiveCfg = Release|Any CPU
{205464FC-E082-489F-9D08-505C00405609}.Release|Any CPU.Build.0 = Release|Any CPU
{2655741C-7AF7-4452-85F9-1A027603F3DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2655741C-7AF7-4452-85F9-1A027603F3DB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2655741C-7AF7-4452-85F9-1A027603F3DB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2655741C-7AF7-4452-85F9-1A027603F3DB}.Release|Any CPU.Build.0 = Release|Any CPU
{ACF1E0ED-2BE2-4627-BA7B-5AD5BF05185E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ACF1E0ED-2BE2-4627-BA7B-5AD5BF05185E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ACF1E0ED-2BE2-4627-BA7B-5AD5BF05185E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ACF1E0ED-2BE2-4627-BA7B-5AD5BF05185E}.Release|Any CPU.Build.0 = Release|Any CPU
{984B0C84-CECC-4B6B-88FA-C8085888CCCF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{984B0C84-CECC-4B6B-88FA-C8085888CCCF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{984B0C84-CECC-4B6B-88FA-C8085888CCCF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{984B0C84-CECC-4B6B-88FA-C8085888CCCF}.Release|Any CPU.Build.0 = Release|Any CPU
{412BFD43-6B22-41C1-AA3C-22C5939BBC82}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{412BFD43-6B22-41C1-AA3C-22C5939BBC82}.Debug|Any CPU.Build.0 = Debug|Any CPU
{412BFD43-6B22-41C1-AA3C-22C5939BBC82}.Release|Any CPU.ActiveCfg = Release|Any CPU
{412BFD43-6B22-41C1-AA3C-22C5939BBC82}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal