package receipt import "time" // Receipt permanently binds an idempotency key to the accepted Event payload. // It deliberately has no UpdatedAt or soft-delete fields because it is immutable. type Receipt struct { ID string `json:"id" gorm:"type:uuid;primaryKey"` EventID string `json:"eventId" gorm:"type:uuid;not null;uniqueIndex"` ProducerID string `json:"producerId" gorm:"size:128;not null;uniqueIndex:bell_receipt_key"` SourceEventID string `json:"sourceEventId" gorm:"size:256;not null;uniqueIndex:bell_receipt_key"` PayloadSHA256 string `json:"-" gorm:"type:char(64);not null"` AcceptedAt time.Time `json:"acceptedAt" gorm:"type:timestamptz;not null"` } func (Receipt) TableName() string { return "bell_event_receipts" }