| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- package dao
- import (
- "time"
- "wails-app/internal/global"
- )
- // CentralPaymentDevice is an independently authenticated POF payment device.
- // It deliberately does not share credentials with a Smart Parking web user.
- type CentralPaymentDevice struct {
- global.GVA_MODEL
- DeviceID string `gorm:"size:64;not null;uniqueIndex" json:"device_id"`
- Username string `gorm:"size:64;not null;uniqueIndex" json:"username"`
- PasswordHash string `gorm:"size:100;not null" json:"-"`
- Enabled bool `gorm:"not null;default:true" json:"enabled"`
- ParkingLotID uint `json:"parking_lot_id"`
- PaymentEntry string `gorm:"size:32;not null" json:"payment_entry"`
- AllowedIPs string `gorm:"size:500" json:"allowed_ips"`
- Description string `gorm:"size:200" json:"description"`
- }
- func (CentralPaymentDevice) TableName() string { return "central_payment_device" }
- // CentralPaymentToken keeps only a SHA-256 digest of an issued device token.
- type CentralPaymentToken struct {
- global.GVA_MODEL
- DeviceID string `gorm:"size:64;not null;index" json:"device_id"`
- TokenHash string `gorm:"size:64;not null;uniqueIndex" json:"-"`
- ExpireAt time.Time `gorm:"not null;index" json:"expire_at"`
- }
- func (CentralPaymentToken) TableName() string { return "central_payment_token" }
- // CentralPaymentRequestLog records POF requests for field verification and
- // reconciliation. Token values are intentionally excluded from RequestBody.
- type CentralPaymentRequestLog struct {
- global.GVA_MODEL
- Endpoint string `gorm:"size:64;not null;index" json:"endpoint"`
- DeviceID string `gorm:"size:64;index" json:"device_id"`
- SourceIP string `gorm:"size:64;index" json:"source_ip"`
- RequestBody string `gorm:"type:text" json:"request_body"`
- Result int `json:"result"`
- Remark string `gorm:"size:500" json:"remark"`
- }
- func (CentralPaymentRequestLog) TableName() string { return "central_payment_request_log" }
|