AppRequest.dawInvitation constructor

AppRequest.dawInvitation({
  1. required String from,
  2. required String to,
  3. required String projectId,
  4. required String projectName,
  5. String role = 'musician',
  6. String? message,
})

Create a DAW project collaboration invitation.

from - profileId of the inviting user (project owner) to - profileId of the user being invited projectId - ID of the DawProject projectName - Name of the project for display role - Proposed role (producer, musician, listener)

Implementation

factory AppRequest.dawInvitation({
  required String from,
  required String to,
  required String projectId,
  required String projectName,
  String role = 'musician',
  String? message,
}) {
  final now = DateTime.now().millisecondsSinceEpoch;
  return AppRequest(
    id: '${from}_daw_$now',
    from: from,
    to: to,
    eventId: projectId,
    createdTime: now,
    expiresAt: now + (defaultDawExpirationDays * 24 * 60 * 60 * 1000),
    message: message ?? 'Invitación al proyecto "$projectName" como $role',
    requestDecision: RequestDecision.pending,
  );
}