fix get search keuangan; add bank name to supplier and customer

This commit is contained in:
giovanni
2026-05-17 20:48:13 +07:00
parent 18f9da1eaf
commit 872a71efda
11 changed files with 28 additions and 2 deletions
@@ -26,6 +26,7 @@ type SupplierListDTO struct {
Address string `json:"address"`
Npwp *string `json:"npwp,omitempty"`
AccountNumber *string `json:"account_number,omitempty"`
BankName *string `json:"bank_name,omitempty"`
Balance float64 `json:"balance"`
DueDate int `json:"due_date"`
CreatedUser *userDTO.UserRelationDTO `json:"created_user"`
@@ -66,6 +67,7 @@ func ToSupplierListDTO(e entity.Supplier) SupplierListDTO {
Address: e.Address,
Npwp: e.Npwp,
AccountNumber: e.AccountNumber,
BankName: e.BankName,
Balance: e.Balance,
DueDate: e.DueDate,
SupplierRelationDTO: ToSupplierRelationDTO(e),
@@ -160,6 +160,7 @@ func (s *supplierService) CreateOne(c *fiber.Ctx, req *validation.Create) (*enti
Address: req.Address,
Npwp: req.Npwp,
AccountNumber: req.AccountNumber,
BankName: req.BankName,
DueDate: req.DueDate,
CreatedBy: actorID,
}
@@ -243,6 +244,10 @@ func (s supplierService) UpdateOne(c *fiber.Ctx, req *validation.Update, id uint
updateBody["account_number"] = *req.AccountNumber
}
if req.BankName != nil {
updateBody["bank_name"] = *req.BankName
}
if req.DueDate != nil {
updateBody["due_date"] = *req.DueDate
}
@@ -12,6 +12,7 @@ type Create struct {
Address string `json:"address" validate:"required_strict"`
Npwp *string `json:"npwp,omitempty" validate:"omitempty,max=50"`
AccountNumber *string `json:"account_number,omitempty" validate:"omitempty,max=50"`
BankName *string `json:"bank_name,omitempty" validate:"omitempty,max=100"`
DueDate int `json:"due_date" validate:"required_strict,number,gt=0"`
}
@@ -27,6 +28,7 @@ type Update struct {
Address *string `json:"address,omitempty" validate:"omitempty"`
Npwp *string `json:"npwp,omitempty" validate:"omitempty,max=50"`
AccountNumber *string `json:"account_number,omitempty" validate:"omitempty,max=50"`
BankName *string `json:"bank_name,omitempty" validate:"omitempty,max=100"`
DueDate *int `json:"due_date,omitempty" validate:"omitempty,number,gt=0"`
}