Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
amountOfPeople,
numberOfBeds,
roomKindName,
} from '~/modules/validator';
@Component({
name: 'popup-room-kind-add-',
validations: {
input: {
name: roomKindName,
numberOfBeds,
amountOfPeople,
},
},
})
export default class extends mixins>(
PopupMixin,
DataMixin({ createRoomKind }),
) {
onOpen() {
this.input = {
name: '',
numberOfBeds: 1,
amountOfPeople: 1,
};
}
}
import _ from 'lodash';
import { getBounding } from './horizontal-timeline.helper';
import { toDateTime, toMoney } from '~/utils';
import { GetBooking } from '~/graphql/types';
import { DataMixin } from '~/components/mixins';
import {
bookingStatusMap,
bookingStatusColorMap,
BookingObject,
PriceItemRender,
} from '~/modules/model';
@Component({
name: 'horizontal-timeline-',
})
export default class extends mixins(DataMixin({ toDateTime, toMoney })) {
@Prop({ required: true })
booking!: GetBooking.Booking;
dayWidth = 4;
get bookingObject() {
return new BookingObject(this.booking);
}
get status() {
return bookingStatusMap[this.booking.status];
}
get statusColor() {
return bookingStatusColorMap[this.booking.status];
}
name: 'popup-bill-update-discount-',
validations: {
input: {
discount: {
...currency,
lessThanTotalPrice(value: string | number) {
const self = this as PopupBillUpdateDiscount;
return self.data
? toNumber(value) < self.data.bill.totalPrice
: true;
},
},
},
},
})
export default class PopupBillUpdateDiscount extends mixins(
PopupMixin,
DataMixin({ updateBillDiscount, toMoney, toPercent }),
) {
roomName = '';
onOpen() {
this.input = {
id: this.data.bill.id,
discount: this.data.bill.discount,
};
}
}
floor: GetFloors.Floors;
},
RoomUpdateInput
>;
@Component({
name: 'popup-room-add-',
validations: {
input: {
name: floorRoomName,
floor: included('floor'),
roomKind: included('roomKind'),
},
},
})
export default class extends mixins(
PopupMixin,
DataMixin({ updateRoom, getRoomKinds, getFloors }),
) {
onOpen() {
const {
room: { id, name },
} = this.data;
this.input = {
id,
name,
floor: { id: -1 },
roomKind: { id: -1 },
};
}
id,
name,
password,
identityCard,
startingDate,
gender,
phoneNumber: { phoneNumber, required },
address,
email: requiredEmail,
birthdate,
position: included('position'),
},
rePassword,
},
})
export default class PopupEmployeeAdd extends mixins<
PopupMixin
>(PopupMixin, DataMixin({ createEmployee, getPositions })) {
rePassword = '';
onOpen() {
this.input = {
id: '',
password: '',
name: '',
identityCard: '',
phoneNumber: '',
address: '',
email: '',
birthdate: '',
gender: true,
startingDate: moment()
.set({ hour: 0, minute: 0, second: 0 })
import { Component, mixins } from 'nuxt-property-decorator';
import { PopupMixin, DataMixin } from '~/components/mixins';
import { PatronKindCreateInput } from '~/graphql/types';
import { createPatronKind } from '~/graphql/documents';
import { patronKindDescription, patronKindName } from '~/modules/validator';
@Component({
name: 'popup-patron-kind-add-',
validations: {
input: {
name: patronKindName,
description: patronKindDescription,
},
},
})
export default class extends mixins>(
PopupMixin,
DataMixin({ createPatronKind }),
) {
onOpen() {
this.input = {
name: '',
description: '',
};
}
}