- {{::sale.item.name}}
+ {{::sale.concept}}
{{::sale.item.subName}}
diff --git a/modules/worker/back/methods/worker/new.js b/modules/worker/back/methods/worker/new.js
index 5316daf01..c9cebda7a 100644
--- a/modules/worker/back/methods/worker/new.js
+++ b/modules/worker/back/methods/worker/new.js
@@ -119,7 +119,8 @@ module.exports = Self => {
Self.new = async(ctx, options) => {
const models = Self.app.models;
- const myOptions = {userId: ctx.req.accessToken.userId};
+ const {userId} = ctx.req.accessToken;
+ const myOptions = {userId};
const args = ctx.args;
let tx;
@@ -188,6 +189,16 @@ module.exports = Self => {
myOptions
);
+ const {defaultCredit} = await models.ClientConfig.findOne(myOptions);
+
+ await models.ClientCredit.create(
+ {
+ clientFk: user.id,
+ amount: defaultCredit,
+ workerFk: userId
+ }, myOptions
+ );
+
const address = await models.Address.create(
{
clientFk: user.id,