Skip to content
This repository has been archived by the owner on Nov 9, 2023. It is now read-only.

Commit

Permalink
Add document type support for payment method
Browse files Browse the repository at this point in the history
  • Loading branch information
yamelsenih committed Sep 27, 2023
1 parent 875c07a commit 66cd106
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ module.exports = ({ config }: ExtensionAPIFunctionParameter) => {
posId: req.query.pos_id,
customerId: req.query.customer_id,
searchValue: req.query.search_value,
documentTypeId: req.query.document_type_id,
// Page Data
pageSize: req.query.page_size,
pageToken: req.query.page_token
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,8 @@ function convertAvailablePaymentMethod (availablePaymentMethod) {
is_payment_reference: availablePaymentMethod.getIsPaymentReference(),
payment_method: convertPaymentMethod(
availablePaymentMethod.getPaymentMethod()
)
),
document_type_id: availablePaymentMethod.getDocumentTypeId()
}
}
return undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,7 @@

var jspb = require('google-protobuf');
var goog = jspb;
var global = (function() {
if (this) { return this; }
if (typeof window !== 'undefined') { return window; }
if (typeof global !== 'undefined') { return global; }
if (typeof self !== 'undefined') { return self; }
return Function('return this')();
}.call(null));
var global = Function('return this')();

var proto_core_functionality_pb = require('../proto/core_functionality_pb.js');
goog.object.extend(proto, proto_core_functionality_pb);
Expand Down Expand Up @@ -21895,7 +21889,8 @@ proto.data.AvailablePaymentMethod.toObject = function(includeInstance, msg) {
refundReferenceCurrency: (f = msg.getRefundReferenceCurrency()) && proto_core_functionality_pb.Currency.toObject(includeInstance, f),
referenceCurrency: (f = msg.getReferenceCurrency()) && proto_core_functionality_pb.Currency.toObject(includeInstance, f),
isPaymentReference: jspb.Message.getBooleanFieldWithDefault(msg, 14, false),
paymentMethod: (f = msg.getPaymentMethod()) && proto.data.PaymentMethod.toObject(includeInstance, f)
paymentMethod: (f = msg.getPaymentMethod()) && proto.data.PaymentMethod.toObject(includeInstance, f),
documentTypeId: jspb.Message.getFieldWithDefault(msg, 16, 0)
};

if (includeInstance) {
Expand Down Expand Up @@ -21993,6 +21988,10 @@ proto.data.AvailablePaymentMethod.deserializeBinaryFromReader = function(msg, re
reader.readMessage(value,proto.data.PaymentMethod.deserializeBinaryFromReader);
msg.setPaymentMethod(value);
break;
case 16:
var value = /** @type {number} */ (reader.readInt32());
msg.setDocumentTypeId(value);
break;
default:
reader.skipField();
break;
Expand Down Expand Up @@ -22125,6 +22124,13 @@ proto.data.AvailablePaymentMethod.serializeBinaryToWriter = function(message, wr
proto.data.PaymentMethod.serializeBinaryToWriter
);
}
f = message.getDocumentTypeId();
if (f !== 0) {
writer.writeInt32(
16,
f
);
}
};


Expand Down Expand Up @@ -22475,6 +22481,24 @@ proto.data.AvailablePaymentMethod.prototype.hasPaymentMethod = function() {
};


/**
* optional int32 document_type_id = 16;
* @return {number}
*/
proto.data.AvailablePaymentMethod.prototype.getDocumentTypeId = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 16, 0));
};


/**
* @param {number} value
* @return {!proto.data.AvailablePaymentMethod} returns this
*/
proto.data.AvailablePaymentMethod.prototype.setDocumentTypeId = function(value) {
return jspb.Message.setProto3IntField(this, 16, value);
};





Expand Down Expand Up @@ -50791,7 +50815,8 @@ proto.data.ListCustomerCreditsRequest.toObject = function(includeInstance, msg)
pageToken: jspb.Message.getFieldWithDefault(msg, 2, ""),
searchValue: jspb.Message.getFieldWithDefault(msg, 3, ""),
posId: jspb.Message.getFieldWithDefault(msg, 4, 0),
customerId: jspb.Message.getFieldWithDefault(msg, 5, 0)
customerId: jspb.Message.getFieldWithDefault(msg, 5, 0),
documentTypeId: jspb.Message.getFieldWithDefault(msg, 6, 0)
};

if (includeInstance) {
Expand Down Expand Up @@ -50848,6 +50873,10 @@ proto.data.ListCustomerCreditsRequest.deserializeBinaryFromReader = function(msg
var value = /** @type {number} */ (reader.readInt32());
msg.setCustomerId(value);
break;
case 6:
var value = /** @type {number} */ (reader.readInt32());
msg.setDocumentTypeId(value);
break;
default:
reader.skipField();
break;
Expand Down Expand Up @@ -50912,6 +50941,13 @@ proto.data.ListCustomerCreditsRequest.serializeBinaryToWriter = function(message
f
);
}
f = message.getDocumentTypeId();
if (f !== 0) {
writer.writeInt32(
6,
f
);
}
};


Expand Down Expand Up @@ -51005,6 +51041,24 @@ proto.data.ListCustomerCreditsRequest.prototype.setCustomerId = function(value)
};


/**
* optional int32 document_type_id = 6;
* @return {number}
*/
proto.data.ListCustomerCreditsRequest.prototype.getDocumentTypeId = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 6, 0));
};


/**
* @param {number} value
* @return {!proto.data.ListCustomerCreditsRequest} returns this
*/
proto.data.ListCustomerCreditsRequest.prototype.setDocumentTypeId = function(value) {
return jspb.Message.setProto3IntField(this, 6, value);
};



/**
* List of repeated fields within this message type.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -837,6 +837,7 @@
Currency reference_currency = 13;
bool is_payment_reference = 14;
PaymentMethod payment_method = 15;
int32 document_type_id = 16;
}

message PaymentMethod {
Expand Down Expand Up @@ -1726,6 +1727,7 @@ message ListOrdersRequest {
string search_value = 3;
int32 pos_id = 4;
int32 customer_id = 5;
int32 document_type_id = 6;
}

message ListCustomerCreditsResponse {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2750,6 +2750,7 @@ class PointOfSales {
// DSL
posId,
customerId,
documentTypeId,
searchValue,
pageSize,
pageToken
Expand All @@ -2763,6 +2764,9 @@ class PointOfSales {
request.setCustomerId(
getValidInteger(customerId)
);
request.setDocumentTypeId(
getValidInteger(documentTypeId)
);
request.setPageSize(
getValidInteger(pageSize)
);
Expand Down

0 comments on commit 66cd106

Please sign in to comment.