Skip to content

Commit

Permalink
Fix seeding of samfundet user (#294)
Browse files Browse the repository at this point in the history
* Remove unused code in MockDataService

* Add username field to SamfundetUserDto
  • Loading branch information
taheeraahmed authored Nov 4, 2023
1 parent 5a8e7d2 commit cb10d62
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 156 deletions.
156 changes: 0 additions & 156 deletions src/main/kotlin/no/fg/hilflingbackend/MockDataService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -382,162 +382,6 @@ class MockDataService {
email = Email("fg-web@samfundet.no")
)
)
/*
private fun generatePhotoOnPurchaseOrderData(): List<PhotoOnPurchaseOrder> {
return listOf(
PhotoOnPurchaseOrder {
photo = generatePhotoData().single {
it.id == 1
}
purchaseOrder = generatePurchaseOrderData().single {
it.id == 1
}
amount = 2
size = "A4"
},
PhotoOnPurchaseOrder {
photo = generatePhotoData().single {
it.id == 2
}
purchaseOrder = generatePurchaseOrderData().single {
it.id == 1
}
amount = 2
size = "A4"
}
)
}
private fun generatePurchaseOrderData(): List<PurchaseOrder> {
return listOf(
PurchaseOrder {
name = "Caroline Sandsbråten"
email = "carosa@samfundet.no"
address = "Magnus den Godes gt. 10"
zipCode = "7030"
city = "Trondheim"
sendByPost = true
comment = "TRENGER BILDENE ASAP!!!!"
isCompleted = false
},
PurchaseOrder {
name = "Oscar Selnes Bognæs"
email = "Oscarsb1@gmail.com"
address = "Frode Rinnas Vei 159"
zipCode = "7051"
city = "Trondheim"
sendByPost = true
comment = "Hvis jeg ikke får bildene innen fredag refunder jeg og legger igjen 1 stjerne på TripAdvisor"
isCompleted = false
}
)
}
private fun generatePhotographyRequestData(): List<PhotographyRequest> {
return listOf(
PhotographyRequest {
description = "Can u take photos uf us pls"
email = "Sindreerkul@kulesindre.kul"
isIntern = true
startTime = LocalDate.parse("2019-12-11")
endTime = LocalDate.parse("2019-12-11")
place = "Your mamas house"
phone = "91382405"
type = "Gruppebilde"
},
PhotographyRequest {
description = "Kan dere ta bilder av oss mens vi skjærer ost?"
email = "email@email.no"
isIntern = false
startTime = LocalDate.parse("2019-12-11")
endTime = LocalDate.parse("2019-12-11")
place = "Odd Brochmanss Veg 62"
phone = "91382405"
type = "Stilbilde"
}
)
}
private fun generatePlaceData(): List<Place> {
return listOf(
PlaceData {
dateCreated = "2019-05-11"
title = "Edgar"
}
PlaceData {
dateCreated = "2018-04-12"
title = "Lyche"
}
PlaceData {
dateCreated = "2019-11-12"
title = "Daglighallen"
}
)
}
private fun generateGangData(): List<Gang> {
return listOf(
Gang {
name = "Fotogjengen"
dateCreated = LocalDate.parse("1907-01-01")
},
Gang {
name = "Diversegjengen"
dateCreated = LocalDate.parse("1937-01-01")
}
)
}
private fun generateEventOwnerData() {
return listOf(
EventOwner {
name = "Samfundet"
},
EventOwner {
name = "Uka"
}
)
}
private fun generateArticleTagData(): List<ArticleTag> {
return listOf(
ArticleTag {
dateCreated = LocalDate.parse("2020-02-02")
name = "Morsom"
},
ArticleTag {
dateCreated = LocalDate.parse("2019-04-08")
name = "Fotografi"
},
ArticleTag {
dateCreated = LocalDate.parse("2018-12-01")
name = "Web"
}
)
}
//To be finished (Making motive before)
private fun generatePhotoData(): List<Photo> {
listOf(
Photo {
dateCreated = LocalDate.parse("2020-01-01")
largeUrl = "https://www.pngitem.com/pimgs/m/141-1412402_transparent-pepe-clipart-hd-png-download.png"
mediumUrl = "https://www.pngitem.com/pimgs/m/141-1412402_transparent-pepe-clipart-hd-png-download.png"
smallUrl = "https://www.pngitem.com/pimgs/m/141-1412402_transparent-pepe-clipart-hd-png-download.png"
}
)
}
*/

fun seedMockData() {
generateAlbumData()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ fun SamfundetUserDto.toEntity(): SamfundetUser {
email = dto.email.value
firstName = dto.firstName
lastName = dto.lastName
username = dto.username
phoneNumber = dto.phoneNumber.value
email = dto.email.value
sex = dto.sex
Expand Down

0 comments on commit cb10d62

Please sign in to comment.