Skip to content

Instantly share code, notes, and snippets.

@amantinband
Last active November 4, 2024 23:53
Show Gist options
  • Save amantinband/425ffc6b82e41610369e51e9d2827e4c to your computer and use it in GitHub Desktop.
Save amantinband/425ffc6b82e41610369e51e9d2827e4c to your computer and use it in GitHub Desktop.
Buber Dinner Domain Aggregates

Domain Aggregates

Bill

class Bill
{
    // TODO: Add methods
}
{
    "id": { "value": "00000000-0000-0000-0000-000000000000" },
    "dinnerId": { "value": "00000000-0000-0000-0000-000000000000" },
    "guestId": { "value": "00000000-0000-0000-0000-000000000000" },
    "hostId": { "value": "00000000-0000-0000-0000-000000000000" },
    "price": {
        "amount": 10.99,
        "currency": "USD"
    },
    "createdDateTime": "2020-01-01T00:00:00.0000000Z",
    "updatedDateTime": "2020-01-01T00:00:00.0000000Z"
}

Domain Aggregates

Dinner

class Dinner
{
    // TODO: Add methods
}
{
    "id": { "value": "00000000-0000-0000-0000-000000000000" },
    "name": "Yummy Dinner",
    "description": "A dinner with yummy food",
    "startDateTime": "2020-01-01T00:00:00.0000000Z",
    "endDateTime": "2020-01-01T00:00:00.0000000Z",
    "startedDateTime": null,
    "endedDateTime": null,
    "status": "Upcoming", // Upcoming, InProgress, Ended, Cancelled
    "isPublic": true,
    "maxGuests": 10,
    "price": {
        "amount": 10.99,
        "currency": "USD"
    },
    "hostId": { "value": "00000000-0000-0000-0000-000000000000" },
    "menuId": { "value": "00000000-0000-0000-0000-000000000000" },
    "imageUrl": "https://image.com",
    "location": {
        "name": "Dan's Pizza Place",
        "address": "Berlin, Germany",
        "latitude": 52.520008,
        "longitude": 13.404954
    },
    "reservations": [
        {
            "id": { "value": "00000000-0000-0000-0000-000000000000" },
            "guestCount": 2,
            "reservationStatus": "Reserved", // PendingGuestConfirmation, Reserved, Cancelled
            "guestId": { "value": "00000000-0000-0000-0000-000000000000" },
            "billId": { "value": "00000000-0000-0000-0000-000000000000 }",
            "arrivalDateTime": null,
            "createdDateTime": "2020-01-01T00:00:00.0000000Z",
            "updatedDateTime": "2020-01-01T00:00:00.0000000Z"
        }
    ],
    "createdDateTime": "2020-01-01T00:00:00.0000000Z",
    "updatedDateTime": "2020-01-01T00:00:00.0000000Z"
}

Domain Aggregates

Guest

class Guest
{
    // TODO: Add methods
}
{
    "id": { "value": "00000000-0000-0000-0000-000000000000" },
    "firstName": "John",
    "lastName": "Doe",
    "profileImage": "https://www.gravatar.com/avatar/00000000000000000000000000000000?d=mp",
    "averageRating": 4.5,
    "userId": { "value": "00000000-0000-0000-0000-000000000000" },
    "upcomingDinnerIds": [
        { "value": "00000000-0000-0000-0000-000000000000" }
    ],
    "pastDinnerIds": [
        { "value": "00000000-0000-0000-0000-000000000000" }
    ],
    "pendingDinnerIds": [
        { "value": "00000000-0000-0000-0000-000000000000" }
    ],
    "billIds": [
        { "value": "00000000-0000-0000-0000-000000000000" }
    ],
    "menuReviewIds": [
        { "value": "00000000-0000-0000-0000-000000000000" }
    ],
    "ratings": [
        {
            "id": { "value": "00000000-0000-0000-0000-000000000000" },
            "hostId": { "value": "00000000-0000-0000-0000-000000000000" },
            "dinnerId": { "value": "00000000-0000-0000-0000-000000000000" },
            "rating": 4,
            "createdDateTime": "2020-01-01T00:00:00.0000000Z",
            "updatedDateTime": "2020-01-01T00:00:00.0000000Z"
        }
    ],
    "createdDateTime": "2020-01-01T00:00:00.0000000Z",
    "updatedDateTime": "2020-01-01T00:00:00.0000000Z"
}

Domain Aggregates

Host

class Host
{
    // TODO: Add methods
}
{
    "id": { "value": "00000000-0000-0000-0000-000000000000" },
    "firstName": "Tiffany",
    "lastName": "Doe",
    "profileImage": "https://www.gravatar.com/avatar/00000000000000000000000000000000?d=mp",
    "averageRating": 4.5,
    "userId": { "value": "00000000-0000-0000-0000-000000000000" },
    "menuIds": [
        { "value": "00000000-0000-0000-0000-000000000000" }
    ],
    "dinnerIds": [
        { "value": "00000000-0000-0000-0000-000000000000" }
    ],
    "createdDateTime": "2020-01-01T00:00:00.0000000Z",
    "updatedDateTime": "2020-01-01T00:00:00.0000000Z"
}

Domain Aggregates

Menu

class Menu
{
    Menu Create();
    void AddDinner(Dinner dinner);
    void RemoveDinner(Dinner dinner);
    void UpdateSection(MenuSection section);
    // TODO: Add remaining methods
}
{
    "id": { "value": "00000000-0000-0000-0000-000000000000" },
    "name": "Yummy Menu",
    "description": "A menu with yummy food",
    "averageRating": 4.5,
    "sections": [
        {
            "id": { "value": "00000000-0000-0000-0000-000000000000" },
            "name": "Appetizers",
            "description": "Starters",
            "items": [
                {
                    "id": { "value": "00000000-0000-0000-0000-000000000000" },
                    "name": "Fried Pickles",
                    "description": "Deep fried pickles"
                }
            ]
        }
    ],
    "hostId": { "value": "00000000-0000-0000-0000-000000000000" },
    "dinnerIds": [
        { "value": "00000000-0000-0000-0000-000000000000" }
    ],
    "menuReviewIds": [
        { "value": "00000000-0000-0000-0000-000000000000" }
    ],
    "createdDateTime": "2020-01-01T00:00:00.0000000Z",
    "updatedDateTime": "2020-01-01T00:00:00.0000000Z"
}

Domain Aggregates

Menu Review

class MenuReview
{
    // TODO: Add methods
}
{
    "id": { "value": "00000000-0000-0000-0000-000000000000" },
    "rating": 4,
    "comment": "A menu with yummy food",
    "hostId": { "value": "00000000-0000-0000-0000-000000000000" },
    "menuId": { "value": "00000000-0000-0000-0000-000000000000" },
    "guestId": { "value": "00000000-0000-0000-0000-000000000000" },
    "dinnerId": { "value": "00000000-0000-0000-0000-000000000000" },
    "createdDateTime": "2020-01-01T00:00:00.0000000Z",
    "updatedDateTime": "2020-01-01T00:00:00.0000000Z"
}

Domain Aggregates

User

class User
{
    // TODO: Add methods
}
{
    "id": { "value": "00000000-0000-0000-0000-000000000000" },
    "firstName": "Tiffany",
    "lastName": "Doe",
    "email": "[email protected]",
    "password": "Amiko1232!", // TODO: Hash this
    "createdDateTime": "2020-01-01T00:00:00.0000000Z",
    "updatedDateTime": "2020-01-01T00:00:00.0000000Z"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment