make fishbone ID includes

This commit is contained in:
areeqakbr 2025-06-23 17:00:15 +07:00
parent a2c71ca81e
commit 68fe9dc83e
2 changed files with 12 additions and 4 deletions

View File

@ -12,6 +12,8 @@ type FishboneResponse struct {
BackboneCode string `json:"backbone_code"`
DeviceStart string `json:"device_start"`
DeviceEnd string `json:"device_end"`
DeviceStartID uuid.UUID `json:"device_start_id"`
DeviceEndID uuid.UUID `json:"device_end_id"`
CoreAmount int `json:"core_amount"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
@ -20,7 +22,9 @@ type FishboneResponse struct {
type FishboneDetailResponse struct {
ID uuid.UUID `json:"id"`
FishboneCode string `json:"fishbone_code"`
Backbone BackboneInfo `json:"backbone"`
DeviceStartID uuid.UUID `json:"device_start_id"`
DeviceEndID uuid.UUID `json:"device_end_id"`
BackboneCode string `json:"backbone_code"`
CoreAmount int `json:"core_amount"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`

View File

@ -18,6 +18,8 @@ func ConvertToFishboneResponses(fishbones []entity.Fishbone, totalFishbone map[u
BackboneCode: fishbone.Backbone.BackboneCode,
DeviceStart: fishbone.DeviceStart.DeviceCode,
DeviceEnd: fishbone.DeviceEnd.DeviceCode,
DeviceStartID: fishbone.DeviceStart.ID,
DeviceEndID: fishbone.DeviceEnd.ID,
CoreAmount: fishbone.CoreAmount,
CreatedAt: fishbone.CreatedAt,
UpdatedAt: fishbone.UpdatedAt,
@ -33,9 +35,9 @@ func ConvertToFishboneDetailResponse(fishbone entity.Fishbone) res.FishboneDetai
return res.FishboneDetailResponse{
ID: fishbone.ID,
FishboneCode: fishbone.FishboneCode,
Backbone: res.BackboneInfo{
BackboneCode: fishbone.Backbone.BackboneCode,// Fixed missing field
},
DeviceStartID: fishbone.DeviceStart.ID,
DeviceEndID: fishbone.DeviceEnd.ID,
BackboneCode: fishbone.Backbone.BackboneCode,
CoreAmount: fishbone.CoreAmount,
CreatedAt: fishbone.CreatedAt,
UpdatedAt: fishbone.UpdatedAt,
@ -53,6 +55,8 @@ func ConvertToSimpleFishboneResponses(fishbones []entity.Fishbone) []res.Fishbon
BackboneCode: fishbone.Backbone.BackboneCode,
DeviceStart: fishbone.DeviceStart.DeviceCode,
DeviceEnd: fishbone.DeviceEnd.DeviceCode,
DeviceStartID: fishbone.DeviceStart.ID,
DeviceEndID: fishbone.DeviceEnd.ID,
CoreAmount: fishbone.CoreAmount,
CreatedAt: fishbone.CreatedAt,
UpdatedAt: fishbone.UpdatedAt,