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
11 changes: 11 additions & 0 deletions Source/DotNET/Screenplay/for_ScreenplayCompiler/invoicing.play
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,17 @@ module Invoicing
screen InvoiceLineReport
file Screens/InvoiceLineReport.tsx

slice StateView CancelledInvoices
description "Archive of cancelled invoices - every property auto-maps from the event"

query ListCancelledInvoices => CancelledInvoiceReadModel[]
authorize IsAccountant

// No explicit mappings needed - AutoMap is on by default and copies
// every matching property from InvoiceCancelled onto the read model.
projection CancelledInvoices => CancelledInvoiceReadModel
from InvoiceCancelled

slice StateView InvoiceDashboard

query GetInvoiceSummary => InvoiceSummaryReadModel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ void Because()
[Fact] void should_have_the_command_description() => RegisterCommand.Description.ShouldEqual("Registers a new invoice with its lines and payment terms");
[Fact] void should_have_both_layouts() => _result.Value!.Modules.Single().Layouts.Count().ShouldEqual(2);
[Fact] void should_have_the_master_detail_slots() => _result.Value!.Modules.Single().Layouts.First().Slots.ShouldContainOnly("sidebar", "main");
[Fact] void should_have_all_slices() => _feature.Slices.Count().ShouldEqual(13);
[Fact] void should_have_all_slices() => _feature.Slices.Count().ShouldEqual(14);
[Fact] void should_have_the_fully_auto_mapped_projection() => Slice("CancelledInvoices").Projection!.Blocks.OfType<FromSyntax>().Single().Mappings.ShouldBeEmpty();
[Fact] void should_have_the_nested_feature() => _feature.Features.Single().Name.ShouldEqual("Adjustments");
[Fact] void should_have_the_nested_feature_slices() => _feature.Features.Single().Slices.Select(_ => _.Name).ShouldContainOnly("ApplyDiscount", "WriteOffInvoice");
[Fact] void should_parse_conditional_produces() => RegisterCommand.Produces.Count(_ => _.When is not null).ShouldEqual(4);
Expand Down
11 changes: 11 additions & 0 deletions Source/Screenplay/Monaco/screenplay-editor/samples/invoicing.play
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,17 @@ module Invoicing
screen InvoiceLineReport
file Screens/InvoiceLineReport.tsx

slice StateView CancelledInvoices
description "Archive of cancelled invoices - every property auto-maps from the event"

query ListCancelledInvoices => CancelledInvoiceReadModel[]
authorize IsAccountant

// No explicit mappings needed - AutoMap is on by default and copies
// every matching property from InvoiceCancelled onto the read model.
projection CancelledInvoices => CancelledInvoiceReadModel
from InvoiceCancelled

slice StateView InvoiceDashboard

query GetInvoiceSummary => InvoiceSummaryReadModel
Expand Down
Loading