This repository has been archived on 2024-12-15. You can view files and clone it, but cannot push or open issues or pull requests.
bottin-agenda/models/models.go

61 lines
1.3 KiB
Go
Raw Normal View History

2023-05-29 17:58:23 -04:00
package models
import "time"
var Schema = `
CREATE TABLE IF NOT EXISTS transactions (
id BIGINT PRIMARY KEY GENERATED ALWAYS AS IDENTITY,
2023-05-29 17:58:23 -04:00
membre_id VARCHAR(7),
given_at TIMESTAMP,
is_perpetual BOOLEAN
);
`
type Transaction struct {
ID string `db:"id" json:"id"`
MembreID string `db:"membre_id" json:"membre_id"`
GivenAt *time.Time `db:"given_at" json:"given_at"`
IsPerpetual bool `db:"is_perpetual" json:"is_perpetual"`
}
type Config struct {
Web WebConfig `json:"web"`
Api ApiConfig `json:"api"`
Bottin BottinConfig `json:"bottin"`
Db DbConfig `json:"db"`
}
type ApiConfig struct {
Key string `json:"key"`
Port int `json:"port"`
}
type BottinConfig struct {
Api struct {
Host string `json:"host"`
Key string `json:"key"`
Protocol string `json:"protocol"`
Port int `json:"port"`
} `json:"api"`
}
type DbConfig struct {
Database string `json:"database"`
Host string `json:"host"`
Password string `json:"password"`
Port int `json:"port"`
User string `json:"user"`
}
type WebConfig struct {
Api struct {
Host string `json:"host"`
Key string `json:"key"`
Port int `json:"port"`
Protocol string `json:"protocol"`
} `json:"api"`
Password string `json:"password"`
Port int `json:"port"`
User string `json:"user"`
}