feat (user): add create

This commit is contained in:
dpurbosakti
2025-08-13 14:26:14 +07:00
parent 2e88eaf793
commit 7577c87f27
12 changed files with 342 additions and 9 deletions

No files matched your search

+2 -2
View File
@@ -1,6 +1,6 @@
package single
type Createdto struct {
type CreateDto struct {
Code string `json:"code"`
Name string `json:"name"`
Description string `json:"description"`
@@ -23,7 +23,7 @@ type ReadDetailDto struct {
type Updatedto struct {
Id uint `json:"id"`
Createdto
CreateDto
}
type Deletedto struct {
+38
View File
@@ -0,0 +1,38 @@
package user
import erc "simrs-vx/internal/domain/references/common"
type CreateDto struct {
Name string `json:"name"`
Password string `json:"password"`
Status_Code erc.StatusCode `json:"status_code"`
}
type ReadListDto struct {
Name string `json:"name"`
Status_Code erc.StatusCode `json:"status_code"`
Page int `json:"page"`
PageSize int `json:"page_size"`
NoPagination int `json:"no_pagination"`
}
type ReadDetailDto struct {
Id uint `json:"id"`
Name string `json:"name"`
}
type Updatedto struct {
Id uint `json:"id"`
CreateDto
}
type Deletedto struct {
Id uint `json:"id"`
}
type MetaDto struct {
PageNumber int `json:"page_number"`
PageSize int `json:"page_size"`
Count int64 `json:"count"`
}
@@ -0,0 +1,14 @@
package user
import (
ecore "simrs-vx/internal/domain/base-entities/core"
erc "simrs-vx/internal/domain/references/common"
)
type User struct {
ecore.Main // adjust this according to the needs
Name string `json:"name" gorm:"not null;size:25"`
Password string `json:"password" gorm:"not null;size:255"`
Status_Code erc.StatusCode `json:"status_code" gorm:"not null;size:10"`
FailedLoginCount uint `json:"failedLoginCount"`
}