// Copyright 2020-2025 Buf Technologies, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.36.9
// 	protoc        (unknown)
// source: invoice/v1/invoice.proto

package invoicev1

import (
	_ "buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate"
	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
	timestamppb "google.golang.org/protobuf/types/known/timestamppb"
	reflect "reflect"
	sync "sync"
	unsafe "unsafe"
)

const (
	// Verify that this generated code is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
	// Verify that runtime/protoimpl is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)

// Invoice is a collection of goods or services sold to a customer.
type Invoice struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// invoice_id is a unique identifier for this invoice.
	InvoiceId string `protobuf:"bytes,1,opt,name=invoice_id,json=invoiceId,proto3" json:"invoice_id,omitempty"`
	// account_id is the unique identifier for the customer associated with this
	// invoice.
	AccountId string `protobuf:"bytes,2,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"`
	// invoice_date is the date for an invoice. It should represent a date and
	// have no values for time components.
	InvoiceDate *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=invoice_date,json=invoiceDate,proto3" json:"invoice_date,omitempty"`
	// line_items represent individual items on this invoice.
	LineItems     []*LineItem `protobuf:"bytes,4,rep,name=line_items,json=lineItems,proto3" json:"line_items,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *Invoice) Reset() {
	*x = Invoice{}
	mi := &file_invoice_v1_invoice_proto_msgTypes[0]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *Invoice) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*Invoice) ProtoMessage() {}

func (x *Invoice) ProtoReflect() protoreflect.Message {
	mi := &file_invoice_v1_invoice_proto_msgTypes[0]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use Invoice.ProtoReflect.Descriptor instead.
func (*Invoice) Descriptor() ([]byte, []int) {
	return file_invoice_v1_invoice_proto_rawDescGZIP(), []int{0}
}

func (x *Invoice) GetInvoiceId() string {
	if x != nil {
		return x.InvoiceId
	}
	return ""
}

func (x *Invoice) GetAccountId() string {
	if x != nil {
		return x.AccountId
	}
	return ""
}

func (x *Invoice) GetInvoiceDate() *timestamppb.Timestamp {
	if x != nil {
		return x.InvoiceDate
	}
	return nil
}

func (x *Invoice) GetLineItems() []*LineItem {
	if x != nil {
		return x.LineItems
	}
	return nil
}

// LineItem is an individual good or service added to an invoice.
type LineItem struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// line_item_id is a unique identifier for this LineItem.
	LineItemId string `protobuf:"bytes,1,opt,name=line_item_id,json=lineItemId,proto3" json:"line_item_id,omitempty"`
	// product_id is the unique identifier for the good or service on this line.
	ProductId string `protobuf:"bytes,2,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"`
	// quantity is the unit count of the good or service provided.
	Quantity uint64 `protobuf:"varint,3,opt,name=quantity,proto3" json:"quantity,omitempty"`
	// unit_price is the price per unit. Note that it is an integer:
	// if this system is using U.S. Dollars, it would represent one cent. We are
	// not working towards internationalization or fractions of a cent within
	// this example.
	UnitPrice     uint64 `protobuf:"varint,4,opt,name=unit_price,json=unitPrice,proto3" json:"unit_price,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *LineItem) Reset() {
	*x = LineItem{}
	mi := &file_invoice_v1_invoice_proto_msgTypes[1]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *LineItem) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*LineItem) ProtoMessage() {}

func (x *LineItem) ProtoReflect() protoreflect.Message {
	mi := &file_invoice_v1_invoice_proto_msgTypes[1]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use LineItem.ProtoReflect.Descriptor instead.
func (*LineItem) Descriptor() ([]byte, []int) {
	return file_invoice_v1_invoice_proto_rawDescGZIP(), []int{1}
}

func (x *LineItem) GetLineItemId() string {
	if x != nil {
		return x.LineItemId
	}
	return ""
}

func (x *LineItem) GetProductId() string {
	if x != nil {
		return x.ProductId
	}
	return ""
}

func (x *LineItem) GetQuantity() uint64 {
	if x != nil {
		return x.Quantity
	}
	return 0
}

func (x *LineItem) GetUnitPrice() uint64 {
	if x != nil {
		return x.UnitPrice
	}
	return 0
}

var File_invoice_v1_invoice_proto protoreflect.FileDescriptor

const file_invoice_v1_invoice_proto_rawDesc = "" +
	"\n" +
	"\x18invoice/v1/invoice.proto\x12\n" +
	"invoice.v1\x1a\x1bbuf/validate/validate.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xd5\b\n" +
	"\aInvoice\x12'\n" +
	"\n" +
	"invoice_id\x18\x01 \x01(\tB\b\xbaH\x05r\x03\xb0\x01\x01R\tinvoiceId\x12'\n" +
	"\n" +
	"account_id\x18\x02 \x01(\tB\b\xbaH\x05r\x03\xb0\x01\x01R\taccountId\x12\xe6\x01\n" +
	"\finvoice_date\x18\x03 \x01(\v2\x1a.google.protobuf.TimestampB\xa6\x01\xbaH\xa2\x01\xba\x01\x9b\x01\n" +
	"\x14invoice_date.no_time\x12\x1dtime component should be zero\x1adthis.getHours() == 0&& this.getMinutes() == 0&& this.getSeconds() == 0&& this.getMilliseconds() == 0\xc8\x01\x01R\vinvoiceDate\x12\x8c\x03\n" +
	"\n" +
	"line_items\x18\x04 \x03(\v2\x14.invoice.v1.LineItemB\xd6\x02\xbaH\xd2\x02\xba\x01\x9a\x01\n" +
	"\x1eline_items.unique_line_item_id\x12&all line_item_id values must be unique\x1aPthis.filter( it, it.line_item_id.size() > 0).map( it, it.line_item_id ).unique()\xba\x01\xa8\x01\n" +
	"\x1bline_items.logically_unique\x12Cline items must be unique combinations of product_id and unit_price\x1aDthis.map( it, it.product_id + '-' + string(it.unit_price) ).unique()\x92\x01\x05\b\x01\x10\xe8\aR\tlineItems:\xff\x02\xbaH\xfb\x02\x1aq\n" +
	"\x19invoice_id.not.account_id\x120invoice_id and account_id should not be the same\x1a\"this.invoice_id != this.account_id\x1a\x81\x01\n" +
	"\x19product_id.not.invoice_id\x12%invoice_id can't also be a product_id\x1a=!this.line_items.exists(it, it.product_id == this.invoice_id)\x1a\x81\x01\n" +
	"\x19product_id.not.account_id\x12%account_id can't also be a product_id\x1a=!this.line_items.exists(it, it.product_id == this.account_id)\"\x9f\x02\n" +
	"\bLineItem\x12*\n" +
	"\fline_item_id\x18\x01 \x01(\tB\b\xbaH\x05r\x03\xb0\x01\x01R\n" +
	"lineItemId\x12'\n" +
	"\n" +
	"product_id\x18\x02 \x01(\tB\b\xbaH\x05r\x03\xb0\x01\x01R\tproductId\x12#\n" +
	"\bquantity\x18\x03 \x01(\x04B\a\xbaH\x042\x02 \x00R\bquantity\x12&\n" +
	"\n" +
	"unit_price\x18\x04 \x01(\x04B\a\xbaH\x042\x02(\x00R\tunitPrice:q\xbaHn\x1al\n" +
	"\x1bline_item_id.not.product_id\x12'line_item_id can't also be a product_id\x1a$this.line_item_id != this.product_idB\xc2\x01\n" +
	"\x0ecom.invoice.v1B\fInvoiceProtoP\x01ZYgithub.com/bufbuild/buf-examples/protovalidate/connect-go/finish/gen/invoice/v1;invoicev1\xa2\x02\x03IXX\xaa\x02\n" +
	"Invoice.V1\xca\x02\n" +
	"Invoice\\V1\xe2\x02\x16Invoice\\V1\\GPBMetadata\xea\x02\vInvoice::V1b\x06proto3"

var (
	file_invoice_v1_invoice_proto_rawDescOnce sync.Once
	file_invoice_v1_invoice_proto_rawDescData []byte
)

func file_invoice_v1_invoice_proto_rawDescGZIP() []byte {
	file_invoice_v1_invoice_proto_rawDescOnce.Do(func() {
		file_invoice_v1_invoice_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_invoice_v1_invoice_proto_rawDesc), len(file_invoice_v1_invoice_proto_rawDesc)))
	})
	return file_invoice_v1_invoice_proto_rawDescData
}

var file_invoice_v1_invoice_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_invoice_v1_invoice_proto_goTypes = []any{
	(*Invoice)(nil),               // 0: invoice.v1.Invoice
	(*LineItem)(nil),              // 1: invoice.v1.LineItem
	(*timestamppb.Timestamp)(nil), // 2: google.protobuf.Timestamp
}
var file_invoice_v1_invoice_proto_depIdxs = []int32{
	2, // 0: invoice.v1.Invoice.invoice_date:type_name -> google.protobuf.Timestamp
	1, // 1: invoice.v1.Invoice.line_items:type_name -> invoice.v1.LineItem
	2, // [2:2] is the sub-list for method output_type
	2, // [2:2] is the sub-list for method input_type
	2, // [2:2] is the sub-list for extension type_name
	2, // [2:2] is the sub-list for extension extendee
	0, // [0:2] is the sub-list for field type_name
}

func init() { file_invoice_v1_invoice_proto_init() }
func file_invoice_v1_invoice_proto_init() {
	if File_invoice_v1_invoice_proto != nil {
		return
	}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_invoice_v1_invoice_proto_rawDesc), len(file_invoice_v1_invoice_proto_rawDesc)),
			NumEnums:      0,
			NumMessages:   2,
			NumExtensions: 0,
			NumServices:   0,
		},
		GoTypes:           file_invoice_v1_invoice_proto_goTypes,
		DependencyIndexes: file_invoice_v1_invoice_proto_depIdxs,
		MessageInfos:      file_invoice_v1_invoice_proto_msgTypes,
	}.Build()
	File_invoice_v1_invoice_proto = out.File
	file_invoice_v1_invoice_proto_goTypes = nil
	file_invoice_v1_invoice_proto_depIdxs = nil
}
