package com.example.dateplanner.services; import com.example.dateplanner.models.entities.Organization; import com.example.dateplanner.repositories.OrganizationRepository; import lombok.AllArgsConstructor; import org.springframework.stereotype.Service; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; import java.time.LocalDateTime; import java.util.UUID; @Service @AllArgsConstructor public class OrganizationService { private final OrganizationRepository organizationRepository; public Flux getByOwner(UUID ownerUuid) { return organizationRepository.findAllByOwnerUuid(ownerUuid); } public Mono create(Organization organization) { organization.setCreatedAt(LocalDateTime.now()); organization.setUpdatedAt(LocalDateTime.now()); return organizationRepository.save(organization); } }