Coder Social home page Coder Social logo

jacky-htg / inventory-service Goto Github PK

View Code? Open in Web Editor NEW
11.0 2.0 2.0 304 KB

Inventory service using golang grpc and postgresql. This service is part of ERP microservices.

License: GNU General Public License v3.0

Shell 0.10% Go 99.78% Makefile 0.12%
inventory golang grpc grpc-go microservices erp-systems

inventory-service's People

Contributors

jacky-htg avatar rasepnugroho avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

inventory-service's Issues

Product Service

Each company can manage their product

message Product { string id = 1; string company_id = 2; Brand brand = 3; ProductCategory product_category = 4; string code = 5; string name = 6; uint32 minimun_stock = 7; google.protobuf.Timestamp created_at = 8; string created_by = 9; google.protobuf.Timestamp updated_at = 10; string updated_by = 11; }

`message ListProductRequest {
Pagination pagination = 1;
string product_category_id = 2;
string brand_id = 3;
}

message ProductPaginationResponse {
Pagination pagination = 1;
string product_category_id = 2;
string brand_id = 3;
uint32 count = 4;
}

message ListProductResponse {
ProductPaginationResponse pagination = 1;
Product product = 2;
}

service ProductService {
rpc Create(Product) returns (Product) {}
rpc Update(Product) returns (Product) {}
rpc View(Id) returns (Product) {}
rpc Delete(Id) returns (Boolean) {}
rpc List(ListProductRequest) returns (stream ListProductResponse) {}
}`

Brand Service

Each company can manage their brand.

message Brand { string id = 1; string company_id = 2; string code = 3; string name = 4; google.protobuf.Timestamp created_at = 5; string created_by = 6; google.protobuf.Timestamp updated_at = 7; string updated_by = 8; }

`message ListBrandResponse {
PaginationResponse pagination = 1;
Brand brand = 2;
}

service BrandService {
rpc Create(Brand) returns (Brand) {}
rpc Update(Brand) returns (Brand) {}
rpc View(Id) returns (Brand) {}
rpc Delete(Id) returns (Boolean) {}
rpc List(Pagination) returns (stream ListBrandResponse) {}
}`

Warehouse Service

Each company can manage their warehouse

message Warehouse { string id = 1; string company_id = 2; string branch_id = 3; string branch_name = 4; string code = 5; string name = 6; string pic_name = 7; string pic_phone = 8; google.protobuf.Timestamp created_at = 9; string created_by = 10; google.protobuf.Timestamp updated_at = 11; string updated_by = 12; }

`message ListWarehouseRequest {
Pagination pagination = 1;
string branch_id = 2;
}

message WarehousePaginationResponse {
Pagination pagination = 1;
string branch_id = 2;
uint32 count = 3;
}

message ListWarehouseResponse {
WarehousePaginationResponse pagination = 1;
Warehouse warehouse = 2;
}

service WarehouseService {
rpc Create(Warehouse) returns (Warehouse) {}
rpc Update(Warehouse) returns (Warehouse) {}
rpc View(Id) returns (Warehouse) {}
rpc Delete(Id) returns (Boolean) {}
rpc List(ListWarehouseRequest) returns (stream ListWarehouseResponse) {}
}`

Shelve Service

Each company can manage trheir shelves on warehouse.

message Shelve { string id = 1; Warehouse warehouse = 2; string code = 3; string name = 4; google.protobuf.Timestamp created_at = 5; string created_by = 6; google.protobuf.Timestamp updated_at = 7; string updated_by = 8; }

`message ListShelveRequest {
Pagination pagination = 1;
string warehouse_id = 2;
}

message ShelvePaginationResponse {
Pagination pagination = 1;
string warehouse_id = 3;
uint32 count = 4;
}

message ListShelveResponse {
ShelvePaginationResponse pagination = 1;
Shelve shelve = 2;
}

service ShelveService {
rpc Create(Shelve) returns (Shelve) {}
rpc Update(Shelve) returns (Shelve) {}
rpc View(Id) returns (Shelve) {}
rpc Delete(Id) returns (Boolean) {}
rpc List(ListShelveRequest) returns (stream ListShelveResponse) {}
}`

Product Category Service

Each company can manage their product category.

`
message Empty {}
message Id { string id = 1; }
message String { string string = 1; }
message Message { string message = 1; }
message Boolean { bool boolean = 1; }

message Pagination {
enum Sort {
ASC = 0;
DESC = 1;
}
uint32 page = 1;
uint32 limit = 2;
uint32 offset = 3;
string search = 4;
string order_by = 5;
Sort sort = 6;
}

message PaginationResponse {
Pagination pagination = 1;
uint32 count = 2;
}
`

message ProductCategory { string id = 1; string company_id = 2; Category category = 3; string name = 4; google.protobuf.Timestamp created_at = 5; string created_by = 6; google.protobuf.Timestamp updated_at = 7; string updated_by = 8; }

`
message ListProductCategoryRequest {
Pagination pagination = 1;
string category_id = 2;
}

message ProductCategoryPaginationResponse {
Pagination pagination = 1;
string category_id = 2;
uint32 count = 3;
}

message ListProductCategoryResponse {
ProductCategoryPaginationResponse pagination = 1;
ProductCategory product_category = 2;
}

service ProductCategoryService {
rpc Create(ProductCategory) returns (ProductCategory) {}
rpc Update(ProductCategory) returns (ProductCategory) {}
rpc View(Id) returns (ProductCategory) {}
rpc Delete(Id) returns (Boolean) {}
rpc List(ListProductCategoryRequest) returns (stream ListProductCategoryResponse) {}
}
`

Category Service

Each company can create and manage own product category, but for manage the standardisation, each product category must related with category. Need no CRUD for category service, the category will be insert from seed. The service just need a streaming list category.

service CategoryService { rpc List(Empty) returns (stream Category) {} }

Delivery Order

Create module delivery order using proto contract below :

`
message Delivery {
string id = 1;
string branch_id = 3;
string branch_name = 4;
string sales_order_id = 5;
string code = 6;
google.protobuf.Timestamp delivery_date = 7;
string remark = 8;
google.protobuf.Timestamp created_at = 9;
string created_by = 10;
google.protobuf.Timestamp updated_at = 11;
string updated_by = 12;
repeated DeliveryDetail details = 13;
}

message DeliveryDetail {
string id = 1;
string delivery_id = 2;
Product product = 3;
string barcode = 4;
Shelve shelve = 5;
}

message ListDeliveryRequest {
Pagination pagination = 1;
string branch_id = 2;
string sales_order_id = 3;
}

message DeliveryPaginationResponse {
Pagination pagination = 1;
string branch_id = 2;
string sales_order_id = 3;
uint32 count = 4;
}

message ListDeliveryResponse {
DeliveryPaginationResponse pagination = 1;
Delivery Delivery = 2;
}

service DeliveryService {
rpc Create(Delivery) returns (Delivery) {}
rpc Update(Delivery) returns (Delivery) {}
rpc View(Id) returns (Delivery) {}
rpc List(ListDeliveryRequest) returns (stream ListDeliveryResponse) {}
}
`

Good Receiving

Good receiving modules

message Receive { string id = 1; string company_id = 2; string branch_id = 3; string branch_name = 4; string purchase_id = 5; string purchase_code = 6; string code = 7; google.protobuf.Timestamp date = 8; string remark = 9; google.protobuf.Timestamp created_at = 10; string created_by = 11; google.protobuf.Timestamp updated_at = 12; string updated_by = 13; repeated ReceiveDetail details = 14; }

message ReceiveDetail { string id = 1; string receive_id = 2; Product product = 3; Shelve shelve = 4; string code = 5; uint32 qty = 6; google.protobuf.Timestamp expired_date = 7; }

`message ListReceiveRequest {
Pagination pagination = 1;
string branch_id = 2;
string purchase_id = 3;
}

message ReceivePaginationResponse {
Pagination pagination = 1;
string branch_id = 2;
string purchase_id = 3;
uint32 count = 4;
}

message ListReceiveResponse {
ReceivePaginationResponse pagination = 1;
Receive Receive = 2;
}

service ReceiveService {
rpc Create(Receive) returns (Receive) {}
rpc Update(Receive) returns (Receive) {}
rpc View(Id) returns (Receive) {}
rpc List(ListReceiveRequest) returns (stream ListReceiveResponse) {}
}`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.