-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
507 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<mjml> | ||
<mj-body background-color="#f1f1f1"> | ||
<mj-section> | ||
<mj-column> | ||
<mj-image | ||
width="100px" | ||
src="https://jslancer.com/assets/images/logo/jslancer.png" | ||
></mj-image> | ||
</mj-column> | ||
</mj-section> | ||
<mj-section background-color="#fff"> | ||
<mj-column> | ||
<mj-text font-size="30px" align="center"> | ||
Invoice payment failed | ||
</mj-text> | ||
<mj-divider border-color="#06adef" width="100px"></mj-divider> | ||
<mj-text font-size="18px" align="left" color="#555" line-height="30px"> | ||
Hi {{name}}! Your invoice payment failed. Your plan expire on {{date}}. | ||
</mj-text> | ||
<mj-text font-size="18px" align="left" color="#555" line-height="30px"> | ||
Please check your card and payment again to extend your plan. | ||
</mj-text> | ||
</mj-column> | ||
</mj-section> | ||
</mj-body> | ||
</mjml> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<mjml> | ||
<mj-body background-color="#f1f1f1"> | ||
<mj-section> | ||
<mj-column> | ||
<mj-image | ||
width="100px" | ||
src="https://jslancer.com/assets/images/logo/jslancer.png" | ||
></mj-image> | ||
</mj-column> | ||
</mj-section> | ||
<mj-section background-color="#fff"> | ||
<mj-column> | ||
<mj-text font-size="30px" align="center"> | ||
Invoice payment successfully | ||
</mj-text> | ||
<mj-divider border-color="#06adef" width="100px"></mj-divider> | ||
<mj-text font-size="18px" align="left" color="#555" line-height="30px"> | ||
Hi {{name}}! Your invoice payment successfully. Your plan expire on {{date}}. | ||
</mj-text> | ||
<mj-text font-size="18px" align="left" color="#555" line-height="30px"> | ||
You can check your invoice at this <a href="{{link}}">link</a>. | ||
</mj-text> | ||
</mj-column> | ||
</mj-section> | ||
</mj-body> | ||
</mjml> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<mjml> | ||
<mj-body background-color="#f1f1f1"> | ||
<mj-section> | ||
<mj-column> | ||
<mj-image | ||
width="100px" | ||
src="https://jslancer.com/assets/images/logo/jslancer.png" | ||
></mj-image> | ||
</mj-column> | ||
</mj-section> | ||
<mj-section background-color="#fff"> | ||
<mj-column> | ||
<mj-text font-size="30px" align="center"> | ||
Trial will end | ||
</mj-text> | ||
<mj-divider border-color="#06adef" width="100px"></mj-divider> | ||
<mj-text font-size="18px" align="left" color="#555" line-height="30px"> | ||
Hi {{name}}! Your trial will expire on {{date}}. We will automatically charge your money when the trial ends. | ||
</mj-text> | ||
<mj-text font-size="18px" align="left" color="#555" line-height="30px"> | ||
Please go to your plan detail if you want to change or unsubscribe subscription. | ||
</mj-text> | ||
</mj-column> | ||
</mj-section> | ||
</mj-body> | ||
</mjml> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
import userResolves from './resolvers/user.resolver'; | ||
import userPlanResolves from './resolvers/user-plan.resolver'; | ||
import stripeResolves from './resolvers/stripe.resolver'; | ||
|
||
export default [userResolves, userPlanResolves, stripeResolves]; | ||
export default [userResolves, userPlanResolves]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
function main() { | ||
Promise.all([ | ||
// todo | ||
]).then(() => { | ||
process.exit(0); | ||
}).catch(() => process.exit(0)); | ||
} | ||
|
||
main(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,32 @@ | ||
import database from '~/config/database.config'; | ||
import { TABLES } from '~/constants/table-name.constant'; | ||
import formatDateDB from '~/utils/format-date-db'; | ||
|
||
const TABLE = TABLES.userPermissions; | ||
|
||
export const userPermissionColumns = { | ||
id: 'user_permissions.id', | ||
userId: 'user_permissions.user_id', | ||
userPlanId: 'user_permissions.user_plan_id', | ||
permission: 'user_permissions.permission', | ||
createAt: 'user_permissions.created_at', | ||
updatedAt: 'user_permissions.updated_at', | ||
deletedAt: 'user_permissions.deleted_at', | ||
}; | ||
|
||
export async function insertMultiPermission(data) { | ||
return database(TABLE).insert(data); | ||
export async function insertMultiPermission(data, transaction = null) { | ||
const query = database(TABLE).insert(data); | ||
if (!transaction) { | ||
return query; | ||
} | ||
return query.transacting(transaction); | ||
} | ||
|
||
export function deletePermissionByUserPlanId(userPlanId, dateDeleted = null) { | ||
const deleteAt = dateDeleted || formatDateDB(); | ||
return database(TABLE).where({ [userPermissionColumns.userPlanId]: userPlanId }).update({ deleted_at: deleteAt }); | ||
} | ||
|
||
export function deletePermissionByUserPlanIds(userPlanIds) { | ||
return database(TABLE).whereIn({ [userPermissionColumns.userPlanId]: userPlanIds }).update({ deleted_at: formatDateDB() }); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.