conversationSchema function

Map<String, dynamic> conversationSchema({
  1. required String name,
  2. required String description,
  3. required String userUuid,
  4. required String notes,
  5. required int messagesPerBox,
  6. required bool isGroup,
  7. required String conversationUUID,
  8. List? infos,
})

Implementation

Map<String, dynamic> conversationSchema(
    {required String name,
    required String description,
    required String userUuid,
    required String notes,
    required int messagesPerBox,
    required bool isGroup,
    required String conversationUUID,
    List<dynamic>? infos}) {
  String now = DateTime.now().toIso8601String();
  return {
    'schema-version': '1.0.0',
    'name': name,
    'description': description,
    'userUuid': userUuid,
    'createdAt': now,
    'updatedAt': now,
    'notes': notes,
    'infos': infos,
    'messagesPerBox': messagesPerBox,
    'group': isGroup,
    'uuid': conversationUUID
  };
}