January 2018
Beginner to intermediate
312 pages
7h 22m
English
We’ve made a first pass at the design, so let’s review what we have so far. First, we’ll write down the types for the public API. We’ll typically put them all in one file, such as DomainApi.fs or something similar.
Here are the inputs:
| | // ---------------------- |
| | // Input data |
| | // ---------------------- |
| | |
| | type UnvalidatedOrder = { |
| | OrderId : string |
| | CustomerInfo : UnvalidatedCustomer |
| | ShippingAddress : UnvalidatedAddress |
| | } |
| | and UnvalidatedCustomer = { |
| | Name : string |
| | Email : string |
| | } |
| | and UnvalidatedAddress = ... |
| | |
| | // ---------------------- |
| | // Input Command |
| | // ---------------------- |
| | |
| | type Command<'data> = { |
| | Data : 'data |
| | Timestamp: DateTime |
| | UserId: string |
| | // etc |
| |
Read now
Unlock full access