Skip to content

Commit

Permalink
feat: remove species, isclubpet
Browse files Browse the repository at this point in the history
  • Loading branch information
bookpanda committed Jan 13, 2024
1 parent 289c80e commit 1b79539
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 25 deletions.
6 changes: 0 additions & 6 deletions src/app/dto/pet.dto.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand All @@ -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"`
Expand All @@ -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"`
Expand All @@ -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"`
Expand All @@ -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"`
Expand All @@ -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"`
Expand Down
4 changes: 0 additions & 4 deletions src/app/handler/pet/pet.handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)]),
Expand All @@ -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(),
Expand All @@ -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),
Expand All @@ -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,
Expand Down
8 changes: 0 additions & 8 deletions src/app/service/pet/pet.service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)]),
Expand All @@ -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(),
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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),
Expand All @@ -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,
Expand All @@ -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),
Expand All @@ -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,
Expand Down
7 changes: 0 additions & 7 deletions src/app/utils/pet/pet.utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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,
Expand All @@ -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),
Expand All @@ -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,
Expand All @@ -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),
Expand All @@ -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),
Expand All @@ -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,
Expand Down

0 comments on commit 1b79539

Please sign in to comment.