Add read-model merchant schedule endpoint and use it in schedule creation validation#1659
Conversation
Co-authored-by: StuartFerguson <16325469+StuartFerguson@users.noreply.github.com>
Co-authored-by: StuartFerguson <16325469+StuartFerguson@users.noreply.github.com>
|
@copilot is there any need for the MerchantScheduleCreatedEvent ? |
Not strictly. It’s only useful if we want to represent a schedule year existing before any month overrides are added, or allow an intentionally empty schedule for a year. Because the month event already carries |
|
@copilot ok maybe a compromise and have the created event and the update events only indicate which days the merchant is closed? |
Co-authored-by: StuartFerguson <16325469+StuartFerguson@users.noreply.github.com>
Co-authored-by: StuartFerguson <16325469+StuartFerguson@users.noreply.github.com>
Done in 642c43a. I kept the created event for the explicit schedule lifecycle, and simplified the month update event/model/request path so month updates now only carry Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot ok can you now expand this get the request from the minimal api endpoint to the aggregate, this means changes to the domain service and request handler |
Co-authored-by: StuartFerguson <16325469+StuartFerguson@users.noreply.github.com>
Done in f622296. I wired create/update merchant schedule requests from the merchant minimal API endpoints through Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Co-authored-by: StuartFerguson <16325469+StuartFerguson@users.noreply.github.com>
Co-authored-by: StuartFerguson <16325469+StuartFerguson@users.noreply.github.com>
|
@copilot i need you to now update my ReadModelDomainEventHandler, Repository and Database context to get this data feeing into my Read Model |
Co-authored-by: StuartFerguson <16325469+StuartFerguson@users.noreply.github.com>
Done in 297c0a2. I wired Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Co-authored-by: StuartFerguson <16325469+StuartFerguson@users.noreply.github.com>
Co-authored-by: StuartFerguson <16325469+StuartFerguson@users.noreply.github.com>
Co-authored-by: StuartFerguson <16325469+StuartFerguson@users.noreply.github.com>
Co-authored-by: StuartFerguson <16325469+StuartFerguson@users.noreply.github.com>
Co-authored-by: StuartFerguson <16325469+StuartFerguson@users.noreply.github.com>
Co-authored-by: StuartFerguson <16325469+StuartFerguson@users.noreply.github.com>
Co-authored-by: StuartFerguson <16325469+StuartFerguson@users.noreply.github.com>
Co-authored-by: StuartFerguson <16325469+StuartFerguson@users.noreply.github.com>
Introduced merchant schedule functionality in domain, database, and event handling. Registered MerchantScheduleAggregate repository and updated DTOs and helpers. Added new domain events for schedule creation and month updates. Refactored integration tests for clarity and coverage, including new merchant schedule scenarios. Cleaned up migration attributes and ensured correct model types.
Merchant schedules could be created and updated, but the validation flow was still reading schedule state from the aggregate path. This change adds a dedicated read-model-backed merchant schedule endpoint and updates the SpecFlow schedule creation flow to validate the projected database state by merchant and year.
Read-model schedule API
GET /api/estates/{estateId}/merchants/{merchantId}/schedules/{year}/readmodelMerchantScheduleResponsefor a single merchant/year from the read-model databaseGetMerchantScheduleendpoint unchangedRepository and query path
SpecFlow validation
WhenICreateTheFollowingMerchantSchedulesto validate via the new read-model endpointRobustness
ClosedDaysparsing now tolerates malformed persisted values instead of throwing during schedule retrievalWarning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
f.feedz.io/usr/bin/dotnet dotnet test /home/REDACTED/work/TransactionProcessor/TransactionProcessor/TransactionProcessor.BusinessLogic.Tests/TransactionProcessor.BusinessLogic.Tests.csproj --filter TransactionProcessorManager_GetMerchantSchedule -p:RestoreIgnoreFailedSources=true -nologo(dns block)/usr/bin/dotnet dotnet test /home/REDACTED/work/TransactionProcessor/TransactionProcessor/TransactionProcessor.BusinessLogic.Tests/TransactionProcessor.BusinessLogic.Tests.csproj --filter GetMerchantScheduleFromReadModel -p:RestoreIgnoreFailedSources=true -nologo(dns block)/opt/hostedtoolcache/CodeQL/2.24.2/x64/codeql/csharp/tools/linux64/Semmle.Autobuild.CSharp /opt/hostedtoolcache/CodeQL/2.24.2/x64/codeql/csharp/tools/linux64/Semmle.Autobuild.CSharp(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.