Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
ProjectsStatusManagement
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hasan.bahjat
ProjectsStatusManagement
Commits
2fddc523
Commit
2fddc523
authored
Jul 26, 2024
by
hasan khaddour
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Cutomer Domain
parent
5d39c9ea
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
153 additions
and
0 deletions
+153
-0
Customer.cs
PSManagement.Domain/Customers/Aggregate/Customer.cs
+39
-0
ContactInfo.cs
PSManagement.Domain/Customers/Entities/ContactInfo.cs
+32
-0
ICustomersRepository.cs
...ent.Domain/Customers/Repositories/ICustomersRepository.cs
+11
-0
Address.cs
PSManagement.Domain/Customers/ValueObjects/Address.cs
+39
-0
ContactNumber.cs
PSManagement.Domain/Customers/ValueObjects/ContactNumber.cs
+32
-0
No files found.
PSManagement.Domain/Customers/Aggregate/Customer.cs
0 → 100644
View file @
2fddc523
using
PSManagement.Domain.Customers.Entities
;
using
PSManagement.Domain.Customers.ValueObjects
;
using
PSManagement.SharedKernel.Aggregate
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Linq.Expressions
;
namespace
PSManagement.Domain.Customers.Aggregate
{
public
class
Customer
:
IAggregateRoot
{
public
String
CustomerName
{
get
;
set
;
}
public
Address
Address
{
get
;
set
;
}
public
IEnumerable
<
ContactInfo
>
ContactInfo
{
get
;
private
set
;
}
public
Customer
()
{
}
public
Customer
(
String
customerName
,
Address
address
)
{
CustomerName
=
customerName
;
Address
=
address
;
}
public
void
AddContactInfo
(
ContactInfo
contactInfo
)
{
if
(
ContactInfo
is
null
)
{
ContactInfo
=
new
List
<
ContactInfo
>();
}
ContactInfo
=
ContactInfo
.
Append
(
contactInfo
);
}
}
}
PSManagement.Domain/Customers/Entities/ContactInfo.cs
0 → 100644
View file @
2fddc523
using
PSManagement.Domain.Customers.ValueObjects
;
using
PSManagement.SharedKernel.Entities
;
using
PSManagement.SharedKernel.ValueObjects
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Text.RegularExpressions
;
using
System.Threading.Tasks
;
namespace
PSManagement.Domain.Customers.Entities
{
public
sealed
class
ContactInfo
:
BaseEntity
{
public
ContactNumber
PhoneNumber
{
get
;
set
;
}
public
ContactNumber
MobileNumber
{
get
;
set
;
}
public
String
Email
{
get
;
set
;
}
public
ContactInfo
()
{
}
public
ContactInfo
(
string
email
,
ContactNumber
mobileNumber
,
ContactNumber
phoneNumer
)
{
Email
=
email
;
MobileNumber
=
mobileNumber
;
PhoneNumber
=
phoneNumer
;
}
}
}
PSManagement.Domain/Customers/Repositories/ICustomersRepository.cs
0 → 100644
View file @
2fddc523
using
PSManagement.Domain.Customers.Aggregate
;
using
PSManagement.SharedKernel.Repositories
;
namespace
PSManagement.Domain.Customers.Repositories
{
public
interface
ICustomersRepository
:
IRepository
<
Customer
>
{
}
}
PSManagement.Domain/Customers/ValueObjects/Address.cs
0 → 100644
View file @
2fddc523
using
PSManagement.SharedKernel.ValueObjects
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
PSManagement.Domain.Customers.ValueObjects
{
public
class
Address
:
ValueObject
{
public
int
StreetNumber
{
get
;
private
set
;
}
public
int
ZipCode
{
get
;
private
set
;
}
public
String
StreetName
{
get
;
private
set
;
}
public
String
City
{
get
;
private
set
;
}
public
Address
()
{
}
public
Address
(
string
city
,
string
streetName
,
int
zipCode
,
int
streetNumber
)
{
City
=
city
;
StreetName
=
streetName
;
ZipCode
=
zipCode
;
StreetNumber
=
streetNumber
;
}
protected
override
IEnumerable
<
object
>
GetEqualityComponents
()
{
yield
return
StreetName
;
yield
return
StreetNumber
;
yield
return
City
;
yield
return
ZipCode
;
}
}
}
PSManagement.Domain/Customers/ValueObjects/ContactNumber.cs
0 → 100644
View file @
2fddc523
using
PSManagement.SharedKernel.ValueObjects
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
PSManagement.Domain.Customers.ValueObjects
{
public
sealed
class
ContactNumber
:
ValueObject
{
public
int
Number
{
get
;
private
set
;
}
public
ContactNumber
(
int
number
)
{
SetNumber
(
number
);
}
public
ContactNumber
()
{
}
private
void
SetNumber
(
int
number
)
{
Number
=
number
;
}
protected
override
IEnumerable
<
object
>
GetEqualityComponents
()
{
yield
return
Number
;
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment