//
// Created by vfs on 02.05.2024.
//

package models

import (
	"errors"
	"time"
)

var ErrNoRecord = errors.New("no matching record found")
var ErrInvalidCredentials = errors.New("invalid credentials")
var ErrDuplicateEmail = errors.New("duplicate email")
var ErrDuplicateUsername = errors.New("duplicate username")

type Account struct {
	ID        int32
	Username  string
	Password  []byte
	Colour     int32
	Firstname string
	Lastname  string
	Email     string
	Created   time.Time
	StripeID  string
}

type SubscriptionStatus string

const (
	Incomplete         SubscriptionStatus = "incomplete"
	IncompleteExpired SubscriptionStatus = "incomplete_expired"
	Trialing           SubscriptionStatus = "trialing"
	Active             SubscriptionStatus = "active"
	PastDue           SubscriptionStatus = "past_due"
	Canceled           SubscriptionStatus = "canceled"
	Unpaid             SubscriptionStatus = "unpaid"
	Paused             SubscriptionStatus = "paused"
)

type Subscription struct {
	ID                   int32
	AccountID            int32
	StripeSubscriptionID string
	StripeCheckoutID     string
	Status               SubscriptionStatus
}
