lib/api/metrc-gw/metrc_gw_models/facility.go

369 lines
9.7 KiB
Go

// Code generated by go-swagger; DO NOT EDIT.
// All Code Copyright(c) 2018-2021 by Taxnexus, Inc.
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package metrc_gw_models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// Facility facility
//
// swagger:model Facility
type Facility struct {
// alias
// Example: OR Larger Rec-WHSLR 1
Alias string `json:"Alias,omitempty"`
// credentialed date
// Example: 2017-08-13
CredentialedDate string `json:"CredentialedDate,omitempty"`
// display name
// Example: OR Larger Rec-WHSLR 1
DisplayName string `json:"DisplayName,omitempty"`
// facility type
FacilityType *FacilityFacilityType `json:"FacilityType,omitempty"`
// hire date
// Example: 2017-08-14
HireDate string `json:"HireDate,omitempty"`
// is manager
// Example: true
IsManager bool `json:"IsManager,omitempty"`
// is owner
// Example: true
IsOwner bool `json:"IsOwner,omitempty"`
// license
License *License `json:"License,omitempty"`
// name
// Example: OR LARGER THAN SALES, LLC
Name string `json:"Name,omitempty"`
// occupations
// Example: []
Occupations []string `json:"Occupations"`
}
// Validate validates this facility
func (m *Facility) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateFacilityType(formats); err != nil {
res = append(res, err)
}
if err := m.validateLicense(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *Facility) validateFacilityType(formats strfmt.Registry) error {
if swag.IsZero(m.FacilityType) { // not required
return nil
}
if m.FacilityType != nil {
if err := m.FacilityType.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("FacilityType")
}
return err
}
}
return nil
}
func (m *Facility) validateLicense(formats strfmt.Registry) error {
if swag.IsZero(m.License) { // not required
return nil
}
if m.License != nil {
if err := m.License.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("License")
}
return err
}
}
return nil
}
// ContextValidate validate this facility based on the context it is used
func (m *Facility) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateFacilityType(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateLicense(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *Facility) contextValidateFacilityType(ctx context.Context, formats strfmt.Registry) error {
if m.FacilityType != nil {
if err := m.FacilityType.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("FacilityType")
}
return err
}
}
return nil
}
func (m *Facility) contextValidateLicense(ctx context.Context, formats strfmt.Registry) error {
if m.License != nil {
if err := m.License.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("License")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *Facility) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *Facility) UnmarshalBinary(b []byte) error {
var res Facility
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
// FacilityFacilityType facility facility type
//
// swagger:model FacilityFacilityType
type FacilityFacilityType struct {
// advanced sales
// Example: false
AdvancedSales bool `json:"AdvancedSales,omitempty"`
// can assign rooms to packages
// Example: false
CanAssignRoomsToPackages bool `json:"CanAssignRoomsToPackages,omitempty"`
// can assign rooms to plant batches
// Example: false
CanAssignRoomsToPlantBatches bool `json:"CanAssignRoomsToPlantBatches,omitempty"`
// can create derived packages
// Example: true
CanCreateDerivedPackages bool `json:"CanCreateDerivedPackages,omitempty"`
// can create opening balance packages
// Example: true
CanCreateOpeningBalancePackages bool `json:"CanCreateOpeningBalancePackages,omitempty"`
// can create process validation packages
// Example: true
CanCreateProcessValidationPackages bool `json:"CanCreateProcessValidationPackages,omitempty"`
// can deliver sales to consumers
// Example: false
CanDeliverSalesToConsumers bool `json:"CanDeliverSalesToConsumers,omitempty"`
// can deliver sales to patients
// Example: false
CanDeliverSalesToPatients bool `json:"CanDeliverSalesToPatients,omitempty"`
// can grow plants
// Example: false
CanGrowPlants bool `json:"CanGrowPlants,omitempty"`
// can have member patients
// Example: false
CanHaveMemberPatients bool `json:"CanHaveMemberPatients,omitempty"`
// can infuse products
// Example: false
CanInfuseProducts bool `json:"CanInfuseProducts,omitempty"`
// can package vegetative plants
// Example: false
CanPackageVegetativePlants bool `json:"CanPackageVegetativePlants,omitempty"`
// can remediate packages with failed lab results
// Example: false
CanRemediatePackagesWithFailedLabResults bool `json:"CanRemediatePackagesWithFailedLabResults,omitempty"`
// can report harvest schedules
// Example: false
CanReportHarvestSchedules bool `json:"CanReportHarvestSchedules,omitempty"`
// can report patients adverse responses
// Example: false
CanReportPatientsAdverseResponses bool `json:"CanReportPatientsAdverseResponses,omitempty"`
// can request product remediation
// Example: false
CanRequestProductRemediation bool `json:"CanRequestProductRemediation,omitempty"`
// can require harvest sample lab test batches
// Example: false
CanRequireHarvestSampleLabTestBatches bool `json:"CanRequireHarvestSampleLabTestBatches,omitempty"`
// can require package sample lab test batches
// Example: false
CanRequirePackageSampleLabTestBatches bool `json:"CanRequirePackageSampleLabTestBatches,omitempty"`
// can sell to caregivers
// Example: false
CanSellToCaregivers bool `json:"CanSellToCaregivers,omitempty"`
// can sell to consumers
// Example: false
CanSellToConsumers bool `json:"CanSellToConsumers,omitempty"`
// can sell to external patients
// Example: false
CanSellToExternalPatients bool `json:"CanSellToExternalPatients,omitempty"`
// can sell to patients
// Example: false
CanSellToPatients bool `json:"CanSellToPatients,omitempty"`
// can submit harvests for testing
// Example: false
CanSubmitHarvestsForTesting bool `json:"CanSubmitHarvestsForTesting,omitempty"`
// can submit packages for testing
// Example: true
CanSubmitPackagesForTesting bool `json:"CanSubmitPackagesForTesting,omitempty"`
// can tag plant batches
// Example: false
CanTagPlantBatches bool `json:"CanTagPlantBatches,omitempty"`
// can test packages
// Example: false
CanTestPackages bool `json:"CanTestPackages,omitempty"`
// can track vegetative plants
// Example: true
CanTrackVegetativePlants bool `json:"CanTrackVegetativePlants,omitempty"`
// can transfer from external facilities
// Example: true
CanTransferFromExternalFacilities bool `json:"CanTransferFromExternalFacilities,omitempty"`
// can update plant strains
// Example: false
CanUpdatePlantStrains bool `json:"CanUpdatePlantStrains,omitempty"`
// is medical
// Example: false
IsMedical bool `json:"IsMedical,omitempty"`
// is retail
// Example: true
IsRetail bool `json:"IsRetail,omitempty"`
// packages require patient affiliation
// Example: false
PackagesRequirePatientAffiliation bool `json:"PackagesRequirePatientAffiliation,omitempty"`
// plants require patient affiliation
// Example: false
PlantsRequirePatientAffiliation bool `json:"PlantsRequirePatientAffiliation,omitempty"`
// sales delivery require patient number
// Example: false
SalesDeliveryRequirePatientNumber bool `json:"SalesDeliveryRequirePatientNumber,omitempty"`
// sales require caregiver number
// Example: false
SalesRequireCaregiverNumber bool `json:"SalesRequireCaregiverNumber,omitempty"`
// sales require caregiver patient number
// Example: false
SalesRequireCaregiverPatientNumber bool `json:"SalesRequireCaregiverPatientNumber,omitempty"`
// sales require external patient identification method
// Example: false
SalesRequireExternalPatientIdentificationMethod bool `json:"SalesRequireExternalPatientIdentificationMethod,omitempty"`
// sales require external patient number
// Example: false
SalesRequireExternalPatientNumber bool `json:"SalesRequireExternalPatientNumber,omitempty"`
// sales require patient number
// Example: false
SalesRequirePatientNumber bool `json:"SalesRequirePatientNumber,omitempty"`
}
// Validate validates this facility facility type
func (m *FacilityFacilityType) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this facility facility type based on context it is used
func (m *FacilityFacilityType) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *FacilityFacilityType) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *FacilityFacilityType) UnmarshalBinary(b []byte) error {
var res FacilityFacilityType
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}