ZML
Help on defining aggregates using DDD
Hi, I'm working on a mini project for a spa management system in which I would like to familiarize myself with the concept of DDD (Domain-Driven Design). I have a general understanding of it, but I'm having trouble defining what should be an aggregate and what should not. Currently, I anticipate having the following classes in the system: Employee, Customer, Service, Salon, Product, Appointment, Sale, Invoice, Report, Schedule, Payment. Could someone guide me on which classes should be aggregates in this case? Thank you in advance for your help.
9 replies
Handling Nullable Property Updates in ASP.NET
I'm creating an endpoint to update an object, specifically a Salon. The SalonUpdateRequest class has three properties that can be updated: string Name, string PhoneNumber, and string? Description (nullable).
I'm facing a dilemma regarding the Description property. If the user doesn't update it (omits it in the JSON), it defaults to null, which makes it unclear whether the user intends to remove the Description or simply doesn't want to update it.
I have two ideas on how to solve this issue, but I'd like to seek advice from more experienced individuals to choose the most sensible approach.
7 replies
Different types of accounts - asp net
Hello, I'm trying to write a project for a spa salon management system (my diploma project). I've already created a controller containing endpoints for registering an administrator account and managing accounts in the system (login, authorization, etc.). Now, I would like to create something like an administrator panel that would allow, among other things, creating accounts for employees. Here is where my problem arises. I'm using Identity and I'm wondering whether, when creating employee accounts, I should also store them in the Identity Users table and assign them the role "Employee," or should I create a separate Employees table (Can Identity handle two different user tables?). I would appreciate help from experienced users because I'm not sure if I'm approaching this problem correctly. Is there perhaps another way to do this? Thank you in advance for your help.
2 replies
ASP Identity - additional properties
Hello, I'm working on a hotel management program in ASP.NET. I've implemented Identity to manage users. In the program, I anticipate at least 2 types of users: Customer and Employee. Here comes my question. Should I create a new class ApplicationUser : IdentityUser and add all the properties of Customer (e.g., FirstName, LastName) and Employee (FirstName, LastName, EmployeeNumber) there, or should I create classes CustomerProfile and EmployeeProfile, and store only the ProfileId or CustomerProfileId and EmployeeProfileId in ApplicationUser?
4 replies
Data validation
Hello, I have a question regarding data validation. I'm working on a project in ASP.NET Core WebApi. My project consists of 3 layers: Core, Infrastructure, and WebApi. I'm using the Repository pattern. I'm wondering in which layer to perform data validation. Let's take the example of user account registration. Data such as email, password (with password validation handled in the PasswordService), first name, last name, etc., are passed to the API. Should I validate this data in the Core layer when creating the Customer object (e.g., in the constructor using methods like SetName, SetEmail, etc.), or should I create a class responsible for data validation in the WebApi layer? Thank you in advance for your help
14 replies
ASP.NET Identity or custom?
Hello, I have a question. I'm quite a beginner programmer and I would like to write a small project for a hotel management system as a web API. I decided to start the project with functions such as registration, login, etc. And here is my question: Is it better to use the Identity package or to write these basic things like registration, login, token authentication using JWT, etc. by myself?
6 replies