generated from azures04/Base-REST-API
Introduce gamification and check-in support plus expanded transport/admin APIs. Added DDL for checkins, badges and user_badges. New repositories: badgeRepository, userBadgeRepository, checkinRepository. New routes: admin badge management, admin transport (lines/platforms/stations), public transport endpoints, user checkins and stations endpoints, and user badges on /me. Services updated: adminService (badge CRUD & user assignment), userService (checkins, badge queries), authService (hasAdminRights). Minor package.json name update. These changes implement database, repo, service and route wiring for badges, user_badins and checkin features and additional transport admin routes.
10 lines
327 B
SQL
10 lines
327 B
SQL
CREATE TABLE IF NOT EXISTS `badges` (
|
|
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
|
|
`name` VARCHAR(255) NOT NULL UNIQUE,
|
|
`description` TEXT,
|
|
`icon` TEXT,
|
|
`condition` VARCHAR(255) NOT NULL COMMENT 'Ex: checkins_count >= 10',
|
|
`createdAt` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
|
|
PRIMARY KEY (id)
|
|
); |