theorose49 df09d23662
All checks were successful
build-and-push / build (push) Successful in 35s
feat: 인턴 직급 + 초과근무 관리자 집계화 + SSO 로그아웃 URL + 디바이스/FCM
- 직급에 인턴 추가(기본 할당량 15), 직책(position)은 UI에서 제거(컬럼은 유지)
- 초과근무: 유저 신청 제거 → 관리자 근무관리에서 실제 출퇴근 기록 기반 자동 집계
- 로그아웃: infra 공통 LOGOUT_URL(/me로 전달) 사용 → oauth2-proxy 종료 + Keycloak end-session
- (이전 커밋 포함) Device 등록 + FCM HTTP v1 sender + notify 연동

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-28 10:55:53 +09:00

40 lines
1.3 KiB
Go

// Package models defines the GORM models for spin. Each domain slice adds its
// own file (member.go, attendance.go, project.go, incentive.go, accounting.go);
// this file holds the shared Base type and the AutoMigrate registry.
package models
import (
"github.com/google/uuid"
"gorm.io/gorm"
)
// Base provides a string UUID primary key populated in a BeforeCreate hook.
type Base struct {
ID string `gorm:"primaryKey" json:"id"`
}
func (b *Base) ensureID() {
if b.ID == "" {
b.ID = uuid.NewString()
}
}
// All returns every model for AutoMigrate. Each slice appends its models here.
func All() []interface{} {
return []interface{}{
// slice 1 — members / org
&Member{}, &Department{}, &AuditLog{}, &Notification{}, &WorkStatusEvent{}, &Device{},
// slice 2 — attendance / leave
&Attendance{}, &LeaveRequest{}, &OvertimeRequest{}, &WorkPolicy{}, &LeaveBalance{},
// slice 3 — projects
&Company{}, &Product{}, &Version{}, &Project{}, &ProjectMember{},
&ClientContact{}, &ProjectTask{}, &Contract{}, &ContractFile{}, &PaymentSplit{},
// slice 4 — incentive
&IncentiveConfig{}, &PaymentStage{}, &UserIncentive{}, &QuarterlySettlement{},
// slice 5 — accounting
&Account{}, &Transaction{}, &TaxRecord{},
}
}
var _ = gorm.ErrRecordNotFound // keep gorm imported for slice files