more auth
This commit is contained in:
1 parent
fd9446632d
commit
7995fedbd3
2 files changed
+43
No files matched your search
@@ -145,6 +145,44 @@ func DecodeInvoiceCredited(raw []byte) (InvoiceCredited, error) {
|
||||
return c, err
|
||||
}
|
||||
|
||||
// OfferLine is one line of an accepted offer — the quotation row the ledger
|
||||
// contract carries. UnitPriceIncVat is öre; TaxRateBp is basis points
|
||||
// (2500 = 25 %).
|
||||
type OfferLine struct {
|
||||
Sku string `json:"sku,omitempty"`
|
||||
Name string `json:"name"`
|
||||
Quantity int `json:"quantity"`
|
||||
UnitPriceIncVat int64 `json:"unit_price_inc_vat,omitempty"`
|
||||
TaxRateBp int `json:"tax_rate_bp,omitempty"`
|
||||
}
|
||||
|
||||
// OfferAccepted is the payload of an event.OfferAccepted envelope: a B2B
|
||||
// offer (offert) was accepted and becomes the agreement (avtal). The payload
|
||||
// carries the offer identity, the buyer company, and the offer's line items
|
||||
// so the consumer — the ledger's offer reactor — can create/activate the
|
||||
// contract exactly as offered. Lines may be empty defensively; reactors must
|
||||
// still record the acceptance as an agreement covering the referenced offer.
|
||||
type OfferAccepted struct {
|
||||
OrderID string `json:"order_id"`
|
||||
OfferNumber string `json:"offer_number"`
|
||||
CompanyID string `json:"company_id,omitempty"`
|
||||
CompanyName string `json:"company_name,omitempty"`
|
||||
OrgNumber string `json:"org_number,omitempty"`
|
||||
CustomerEmail string `json:"customer_email,omitempty"`
|
||||
ValidUntil string `json:"valid_until,omitempty"`
|
||||
AcceptedAtMs int64 `json:"accepted_at_ms"`
|
||||
Notes string `json:"notes,omitempty"`
|
||||
Lines []OfferLine `json:"lines,omitempty"`
|
||||
}
|
||||
|
||||
func (o OfferAccepted) Encode() ([]byte, error) { return json.Marshal(o) }
|
||||
|
||||
func DecodeOfferAccepted(raw []byte) (OfferAccepted, error) {
|
||||
var o OfferAccepted
|
||||
err := json.Unmarshal(raw, &o)
|
||||
return o, err
|
||||
}
|
||||
|
||||
// SalePaid is the payload of an event.SalePaid envelope: a consumer (PSP)
|
||||
// order was captured. It is the accounting fact for shop sales — the ledger
|
||||
// aggregates captured sales into the daily SHOP- voucher (clearing D /
|
||||
|
||||
Reference in new issue
Block a user