feat(backend): add communication, tester, admin and middleman modules
Implement step 17 modules: threads/messages, notifications with automation (submission.created, idea.created, grant_call.opened), innovation test feedback, admin panel (submissions, verify, metrics, grant call status), Middleman adaptation and partnerships. Split multi-type files into one type per file and replace object-valued dictionaries with string-valued maps in data contracts (migrations 0006/0007).
This commit is contained in:
@@ -62,7 +62,7 @@ public sealed class KnowledgeItemService : IKnowledgeItemService
|
||||
["id"] = id,
|
||||
["title"] = request.Title,
|
||||
["kind"] = request.Kind,
|
||||
["attachments"] = request.Attachments ?? [],
|
||||
["attachments"] = ToConcreteList(request.Attachments),
|
||||
["published"] = request.Published,
|
||||
};
|
||||
|
||||
@@ -99,7 +99,7 @@ public sealed class KnowledgeItemService : IKnowledgeItemService
|
||||
["id"] = id,
|
||||
["title"] = request.Title,
|
||||
["kind"] = request.Kind,
|
||||
["attachments"] = request.Attachments ?? [],
|
||||
["attachments"] = ToConcreteList(request.Attachments),
|
||||
["published"] = request.Published,
|
||||
};
|
||||
|
||||
@@ -216,13 +216,17 @@ public sealed class KnowledgeItemService : IKnowledgeItemService
|
||||
}
|
||||
}
|
||||
|
||||
private static List<Dictionary<string, string?>> ToConcreteList(
|
||||
IReadOnlyList<IReadOnlyDictionary<string, string?>>? values) =>
|
||||
values?.Select(item => item.ToDictionary(pair => pair.Key, pair => pair.Value)).ToList() ?? [];
|
||||
|
||||
private static KnowledgeItemResponse Map(KnowledgeItemRow row) => new(
|
||||
row.Id,
|
||||
row.Title,
|
||||
row.Kind,
|
||||
NormalizeRecordId(row.Challenge),
|
||||
row.SourceUrl,
|
||||
row.Attachments.Select(item => (IReadOnlyDictionary<string, object?>)item).ToList(),
|
||||
row.Attachments.Select(item => (IReadOnlyDictionary<string, string?>)item).ToList(),
|
||||
row.Published,
|
||||
row.UpdatedAt);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user