package com.alttd.altitudeweb.mappers;

import com.alttd.altitudeweb.database.web_db.forms.DiscordAppeal;
import com.alttd.altitudeweb.model.DiscordAppealDto;
import org.springframework.stereotype.Service;

import java.time.Instant;
import java.util.UUID;

@Service
public class DiscordAppealDtoToDiscordAppealMapper {

    public DiscordAppeal map(DiscordAppealDto discordAppealDto, UUID loggedInUserUuid, String discordUsername) {
        return new DiscordAppeal(
                UUID.randomUUID(),
                loggedInUserUuid,
                Long.parseLong(discordAppealDto.getDiscordId()),
                discordUsername,
                discordAppealDto.getAppeal(),
                Instant.now(),
                null,
                discordAppealDto.getEmail(),
                null);
    }

}
