Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
82 changes: 82 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion .github/workflows/master_jobflow-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion JobFlow.API/Controllers/AuthController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ public async Task<IActionResult> DeleteAccount(string uid)
return BadRequest(new { Message = "Failed to delete user.", Error = ex.Message });
}
}

}

// ============================================================
Expand Down
2 changes: 1 addition & 1 deletion JobFlow.API/Controllers/InvoiceComtroller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public async Task<IActionResult> 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;
Expand Down
6 changes: 3 additions & 3 deletions JobFlow.API/Controllers/JobController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public async Task<IActionResult> UpsertJob([FromBody] JobDto model)
return Unauthorized("Organization context missing.");

var mappedJob = _mapper.Map<JobDto, Job>(model);

var result = await _jobService.UpsertJobAsync(mappedJob, orgId);

if (result.IsFailure)
Expand All @@ -85,7 +85,7 @@ public async Task<IActionResult> DeleteJob(Guid id)

return NoContent();
}

[HttpGet("all")]
public async Task<IActionResult> GetJobs()
{
Expand All @@ -97,6 +97,6 @@ public async Task<IActionResult> GetJobs()

return Ok(result.Value);
}


}
2 changes: 1 addition & 1 deletion JobFlow.API/Controllers/PaymentController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ public async Task<IActionResult> SetDefaultPaymentMethod([FromBody] SetDefaultPa

return result.IsSuccess ? Ok() : BadRequest(result.Error);
}


[HttpPost("webhook")]
public async Task<IActionResult> HandleStripeWebhook()
Expand Down
4 changes: 4 additions & 0 deletions JobFlow.API/JobFlow.API.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,8 @@
<ProjectReference Include="..\JobFlow.Infrastructure\JobFlow.Infrastructure.csproj" />
</ItemGroup>

<ItemGroup>
<Folder Include=".github\workflows\" />
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions JobFlow.API/Mappings/InvoiceMappingExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
};
}
Expand Down
4 changes: 2 additions & 2 deletions JobFlow.API/Mappings/MapsterConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ public void Register(TypeAdapterConfig config)

//InvoiceLineItem → DTO
config.NewConfig<InvoiceLineItem, InvoiceLineItemDto>();

//Job → DTO
config.NewConfig<Job, JobDto>();

config.NewConfig<Assignment, AssignmentDto>();
//DTO → Job
config.NewConfig<JobDto, Job>();
Expand Down
Loading