online_payment
Raz 7 months ago
parent 8eca1f3d78
commit 339efee333
  1. 10
      PadelClub/Views/Player/PlayerDetailView.swift
  2. 34
      PadelClub/Views/Team/EditingTeamView.swift

@ -54,9 +54,11 @@ struct PlayerDetailView: View {
}
}
RegistrationStatusPicker(player: player)
.onChange(of: player.registrationStatus) { player.tournamentStore?.playerRegistrations.addOrUpdate(instance: player)
}
if tournament.enableTimeToConfirm {
RegistrationStatusPicker(player: player)
.onChange(of: player.registrationStatus) { player.tournamentStore?.playerRegistrations.addOrUpdate(instance: player)
}
}
if let timeToConfirm = player.timeToConfirm {
LabeledContent {
@ -68,6 +70,8 @@ struct PlayerDetailView: View {
}
}
}
} header: {
Text("Statut de l'inscription en ligne")
}
}

@ -114,26 +114,29 @@ struct EditingTeamView: View {
Text("Inscrits en ligne")
}
LabeledContent {
Text(team.hasPaidOnline() ? "Oui" : "Non")
} label: {
Text("Payé en ligne")
if tournament.enableOnlinePayment || team.hasPaidOnline() {
LabeledContent {
Text(team.hasPaidOnline() ? "Oui" : "Non")
} label: {
Text("Payé en ligne")
}
}
if let refundMessage, refundMessage.isEmpty == false {
Text(refundMessage).foregroundStyle(.logoRed)
}
if team.hasPaidOnline() {
RowButtonView("Rembourser l'équipe", role: .destructive) {
await _processRefund()
}
} else if team.hasConfirmed() == false {
} else if team.hasConfirmed() == false, tournament.enableTimeToConfirm {
RowButtonView("Confirmer l'inscription de l'équipe", role: .destructive) {
team.confirmRegistration()
}
.disabled(team.walkOut)
}
} header: {
Text("Statut de l'inscription en ligne")
} footer: {
if team.hasPaidOnline() {
Text("Le remboursement passe part le service de Stripe qui re-crédite le moyen de paiement utilisé du montant payé.")
@ -274,6 +277,10 @@ struct EditingTeamView: View {
}
.alert("Attention", isPresented: hasChanged, actions: {
Button("Confirmer") {
if walkOut == false && team.walkOut == true {
registrationDateModified = Date()
registrationDate = registrationDateModified
}
_resetTeam()
team.registrationDate = registrationDate
team.wildCardBracket = wildCardBracket
@ -378,12 +385,21 @@ struct EditingTeamView: View {
}
.onChange(of: registrationDate) {
if canSaveWithoutWarning() {
team.registrationDate = registrationDate
_save()
if let tr = team.registrationDate, tr == registrationDate {
} else {
team.registrationDate = registrationDate
_save()
}
}
}
.onChange(of: [walkOut, wildCardBracket, wildCardGroupStage]) {
if canSaveWithoutWarning() {
if walkOut == false && team.walkOut == true {
registrationDateModified = Date()
team.registrationDate = registrationDateModified
registrationDate = registrationDateModified
}
_resetTeam()
team.walkOut = walkOut
team.wildCardBracket = wildCardBracket

Loading…
Cancel
Save