당직근무 0.14.0 근무 변경과 교환 및 인수인계와 출력 추가
날짜별 대타·휴가·병가·교육과 기간 일괄 변경 및 적용일이 있는 근무제 이력을 추가했다. 설정한 근무시간과 휴게 및 최소 휴식 기준으로 월간·연간 통계를 계산하며 시간 일정 저장 전에 겹침을 안내한다. 같은 소속의 교환 요청과 수락 및 선택형 관리자 승인을 추가했다. 확정 시 두 회원의 근무표를 한 트랜잭션으로 변경하고 기존 버전과 소속을 다시 검사한다. 날짜별 인수인계와 확인 목록 및 읽음 확인을 제공한다. 개인 근무 메모와 시간 설정은 소속 공유에서 제외한다. 근무표 PNG·PDF 출력과 삭제 복원 및 변경 기록과 최대 31개 날짜 일정 복사를 추가했다. 출력의 개인 일정 제목은 기본으로 숨기며 공유 Provider는 출력 사본 읽기만 허용한다. 위젯과 기본 달력 및 서버 구독은 같은 근무 계획을 사용한다. 관련 사용·Android·서버·구조·배포 매뉴얼과 변경 기록을 갱신했다. 검사: 앱 단위 47개와 서버 81개 통과. 웹 근무 계획 경계 검사와 배포 APK 빌드 및 공개 소스 ZIP의 별도 빌드 통과. 정적 오류 0개와 경고 93개. API 36에서 비회원 저장과 복원 및 일괄 복사 원자성 및 시간 겹침을 확인했다. 네 위젯 크기와 전체 달력 및 월·일 시작과 글자 배율 및 중복 진입과 기본 달력 등록·수정·중복 방지·삭제를 회귀 검사했다. 실제 앱 PDF 저장과 웹의 두 회원 교환 확정 및 인수인계와 390px 화면을 확인했다. 운영: 설치 번호 20과 웹 버전 2026-11-21.4로 반영했다. 협업·이력 테이블 다섯 개를 추가했으며 기존 회원·일정·근무·소속의 행과 월요일 시작 설정을 백업과 대조했다. 자료 이전은 없다. duty-calendar만 재시작하고 다른 서비스와 원격 세션을 유지했다. 변경 전 소스와 DB는 비공개 20261121-work-management 백업에 보관했다. 제한: 소속 교환·인수인계는 앱에서 웹 회원 화면으로 연결한다. 통계는 근무표 예정시간이며 별도 시간 일정 합계와 급여 계산은 포함하지 않는다. 이전에 내용 없이 삭제한 항목은 복원할 수 없다. 실물 휴대폰과 제조사별 홈 화면 및 장시간 절전은 미확인이다. 스토어 등록은 장기 목표이며 현재 배포 방식과 인증서를 유지한다.
This commit is contained in:
1 parent
7db48d8d3a
commit
6ff79b9154
40 files changed
+1068
-63
No files matched your search
+17
-4
@@ -6,6 +6,8 @@
|
||||
"""
|
||||
import asyncio
|
||||
import company
|
||||
import work_team
|
||||
from work_plan import validate_plan, SHIFTS
|
||||
from work_names import validate_name_rule
|
||||
from personal import validate_personal, mirror_display, validate_event_options, validate_week_start, preserve_week_start
|
||||
import hashlib
|
||||
@@ -103,6 +105,7 @@ with db() as conn:
|
||||
action TEXT NOT NULL, created INTEGER NOT NULL);
|
||||
""")
|
||||
company.init_schema(conn)
|
||||
work_team.init_schema(conn)
|
||||
# 이전 일정 구조는 그대로 둔다. 회원에 연결되지 않은 옛 익명 인증값은 새 접근 검사에서 거절한다.
|
||||
columns = {row[1] for row in conn.execute("PRAGMA table_info(clients)")}
|
||||
if "member" not in columns:
|
||||
@@ -445,7 +448,8 @@ def validate(op):
|
||||
if op["deleted"]:
|
||||
if kind in ("rotation", "preferences"):
|
||||
raise ValueError("반복 근무와 개인 설정은 삭제할 수 없습니다.")
|
||||
op["data"] = {}
|
||||
if data:
|
||||
restored={**op,"deleted":False};validate(restored);op["data"]=restored["data"]
|
||||
return
|
||||
if kind == "name_rule":
|
||||
op["data"] = validate_name_rule(data)
|
||||
@@ -457,7 +461,7 @@ def validate(op):
|
||||
date.fromisoformat(data["anchor"])
|
||||
if not re.fullmatch(r"20\d{2}-\d{2}-\d{2}", data["anchor"]):
|
||||
raise ValueError("기준 날짜는 2000년부터 2099년까지 지정해 주세요.")
|
||||
if not isinstance(data["pattern"], list) or not 1 <= len(data["pattern"]) <= 366 or any(item not in ("DUTY", "OFF", "REGULAR", "DAY", "EVENING", "NIGHT", "REST") for item in data["pattern"]):
|
||||
if not isinstance(data["pattern"], list) or not 1 <= len(data["pattern"]) <= 366 or any(item not in SHIFTS for item in data["pattern"]):
|
||||
raise ValueError("근무 반복은 1일부터 366일까지 지정해 주세요.")
|
||||
if kind == "person":
|
||||
if not isinstance(data.get("name"), str) or not 1 <= len(data["name"].strip()) <= 30:
|
||||
@@ -484,6 +488,7 @@ def validate(op):
|
||||
if "offAsHoliday" in data:
|
||||
op["data"]["offAsHoliday"] = data["offAsHoliday"]
|
||||
if kind == "rotation":
|
||||
if "workPlan" in data: op["data"]["workPlan"] = validate_plan(data["workPlan"])
|
||||
op["data"].update(validate_week_start(data))
|
||||
return
|
||||
if not isinstance(data.get("title"), str) or not 1 <= len(data["title"].strip()) <= 120:
|
||||
@@ -576,13 +581,19 @@ async def mutations(request: Request):
|
||||
previous_display = json.loads(current["data"]).get("dutyAsWeekday")
|
||||
if type(previous_display) is bool:
|
||||
op["data"]["dutyAsWeekday"] = previous_display
|
||||
if op["kind"] == "rotation" and not op["deleted"] and current and "workPlan" not in op["data"]:
|
||||
previous_plan=json.loads(current["data"]).get("workPlan")
|
||||
if previous_plan is not None: op["data"]["workPlan"]=previous_plan
|
||||
if not op["deleted"]:
|
||||
preserve_week_start(conn, client["calendar"], op["kind"], op["data"], current)
|
||||
if op["deleted"] and not op["data"] and current:
|
||||
op["data"]=json.loads(current["data"])
|
||||
conn.execute("INSERT INTO items VALUES(?,?,?,?,?,?) ON CONFLICT(calendar,id) DO UPDATE SET version=excluded.version,deleted=excluded.deleted,data=excluded.data", (client["calendar"], op["id"], op["kind"], version + 1, int(op["deleted"]), json.dumps(op["data"], ensure_ascii=False)))
|
||||
conn.execute("UPDATE calendars SET revision=revision+1 WHERE id=?", (client["calendar"],))
|
||||
if not op["deleted"]:
|
||||
mirror_display(conn, client["calendar"], op["kind"], op["data"])
|
||||
conn.execute("INSERT INTO applied VALUES(?,?,?)", (client["hash"], op["changeId"], int(time.time())))
|
||||
work_team.history(conn,client['calendar'],'삭제' if op['deleted'] else '수정·복원' if current else '추가',op['data'].get('title',op['data'].get('name','근무표' if op['kind']=='rotation' else '개인 설정')))
|
||||
accepted.append(op["changeId"])
|
||||
result = {"accepted": accepted, "conflicts": conflicts, "state": snapshot(conn, client["calendar"])}
|
||||
async with changed:
|
||||
@@ -614,7 +625,7 @@ company.setup(app, identity, payload, db, throttle, changed, snapshot)
|
||||
|
||||
@app.get(PREFIX + "/health")
|
||||
async def health():
|
||||
return {"status": "ok", "version": "0.13.2"}
|
||||
return {"status": "ok", "version": "0.14.0"}
|
||||
|
||||
|
||||
@app.get(PREFIX + "/download")
|
||||
@@ -660,7 +671,7 @@ async def index():
|
||||
|
||||
@app.get(PREFIX + "/assets/{name}")
|
||||
async def asset(name: str):
|
||||
if name not in ("app.js", "week-start.js", "work-names.js", "calendar-tools.js", "anniversary-dates.js", "anniversaries.js", "company.js", "updates.js", "style.css", "holidays.json", "holidays-LICENSE.txt", "work-patterns.json", "lunar-months.json", "lunar-LICENSE.txt"):
|
||||
if name not in ("work-plan.js", "work-management.js", "work-team.js", "app.js", "week-start.js", "work-names.js", "calendar-tools.js", "anniversary-dates.js", "anniversaries.js", "company.js", "updates.js", "style.css", "holidays.json", "holidays-LICENSE.txt", "work-patterns.json", "lunar-months.json", "lunar-LICENSE.txt"):
|
||||
raise HTTPException(404)
|
||||
if name == "holidays.json":
|
||||
return holiday_response()
|
||||
@@ -682,3 +693,5 @@ async def holiday_data(refresh: bool = False):
|
||||
# 회원 자료와 같은 DB에 구독 범위를 기록한다. 공개 주소도 활성 회원과 명시한 항목만 조회한다.
|
||||
import calendar_sharing
|
||||
calendar_sharing.install(app, db, identity, payload, snapshot, throttle, pair_hash, holidays, ORIGIN, PREFIX)
|
||||
|
||||
work_team.setup(app,PREFIX,identity,payload,db,throttle,changed)
|
||||
Reference in new issue
Block a user