fix(BE-273): add object nonstock and supplier in response get one and fix name base to relation in dto

This commit is contained in:
Hafizh A. Y
2025-11-20 14:59:50 +07:00
parent b4b860b9d4
commit 228aedc215
64 changed files with 964 additions and 3576 deletions
+7 -7
View File
@@ -8,7 +8,7 @@ import (
// === DTO Structs ===
type UserBaseDTO struct {
type UserRelationDTO struct {
Id uint `json:"id"`
IdUser int64 `json:"id_user"`
Email string `json:"email"`
@@ -16,7 +16,7 @@ type UserBaseDTO struct {
}
type UserListDTO struct {
UserBaseDTO
UserRelationDTO
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
@@ -27,8 +27,8 @@ type UserDetailDTO struct {
// === Mapper Functions ===
func ToUserBaseDTO(m entity.User) UserBaseDTO {
return UserBaseDTO{
func ToUserRelationDTO(m entity.User) UserRelationDTO {
return UserRelationDTO{
Id: m.Id,
IdUser: m.IdUser,
Email: m.Email,
@@ -38,9 +38,9 @@ func ToUserBaseDTO(m entity.User) UserBaseDTO {
func ToUserListDTO(m entity.User) UserListDTO {
return UserListDTO{
UserBaseDTO: ToUserBaseDTO(m),
CreatedAt: m.CreatedAt,
UpdatedAt: m.UpdatedAt,
UserRelationDTO: ToUserRelationDTO(m),
CreatedAt: m.CreatedAt,
UpdatedAt: m.UpdatedAt,
}
}