Merge pull request 'development' (#103) from development into production
Reviewed-on: #103pull/113/head 1.1.1-production.2
commit
9026f85a66
|
@ -40,11 +40,13 @@ export class SupersetService {
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
return { loginToken, csrfToken: response.data.result };
|
const cookie = response.headers['set-cookie'];
|
||||||
|
|
||||||
|
return { loginToken, csrfToken: response.data.result, cookie };
|
||||||
}
|
}
|
||||||
|
|
||||||
async getGuestToken(uuid: string) {
|
async getGuestToken(uuid: string) {
|
||||||
const { loginToken, csrfToken } = await this.getCSRFToken();
|
const { loginToken, csrfToken, cookie } = await this.getCSRFToken();
|
||||||
|
|
||||||
const data = {
|
const data = {
|
||||||
resources: [{ type: 'dashboard', id: uuid }],
|
resources: [{ type: 'dashboard', id: uuid }],
|
||||||
|
@ -52,11 +54,14 @@ export class SupersetService {
|
||||||
user: { username: 'pos_embed', first_name: 'pos', last_name: 'embed' },
|
user: { username: 'pos_embed', first_name: 'pos', last_name: 'embed' },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const [requestCookie] = cookie[0].split(';');
|
||||||
|
|
||||||
const headers = {
|
const headers = {
|
||||||
'Content-Type': 'application/json',
|
|
||||||
Authorization: `Bearer ${loginToken}`,
|
Authorization: `Bearer ${loginToken}`,
|
||||||
|
Cookie: requestCookie,
|
||||||
|
'Content-Type': 'application/json',
|
||||||
'X-CSRFToken': `${csrfToken}`,
|
'X-CSRFToken': `${csrfToken}`,
|
||||||
Referer: `${this.supersetURL}/v1/security/guest_token/`,
|
'Access-Control-Allow-Credentials': true,
|
||||||
};
|
};
|
||||||
|
|
||||||
const response = await firstValueFrom(
|
const response = await firstValueFrom(
|
||||||
|
|
|
@ -14,9 +14,9 @@ export default <ReportConfigEntity>{
|
||||||
unique_name: `${REPORT_GROUP.transaction_report}__cancel`,
|
unique_name: `${REPORT_GROUP.transaction_report}__cancel`,
|
||||||
label: 'Pembatalan',
|
label: 'Pembatalan',
|
||||||
table_schema: `transactions main
|
table_schema: `transactions main
|
||||||
LEFT JOIN season_types s_period_type ON s_period_type.id::text = main.season_period_type_id
|
LEFT JOIN season_types s_period_type ON s_period_type.id = main.season_period_type_id::uuid
|
||||||
LEFT JOIN refunds refund ON refund.transaction_id = main.id and refund.status != 'cancel'
|
LEFT JOIN refunds refund ON refund.transaction_id::uuid = main.id and refund.status != 'cancel'
|
||||||
LEFT JOIN vip_codes vip ON vip.id::text = main.discount_code_id::text
|
LEFT JOIN vip_codes vip ON vip.id = main.discount_code_id::uuid
|
||||||
LEFT JOIN (
|
LEFT JOIN (
|
||||||
select item.transaction_id, sum(item.total_hpp) AS total_hpp_item
|
select item.transaction_id, sum(item.total_hpp) AS total_hpp_item
|
||||||
from transaction_items item
|
from transaction_items item
|
||||||
|
|
|
@ -14,11 +14,11 @@ export default <ReportConfigEntity>{
|
||||||
unique_name: `${REPORT_GROUP.transaction_report}__giving_discounts`,
|
unique_name: `${REPORT_GROUP.transaction_report}__giving_discounts`,
|
||||||
label: 'Pemberian Diskon',
|
label: 'Pemberian Diskon',
|
||||||
table_schema: `transactions main
|
table_schema: `transactions main
|
||||||
LEFT JOIN vip_codes vip ON vip.id::text = main.discount_code_id::text
|
LEFT JOIN vip_codes vip ON vip.id = main.discount_code_id::uuid
|
||||||
LEFT JOIN vip_categories vip_category ON vip_category.id::text = vip.vip_category_id::text
|
LEFT JOIN vip_categories vip_category ON vip_category.id = vip.vip_category_id
|
||||||
LEFT JOIN users account ON account.id::text = vip.creator_id::text
|
LEFT JOIN users account ON account.id = vip.creator_id::uuid
|
||||||
LEFT JOIN user_privileges privilege ON privilege.id::text = account.user_privilege_id::text
|
LEFT JOIN user_privileges privilege ON privilege.id = account.user_privilege_id
|
||||||
LEFT JOIN season_types s_period_type ON s_period_type.id::text = main.season_period_type_id`,
|
LEFT JOIN season_types s_period_type ON s_period_type.id = main.season_period_type_id::uuid`,
|
||||||
main_table_alias: 'main',
|
main_table_alias: 'main',
|
||||||
whereDefaultConditions: [
|
whereDefaultConditions: [
|
||||||
{
|
{
|
||||||
|
@ -37,7 +37,7 @@ export default <ReportConfigEntity>{
|
||||||
values: [false],
|
values: [false],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
whereCondition(filterModel) {
|
whereCondition(_filterModel) {
|
||||||
return [
|
return [
|
||||||
`main.discount_percentage is not null or main.discount_value is not null`,
|
`main.discount_percentage is not null or main.discount_value is not null`,
|
||||||
];
|
];
|
||||||
|
|
|
@ -14,12 +14,12 @@ export default <ReportConfigEntity>{
|
||||||
unique_name: `${REPORT_GROUP.transaction_report}__income_per_item_master`,
|
unique_name: `${REPORT_GROUP.transaction_report}__income_per_item_master`,
|
||||||
label: 'Pendapatan Per Item Master',
|
label: 'Pendapatan Per Item Master',
|
||||||
table_schema: `transactions main
|
table_schema: `transactions main
|
||||||
LEFT JOIN transaction_items tr_item ON tr_item.transaction_id::text = main.id::text
|
LEFT JOIN transaction_items tr_item ON tr_item.transaction_id = main.id
|
||||||
LEFT JOIN transaction_item_breakdowns tr_item_bundling ON tr_item_bundling.transaction_item_id::text = tr_item.id::text
|
LEFT JOIN transaction_item_breakdowns tr_item_bundling ON tr_item_bundling.transaction_item_id = tr_item.id
|
||||||
LEFT JOIN refunds refund ON refund.transaction_id = main.id
|
LEFT JOIN refunds refund ON refund.transaction_id = main.id
|
||||||
|
LEFT JOIN refund_items refund_item ON refund_item.refund_item_id = tr_item.item_id::uuid
|
||||||
LEFT JOIN items item ON item.id::text = tr_item.item_id::text
|
LEFT JOIN items item ON item.id::text = tr_item.item_id::text
|
||||||
LEFT JOIN users tenant ON tenant.id::text = item.tenant_id::text
|
LEFT JOIN users tenant ON tenant.id::text = item.tenant_id::text`,
|
||||||
LEFT JOIN refund_items refund_item ON refund_item.refund_item_id::text = tr_item.item_id::text`,
|
|
||||||
main_table_alias: 'main',
|
main_table_alias: 'main',
|
||||||
whereDefaultConditions: [
|
whereDefaultConditions: [
|
||||||
{
|
{
|
||||||
|
|
|
@ -14,11 +14,11 @@ export default <ReportConfigEntity>{
|
||||||
unique_name: `${REPORT_GROUP.transaction_report}__income_per_item`,
|
unique_name: `${REPORT_GROUP.transaction_report}__income_per_item`,
|
||||||
label: 'Pendapatan Per Item',
|
label: 'Pendapatan Per Item',
|
||||||
table_schema: `transactions main
|
table_schema: `transactions main
|
||||||
LEFT JOIN transaction_items tr_item ON tr_item.transaction_id::text = main.id::text
|
LEFT JOIN transaction_items tr_item ON tr_item.transaction_id = main.id
|
||||||
LEFT JOIN refunds refund ON refund.transaction_id = main.id
|
LEFT JOIN refunds refund ON refund.transaction_id = main.id
|
||||||
|
LEFT JOIN refund_items refund_item ON refund_item.refund_item_id = tr_item.item_id::uuid
|
||||||
LEFT JOIN items item ON item.id::text = tr_item.item_id::text
|
LEFT JOIN items item ON item.id::text = tr_item.item_id::text
|
||||||
LEFT JOIN users tenant ON tenant.id::text = item.tenant_id::text
|
LEFT JOIN users tenant ON tenant.id::text = item.tenant_id::text`,
|
||||||
LEFT JOIN refund_items refund_item ON refund_item.refund_item_id::text = tr_item.item_id::text`,
|
|
||||||
main_table_alias: 'main',
|
main_table_alias: 'main',
|
||||||
whereDefaultConditions: [
|
whereDefaultConditions: [
|
||||||
{
|
{
|
||||||
|
|
|
@ -14,7 +14,7 @@ export default <ReportConfigEntity>{
|
||||||
unique_name: `${REPORT_GROUP.transaction_report}__reconciliation`,
|
unique_name: `${REPORT_GROUP.transaction_report}__reconciliation`,
|
||||||
label: 'Rekonsiliasi',
|
label: 'Rekonsiliasi',
|
||||||
table_schema: `transactions main
|
table_schema: `transactions main
|
||||||
LEFT JOIN payment_methods payment ON payment.id::text = main.payment_type_method_id::text`,
|
LEFT JOIN payment_methods payment ON payment.id = main.payment_type_method_id::uuid`,
|
||||||
main_table_alias: 'main',
|
main_table_alias: 'main',
|
||||||
defaultOrderBy: [],
|
defaultOrderBy: [],
|
||||||
lowLevelOrderBy: [],
|
lowLevelOrderBy: [],
|
||||||
|
|
Loading…
Reference in New Issue