```
UserStory ManageCustomers {
As an "Insurance Employee"
I want to "create" a "Customer" with its "firstname", "lastname"
I want to "update" an "Address" for a "Customer"
I want to "create" a "Contract" for a "Customer"
so that "I am able to manage the customer data and offer them contracts."
}
```
UserStory ManageCustomer {
As I am 'Customer'
I want to 'register' a 'Customer' with 'mobile'
I want to 'verify' 'Customer' 'mobile' is 'validate' with 'OTP'
I want to 'login' 'Customer' with 'mobile' and 'OTP'
so that "I am able to registe a Customer and login a Customer"
}
UserStory CustomerBan {
As I am 'Customer'
I want to 'create' a 'Ban' with at least two "Stop" and "Cargo" for a 'Quotation'
I want to 'trace' my 'Ban' with 'BanId'
I want to 'accept/reject' my 'Ban' 'Quotation'
I want to 'reserve' a 'Reservation' with booking time and who I am.
I 'reserve' a "Ban" start time but 'System' canceled the 'Reservation'.
}
```=kotlin
enum BanStatus {
'waitingForSystemQuotation',
'customerRepliedQuotation(status: QuotationState)',
'waittingForCustomerReservation(status: ReservationState)'
}
enum QuotationState {
case accepted
case rejected
}
if "103" {
Ban.status = BanStatus.customerRepliedQuotation(.accepted)
}
Domain BanApplication {
data class Ban(
val id: String,
val customerId: String,
val quotationId: String?,
val reservationId: String?,
val state: State ['init', 'quotating', 'quotation_accepted', 'quotation_rejected' 'reserving', 'reserved', 'reservation_canceled'],
)
data class Quotation(
val id: String,
val cargo: Cargo,
val route: Route,
val state: ['pending', 'quoting', 'quoted', 'invalid'],
val expiredAt: Date,
val price: String?,
val mobile: String?,
)
data class Route (
val stops() : List<Stop>
) {
val originStop = stops.first
val destinationStop = stops.last
val enStops = ....
}
// address or position required
data class Stop (
val lat: Double,
val lng: Double,
val address: String?,
val city: String,
val floor: String,
val hasElevator: Boolean,
)
data class Cargo(
val imageUrls: List<String>,
val description: String,
)
data class Reservation(
val id: String,
val bookingAt: Date,
val customerName: String,
val state: ['reserving', 'reserved', 'canceled']
)
}
Domain QuotationApplication {
data class Quoter {
// TODO
}
}
```
```
UseCase ManageCustomers {
actor "Insurance Employee"
interactions
"create" a "Customer" with its "firstname", "lastname",
"update" an "Address" for a "Customer",
"create" a "Contract" for a "Customer"
benefit "Being able to manage the customers data and offer them contracts."
scope "Insurance Application"
level "Summary"
}
```
```
Domain Insurance_Application {
Subdomain ClaimsManagement {
domainVisionStatement "Aims at promoting: A claimant submits a claim and ..."
Entity Claim {
Date date
Double amountClaimed
String description
- Agent agent
}
Entity Policy {
Date startDate
Date endDate
- List<Claim> claims
}
Entity Contract {
- List<Policy> policies
}
Entity Agent {
Long personalID
String firstName
String lastName
}
Entity Claimant {
String firstName
String lastName
- List<Claim> claims
}
Service AccidentService {
submitClaim;
verifyExistanceOfPolicy;
assignAgent;
verifyPolicy;
payClaimant;
closeClaim;
}
}
}
```