mirror of
https://github.com/tomru/pfadi-bussle.git
synced 2026-03-04 15:07:13 +01:00
remove *Document intefaces from FE code
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { createEvents, EventStatus } from 'ics'
|
||||
import { BookingDocument } from '../db/booking'
|
||||
import { Booking } from '../db/booking'
|
||||
import { BOOKING_STATUS } from '../db/enums'
|
||||
import { getBaseURL } from './url'
|
||||
|
||||
@@ -11,7 +11,7 @@ function convertDay(value: string): [number, number, number] {
|
||||
return [Number(parts[0]), Number(parts[1]), Number(parts[2])]
|
||||
}
|
||||
|
||||
export function generateBookedCalendar(bookings: BookingDocument[]) {
|
||||
export function generateBookedCalendar(bookings: Booking[]) {
|
||||
const events = bookings.map((booking) => ({
|
||||
calName: 'Pfadi-Bussle Buchungen',
|
||||
start: convertDay(booking.days[0]),
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { BookingDocument } from '../db/booking'
|
||||
import { Booking } from '../db/booking'
|
||||
import { getBaseURL } from '../helpers/url'
|
||||
|
||||
const SENDGRID_API_KEY = process.env.SENDGRID_API_KEY
|
||||
@@ -28,7 +28,7 @@ Pfadi Bussle Wart
|
||||
Tel. 0151/212 253 62
|
||||
`
|
||||
|
||||
function getReceivedBookingBookerText(booking: BookingDocument) {
|
||||
function getReceivedBookingBookerText(booking: Booking) {
|
||||
return `Hallo liebe/r ${booking.booker.name},
|
||||
|
||||
Vielen Dank für Deine Buchung. Nach Prüfung bestätigen wir die Buchung bald per E-Mail!
|
||||
@@ -43,7 +43,7 @@ ${footer}
|
||||
`
|
||||
}
|
||||
|
||||
function getBookingConfirmedText(booking: BookingDocument) {
|
||||
function getBookingConfirmedText(booking: Booking) {
|
||||
return `Hallo liebe/r ${booking.booker.name},
|
||||
|
||||
deine Buchung ist bestätigt!
|
||||
@@ -57,7 +57,7 @@ einsehen und stornieren.
|
||||
${footer}
|
||||
`
|
||||
}
|
||||
function getBookingRejectedText(booking: BookingDocument) {
|
||||
function getBookingRejectedText(booking: Booking) {
|
||||
return `Hallo liebe/r ${booking.booker.name},
|
||||
|
||||
es tut uns leid aber deine Buchung konnte leider nicht bestätigt werden.
|
||||
@@ -77,7 +77,7 @@ es ging folgende Buchung ein: ${getBaseURL()}/admin/booking/${booking.uuid}
|
||||
MfG`
|
||||
}
|
||||
|
||||
export async function sendReceivedBookingAdminMail(booking: BookingDocument) {
|
||||
export async function sendReceivedBookingAdminMail(booking: Booking) {
|
||||
try {
|
||||
await sendMail({
|
||||
to: [{ email: ADMIN_EMAIL }],
|
||||
@@ -90,7 +90,7 @@ export async function sendReceivedBookingAdminMail(booking: BookingDocument) {
|
||||
}
|
||||
}
|
||||
|
||||
export async function sendReceivedBookingBookerMail(booking: BookingDocument) {
|
||||
export async function sendReceivedBookingBookerMail(booking: Booking) {
|
||||
try {
|
||||
await sendMail({
|
||||
to: [{ email: booking.booker.email, name: booking.booker.name }],
|
||||
@@ -103,7 +103,7 @@ export async function sendReceivedBookingBookerMail(booking: BookingDocument) {
|
||||
}
|
||||
}
|
||||
|
||||
export async function sendBookingConfirmed(booking: BookingDocument) {
|
||||
export async function sendBookingConfirmed(booking: Booking) {
|
||||
try {
|
||||
await sendMail({
|
||||
to: [{ email: booking.booker.email, name: booking.booker.name }],
|
||||
@@ -116,7 +116,7 @@ export async function sendBookingConfirmed(booking: BookingDocument) {
|
||||
}
|
||||
}
|
||||
|
||||
export async function sendBookingRejected(booking: BookingDocument) {
|
||||
export async function sendBookingRejected(booking: Booking) {
|
||||
try {
|
||||
await sendMail({
|
||||
to: [{ email: booking.booker.email, name: booking.booker.name }],
|
||||
|
||||
Reference in New Issue
Block a user