~evanj/cms

ref: 5eb977545bd0bfaacf289952a8b7f5a273168ab6 cms/internal/m/space/mock.go -rw-r--r-- 783 bytes
5eb97754Evan M Jones Chore(Error2 -> Error): Swapped Error impl. for Error2 in all 1 year, 1 month ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package space

import (
	"git.sr.ht/~evanj/cms/internal/m/org"
	"git.sr.ht/~evanj/cms/internal/m/tier"
)

type _space struct {
	id, name, desc string
	org            _org
}

type _org struct {
	id       string
	payment  bool
	customer string
	tier     tier.Tier
}

func NewMock(id, name, desc string) _space {
	return _space{id, name, desc, _org{}}
}

func (s _space) ID() string   { return s.id }
func (s _space) Name() string { return s.name }
func (s _space) Desc() string { return s.desc }
func (s _space) Org() org.Org { return s.org }

func (o _org) ID() string                { return o.id }
func (o _org) HasPaymentCustomer() bool  { return o.payment }
func (o _org) PaymentCustomerID() string { return o.customer }
func (o _org) Tier() tier.Tier           { return o.tier }