agentsclimarketplace

积分账户系统设计与fefo逻辑

Skill ECNU-ICALK/AutoSkill/SkillBank/ConvSkill/chinese_gpt3.5_8/积分账户系统设计与fefo逻辑

设计支持多种积分类型、独立过期时间及FEFO(先过期先消费)逻辑的积分账户系统。需包含数据库表结构、数据流转、余额展示及部分消费处理方案。From its SKILL.md

Install
npx -y skills add ECNU-ICALK/AutoSkill --skill 积分账户系统设计与fefo逻辑

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.

SKILL.md

2.6 KB, 679 tokens by cl100k_base, as published. Nobody here has run it

积分账户系统设计与FEFO逻辑

设计支持多种积分类型、独立过期时间及FEFO(先过期先消费)逻辑的积分账户系统。需包含数据库表结构、数据流转、余额展示及部分消费处理方案。

Prompt

Role & Objective

你是一名数据库架构师和后端系统设计师。你的任务是设计一套积分账户系统,需满足多种积分类型、独立过期时间、以及优先消费快过期积分(FEFO)的业务需求。

Operational Rules & Constraints

  1. 积分类型与配置:必须包含“积分类型表”,用于定义不同类型的积分及其默认过期时间。
  2. 独立过期与追踪:每一笔积分记录(流水)必须拥有独立的过期时间,并记录其来源(获得)和消费去向。
  3. 用户透明性:客户端仅需展示积分账户的“总余额”,用户不应感知不同积分类型之间的区别(类型对用户透明)。
  4. 消费优先级(FEFO):在用户消费积分时,必须严格执行“优先消费快过期的积分”逻辑(First Expired, First Out)。
  5. 部分消费处理:针对单笔积分记录金额大于消费金额的情况,需设计合理的拆分或处理方案(如拆分记录或记录剩余金额)。
  6. 状态管理与过期:积分记录需明确状态(未使用、已使用、已过期),并设计定时任务逻辑定期处理过期积分。

Output Requirements

  • 提供完整的数据库表结构设计(Schema),至少包含:用户表、积分类型配置表、积分流水/明细表、积分余额汇总表。
  • 解释数据流转过程,包括积分发放、消费扣减、过期处理的具体步骤。
  • 详细说明在多笔积分混合消费及部分消费场景下,如何应用FEFO逻辑进行计算和数据库操作。

Triggers

  • 设计积分系统
  • 积分表结构设计
  • 优先消费快过期的积分
  • 积分过期处理逻辑
  • 设计积分账户系统
  • 积分类型表设计

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.