Add specifications for gamification, generation, and R42 chat services

- Introduced gamification service spec detailing responsibilities, API surface, XP calculation, levels, streaks, badges, milestone cards, and heatmap data.
- Added generation service spec outlining the process for generating micro learning content, including API endpoints, AI call configuration, prompt strategies, and error handling.
- Created R42 chat service spec covering chatbot interactions, retrieval pipeline, prompt construction, response generation, and stateless design principles.
This commit is contained in:
RaymondVerhoef
2026-05-23 18:13:08 +02:00
parent dda20612e9
commit 472685f0d7
62 changed files with 11552 additions and 21 deletions

View File

@@ -46,7 +46,7 @@ const field = {
}),
json: (name: string): FieldDef => ({
name, type: 'json', required: false, options: {},
name, type: 'json', required: false, options: { maxSize: 2097152 },
}),
date: (name: string): FieldDef => ({
@@ -146,18 +146,17 @@ async function run(): Promise<void> {
const usersCol = await pb.collections.getFirstListItem<CollectionModel>('name="users"');
ids.set('users', usersCol.id);
const hasRole = usersCol.schema.some(s => s.name === 'role');
if (!hasRole) {
const existingFieldNames = new Set(usersCol.schema.map((s: { name: string }) => s.name));
const fieldsToAdd: FieldDef[] = [];
if (!existingFieldNames.has('role')) fieldsToAdd.push(field.select('role', ['admin', 'employee'], true));
if (!existingFieldNames.has('display_name')) fieldsToAdd.push(field.text('display_name'));
if (fieldsToAdd.length > 0) {
const updateBody: Record<string, unknown> = {
schema: [
...usersCol.schema,
field.select('role', ['admin', 'employee'], true),
field.text('display_name'),
field.file('avatar', ['image/jpeg', 'image/png', 'image/webp']),
],
schema: [...usersCol.schema, ...fieldsToAdd],
};
await pb.collections.update(usersCol.id, updateBody);
console.log(' extended with role, display_name, avatar');
console.log(` extended with: ${fieldsToAdd.map((f: FieldDef) => f.name).join(', ')}`);
} else {
console.log(' skip users (already extended)');
}