From e7bbe5cd481e635d8b62d5bb809a2dd14c82671b Mon Sep 17 00:00:00 2001 From: Peter van den Hamer <13396568+vdhamer@users.noreply.github.com> Date: Mon, 7 Oct 2024 00:52:26 +0200 Subject: [PATCH] Fix: #26 Added HansK, Jelle, and Peter als MemberPortfios rather than as Photographers. --- Photo Club Hub HTML/ContentView.swift | 67 ++++++++++++++++++++------- 1 file changed, 50 insertions(+), 17 deletions(-) diff --git a/Photo Club Hub HTML/ContentView.swift b/Photo Club Hub HTML/ContentView.swift index 9a3bb85..748798a 100644 --- a/Photo Club Hub HTML/ContentView.swift +++ b/Photo Club Hub HTML/ContentView.swift @@ -113,23 +113,56 @@ struct ContentView: View { func addTestMembers() { let fgDeGender = ContentView.addFGdeGender() - let hansKrüsemann = PersonName(givenName: "Hans", infixName: "", familyName: "Krüsemann") - _ = Photographer.findCreateUpdate(context: viewContext, - personName: hansKrüsemann, - optionalFields: PhotographerOptionalFields()) - - let jelleVanDeVoort = PersonName(givenName: "Jelle", infixName: "van de", familyName: "Voort") - _ = Photographer.findCreateUpdate(context: viewContext, - personName: jelleVanDeVoort, - optionalFields: PhotographerOptionalFields()) - - let peterVanDenHamer = PersonName(givenName: "Peter", infixName: "van den", familyName: "Hamer") - _ = Photographer.findCreateUpdate(context: viewContext, - personName: peterVanDenHamer, - optionalFields: PhotographerOptionalFields( - photographerWebsite: URL(string: "https://glass.photo/vdhamer") - ) - ) + let hansKrüsemannPN = PersonName(givenName: "Hans", infixName: "", familyName: "Krüsemann") + let hansKrüsemannPho = Photographer.findCreateUpdate(context: viewContext, + personName: hansKrüsemannPN, + optionalFields: PhotographerOptionalFields()) + let hansKrüsemannOpt = MemberOptionalFields( + level3URL: URL(string: "http://www.vdhamer.com/fgDeGender/Hans_Krusemann/"), + memberRolesAndStatus: MemberRolesAndStatus(role: [ .admin: true ], status: [:]), + fotobondNumber: 1620090, + membershipStartDate: "2016-04-01".extractDate(), + membershipEndDate: nil) + let hansKrüsemannMem = MemberPortfolio.findCreateUpdate(bgContext: viewContext, + organization: fgDeGender, + photographer: hansKrüsemannPho, + optionalFields: hansKrüsemannOpt) + hansKrüsemannMem.refreshFirstImage() + + let jelleVanDeVoortPN = PersonName(givenName: "Jelle", infixName: "van de", familyName: "Voort") + let jelleVanDeVoortPho = Photographer.findCreateUpdate(context: viewContext, + personName: jelleVanDeVoortPN, + optionalFields: PhotographerOptionalFields()) + let jelleVanDeVoortOpt = MemberOptionalFields( + level3URL: URL(string: "http://www.vdhamer.com/fgDeGender/Jelle_van_de_Voort/"), + memberRolesAndStatus: MemberRolesAndStatus(role: [ .chairman: true ], status: [:]), + fotobondNumber: 1620103, + membershipStartDate: "2020-01-01".extractDate(), + membershipEndDate: nil) + let jelleVanDeVoortMem = MemberPortfolio.findCreateUpdate(bgContext: viewContext, + organization: fgDeGender, + photographer: jelleVanDeVoortPho, + optionalFields: jelleVanDeVoortOpt) + jelleVanDeVoortMem.refreshFirstImage() + + let peterVanDenHamerPN = PersonName(givenName: "Peter", infixName: "van den", familyName: "Hamer") + let peterVanDenHamerPho = Photographer.findCreateUpdate(context: viewContext, + personName: peterVanDenHamerPN, + optionalFields: PhotographerOptionalFields( + bornDT: "1957-10-18".extractDate(), + photographerWebsite: URL(string: "https://glass.photo/vdhamer") + )) + let peterVanDenHamerOpt = MemberOptionalFields( + level3URL: URL(string: "http://www.vdhamer.com/fgDeGender/Peter_van_den_Hamer/"), + memberRolesAndStatus: MemberRolesAndStatus(role: [ .admin: true ], status: [:]), + fotobondNumber: 1620110, + membershipStartDate: "2024-01-01".extractDate(), + membershipEndDate: nil) + let peterVanDenHamerMem = MemberPortfolio.findCreateUpdate(bgContext: viewContext, + organization: fgDeGender, + photographer: peterVanDenHamerPho, + optionalFields: peterVanDenHamerOpt) + peterVanDenHamerMem.refreshFirstImage() } public static func addFGdeGender() -> Organization {