Bootstrap copied BFF and local accounts with public Sendico contracts (#34)
This commit is contained in:
1 parent
67dc5b5b1e
commit
7062672a87
556 files changed
+42291
-777
No files matched your search
@@ -0,0 +1,44 @@
|
||||
package merrors
|
||||
|
||||
import "strings"
|
||||
|
||||
const (
|
||||
ReasonDocumentsReportOwned = "DOCUMENTS_REPORT_OWNED"
|
||||
ReasonDocumentsQuotationExpired = "DOCUMENTS_QUOTATION_EXPIRED"
|
||||
)
|
||||
|
||||
var ErrDocumentsReportOwned = Define("documents.report_owned")
|
||||
|
||||
var ErrDocumentsQuotationExpired = Define("documents.quotation_expired")
|
||||
|
||||
// DocumentsReportOwned reports that an active or settled payout owns a
|
||||
// report, so callers must not mutate its document lifecycle.
|
||||
func DocumentsReportOwned(msg string) error {
|
||||
msg = strings.TrimSpace(msg)
|
||||
if msg == "" {
|
||||
msg = "report is owned by a payout"
|
||||
}
|
||||
return classifiedError{
|
||||
base: ErrDataConflict,
|
||||
code: ErrDocumentsReportOwned,
|
||||
msg: msg,
|
||||
reason: ReasonDocumentsReportOwned,
|
||||
publicMessage: true,
|
||||
}
|
||||
}
|
||||
|
||||
// DocumentsQuotationExpired reports that a payout registry still references
|
||||
// a quotation which can no longer be executed. A fresh quotation is required.
|
||||
func DocumentsQuotationExpired(msg string) error {
|
||||
msg = strings.TrimSpace(msg)
|
||||
if msg == "" {
|
||||
msg = "the payout quotation has expired; request a new quotation"
|
||||
}
|
||||
return classifiedError{
|
||||
base: ErrFailedPrecondition,
|
||||
code: ErrDocumentsQuotationExpired,
|
||||
msg: msg,
|
||||
reason: ReasonDocumentsQuotationExpired,
|
||||
publicMessage: true,
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user