API Docs Help

Vendor Internal

Vendor Internal Communication API (proto file)

This document describes the gRPC API defined in the vendor_internal.proto file for vendor-related internal communication functionalities.

Dependencies

  • google/protobuf/empty.proto: Used for empty response messages.

  • vendor_common.proto: Likely defines shared message types used across other services.

Services

The VendorInternalService offers gRPC methods for managing vendor information and invoices.

Functions:

  1. LinkVendorToInvoice: Links a specified Vendor (identified by id) to an Invoice within a particular companyId. The linked Vendor is returned in the response.

  2. UnlinkVendorFromInvoice: Removes the link between a Vendor and an Invoice based on provided IDs and companyId. Returns an empty message on success.

  3. UnlinkVendorsFromInvoices: Unlinks multiple Vendors from their respective Invoices within a specified companyId. IDs of involved Vendors are provided in a list. Returns an empty message on success.

  4. MatchVendors: Matches Vendors based on provided criteria in a MatchVendorsRequest. Returns a VendorsResponse containing matching Vendor information.

  5. GetVendorById: Retrieves a specific Vendor by its unique id.

  6. GetVendorByInternalNumber: Retrieves a Vendor based on its internalNumber.

  7. GetVendors: Retrieves a list of Vendors matching provided IDs.

Messages

LinkVendorToInvoiceRequest:

  • id: Unique identifier of the Vendor to be linked.

  • companyId: Identifier of the company the Invoice belongs to.

  • oldVendorId: (Optional) ID of the previously linked Vendor (if applicable).

UnlinkVendorFromInvoiceRequest:

  • id: Unique identifier of the Vendor to be unlinked.

  • companyId: Identifier of the company the Invoice belongs to.

UnlinkVendorsFromInvoicesRequest:

  • ids: List of IDs for the Vendors to be unlinked.

  • companyId: Identifier of the company where the linked Invoices reside.

GetVendorsRequest:

  • ids: List of IDs for the specific Vendors to be retrieved.

GetVendorByInternalNumberRequest:

  • internalNumber: Internal identification number of the Vendor to be retrieved.

Vendor:

  • (Definition likely resides in vendor_common.proto)

  • Represents a vendor entity with relevant attributes.

VendorsResponse:

  • vendors: List of matching Vendor objects as per the request.

Proto Definition (Markdown format)

syntax = "proto3"; package ai.pedant.srv.entity; option java_package = "ai.pedant.srv.entity"; option go_package = "pedant.ai/pedant-main-service/grpc-gateway"; import "google/protobuf/empty.proto"; import "vendor_common.proto"; service VendorInternalService { rpc LinkVendorToInvoice (LinkVendorToInvoiceRequest) returns (Vendor); rpc UnlinkVendorFromInvoice (UnlinkVendorFromInvoiceRequest) returns (google.protobuf.Empty); rpc UnlinkVendorsFromInvoices (UnlinkVendorsFromInvoicesRequest) returns (google.protobuf.Empty); rpc MatchVendors (MatchVendorsRequest) returns (VendorsResponse); rpc GetVendorById (GetVendorByIdRequest) returns (Vendor); rpc GetVendorByInternalNumber (GetVendorByInternalNumberRequest) returns (Vendor); rpc GetVendors (GetVendorsRequest) returns (VendorsResponse); } message LinkVendorToInvoiceRequest { string id = 1; string companyId = 2; string oldVendorId = 3; } message UnlinkVendorFromInvoiceRequest { string id = 1; string companyId = 2; } message UnlinkVendorsFromInvoicesRequest { repeated string ids = 1; string companyId = 2; } message GetVendorsRequest { repeated string ids = 1; } message GetVendorByInternalNumberRequest { string internalNumber = 1; }
Last modified: 20 October 2024