package platform

import (
	"context"

	"source.gleipnir.technology/Gleipnir/nidus-sync/db"
	querypublic "source.gleipnir.technology/Gleipnir/nidus-sync/db/query/public"
	"source.gleipnir.technology/Gleipnir/nidus-sync/platform/types"
)

func MailerByID(ctx context.Context, user User, id int32) (*types.Mailer, error) {
	return querypublic.MailerFromID(ctx, db.PGInstance.PGXPool, int64(user.Organization.ID), int64(id))
}
func MailerList(ctx context.Context, user User, limit int) ([]types.Mailer, error) {
	return querypublic.MailersFromOrganizationID(ctx, db.PGInstance.PGXPool, int64(user.Organization.ID), int64(limit))
}
