|
@@ -591,6 +591,10 @@
|
|
|
<span class="month-fix-label">Rules</span>
|
|
<span class="month-fix-label">Rules</span>
|
|
|
<button class="fix-btn" :disabled="fixBusy['month-rules-down']" @click="fixMonthScripts()" title="Apply rules for whole month">↓</button>
|
|
<button class="fix-btn" :disabled="fixBusy['month-rules-down']" @click="fixMonthScripts()" title="Apply rules for whole month">↓</button>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <div v-if="monthCats.has('remote_sync')" class="month-fix-group">
|
|
|
|
|
+ <span class="month-fix-label">Remote Sync</span>
|
|
|
|
|
+ <button class="fix-btn" :disabled="fixMonthBusy('remote_sync')" @click="fixMonth('up','remote_sync')" title="Fix service-side integrity issues for whole month">↑</button>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
<div class="sync-bar-tools">
|
|
<div class="sync-bar-tools">
|
|
@@ -1125,6 +1129,26 @@
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
+ <template v-for="(item, svc) in selMismatches.remote_sync" :key="'rs-' + svc">
|
|
|
|
|
+ <div class="cat-section">
|
|
|
|
|
+ <div class="cat-head">
|
|
|
|
|
+ <span class="cat-indicator"></span>
|
|
|
|
|
+ <span class="cat-label">{{ CAT.remote_sync.label }}: {{ serviceName(svc) }}</span>
|
|
|
|
|
+ <div class="fix-btns">
|
|
|
|
|
+ <button class="fix-btn" title="Fix on service"
|
|
|
|
|
+ :disabled="fixDayBusy('remote_sync', selection.key)"
|
|
|
|
|
+ @click="fixDay('up', 'remote_sync', selection.key)">↑</button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="cat-rows">
|
|
|
|
|
+ <div class="cat-row">
|
|
|
|
|
+ <span class="cat-row-label">rooms_to_sell</span>
|
|
|
|
|
+ <span class="cat-row-val is-missing">{{ item.actual_rts }} (expected {{ item.expected_rts }})</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+
|
|
|
</div><!-- /sync error card -->
|
|
</div><!-- /sync error card -->
|
|
|
|
|
|
|
|
</template><!-- /day selected -->
|
|
</template><!-- /day selected -->
|
|
@@ -1271,6 +1295,7 @@ const CAT = {
|
|
|
rule_closed: { label: 'Rule: Closed', color: '#7c3aed' },
|
|
rule_closed: { label: 'Rule: Closed', color: '#7c3aed' },
|
|
|
rule_prices: { label: 'Rule: Prices', color: '#7c3aed' },
|
|
rule_prices: { label: 'Rule: Prices', color: '#7c3aed' },
|
|
|
orphans: { label: 'Orphans', color: '#64748b' },
|
|
orphans: { label: 'Orphans', color: '#64748b' },
|
|
|
|
|
+ remote_sync: { label: 'Remote Sync', color: '#dc2626' },
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
// null = not supported in that direction
|
|
// null = not supported in that direction
|
|
@@ -1299,6 +1324,7 @@ const FIX = {
|
|
|
down: (d,x) => [`/action/apply-rules/${d}/${d}`, x],
|
|
down: (d,x) => [`/action/apply-rules/${d}/${d}`, x],
|
|
|
busyKey: d => `rules-down-${d}` },
|
|
busyKey: d => `rules-down-${d}` },
|
|
|
orphans: { up: null, down: null },
|
|
orphans: { up: null, down: null },
|
|
|
|
|
+ remote_sync: { up: d => [`/action/remote-sync/${d}/${d}`, {}], down: null },
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const MONTH_FIX = {
|
|
const MONTH_FIX = {
|
|
@@ -1310,6 +1336,7 @@ const MONTH_FIX = {
|
|
|
reservations: { down: (s,e) => [`/action/fetch-reservations/${s}/${e}`, {}] },
|
|
reservations: { down: (s,e) => [`/action/fetch-reservations/${s}/${e}`, {}] },
|
|
|
user_cal: { up: (s,e) => [`/workflow/user-cal/${s}/${e}`, {}],
|
|
user_cal: { up: (s,e) => [`/workflow/user-cal/${s}/${e}`, {}],
|
|
|
down: (s,e) => [`/action/fetch-user-cal/${s}/${e}`, {}] },
|
|
down: (s,e) => [`/action/fetch-user-cal/${s}/${e}`, {}] },
|
|
|
|
|
+ remote_sync: { up: (s,e) => [`/action/remote-sync/${s}/${e}`, {}] },
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
async function apiFetch(url, opts) {
|
|
async function apiFetch(url, opts) {
|
|
@@ -1809,6 +1836,7 @@ createApp({
|
|
|
const get = ds => idx[ds] || (idx[ds] = {
|
|
const get = ds => idx[ds] || (idx[ds] = {
|
|
|
prices: null, closed: null, discounts: null,
|
|
prices: null, closed: null, discounts: null,
|
|
|
user_cal_closed: null, ical_feeds_closed: {}, rule_discounts: {}, rule_closed: {}, rule_prices: {}, orphans: [], reservations: [],
|
|
user_cal_closed: null, ical_feeds_closed: {}, rule_discounts: {}, rule_closed: {}, rule_prices: {}, orphans: [], reservations: [],
|
|
|
|
|
+ remote_sync: {},
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
for (const x of d.prices || []) get(x.date).prices = x;
|
|
for (const x of d.prices || []) get(x.date).prices = x;
|
|
@@ -1826,6 +1854,8 @@ createApp({
|
|
|
for (const x of items) get(x.date).rule_prices[sn] = x;
|
|
for (const x of items) get(x.date).rule_prices[sn] = x;
|
|
|
for (const x of d.reservations || [])
|
|
for (const x of d.reservations || [])
|
|
|
if (x.status !== 'changed' && x.checkin_date) get(x.checkin_date).reservations.push(x);
|
|
if (x.status !== 'changed' && x.checkin_date) get(x.checkin_date).reservations.push(x);
|
|
|
|
|
+ for (const [svc, items] of Object.entries(d.remote_sync || {}))
|
|
|
|
|
+ for (const x of items) get(x.date).remote_sync[svc] = x;
|
|
|
|
|
|
|
|
return idx;
|
|
return idx;
|
|
|
});
|
|
});
|
|
@@ -1850,6 +1880,7 @@ createApp({
|
|
|
if (Object.keys(m.rule_closed).length) cats.push('rule_closed');
|
|
if (Object.keys(m.rule_closed).length) cats.push('rule_closed');
|
|
|
if (Object.keys(m.rule_prices).length) cats.push('rule_prices');
|
|
if (Object.keys(m.rule_prices).length) cats.push('rule_prices');
|
|
|
if (m.orphans.length) cats.push('orphans');
|
|
if (m.orphans.length) cats.push('orphans');
|
|
|
|
|
+ if (Object.keys(m.remote_sync).length) cats.push('remote_sync');
|
|
|
return cats;
|
|
return cats;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1864,6 +1895,7 @@ createApp({
|
|
|
if (m.discounts || m.user_cal_closed) cats.add('user_cal');
|
|
if (m.discounts || m.user_cal_closed) cats.add('user_cal');
|
|
|
if (Object.keys(m.ical_feeds_closed).length) cats.add('ical_feeds_closed');
|
|
if (Object.keys(m.ical_feeds_closed).length) cats.add('ical_feeds_closed');
|
|
|
if (Object.keys(m.rule_discounts).length || Object.keys(m.rule_closed).length || Object.keys(m.rule_prices).length) cats.add('rules');
|
|
if (Object.keys(m.rule_discounts).length || Object.keys(m.rule_closed).length || Object.keys(m.rule_prices).length) cats.add('rules');
|
|
|
|
|
+ if (Object.keys(m.remote_sync).length) cats.add('remote_sync');
|
|
|
}
|
|
}
|
|
|
if (resChanges.value.length) cats.add('reservations');
|
|
if (resChanges.value.length) cats.add('reservations');
|
|
|
return cats;
|
|
return cats;
|