-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4b9d852
commit 5c51d08
Showing
88 changed files
with
4,418 additions
and
813 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
**/.classpath | ||
**/.dockerignore | ||
**/.env | ||
**/.git | ||
**/.gitignore | ||
**/.project | ||
**/.settings | ||
**/.toolstarget | ||
**/.vs | ||
**/.vscode | ||
**/*.*proj.user | ||
**/*.dbmdl | ||
**/*.jfm | ||
**/azds.yaml | ||
**/bin | ||
**/charts | ||
**/docker-compose* | ||
**/Dockerfile* | ||
**/node_modules | ||
**/npm-debug.log | ||
**/obj | ||
**/secrets.dev.yaml | ||
**/values.dev.yaml | ||
LICENSE | ||
README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
using AutoMapper; | ||
using GsServer.Protobufs; | ||
using GsServer.Models; | ||
|
||
namespace GsServer.MapperProfile; | ||
|
||
public class AutoMapperProfile : Profile | ||
{ | ||
public AutoMapperProfile() | ||
{ | ||
CreateMap<Attendance, GetAttendanceByIdResponse>() | ||
.ForMember(dest => dest.AttendeesStatuses, src => src.MapFrom(src => src.AttendeesStatuses)); | ||
CreateMap<CreateAttendanceRequest, Attendance>() | ||
.ForMember(dest => dest.AttendeesStatuses, src => src.MapFrom(src => src.AttendeesStatuses)); | ||
CreateMap<Models.AttendanceAttendeeStatus, Protobufs.AttendanceAttendeeStatus>(); | ||
|
||
CreateMap<Customer, GetCustomerByIdResponse>() | ||
.ForMember(dest => dest.Dependents, src => src.MapFrom(src => src.Dependents)); | ||
CreateMap<Customer, CustomerOption>() | ||
.ForMember(dest => dest.Dependents, src => src.MapFrom(src => src.Dependents)); | ||
CreateMap<CreateCustomerRequest, Customer>() | ||
.ForMember(dest => dest.Dependents, src => src.MapFrom(src => src.Dependents)); | ||
|
||
CreateMap<Discipline, GetDisciplineByIdResponse>() | ||
.ForMember(dest => dest.ClassDays, src => src.MapFrom(src => src.ClassDays)); | ||
CreateMap<CreateDisciplineRequest, Discipline>() | ||
.ForMember(dest => dest.ClassDays, src => src.MapFrom(src => src.ClassDays)); | ||
|
||
CreateMap<Instructor, GetInstructorByIdResponse>(); | ||
CreateMap<Instructor, InstructorOption>(); | ||
CreateMap<CreateInstructorRequest, Instructor>(); | ||
|
||
CreateMap<Notification, GetNotificationByIdResponse>(); | ||
CreateMap<CreateNotificationRequest, Notification>(); | ||
|
||
// TODO | ||
// CreateMap<Order, GetOrderByIdResponse>(); | ||
// CreateMap<CreateOrderRequest, Order>(); | ||
// CreateMap<Models.OrderStatus, Protobufs.OrderStatus>(); | ||
|
||
CreateMap<Payment, GetPaymentByIdResponse>() | ||
.ForMember(dest => dest.Installments, src => src.MapFrom(src => src.Installments)); | ||
CreateMap<CreatePaymentRequest, Payment>() | ||
.ForMember(dest => dest.Installments, src => src.MapFrom(src => src.Installments)); | ||
CreateMap<Models.PaymentInstallment, Protobufs.PaymentInstallment>(); | ||
|
||
CreateMap<Models.Person, Protobufs.Person>(); | ||
|
||
CreateMap<Product, GetProductByIdResponse>() | ||
.ForMember(dest => dest.Variants, src => src.MapFrom(src => src.Variants)); | ||
CreateMap<CreateProductRequest, Product>() | ||
.ForMember(dest => dest.Variants, src => src.MapFrom(src => src.Variants)); | ||
CreateMap<Models.ProductBrand, Protobufs.ProductBrand>(); | ||
CreateMap<Models.ProductCategory, Protobufs.ProductCategory>(); | ||
// TODO | ||
// CreateMap<Models.ProductStockHistory, Protobufs.ProductStockHistory>(); | ||
CreateMap<Models.ProductVariant, Protobufs.ProductVariant>(); | ||
CreateMap<Models.ProductVariantInventory, Protobufs.ProductVariantInventory>(); | ||
|
||
CreateMap<Promotion, GetPromotionByIdResponse>(); | ||
CreateMap<CreatePromotionRequest, Promotion>(); | ||
|
||
CreateMap<Return, GetReturnByIdResponse>() | ||
.ForMember(dest => dest.ItemsReturned, src => src.MapFrom(src => src.ItemsReturned)); | ||
CreateMap<CreateReturnRequest, Return>() | ||
.ForMember(dest => dest.ItemsReturned, src => src.MapFrom(src => src.ItemsReturned)); | ||
CreateMap<Models.ReturnItem, Protobufs.ReturnItem>(); | ||
|
||
CreateMap<Sale, GetSaleByIdResponse>() | ||
.ForMember(dest => dest.ItemsSold, src => src.MapFrom(src => src.ItemsSold)); | ||
CreateMap<CreateSaleRequest, Sale>() | ||
.ForMember(dest => dest.ItemsSold, src => src.MapFrom(src => src.ItemsSold)); | ||
CreateMap<SaleBilling, GetSaleBillingByIdResponse>(); | ||
CreateMap<CreateSaleBillingRequest, SaleBilling>(); | ||
CreateMap<Models.SaleItem, Protobufs.SaleItem>(); | ||
|
||
CreateMap<Subscription, GetSubscriptionByIdResponse>(); | ||
CreateMap<CreateSubscriptionRequest, Subscription>(); | ||
CreateMap<SubscriptionBilling, GetSubscriptionBillingByIdResponse>(); | ||
CreateMap<CreateSubscriptionBillingRequest, SubscriptionBilling>(); | ||
|
||
CreateMap<User, GetUserByIdResponse>(); | ||
CreateMap<RegisterRequest, User>(); | ||
|
||
CreateMap<System.DayOfWeek, Protobufs.DayOfWeek>(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
namespace GsServer.Protobufs; | ||
|
||
public partial class CalendarDate | ||
{ | ||
public CalendarDate(int year, int month, int day) | ||
{ | ||
Year = year; | ||
Month = month; | ||
Day = day; | ||
} | ||
|
||
public static implicit operator DateOnly(CalendarDate date) | ||
{ | ||
return new DateOnly( | ||
date.Year, | ||
date.Month, | ||
date.Day | ||
); | ||
} | ||
|
||
public static implicit operator CalendarDate(DateOnly date) | ||
{ | ||
return new CalendarDate() | ||
{ | ||
Day = date.Day, | ||
Month = date.Month, | ||
Year = date.Year | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// namespace GsServer.Protobufs; | ||
|
||
// public partial class DayOfWeek | ||
// { | ||
// public DayOfWeek() | ||
// { | ||
// // TODO | ||
// } | ||
|
||
// public static implicit operator DayOfWeek(Protobufs.DayOfWeek time) | ||
// { | ||
// return new System.DayOfWeek(); | ||
// } | ||
|
||
// public static implicit operator DayOfWeek(System.DayOfWeek time) | ||
// { | ||
// return new Protobufs.DayOfWeek(); | ||
// } | ||
|
||
// readonly Dictionary<DayOfWeek, System.DayOfWeek> DayOfWeekMapping = new() | ||
// { | ||
// { DayOfWeek.Sunday, System.DayOfWeek.Sunday }, | ||
// { DayOfWeek.Monday, System.DayOfWeek.Monday }, | ||
// { DayOfWeek.Tuesday, System.DayOfWeek.Tuesday }, | ||
// { DayOfWeek.Wednesday, System.DayOfWeek.Wednesday }, | ||
// { DayOfWeek.Thursday, System.DayOfWeek.Thursday }, | ||
// { DayOfWeek.Friday, System.DayOfWeek.Friday }, | ||
// { DayOfWeek.Saturday, System.DayOfWeek.Saturday } | ||
// }; | ||
// } | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
namespace GsServer.Protobufs; | ||
|
||
public partial class TimeOfDay | ||
{ | ||
public TimeOfDay(int hour, int minute) | ||
{ | ||
Hour = hour; | ||
Minute = minute; | ||
} | ||
|
||
public static implicit operator TimeOnly(TimeOfDay time) | ||
{ | ||
return new TimeOnly( | ||
time.Hour, | ||
time.Minute | ||
); | ||
} | ||
|
||
public static implicit operator TimeOfDay(TimeOnly time) | ||
{ | ||
return new TimeOfDay() | ||
{ | ||
Hour = time.Hour, | ||
Minute = time.Minute | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.