From d0834775e73b0f6696373bf69675b04d3a25654f Mon Sep 17 00:00:00 2001 From: Jerry Phillips Date: Tue, 17 Mar 2026 15:44:17 -0400 Subject: [PATCH 1/2] chore(GitActions): Add Linter --- .github/workflows/lint.yml | 30 +++++++++++++++++++ JobFlow.API/.github/workflows/lint.yml | 30 +++++++++++++++++++ JobFlow.API/Controllers/AuthController.cs | 2 +- JobFlow.API/Controllers/InvoiceComtroller.cs | 2 +- JobFlow.API/Controllers/JobController.cs | 6 ++-- JobFlow.API/Controllers/PaymentController.cs | 2 +- .../Mappings/InvoiceMappingExtensions.cs | 4 +-- JobFlow.API/Mappings/MapsterConfig.cs | 4 +-- 8 files changed, 70 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/lint.yml create mode 100644 JobFlow.API/.github/workflows/lint.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..a20f7e9 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,30 @@ +name: Lint + +on: + pull_request: + push: + branches: + - main + - master + - dev + - feature/** + +jobs: + dotnet-format: + name: dotnet format + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '10.0.x' + + - name: Restore + run: dotnet restore ./JobFlow.API/JobFlow.API.csproj + + - name: Verify formatting + run: dotnet format ./JobFlow.API/JobFlow.API.csproj --verify-no-changes --verbosity minimal diff --git a/JobFlow.API/.github/workflows/lint.yml b/JobFlow.API/.github/workflows/lint.yml new file mode 100644 index 0000000..b6e8709 --- /dev/null +++ b/JobFlow.API/.github/workflows/lint.yml @@ -0,0 +1,30 @@ +name: Lint + +on: + pull_request: + push: + branches: + - main + - master + - develop + - feature/** + +jobs: + dotnet-format: + name: dotnet format + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '10.0.x' + + - name: Restore + run: dotnet restore ./JobFlow.API/JobFlow.API.csproj + + - name: Verify formatting + run: dotnet format ./JobFlow.API/JobFlow.API.csproj --verify-no-changes --verbosity minimal diff --git a/JobFlow.API/Controllers/AuthController.cs b/JobFlow.API/Controllers/AuthController.cs index ee51f64..7341444 100644 --- a/JobFlow.API/Controllers/AuthController.cs +++ b/JobFlow.API/Controllers/AuthController.cs @@ -210,7 +210,7 @@ public async Task DeleteAccount(string uid) return BadRequest(new { Message = "Failed to delete user.", Error = ex.Message }); } } - + } // ============================================================ diff --git a/JobFlow.API/Controllers/InvoiceComtroller.cs b/JobFlow.API/Controllers/InvoiceComtroller.cs index 46ffa25..4a770dd 100644 --- a/JobFlow.API/Controllers/InvoiceComtroller.cs +++ b/JobFlow.API/Controllers/InvoiceComtroller.cs @@ -72,7 +72,7 @@ public async Task Upsert( var invoiceNumber = await numberGenerator.GenerateAsync(organizationId); var jobInfo = await this._jobService.GetJobByIdAsync(request.JobId, organizationId); - + request.OrganizationClientId = jobInfo.Value.OrganizationClientId; var invoice = request.ToInvoice(invoiceNumber); invoice.OrganizationId = organizationId; diff --git a/JobFlow.API/Controllers/JobController.cs b/JobFlow.API/Controllers/JobController.cs index f8fad23..f557d95 100644 --- a/JobFlow.API/Controllers/JobController.cs +++ b/JobFlow.API/Controllers/JobController.cs @@ -63,7 +63,7 @@ public async Task UpsertJob([FromBody] JobDto model) return Unauthorized("Organization context missing."); var mappedJob = _mapper.Map(model); - + var result = await _jobService.UpsertJobAsync(mappedJob, orgId); if (result.IsFailure) @@ -85,7 +85,7 @@ public async Task DeleteJob(Guid id) return NoContent(); } - + [HttpGet("all")] public async Task GetJobs() { @@ -97,6 +97,6 @@ public async Task GetJobs() return Ok(result.Value); } - + } \ No newline at end of file diff --git a/JobFlow.API/Controllers/PaymentController.cs b/JobFlow.API/Controllers/PaymentController.cs index b08de7c..9befecb 100644 --- a/JobFlow.API/Controllers/PaymentController.cs +++ b/JobFlow.API/Controllers/PaymentController.cs @@ -311,7 +311,7 @@ public async Task SetDefaultPaymentMethod([FromBody] SetDefaultPa return result.IsSuccess ? Ok() : BadRequest(result.Error); } - + [HttpPost("webhook")] public async Task HandleStripeWebhook() diff --git a/JobFlow.API/Mappings/InvoiceMappingExtensions.cs b/JobFlow.API/Mappings/InvoiceMappingExtensions.cs index 23ad349..1272436 100644 --- a/JobFlow.API/Mappings/InvoiceMappingExtensions.cs +++ b/JobFlow.API/Mappings/InvoiceMappingExtensions.cs @@ -45,8 +45,8 @@ public static InvoiceDto ToDto(this Invoice invoice) AmountPaid = invoice.AmountPaid, BalanceDue = invoice.BalanceDue, Status = invoice.Status, - ExternalPaymentId = invoice.ExternalPaymentId, - + ExternalPaymentId = invoice.ExternalPaymentId, + LineItems = invoice.LineItems.Select(li => li.ToDto()).ToList() }; } diff --git a/JobFlow.API/Mappings/MapsterConfig.cs b/JobFlow.API/Mappings/MapsterConfig.cs index dfed639..8073cba 100644 --- a/JobFlow.API/Mappings/MapsterConfig.cs +++ b/JobFlow.API/Mappings/MapsterConfig.cs @@ -40,10 +40,10 @@ public void Register(TypeAdapterConfig config) //InvoiceLineItem → DTO config.NewConfig(); - + //Job → DTO config.NewConfig(); - + config.NewConfig(); //DTO → Job config.NewConfig(); From fefbb0b6ffc5ffbad71dca4b1de2e51abfc618e2 Mon Sep 17 00:00:00 2001 From: Jerry Phillips Date: Tue, 17 Mar 2026 16:35:13 -0400 Subject: [PATCH 2/2] chore(GitActions): Modify Git Workflow --- .github/workflows/ci.yml | 82 ++++++++++++++++++++++++ .github/workflows/lint.yml | 30 --------- .github/workflows/master_jobflow-api.yml | 2 +- JobFlow.API/.github/workflows/lint.yml | 30 --------- JobFlow.API/JobFlow.API.csproj | 4 ++ 5 files changed, 87 insertions(+), 61 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/lint.yml delete mode 100644 JobFlow.API/.github/workflows/lint.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..62d4322 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,82 @@ +name: CI + +on: + pull_request: + push: + branches: + - main + - master + - dev + - feature/** + +jobs: + dotnet-format: + name: dotnet format + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '10.0.x' + + - name: Restore + run: dotnet restore ./JobFlow.API/JobFlow.API.csproj + + - name: Verify formatting + run: dotnet format ./JobFlow.API/JobFlow.API.csproj --verify-no-changes --verbosity minimal + + dependency-review: + name: Dependency review + runs-on: ubuntu-latest + if: github.event_name == 'pull_request' + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Dependency review + uses: actions/dependency-review-action@v4 + continue-on-error: true + + build: + name: Build + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '10.0.x' + + - name: Restore + run: dotnet restore ./JobFlow.API/JobFlow.API.csproj + + - name: Build + run: dotnet build ./JobFlow.API/JobFlow.API.csproj -c Release --no-restore + + test: + name: Test + runs-on: ubuntu-latest + needs: build + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '10.0.x' + + - name: Restore + run: dotnet restore ./JobFlow.API/JobFlow.API.csproj + + - name: Test + run: dotnet test ./JobFlow.API/JobFlow.API.csproj -c Release --no-build diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index a20f7e9..0000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Lint - -on: - pull_request: - push: - branches: - - main - - master - - dev - - feature/** - -jobs: - dotnet-format: - name: dotnet format - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup .NET - uses: actions/setup-dotnet@v4 - with: - dotnet-version: '10.0.x' - - - name: Restore - run: dotnet restore ./JobFlow.API/JobFlow.API.csproj - - - name: Verify formatting - run: dotnet format ./JobFlow.API/JobFlow.API.csproj --verify-no-changes --verbosity minimal diff --git a/.github/workflows/master_jobflow-api.yml b/.github/workflows/master_jobflow-api.yml index 83ad6e7..65aa19c 100644 --- a/.github/workflows/master_jobflow-api.yml +++ b/.github/workflows/master_jobflow-api.yml @@ -21,7 +21,7 @@ jobs: - name: Set up .NET Core uses: actions/setup-dotnet@v4 with: - dotnet-version: '8.x' + dotnet-version: '10.0.x' - name: Build with dotnet run: dotnet build JobFlow.API/JobFlow.API.csproj --configuration Release diff --git a/JobFlow.API/.github/workflows/lint.yml b/JobFlow.API/.github/workflows/lint.yml deleted file mode 100644 index b6e8709..0000000 --- a/JobFlow.API/.github/workflows/lint.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Lint - -on: - pull_request: - push: - branches: - - main - - master - - develop - - feature/** - -jobs: - dotnet-format: - name: dotnet format - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup .NET - uses: actions/setup-dotnet@v4 - with: - dotnet-version: '10.0.x' - - - name: Restore - run: dotnet restore ./JobFlow.API/JobFlow.API.csproj - - - name: Verify formatting - run: dotnet format ./JobFlow.API/JobFlow.API.csproj --verify-no-changes --verbosity minimal diff --git a/JobFlow.API/JobFlow.API.csproj b/JobFlow.API/JobFlow.API.csproj index 9fc8fd1..001b617 100644 --- a/JobFlow.API/JobFlow.API.csproj +++ b/JobFlow.API/JobFlow.API.csproj @@ -47,4 +47,8 @@ + + + +