From 1b7953928f93348828e6458101ab3bf9481cdb4b Mon Sep 17 00:00:00 2001 From: Idhibhat Pankam Date: Sat, 13 Jan 2024 14:13:04 +0700 Subject: [PATCH] feat: remove species, isclubpet --- src/app/dto/pet.dto.go | 6 ------ src/app/handler/pet/pet.handler_test.go | 4 ---- src/app/service/pet/pet.service_test.go | 8 -------- src/app/utils/pet/pet.utils.go | 7 ------- 4 files changed, 25 deletions(-) diff --git a/src/app/dto/pet.dto.go b/src/app/dto/pet.dto.go index 39a77ff..2e0df1e 100644 --- a/src/app/dto/pet.dto.go +++ b/src/app/dto/pet.dto.go @@ -7,7 +7,6 @@ import ( type PetResponse struct { Id string `json:"id"` Type string `json:"type"` - Species string `json:"species"` Name string `json:"name"` Birthdate string `json:"birthdate"` Gender pet.Gender `json:"gender"` @@ -19,7 +18,6 @@ type PetResponse struct { IsSterile *bool `json:"is_sterile"` IsVaccinated *bool `json:"is_vaccinated"` IsVisible *bool `json:"is_visible"` - IsClubPet *bool `json:"is_club_pet"` Origin string `json:"origin"` Address string `json:"address"` Contact string `json:"contact"` @@ -29,7 +27,6 @@ type PetResponse struct { type CreatePetRequest struct { Type string `json:"type" validate:"required"` - Species string `json:"species" validate:"required"` Name string `json:"name" validate:"required"` Birthdate string `json:"birthdate" validate:"required"` Gender pet.Gender `json:"gender" validate:"required" example:"male"` @@ -41,7 +38,6 @@ type CreatePetRequest struct { IsSterile *bool `json:"is_sterile" validate:"required"` IsVaccinated *bool `json:"is_vaccinated" validate:"required"` IsVisible *bool `json:"is_visible" validate:"required"` - IsClubPet *bool `json:"is_club_pet" validate:"required"` Origin string `json:"origin" validate:"required"` Address string `json:"address"` Contact string `json:"contact"` @@ -68,7 +64,6 @@ type AdoptByResponse struct { type UpdatePetRequest struct { Type string `json:"type"` - Species string `json:"species"` Name string `json:"name"` Birthdate string `json:"birthdate"` Gender pet.Gender `json:"gender"` @@ -80,7 +75,6 @@ type UpdatePetRequest struct { IsSterile *bool `json:"is_sterile"` IsVaccinated *bool `json:"is_vaccinated"` IsVisible *bool `json:"is_visible"` - IsClubPet *bool `json:"is_club_pet"` Origin string `json:"origin"` Address string `json:"address"` Contact string `json:"contact"` diff --git a/src/app/handler/pet/pet.handler_test.go b/src/app/handler/pet/pet.handler_test.go index 26318e6..6cff0fc 100644 --- a/src/app/handler/pet/pet.handler_test.go +++ b/src/app/handler/pet/pet.handler_test.go @@ -56,7 +56,6 @@ func (t *PetHandlerTest) SetupTest() { pet := &petProto.Pet{ Id: faker.UUIDDigit(), Type: faker.Word(), - Species: faker.Word(), Name: faker.Name(), Birthdate: faker.Word(), Gender: string(genders[rand.Intn(2)]), @@ -69,7 +68,6 @@ func (t *PetHandlerTest) SetupTest() { IsSterile: true, IsVaccinated: true, IsVisible: true, - IsClubPet: true, Origin: faker.Paragraph(), Address: faker.Paragraph(), Contact: faker.Paragraph(), @@ -85,7 +83,6 @@ func (t *PetHandlerTest) SetupTest() { t.PetDto = &dto.PetResponse{ Id: t.Pet.Id, Type: t.Pet.Type, - Species: t.Pet.Species, Name: t.Pet.Name, Birthdate: t.Pet.Birthdate, Gender: pet.Gender(t.Pet.Gender), @@ -97,7 +94,6 @@ func (t *PetHandlerTest) SetupTest() { IsSterile: &t.Pet.IsSterile, IsVaccinated: &t.Pet.IsVaccinated, IsVisible: &t.Pet.IsVisible, - IsClubPet: &t.Pet.IsClubPet, Origin: t.Pet.Origin, Address: t.Pet.Address, Contact: t.Pet.Contact, diff --git a/src/app/service/pet/pet.service_test.go b/src/app/service/pet/pet.service_test.go index a627d53..ce29072 100644 --- a/src/app/service/pet/pet.service_test.go +++ b/src/app/service/pet/pet.service_test.go @@ -59,7 +59,6 @@ func (t *PetServiceTest) SetupTest() { pet := &petproto.Pet{ Id: faker.UUIDDigit(), Type: faker.Word(), - Species: faker.Word(), Name: faker.Name(), Birthdate: faker.Word(), Gender: string(genders[rand.Intn(2)]), @@ -72,7 +71,6 @@ func (t *PetServiceTest) SetupTest() { IsSterile: true, IsVaccinated: true, IsVisible: true, - IsClubPet: true, Origin: faker.Paragraph(), Address: faker.Paragraph(), Contact: faker.Paragraph(), @@ -88,7 +86,6 @@ func (t *PetServiceTest) SetupTest() { t.PetNotVisible = &petproto.Pet{ Id: t.Pet.Id, Type: t.Pet.Type, - Species: t.Pet.Species, Name: t.Pet.Name, Birthdate: t.Pet.Birthdate, Gender: t.Pet.Gender, @@ -101,7 +98,6 @@ func (t *PetServiceTest) SetupTest() { IsSterile: t.Pet.IsSterile, IsVaccinated: t.Pet.IsVaccinated, IsVisible: false, - IsClubPet: t.Pet.IsClubPet, Origin: t.Pet.Origin, Address: t.Pet.Address, Contact: t.Pet.Contact, @@ -112,7 +108,6 @@ func (t *PetServiceTest) SetupTest() { t.CreatePetDto = &dto.CreatePetRequest{ Type: t.Pet.Type, - Species: t.Pet.Species, Name: t.Pet.Name, Birthdate: t.Pet.Birthdate, Gender: pet.Gender(t.Pet.Gender), @@ -125,7 +120,6 @@ func (t *PetServiceTest) SetupTest() { IsSterile: &t.Pet.IsSterile, IsVaccinated: &t.Pet.IsVaccinated, IsVisible: &t.Pet.IsVisible, - IsClubPet: &t.Pet.IsClubPet, Origin: t.Pet.Origin, Address: t.Pet.Address, Contact: t.Pet.Contact, @@ -134,7 +128,6 @@ func (t *PetServiceTest) SetupTest() { t.UpdatePetDto = &dto.UpdatePetRequest{ Type: t.Pet.Type, - Species: t.Pet.Species, Name: t.Pet.Name, Birthdate: t.Pet.Birthdate, Gender: pet.Gender(t.Pet.Gender), @@ -147,7 +140,6 @@ func (t *PetServiceTest) SetupTest() { IsSterile: &t.Pet.IsSterile, IsVaccinated: &t.Pet.IsVaccinated, IsVisible: &t.Pet.IsVisible, - IsClubPet: &t.Pet.IsClubPet, Origin: t.Pet.Origin, Address: t.Pet.Address, Contact: t.Pet.Contact, diff --git a/src/app/utils/pet/pet.utils.go b/src/app/utils/pet/pet.utils.go index 56829bc..b57c6a7 100644 --- a/src/app/utils/pet/pet.utils.go +++ b/src/app/utils/pet/pet.utils.go @@ -31,7 +31,6 @@ func ProtoToDto(in *petproto.Pet, images []*imgproto.Image) *dto.PetResponse { pet := &dto.PetResponse{ Id: in.Id, Type: in.Type, - Species: in.Species, Name: in.Name, Birthdate: in.Birthdate, Gender: pet.Gender(in.Gender), @@ -43,7 +42,6 @@ func ProtoToDto(in *petproto.Pet, images []*imgproto.Image) *dto.PetResponse { IsSterile: &in.IsSterile, IsVaccinated: &in.IsVaccinated, IsVisible: &in.IsVisible, - IsClubPet: &in.IsClubPet, Origin: in.Origin, Address: in.Address, Contact: in.Contact, @@ -57,7 +55,6 @@ func CreateDtoToProto(in *dto.CreatePetRequest) *petproto.CreatePetRequest { return &petproto.CreatePetRequest{ Pet: &petproto.Pet{ Type: in.Type, - Species: in.Species, Name: in.Name, Birthdate: in.Birthdate, Gender: string(in.Gender), @@ -70,7 +67,6 @@ func CreateDtoToProto(in *dto.CreatePetRequest) *petproto.CreatePetRequest { IsSterile: *in.IsSterile, IsVaccinated: *in.IsVaccinated, IsVisible: *in.IsVisible, - IsClubPet: *in.IsClubPet, Origin: in.Origin, Address: in.Address, Contact: in.Contact, @@ -84,7 +80,6 @@ func UpdateDtoToProto(id string, in *dto.UpdatePetRequest) *petproto.UpdatePetRe Pet: &petproto.Pet{ Id: id, Type: in.Type, - Species: in.Species, Name: in.Name, Birthdate: in.Birthdate, Gender: string(in.Gender), @@ -110,7 +105,6 @@ func ProtoToDtoList(in []*petproto.Pet, imagesList [][]*imgproto.Image) []*dto.P pet := &dto.PetResponse{ Id: p.Id, Type: p.Type, - Species: p.Species, Name: p.Name, Birthdate: p.Birthdate, Gender: pet.Gender(p.Gender), @@ -122,7 +116,6 @@ func ProtoToDtoList(in []*petproto.Pet, imagesList [][]*imgproto.Image) []*dto.P IsSterile: &p.IsSterile, IsVaccinated: &p.IsVaccinated, IsVisible: &p.IsVisible, - IsClubPet: &p.IsClubPet, Origin: p.Origin, Address: p.Address, Contact: p.Contact,