2023-03-28 17:47:34 +00:00
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2020 by Taxnexus, Inc.
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package members_models
import (
"context"
2026-07-24 14:54:36 +00:00
"encoding/json"
2023-03-28 17:47:34 +00:00
2026-07-24 14:54:36 +00:00
"github.com/go-openapi/errors"
2023-03-28 17:47:34 +00:00
"github.com/go-openapi/strfmt"
regen: refresh all sibling clients (go-swagger v0.35.0)
Runs scripts/release.sh regen against current origin/main specs for
auth, crm, stash, sf-gate, research, members, and plex. Picks up:
- members PaymentMethod: processor_token/tenant_id replace card_* columns
(go/db v0.7.3, ADR-KV-014 first exercise) — generated model now carries
ProcessorToken/TenantID with no Card* fields.
- sf-gate: PUT /researchprojectservices now has a tags: entry (sf-gate #3),
so its operation generates into the research_projects package under
--client-package instead of falling back to an untagged operations
package that broke the build.
- members: session handoff endpoints and onboard_request model (current
members spec); webhooks/clerk endpoints removed (retired upstream).
Also bumps go-openapi/runtime v0.26.2 -> v0.32.4 (go mod tidy) — go-swagger
v0.35.0 client templates reference runtime.ContextualTransport, which
v0.26.2 doesn't have; this is a genuine dependency floor bump, not the
known untagged-operation issue documented in release.sh (that issue is
resolved by sf-gate #3 and no longer reproduces here).
go build ./..., go vet ./..., and go test ./... all pass on the
regenerated tree.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-12 07:22:01 +00:00
"github.com/go-openapi/swag/jsonutils"
2026-07-24 14:54:36 +00:00
"github.com/go-openapi/swag/typeutils"
"github.com/go-openapi/validate"
2023-03-28 17:47:34 +00:00
)
2026-07-24 14:54:36 +00:00
// Transaction Tenant-owned commercial transaction metadata. PaymentMethodID and processor material are deliberately absent. TenantID, identity, audit fields, amount, currency, and transaction date become server-owned after creation.
2023-03-28 17:47:34 +00:00
//
2026-07-24 14:54:36 +00:00
// swagger:model Transaction
2023-03-28 17:47:34 +00:00
type Transaction struct {
2026-07-24 14:54:36 +00:00
// Exact non-negative DECIMAL(10,2) text; never represented as float64.
// Pattern: ^(0|[1-9][0-9]{0,7})(\.[0-9]{1,2})?$
Amount string ` json:"Amount,omitempty" `
2023-03-28 17:47:34 +00:00
// created by ID
2026-07-24 14:54:36 +00:00
// Read Only: true
// Format: uuid
CreatedByID * strfmt . UUID ` json:"CreatedByID,omitempty" `
2023-03-28 17:47:34 +00:00
// created date
2026-07-24 14:54:36 +00:00
// Read Only: true
// Format: date-time
CreatedDate * strfmt . DateTime ` json:"CreatedDate,omitempty" `
2023-03-28 17:47:34 +00:00
// currency
2026-07-24 14:54:36 +00:00
// Pattern: ^[A-Z]{3}$
Currency string ` json:"Currency,omitempty" `
2023-03-28 17:47:34 +00:00
// ID
2026-07-24 14:54:36 +00:00
// Read Only: true
// Format: uuid
ID strfmt . UUID ` json:"ID,omitempty" `
2023-03-28 17:47:34 +00:00
// last modified by ID
2026-07-24 14:54:36 +00:00
// Read Only: true
// Format: uuid
LastModifiedByID * strfmt . UUID ` json:"LastModifiedByID,omitempty" `
2023-03-28 17:47:34 +00:00
// last modified date
2026-07-24 14:54:36 +00:00
// Format: date-time
LastModifiedDate * strfmt . DateTime ` json:"LastModifiedDate,omitempty" `
2023-03-28 17:47:34 +00:00
// status
2026-07-24 14:54:36 +00:00
// Enum: ["pending","completed","failed","refunded"]
2023-03-28 17:47:34 +00:00
Status * string ` json:"Status,omitempty" `
2026-07-24 14:54:36 +00:00
// tenant ID
// Read Only: true
// Format: uuid
TenantID * strfmt . UUID ` json:"TenantID,omitempty" `
2023-03-28 17:47:34 +00:00
2026-07-24 14:54:36 +00:00
// transaction date
// Format: date-time
TransactionDate * strfmt . DateTime ` json:"TransactionDate,omitempty" `
2023-03-28 17:47:34 +00:00
}
// Validate validates this transaction
func ( m * Transaction ) Validate ( formats strfmt . Registry ) error {
2026-07-24 14:54:36 +00:00
var res [ ] error
if err := m . validateAmount ( formats ) ; err != nil {
res = append ( res , err )
}
if err := m . validateCreatedByID ( formats ) ; err != nil {
res = append ( res , err )
}
if err := m . validateCreatedDate ( formats ) ; err != nil {
res = append ( res , err )
}
if err := m . validateCurrency ( formats ) ; err != nil {
res = append ( res , err )
}
if err := m . validateID ( formats ) ; err != nil {
res = append ( res , err )
}
if err := m . validateLastModifiedByID ( formats ) ; err != nil {
res = append ( res , err )
}
if err := m . validateLastModifiedDate ( formats ) ; err != nil {
res = append ( res , err )
}
if err := m . validateStatus ( formats ) ; err != nil {
res = append ( res , err )
}
if err := m . validateTenantID ( formats ) ; err != nil {
res = append ( res , err )
}
if err := m . validateTransactionDate ( formats ) ; err != nil {
res = append ( res , err )
}
if len ( res ) > 0 {
return errors . CompositeValidationError ( res ... )
}
return nil
}
func ( m * Transaction ) validateAmount ( formats strfmt . Registry ) error {
if typeutils . IsZero ( m . Amount ) { // not required
return nil
}
if err := validate . Pattern ( "Amount" , "body" , m . Amount , ` ^(0|[1-9][0-9] { 0,7})(\.[0-9] { 1,2})?$ ` ) ; err != nil {
return err
}
return nil
}
func ( m * Transaction ) validateCreatedByID ( formats strfmt . Registry ) error {
if typeutils . IsZero ( m . CreatedByID ) { // not required
return nil
}
if err := validate . FormatOf ( "CreatedByID" , "body" , "uuid" , m . CreatedByID . String ( ) , formats ) ; err != nil {
return err
}
return nil
}
func ( m * Transaction ) validateCreatedDate ( formats strfmt . Registry ) error {
if typeutils . IsZero ( m . CreatedDate ) { // not required
return nil
}
if err := validate . FormatOf ( "CreatedDate" , "body" , "date-time" , m . CreatedDate . String ( ) , formats ) ; err != nil {
return err
}
return nil
}
func ( m * Transaction ) validateCurrency ( formats strfmt . Registry ) error {
if typeutils . IsZero ( m . Currency ) { // not required
return nil
}
if err := validate . Pattern ( "Currency" , "body" , m . Currency , ` ^[A-Z] { 3}$ ` ) ; err != nil {
return err
}
return nil
}
func ( m * Transaction ) validateID ( formats strfmt . Registry ) error {
if typeutils . IsZero ( m . ID ) { // not required
return nil
}
if err := validate . FormatOf ( "ID" , "body" , "uuid" , m . ID . String ( ) , formats ) ; err != nil {
return err
}
return nil
}
func ( m * Transaction ) validateLastModifiedByID ( formats strfmt . Registry ) error {
if typeutils . IsZero ( m . LastModifiedByID ) { // not required
return nil
}
if err := validate . FormatOf ( "LastModifiedByID" , "body" , "uuid" , m . LastModifiedByID . String ( ) , formats ) ; err != nil {
return err
}
return nil
}
func ( m * Transaction ) validateLastModifiedDate ( formats strfmt . Registry ) error {
if typeutils . IsZero ( m . LastModifiedDate ) { // not required
return nil
}
if err := validate . FormatOf ( "LastModifiedDate" , "body" , "date-time" , m . LastModifiedDate . String ( ) , formats ) ; err != nil {
return err
}
return nil
}
var transactionTypeStatusPropEnum [ ] any
func init ( ) {
var res [ ] string
if err := json . Unmarshal ( [ ] byte ( ` ["pending","completed","failed","refunded"] ` ) , & res ) ; err != nil {
panic ( err )
}
for _ , v := range res {
transactionTypeStatusPropEnum = append ( transactionTypeStatusPropEnum , v )
}
}
const (
// TransactionStatusPending captures enum value "pending"
TransactionStatusPending string = "pending"
// TransactionStatusCompleted captures enum value "completed"
TransactionStatusCompleted string = "completed"
// TransactionStatusFailed captures enum value "failed"
TransactionStatusFailed string = "failed"
// TransactionStatusRefunded captures enum value "refunded"
TransactionStatusRefunded string = "refunded"
)
// prop value enum
func ( m * Transaction ) validateStatusEnum ( path , location string , value string ) error {
if err := validate . EnumCase ( path , location , value , transactionTypeStatusPropEnum , true ) ; err != nil {
return err
}
return nil
}
func ( m * Transaction ) validateStatus ( formats strfmt . Registry ) error {
if typeutils . IsZero ( m . Status ) { // not required
return nil
}
// value enum
if err := m . validateStatusEnum ( "Status" , "body" , * m . Status ) ; err != nil {
return err
}
2023-03-28 17:47:34 +00:00
return nil
}
2026-07-24 14:54:36 +00:00
func ( m * Transaction ) validateTenantID ( formats strfmt . Registry ) error {
if typeutils . IsZero ( m . TenantID ) { // not required
return nil
}
if err := validate . FormatOf ( "TenantID" , "body" , "uuid" , m . TenantID . String ( ) , formats ) ; err != nil {
return err
}
return nil
}
func ( m * Transaction ) validateTransactionDate ( formats strfmt . Registry ) error {
if typeutils . IsZero ( m . TransactionDate ) { // not required
return nil
}
if err := validate . FormatOf ( "TransactionDate" , "body" , "date-time" , m . TransactionDate . String ( ) , formats ) ; err != nil {
return err
}
return nil
}
// ContextValidate validate this transaction based on the context it is used
2023-03-28 17:47:34 +00:00
func ( m * Transaction ) ContextValidate ( ctx context . Context , formats strfmt . Registry ) error {
2026-07-24 14:54:36 +00:00
var res [ ] error
if err := m . contextValidateCreatedByID ( ctx , formats ) ; err != nil {
res = append ( res , err )
}
if err := m . contextValidateCreatedDate ( ctx , formats ) ; err != nil {
res = append ( res , err )
}
if err := m . contextValidateID ( ctx , formats ) ; err != nil {
res = append ( res , err )
}
if err := m . contextValidateLastModifiedByID ( ctx , formats ) ; err != nil {
res = append ( res , err )
}
if err := m . contextValidateTenantID ( ctx , formats ) ; err != nil {
res = append ( res , err )
}
if len ( res ) > 0 {
return errors . CompositeValidationError ( res ... )
}
return nil
}
func ( m * Transaction ) contextValidateCreatedByID ( ctx context . Context , formats strfmt . Registry ) error {
if err := validate . ReadOnly ( ctx , "CreatedByID" , "body" , m . CreatedByID ) ; err != nil {
return err
}
return nil
}
func ( m * Transaction ) contextValidateCreatedDate ( ctx context . Context , formats strfmt . Registry ) error {
if err := validate . ReadOnly ( ctx , "CreatedDate" , "body" , m . CreatedDate ) ; err != nil {
return err
}
return nil
}
func ( m * Transaction ) contextValidateID ( ctx context . Context , formats strfmt . Registry ) error {
if err := validate . ReadOnly ( ctx , "ID" , "body" , m . ID ) ; err != nil {
return err
}
return nil
}
func ( m * Transaction ) contextValidateLastModifiedByID ( ctx context . Context , formats strfmt . Registry ) error {
if err := validate . ReadOnly ( ctx , "LastModifiedByID" , "body" , m . LastModifiedByID ) ; err != nil {
return err
}
return nil
}
func ( m * Transaction ) contextValidateTenantID ( ctx context . Context , formats strfmt . Registry ) error {
if err := validate . ReadOnly ( ctx , "TenantID" , "body" , m . TenantID ) ; err != nil {
return err
}
2023-03-28 17:47:34 +00:00
return nil
}
// MarshalBinary interface implementation
func ( m * Transaction ) MarshalBinary ( ) ( [ ] byte , error ) {
if m == nil {
return nil , nil
}
regen: refresh all sibling clients (go-swagger v0.35.0)
Runs scripts/release.sh regen against current origin/main specs for
auth, crm, stash, sf-gate, research, members, and plex. Picks up:
- members PaymentMethod: processor_token/tenant_id replace card_* columns
(go/db v0.7.3, ADR-KV-014 first exercise) — generated model now carries
ProcessorToken/TenantID with no Card* fields.
- sf-gate: PUT /researchprojectservices now has a tags: entry (sf-gate #3),
so its operation generates into the research_projects package under
--client-package instead of falling back to an untagged operations
package that broke the build.
- members: session handoff endpoints and onboard_request model (current
members spec); webhooks/clerk endpoints removed (retired upstream).
Also bumps go-openapi/runtime v0.26.2 -> v0.32.4 (go mod tidy) — go-swagger
v0.35.0 client templates reference runtime.ContextualTransport, which
v0.26.2 doesn't have; this is a genuine dependency floor bump, not the
known untagged-operation issue documented in release.sh (that issue is
resolved by sf-gate #3 and no longer reproduces here).
go build ./..., go vet ./..., and go test ./... all pass on the
regenerated tree.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-12 07:22:01 +00:00
return jsonutils . WriteJSON ( m )
2023-03-28 17:47:34 +00:00
}
// UnmarshalBinary interface implementation
func ( m * Transaction ) UnmarshalBinary ( b [ ] byte ) error {
var res Transaction
regen: refresh all sibling clients (go-swagger v0.35.0)
Runs scripts/release.sh regen against current origin/main specs for
auth, crm, stash, sf-gate, research, members, and plex. Picks up:
- members PaymentMethod: processor_token/tenant_id replace card_* columns
(go/db v0.7.3, ADR-KV-014 first exercise) — generated model now carries
ProcessorToken/TenantID with no Card* fields.
- sf-gate: PUT /researchprojectservices now has a tags: entry (sf-gate #3),
so its operation generates into the research_projects package under
--client-package instead of falling back to an untagged operations
package that broke the build.
- members: session handoff endpoints and onboard_request model (current
members spec); webhooks/clerk endpoints removed (retired upstream).
Also bumps go-openapi/runtime v0.26.2 -> v0.32.4 (go mod tidy) — go-swagger
v0.35.0 client templates reference runtime.ContextualTransport, which
v0.26.2 doesn't have; this is a genuine dependency floor bump, not the
known untagged-operation issue documented in release.sh (that issue is
resolved by sf-gate #3 and no longer reproduces here).
go build ./..., go vet ./..., and go test ./... all pass on the
regenerated tree.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-12 07:22:01 +00:00
if err := jsonutils . ReadJSON ( b , & res ) ; err != nil {
2023-03-28 17:47:34 +00:00
return err
}
* m = res
return nil
}