Decision acceptance deadline

23.06.26 (inclusive)

Form of award

Payment

Product status

Idea

Task type

ICT tasks

Сфера применения

Medicine

Область задачи

Other technological solutions

Type of product

Software/ IS

Problem description

Historically, shift shifts and financial accounting in private clinics have been hours of routine work, accompanied by conflicts over shortages. Anonymity and lack of responsibility: In most old accounting systems (or when keeping records in Excel), shifts are not recorded, or the account on the cash register computer is the same for all registrars. When a shortage of several thousand tenge is discovered at the end of the day, the management cannot find the culprit — it is not known who exactly accepted the payment . Chaos when transferring cash: Due to the lack of strict fixation of the base balance at the beginning of the day (opening_balance), cashiers are confused about what amount was in the cash register for deposit in the morning. Unauthorized withdrawal of money for household needs (without registration of collection) leads to a complete distortion of the financial picture . "Gray" payments past the cash register: Without a strict technical lock, administrators can accept money and carry out transactions in the system at any time, even after the cash register is formally "closed". The painful consolidation of Z-reports: Accounting departments and cashiers have to manually combine data from different terminals (bank POS, Kaspi terminal and cash). In the presence of mixed payments and refunds, manual calculation inevitably leads to mathematical errors and staff stress.

Expected effect

The launch of the digital shift management module will radically change the financial discipline of clinics: 100% personal responsibility: The strict binding of each transaction to an individual user token and a specific shift_id will completely eliminate the possibility of working "incognito" . A Z-report will be generated for each shift, which will allow management to know exactly who made a mistake and when . Fraud eradication (Errors → 0%): A programmatic ban on working without an active shift (403 NO_ACTIVE_SHIFT) and automatic calculation of the shortage field (discretion) will make financial fraud or theft technically impossible and instantly noticeable . Saving time on closing shifts: What used to take cashiers from 30 minutes to an hour (transferring cash to terminals) will now happen in a couple of seconds. The server will automatically calculate all the shares (cash, QR, cards, installments) and issue a ready-to-print PDF document. Absolute transparency for investors: Business owners will be able to remotely request PDF Z-reports for any shift from any branch through secure URL links, having full control over the clinic's cash flows.

Full name of responsible person

Amina Agzamova

Purpose and description of task (project)

To introduce a system of strict digital, financial and personal responsibility of cashiers in clinics. The main task of this block is to algorithmically prohibit any unauthorized financial transactions "outside the cash register", ensure strict cash accounting from the moment of opening to the moment of closing the working day, and fully automate the calculation of total revenue with the generation of fiscal Z-reports. Detailed description of the functionality and technical solutions: Shift opening mechanics and JWT validation: The cashier's working day begins with the "Shift Card" interface . The cashier initiates a POST request to open the shift, where he must record the remaining cash in the cash register at the time of start (opening_balance) . The server creates an entry in the shifts table, and most importantly, updates the user's JWT token by sewing shift_id into it. . This is a critical security element: The Middleware of the backend blocks any transactions (payment, refund) if there is no active shift_id in the token, returning the error 403 NO_ACTIVE_SHIFT . Protection against parallel shifts: The system checks the open shifts of the branch at the database level. If one cashier has already opened a shift, the second cashier's attempt to open a parallel cashier in the same branch is blocked by the server with error 409 SHIFT_ALREADY_OPEN . Cash-out: The introduction of a mechanism for safely withdrawing cash from the cash register during the day (for example, for transfer to cash collectors) without closing the shift itself. The POST /api/v2/shifts/:id/cash-out endpoint is used for this . Collection is recorded in the system, affects the estimated final cash balance (closing_balance), but does not mathematically distort the total revenue of the clinic . Cash reconciliation and shortage calculation: When you click "Close shift", the system summarizes the results: the cashier must manually enter the actual amount of paper money in the cash register (cash_drawer_closing) . The server compares the entered amount with the calculated amount using the formula: closing_balance − (opening_balance + cash_in − cash_out). Any discrepancies (shortfall or excess) are firmly fixed in the discretion field . Automatic generation of Z-reports: The server performs complex SQL aggregations (COUNT and SUM) of all transactions during the shift period with an accurate breakdown by methods: Cash, Kaspi, Card, Refunds and Net Revenue . After mathematical reconciliation, the backend uses the pdfkit library (or puppeteer) to instantly generate a PDF document (Z-report) . The generated file is saved to a secure S3-compatible object storage , and the cashier's token is revoked.

Note