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

Commit

Permalink
feat(me): add some routes for debtAccount, order and bill
Browse files Browse the repository at this point in the history
  • Loading branch information
Jisay committed Apr 23, 2018
1 parent 42943a5 commit 4ab83ec
Show file tree
Hide file tree
Showing 10 changed files with 312 additions and 11 deletions.
156 changes: 155 additions & 1 deletion dist/ovh-api-services.js
Original file line number Diff line number Diff line change
Expand Up @@ -6680,6 +6680,156 @@ angular.module("ovh-api-services").service("OvhApiMeContactV7", ["$resource", "$
return userContactResource;
}]);

angular.module("ovh-api-services").service("OvhApiMeDebtAccountDebtV6", ["$resource", "$cacheFactory", function ($resource, $cacheFactory) {
"use strict";

var cache = $cacheFactory("OvhApiMeDebtAccountDebtV6");
var queryCache = $cacheFactory("OvhApiMeDebtAccountDebtQueryV6");

var interceptor = {
response: function (response) {
cache.remove(response.config.url);
return response;
}
};

var debtResource = $resource("/me/debtAccount/debt/:debtId", {
debtId: "@debtId"
}, {
get: {
method: "GET",
cache: cache
},
pay: {
url: "/me/debtAccount/debt/{debtId}/pay",
method: "POST",
interceptor: interceptor
},
getBatch: {
method: "GET",
isArray: true,
headers: {
"X-Ovh-Batch": ","
},
cache: queryCache
},
});

debtResource.resetCache = function () {
cache.removeAll();
};

debtResource.resetQueryCache = function () {
queryCache.removeAll();
};

debtResource.resetAllCache = function () {
cache.removeAll();
queryCache.removeAll();
};

return debtResource;

}]);

angular.module("ovh-api-services").service("OvhApiMeDebtAccountDebt", ["$injector", function ($injector) {
"use strict";
return {
v6: function () {
return $injector.get("OvhApiMeDebtAccountDebtV6");
},
Operation: function () {
return $injector.get("OvhApiMeDebtAccountDebtOperation");
}
};
}]);

angular.module("ovh-api-services").service("OvhApiMeDebtAccountDebtOperationV6", ["$resource", "$cacheFactory", function ($resource, $cacheFactory) {
"use strict";

var cache = $cacheFactory("OvhApiMeDebtAccountDebtOperationV6");
var queryCache = $cacheFactory("OvhApiMeDebtAccountDebtOperationQueryV6");

var interceptor = {
response: function (response) {
cache.remove(response.config.url);
return response;
}
};

var operationResource = $resource("/me/debtAccount/debt/:debtId/operation/:operationId", {
debtId: "@debtId",
operationId: "@operationId"
}, {
get: {
method: "GET",
cache: cache
},
getBatch: {
method: "GET",
isArray: true,
headers: {
"X-Ovh-Batch": ","
},
cache: queryCache
},
associatedObject: {
url: "/me/debtAccount/debt/:debtId/operation/:operationId/associatedObject",
method: "GET",
cache: cache
}
});

operationResource.resetCache = function () {
cache.removeAll();
};

operationResource.resetQueryCache = function () {
queryCache.removeAll();
};

operationResource.resetAllCache = function () {
cache.removeAll();
queryCache.removeAll();
};

return operationResource;

}]);

angular.module("ovh-api-services").service("OvhApiMeDebtAccountDebtOperation", ["$injector", function ($injector) {
"use strict";
return {
v6: function () {
return $injector.get("OvhApiMeDebtAccountDebtOperationV6");
}
};
}]);

angular.module("ovh-api-services").service("OvhApiMeDebtAccountV6", ["$resource", function ($resource) {
"use strict";

return $resource("/me/debtAccount", {}, {
pay: {
url: "/me/debtAccount/pay",
method: "POST"
}
});

}]);

angular.module("ovh-api-services").service("OvhApiMeDebtAccount", ["$injector", function ($injector) {
"use strict";
return {
v6: function () {
return $injector.get("OvhApiMeDebtAccountV6");
},
Debt: function () {
return $injector.get("OvhApiMeDebtAccountDebt");
}
};
}]);

angular.module("ovh-api-services").service("OvhApiMeDepositRequest", ["$injector", function ($injector) {
"use strict";

Expand Down Expand Up @@ -6916,6 +7066,9 @@ angular.module("ovh-api-services").service("OvhApiMe", ["$injector", function ($
},
DepositRequest: function () {
return $injector.get("OvhApiMeDepositRequest");
},
DebtAccount: function () {
return $injector.get("OvhApiMeDebtAccount");
}
};
}]);
Expand Down Expand Up @@ -6998,7 +7151,8 @@ angular.module("ovh-api-services").service("OvhApiMeOrderV6", ["$resource", "$ca
},
getDetails: { method: "GET", url: "/me/order/:orderId/details", cache: queryCache, isArray: true },
getDetail: { method: "GET", url: "/me/order/:orderId/details/:detailId", params: { orderId: "@orderId", detailId: "@detailId" }, cache: queryCache },
payRegisteredPaymentMean: { method: "POST", url: "/me/order/:orderId/payWithRegisteredPaymentMean", interceptor: interceptor }
payRegisteredPaymentMean: { method: "POST", url: "/me/order/:orderId/payWithRegisteredPaymentMean", interceptor: interceptor },
associatedObject: { method: "GET", url: "/me/order/:orderId/associatedObject", cache: queryCache }
});

userOrderResource.resetAllCache = function () {
Expand Down
17 changes: 8 additions & 9 deletions dist/ovh-api-services.min.js

Large diffs are not rendered by default.

51 changes: 51 additions & 0 deletions src/me/debtAccount/debt/me-debtAccount-debt-v6.service.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
angular.module("ovh-api-services").service("OvhApiMeDebtAccountDebtV6", function ($resource, $cacheFactory) {
"use strict";

var cache = $cacheFactory("OvhApiMeDebtAccountDebtV6");
var queryCache = $cacheFactory("OvhApiMeDebtAccountDebtQueryV6");

var interceptor = {
response: function (response) {
cache.remove(response.config.url);
return response;
}
};

var debtResource = $resource("/me/debtAccount/debt/:debtId", {
debtId: "@debtId"
}, {
get: {
method: "GET",
cache: cache
},
pay: {
url: "/me/debtAccount/debt/{debtId}/pay",
method: "POST",
interceptor: interceptor
},
getBatch: {
method: "GET",
isArray: true,
headers: {
"X-Ovh-Batch": ","
},
cache: queryCache
},
});

debtResource.resetCache = function () {
cache.removeAll();
};

debtResource.resetQueryCache = function () {
queryCache.removeAll();
};

debtResource.resetAllCache = function () {
cache.removeAll();
queryCache.removeAll();
};

return debtResource;

});
11 changes: 11 additions & 0 deletions src/me/debtAccount/debt/me-debtAccount-debt.service.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
angular.module("ovh-api-services").service("OvhApiMeDebtAccountDebt", function ($injector) {
"use strict";
return {
v6: function () {
return $injector.get("OvhApiMeDebtAccountDebtV6");
},
Operation: function () {
return $injector.get("OvhApiMeDebtAccountDebtOperation");
}
};
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
angular.module("ovh-api-services").service("OvhApiMeDebtAccountDebtOperationV6", function ($resource, $cacheFactory) {
"use strict";

var cache = $cacheFactory("OvhApiMeDebtAccountDebtOperationV6");
var queryCache = $cacheFactory("OvhApiMeDebtAccountDebtOperationQueryV6");

var interceptor = {
response: function (response) {
cache.remove(response.config.url);
return response;
}
};

var operationResource = $resource("/me/debtAccount/debt/:debtId/operation/:operationId", {
debtId: "@debtId",
operationId: "@operationId"
}, {
get: {
method: "GET",
cache: cache
},
getBatch: {
method: "GET",
isArray: true,
headers: {
"X-Ovh-Batch": ","
},
cache: queryCache
},
associatedObject: {
url: "/me/debtAccount/debt/:debtId/operation/:operationId/associatedObject",
method: "GET",
cache: cache
}
});

operationResource.resetCache = function () {
cache.removeAll();
};

operationResource.resetQueryCache = function () {
queryCache.removeAll();
};

operationResource.resetAllCache = function () {
cache.removeAll();
queryCache.removeAll();
};

return operationResource;

});
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
angular.module("ovh-api-services").service("OvhApiMeDebtAccountDebtOperation", function ($injector) {
"use strict";
return {
v6: function () {
return $injector.get("OvhApiMeDebtAccountDebtOperationV6");
}
};
});
11 changes: 11 additions & 0 deletions src/me/debtAccount/me-debtAccount-v6.service.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
angular.module("ovh-api-services").service("OvhApiMeDebtAccountV6", function ($resource) {
"use strict";

return $resource("/me/debtAccount", {}, {
pay: {
url: "/me/debtAccount/pay",
method: "POST"
}
});

});
11 changes: 11 additions & 0 deletions src/me/debtAccount/me-debtAccount.service.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
angular.module("ovh-api-services").service("OvhApiMeDebtAccount", function ($injector) {
"use strict";
return {
v6: function () {
return $injector.get("OvhApiMeDebtAccountV6");
},
Debt: function () {
return $injector.get("OvhApiMeDebtAccountDebt");
}
};
});
3 changes: 3 additions & 0 deletions src/me/me.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ angular.module("ovh-api-services").service("OvhApiMe", function ($injector) {
},
DepositRequest: function () {
return $injector.get("OvhApiMeDepositRequest");
},
DebtAccount: function () {
return $injector.get("OvhApiMeDebtAccount");
}
};
});
3 changes: 2 additions & 1 deletion src/me/order/me-order.v6.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ angular.module("ovh-api-services").service("OvhApiMeOrderV6", function ($resourc
},
getDetails: { method: "GET", url: "/me/order/:orderId/details", cache: queryCache, isArray: true },
getDetail: { method: "GET", url: "/me/order/:orderId/details/:detailId", params: { orderId: "@orderId", detailId: "@detailId" }, cache: queryCache },
payRegisteredPaymentMean: { method: "POST", url: "/me/order/:orderId/payWithRegisteredPaymentMean", interceptor: interceptor }
payRegisteredPaymentMean: { method: "POST", url: "/me/order/:orderId/payWithRegisteredPaymentMean", interceptor: interceptor },
associatedObject: { method: "GET", url: "/me/order/:orderId/associatedObject" }
});

userOrderResource.resetAllCache = function () {
Expand Down

0 comments on commit 4ab83ec

Please sign in to comment.