All checks were successful
build-and-push / build (push) Successful in 32s
- GET /my/tasks: 전 프로젝트에서 나에게 배정된 작업 + projectName (대시보드 JIRA 보드용) · fix: ORDER BY "end"(예약어) 따옴표 처리 - CalendarEvent 모델 + /calendar/events CRUD(본인 소유), nav에 캘린더 추가 - internal/ai(OpenAI, stdlib): 메일 동기화 시 신규 메일에 한 줄 AI 요약 생성(OPENAI_API_KEY) · ProjectMailMsg.Summary, 회당 40건 상한 - nav inbox 라벨 쪽지함으로 통일 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
41 lines
1.4 KiB
Go
41 lines
1.4 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{}, &TaskComment{}, &MailNote{}, &ProjectMailMsg{}, &ProjectMailState{},
|
|
&CalendarEvent{}, &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
|